增加新模块

This commit is contained in:
何江明
2025-03-20 08:46:07 +08:00
parent 15014e22aa
commit 2ae62b59ed
1729 changed files with 94700 additions and 4232 deletions
@@ -0,0 +1,346 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const utils_enumUtils = require("../../utils/enumUtils.js");
const api_cart = require("../../api/cart.js");
const utils_index = require("../../utils/index.js");
const Address = () => "../../components/address.js";
const _sfc_main = {
computed: {
PAYMENT_WAY_() {
return utils_enumUtils.PAYMENT_WAY_;
},
PRODUCT_DELIVERY_TIME() {
return utils_enumUtils.PRODUCT_DELIVERY_TIME;
}
},
components: {
Address
},
onLoad(option) {
const ids = option.ids;
if (ids) {
this.ids = ids;
this.getOrder();
}
},
data() {
return {
ids: 0,
orderInfo: {
// coupon:2,//优惠卷
paymentMethod: null,
// 支付方式
total: 4e3,
// 需要支付的总金额
address: {},
// 选中的地址
store: []
},
wayList: [
{
disabled: false,
id: utils_enumUtils.PAYMENT_WAY.WECHAT,
name: "微信支付",
path: "/static/product/way_wx.png"
},
{
disabled: false,
id: utils_enumUtils.PAYMENT_WAY.ALIPAY,
name: "支付宝支付",
path: "/static/product/way_zfb.png"
}
],
wayShow: false,
addressShow: false,
// 收件地址选择
addressType: "",
// 收件地址数据类型
addressIndex: 0,
// 收件地址数据类型
shopsIndex: 0,
// 收件地址数据类型
selectAddress: {}
// 收件地址选择
};
},
methods: {
getValue: utils_enumUtils.getValue,
assembleAddress: utils_index.assembleAddress,
async getOrder() {
const ids = this.ids;
if (!ids || ids === 0) {
this.$refs.uToastRef.show({
type: "error",
message: "暂时没有需要结算的订单"
});
setTimeout(() => {
common_vendor.index.switchTab({
url: "/pages/shopping_cart/shopping_cart"
});
}, 2e3);
return;
}
const params = {
cartIds: ids
};
const resp = await api_cart.getSettleList(params);
if (resp && resp.bizcode === 100) {
const data = resp.data;
const shops = data.shops;
if (shops && shops.length !== 0) {
shops.map((item) => {
item.addrTimes.map((addItem) => {
addItem.remark = null;
});
});
}
data.shops = shops;
data.paymentMethod = null;
common_vendor.index.__f__("log", "at pages/order_submit/order_submit.vue:245", "data", data);
this.orderInfo = data;
}
},
/**
* 数量进行增加删除
* @param {Object} type 区分是 + 还是 -
* @param {Object} pIndex 父节点数据,用作与从新修改数据
* @param {Object} addIndex 需要修改店铺的数据节点
* @param {Object} index 需要修改的数据节点
*/
quantityFun(type, index, addIndex, pIndex) {
let currentQuantity = this.orderInfo.shops[index].addrTimes[addIndex].goods[pIndex].num;
if (type === "minus") {
if (currentQuantity === 1) {
this.$refs.uToastRef.show({
type: "error",
message: "不能再减拉,不能小于最低购买数量~"
});
} else {
currentQuantity = currentQuantity - 1;
}
} else if (type === "add") {
currentQuantity = currentQuantity + 1;
}
this.orderInfo.shops[index].addrTimes[addIndex].goods[pIndex].num = currentQuantity;
},
// 获取备注
getRemark() {
const orderInfo = this.orderInfo;
const remarkArr = [];
if (orderInfo && Object.keys(orderInfo).length !== 0)
;
return remarkArr;
},
/**
* 去支付
*/
goPay() {
const params = {
addrId: this.orderInfo.address.id,
// 收货地址ID
cartIds: this.ids,
//结算的购物车ID,多个以逗号分割,ALL表示全选
payway: 0,
// 支付方式:1-微信,2-支付宝
remark: null
//备注信息'[{"sid":"店铺ID","rmk":"备注内容"},{"sid":"店铺ID","rmk":"备注内容"}]'
};
common_vendor.index.__f__("log", "at pages/order_submit/order_submit.vue:294", "params", params);
},
// 地址选中
getAddressValueFunc(item) {
const addressObj = item;
addressObj.addressStr = utils_index.assembleAddress(addressObj).names;
this.selectAddress = addressObj;
},
addressOk() {
const type = this.addressType;
const addressIndex = this.addressIndex;
const shopsIndex = this.shopsIndex;
if (type === "data") {
this.orderInfo.address = this.selectAddress;
} else if (type === "addrTimes") {
this.orderInfo.shops[shopsIndex].addrTimes[addressIndex].address = this.selectAddress;
}
this.addressShow = this.false;
},
// 地址类型
checkAddressShow(status, type, addIndex, index) {
this.addressShow = status;
this.addressType = type;
this.addressIndex = addIndex;
this.shopsIndex = index;
}
}
};
if (!Array) {
const _easycom_up_image2 = common_vendor.resolveComponent("up-image");
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio");
const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group");
const _easycom_up_popup2 = common_vendor.resolveComponent("up-popup");
const _component_Address = common_vendor.resolveComponent("Address");
const _easycom_up_toast2 = common_vendor.resolveComponent("up-toast");
(_easycom_up_image2 + _easycom_up_input2 + _easycom_up_radio2 + _easycom_up_radio_group2 + _easycom_up_popup2 + _component_Address + _easycom_up_toast2)();
}
const _easycom_up_image = () => "../../uni_modules/uview-plus/components/u-image/u-image.js";
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
const _easycom_up_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
const _easycom_up_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.js";
const _easycom_up_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
const _easycom_up_toast = () => "../../uni_modules/uview-plus/components/u-toast/u-toast.js";
if (!Math) {
(_easycom_up_image + _easycom_up_input + _easycom_up_radio + _easycom_up_radio_group + _easycom_up_popup + _easycom_up_toast)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $data.orderInfo.address && Object.keys($data.orderInfo.address).length !== 0
}, $data.orderInfo.address && Object.keys($data.orderInfo.address).length !== 0 ? common_vendor.e({
b: $data.orderInfo.address.isDefault
}, $data.orderInfo.address.isDefault ? {} : {}, {
c: common_vendor.t($options.assembleAddress($data.orderInfo.address).names),
d: common_vendor.t($data.orderInfo.address.address),
e: common_vendor.p({
src: "/static/common/right.png",
width: "20",
height: "20",
bgColor: "#f1f6ff00"
}),
f: common_vendor.t($data.orderInfo.address.name),
g: common_vendor.t($data.orderInfo.address.phone),
h: common_vendor.o(($event) => $options.checkAddressShow(true, "data"))
}) : {
i: common_vendor.p({
src: "/static/common/right.png",
width: "14",
height: "14",
bgColor: "#f1f6ff00"
}),
j: common_vendor.o(($event) => $options.checkAddressShow(true, "data"))
}, {
k: common_vendor.f($data.orderInfo.shops, (item, index, i0) => {
return {
a: "dc7219ba-2-" + i0,
b: common_vendor.p({
src: item.logo,
width: "22",
height: "22",
bgColor: "#f1f6ff00"
}),
c: common_vendor.t(item.name),
d: common_vendor.f(item.addrTimes, (addItem, addIndex, i1) => {
return common_vendor.e({
a: addItem.address
}, addItem.address ? {
b: common_vendor.t(addItem.address.name),
c: common_vendor.t(addItem.address.address),
d: "dc7219ba-3-" + i0 + "-" + i1,
e: common_vendor.p({
src: "/static/common/right.png",
width: "16",
height: "16",
bgColor: "#f1f6ff00"
}),
f: common_vendor.o(($event) => $options.checkAddressShow(true, "addrTimes", addIndex, index), addIndex)
} : {}, {
g: common_vendor.f(addItem.goods, (pItem, pIndex, i2) => {
return {
a: "dc7219ba-4-" + i0 + "-" + i1 + "-" + i2,
b: common_vendor.p({
src: pItem.img,
width: "80",
height: "80",
bgColor: "#f1f6ff00"
}),
c: common_vendor.t(pItem.title),
d: common_vendor.t(pItem.specs),
e: common_vendor.t(pItem.totalPrice),
f: common_vendor.t(pItem.unitPrice),
g: common_vendor.o(($event) => $options.quantityFun("minus", index, addIndex, pIndex), pItem.id),
h: common_vendor.t(pItem.num),
i: common_vendor.o(($event) => $options.quantityFun("add", index, addIndex, pIndex), pItem.id),
j: pItem.id
};
}),
h: "dc7219ba-5-" + i0 + "-" + i1,
i: common_vendor.o(($event) => addItem.remark = $event, addIndex),
j: common_vendor.p({
placeholder: "建议留言前先与商家沟通确认",
border: "surround",
customStyle: {
"text-align": "right !important",
"border": "0rpx"
},
modelValue: addItem.remark
}),
k: common_vendor.t($options.getValue($options.PRODUCT_DELIVERY_TIME, addItem.deliveryTime)),
l: addIndex
});
}),
e: item.id
};
}),
l: common_vendor.t($options.getValue($options.PAYMENT_WAY_, $data.orderInfo.paymentMethod)),
m: common_vendor.p({
src: "/static/common/right.png",
width: "20",
height: "20",
bgColor: "#f1f6ff00"
}),
n: common_vendor.o(($event) => {
$data.wayShow = true;
}),
o: common_vendor.t($data.orderInfo.amount),
p: common_vendor.o((...args) => $options.goPay && $options.goPay(...args)),
q: common_vendor.f($data.wayList, (item, k0, i0) => {
return {
a: "dc7219ba-9-" + i0 + ",dc7219ba-8",
b: common_vendor.p({
src: item.path,
width: "20",
height: "20",
bgColor: "#f1f6ff00"
}),
c: common_vendor.t(item.name),
d: "dc7219ba-10-" + i0 + ",dc7219ba-8",
e: common_vendor.p({
name: item.id,
disabled: item.disabled,
activeColor: "#FF7C41"
}),
f: item.id
};
}),
r: common_vendor.o(($event) => $data.orderInfo.paymentMethod = $event),
s: common_vendor.p({
placement: "column",
modelValue: $data.orderInfo.paymentMethod
}),
t: common_vendor.o(($event) => {
$data.wayShow = false;
}),
v: common_vendor.o(($event) => $data.wayShow = $event),
w: common_vendor.p({
round: 10,
closeOnClickOverlay: false,
closeable: true,
safeAreaInsetBottom: false,
show: $data.wayShow
}),
x: common_vendor.o($options.getAddressValueFunc),
y: common_vendor.o((...args) => $options.addressOk && $options.addressOk(...args)),
z: common_vendor.o(($event) => $options.checkAddressShow(false, null, 0, 0)),
A: common_vendor.o(($event) => $data.addressShow = $event),
B: common_vendor.p({
round: 10,
closeOnClickOverlay: false,
closeable: true,
safeAreaInsetBottom: false,
show: $data.addressShow
}),
C: common_vendor.sr("uToastRef", "dc7219ba-13")
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-dc7219ba"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/order_submit/order_submit.js.map
@@ -0,0 +1,16 @@
{
"navigationBarTitleText": "提交订单",
"navigationBarBackgroundColor": "#F5F5F5",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default",
"usingComponents": {
"address": "../../components/address",
"up-image": "../../uni_modules/uview-plus/components/u-image/u-image",
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
"up-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
"up-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
"up-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup",
"up-toast": "../../uni_modules/uview-plus/components/u-toast/u-toast"
}
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,261 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/* uni.scss */
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
.order_submit_warp.data-v-dc7219ba {
background-color: #F5F5F5;
height: calc(100vh - 200rpx);
padding: 20rpx;
overflow-y: auto;
}
.order_submit_header_warp.data-v-dc7219ba {
background: #FFFFFF;
border-radius: 24rpx;
padding: 30rpx;
}
.order_submit_header_warp .header_areaAddress_warp.data-v-dc7219ba {
display: flex;
font-weight: 500;
font-size: 26rpx;
color: #222222;
}
.order_submit_header_warp .header_areaAddress_warp .tab-comm.data-v-dc7219ba {
color: #FFFFFF;
border-radius: 8rpx;
width: 58rpx;
font-size: 24rpx;
font-weight: 500;
margin-right: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
.order_submit_header_warp .header_areaAddress_warp .areaAddress_default.data-v-dc7219ba {
background: #FD2A53;
}
.order_submit_header_warp .header_areaAddress_warp .areaAddress_tab.data-v-dc7219ba {
background: #4D88FE;
}
.order_submit_header_warp .header_detailedAddress_warp.data-v-dc7219ba {
display: flex;
justify-content: space-between;
align-items: center;
font-weight: bold;
font-size: 32rpx;
color: #222222;
margin-top: 10rpx;
}
.order_submit_header_warp .header_name_warp.data-v-dc7219ba {
font-weight: 500;
font-size: 26rpx;
color: #222222;
margin-top: 10rpx;
}
.no_address.data-v-dc7219ba {
background: #FFFFFF;
border-radius: 24rpx;
padding: 30rpx;
}
.no_address .no_address_title.data-v-dc7219ba {
display: flex;
align-items: center;
font-weight: bold;
font-size: 32rpx;
color: #222222;
}
.no_address .no_address_msg.data-v-dc7219ba {
font-weight: 500;
font-size: 26rpx;
color: #808080;
margin-top: 10rpx;
}
.order_store_warp.data-v-dc7219ba {
margin-top: 30rpx;
background: #FFFFFF;
border-radius: 24rpx;
padding: 30rpx;
}
.order_product_warp .order_product_header.data-v-dc7219ba {
display: flex;
}
.order_product_warp .order_product_title.data-v-dc7219ba {
font-weight: bold;
font-size: 28rpx;
color: #1A1A1A;
margin-left: 10rpx;
}
.order_product_warp .shops_address_warp.data-v-dc7219ba {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
background-color: #F5F5F5;
border-radius: 10rpx;
margin: 10rpx;
font-size: 26rpx;
}
.order_product_warp .shops_address_warp .shops_address_warp_title.data-v-dc7219ba {
color: #222222;
}
.order_product_warp .order_item_content.data-v-dc7219ba {
display: flex;
}
.order_product_warp .order_item_content .content_info_right.data-v-dc7219ba {
margin-left: 20rpx;
display: grid;
}
.order_product_warp .order_item_content .content_info_title.data-v-dc7219ba {
width: 266px;
}
.order_product_warp .order_item_content .content_info_tag.data-v-dc7219ba {
font-size: 20rpx;
}
.order_product_warp .order_item_content .content_info_right_total.data-v-dc7219ba {
display: flex;
justify-content: space-between;
padding: 0 20rpx 0 0;
}
.order_product_warp .order_item_content .content_right_total.data-v-dc7219ba {
font-weight: 500;
font-size: 22rpx;
color: #FF7C41;
}
.order_product_warp .content_info_right_remark.data-v-dc7219ba {
display: flex;
justify-content: space-between;
margin-top: 20rpx;
align-items: center;
}
.order_product_warp .content_info_right_remark .title.data-v-dc7219ba {
font-weight: 500;
font-size: 26rpx;
color: #222222;
}
.order_product_warp .content_info_right_remark.data-v-dc7219ba input {
text-align: right;
}
.order_freight_warp .order_freight_item.data-v-dc7219ba {
display: flex;
justify-content: space-between;
font-weight: 500;
font-size: 26rpx;
color: #222222;
line-height: 60rpx;
}
.order_freight_warp .order_freight_item .value_.data-v-dc7219ba {
color: #FF7C41;
}
.order_freight_warp .order_freight_item .coupon_.data-v-dc7219ba {
margin-left: 20rpx;
height: 32rpx;
border-radius: 5rpx;
border: 1px solid #FF7C41;
font-size: 20rpx;
color: #FF7C41;
padding: 0rpx 6rpx;
}
.order_way_warp.data-v-dc7219ba {
display: flex;
justify-content: space-between;
align-items: center;
background: #FFFFFF;
border-radius: 24rpx;
margin-top: 30rpx;
padding: 30rpx;
font-weight: 500;
font-size: 26rpx;
color: #222222;
}
.order_way_warp .order_way_right.data-v-dc7219ba {
display: flex;
}
.order_pay_but.data-v-dc7219ba {
position: fixed;
bottom: 0;
height: 144rpx;
background: #FFFFFF;
display: flex;
justify-content: space-between;
width: calc(100% - 34rpx);
padding-top: 20rpx;
}
.order_pay_but ._but.data-v-dc7219ba {
padding: 20rpx 72rpx;
text-align: center;
background: #FF7C41;
border-radius: 16rpx 16rpx 16rpx 16rpx;
color: #FFF;
height: 46rpx;
}
.order_pay_but .price_.data-v-dc7219ba {
font-weight: bold;
font-size: 36rpx;
color: #FF7C41;
}
.way_popup_warp.data-v-dc7219ba {
padding: 30rpx;
min-height: 800rpx;
width: calc(100% - 60rpx);
}
.way_popup_warp .way_popup_title.data-v-dc7219ba {
text-align: center;
margin-bottom: 60rpx;
}
.way_popup_warp .way_item.data-v-dc7219ba {
display: flex;
justify-content: space-between;
line-height: 82rpx;
}
.way_popup_warp .way_item .way_item_.data-v-dc7219ba {
display: flex;
align-items: center;
}
.way_popup_warp .way_item .way_item_val.data-v-dc7219ba {
font-weight: bold;
font-size: 30rpx;
color: #222222;
margin-left: 20rpx;
}
.popup_but.data-v-dc7219ba {
position: fixed;
bottom: 64rpx;
background: #FF7C41;
border-radius: 16rpx;
color: #FFFFFF;
text-align: center;
padding: 20rpx 0;
width: calc(100% - 60rpx);
}
.address_popup_warp.data-v-dc7219ba {
padding: 30rpx;
height: 1200rpx;
overflow-y: hidden;
}
.address_popup_warp .address_popup_title.data-v-dc7219ba {
text-align: center;
margin-bottom: 20rpx;
}
.address_popup_warp .address_popup_content.data-v-dc7219ba {
height: calc(100% - 180rpx);
overflow-y: auto;
}