create-weapp-vite 2.0.30 → 2.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/{chunk-HT7GOIHP.js → chunk-IT75MAH3.js} +3 -2
- package/dist/cli.js +5 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/templates/tailwindcss/package.json +1 -1
- package/templates/tdesign/package.json +1 -1
- package/templates/vant/package.json +1 -1
- package/templates/wevu-retail/.editorconfig +9 -0
- package/templates/wevu-retail/.vscode/settings.json +10 -0
- package/templates/wevu-retail/AGENTS.md +35 -0
- package/templates/wevu-retail/README.md +26 -0
- package/templates/wevu-retail/auto-import-components.json +1 -0
- package/templates/wevu-retail/gitignore +35 -0
- package/templates/wevu-retail/package.json +42 -0
- package/templates/wevu-retail/postcss.config.js +6 -0
- package/templates/wevu-retail/project.config.json +44 -0
- package/templates/wevu-retail/project.private.config.json +8 -0
- package/templates/wevu-retail/src/app.vue +104 -0
- package/templates/wevu-retail/src/common/updateManager.ts +29 -0
- package/templates/wevu-retail/src/components/filter/index.vue +134 -0
- package/templates/wevu-retail/src/components/filter-popup/index.vue +67 -0
- package/templates/wevu-retail/src/components/goods-card/index.vue +219 -0
- package/templates/wevu-retail/src/components/goods-list/index.vue +91 -0
- package/templates/wevu-retail/src/components/load-more/index.vue +99 -0
- package/templates/wevu-retail/src/components/loading-content/index.vue +48 -0
- package/templates/wevu-retail/src/components/price/index.vue +104 -0
- package/templates/wevu-retail/src/components/promotion/ui-coupon-card/index.vue +143 -0
- package/templates/wevu-retail/src/components/promotion/ui-coupon-card/tools.wxs +18 -0
- package/templates/wevu-retail/src/components/swipeout/index.vue +118 -0
- package/templates/wevu-retail/src/components/swipeout/swipe.wxs +151 -0
- package/templates/wevu-retail/src/components/webp-image/index.vue +105 -0
- package/templates/wevu-retail/src/components/webp-image/utils.wxs +140 -0
- package/templates/wevu-retail/src/config/index.ts +20437 -0
- package/templates/wevu-retail/src/custom-tab-bar/data.ts +22 -0
- package/templates/wevu-retail/src/custom-tab-bar/index.vue +62 -0
- package/templates/wevu-retail/src/model/activities.ts +7 -0
- package/templates/wevu-retail/src/model/activity.ts +18 -0
- package/templates/wevu-retail/src/model/address.ts +31 -0
- package/templates/wevu-retail/src/model/cart.ts +306 -0
- package/templates/wevu-retail/src/model/category.ts +175 -0
- package/templates/wevu-retail/src/model/comments/queryDetail.ts +50 -0
- package/templates/wevu-retail/src/model/comments.ts +298 -0
- package/templates/wevu-retail/src/model/coupon.ts +39 -0
- package/templates/wevu-retail/src/model/detailsComments.ts +30 -0
- package/templates/wevu-retail/src/model/good.ts +1904 -0
- package/templates/wevu-retail/src/model/goods.ts +7 -0
- package/templates/wevu-retail/src/model/order/applyService.ts +329 -0
- package/templates/wevu-retail/src/model/order/orderConfirm.ts +147 -0
- package/templates/wevu-retail/src/model/order/orderDetail.ts +1191 -0
- package/templates/wevu-retail/src/model/order/orderList.ts +1033 -0
- package/templates/wevu-retail/src/model/promotion.ts +20 -0
- package/templates/wevu-retail/src/model/search.ts +60 -0
- package/templates/wevu-retail/src/model/submitComment.ts +58 -0
- package/templates/wevu-retail/src/model/swiper.ts +39 -0
- package/templates/wevu-retail/src/model/usercenter.ts +52 -0
- package/templates/wevu-retail/src/pages/cart/components/cart-bar/index.vue +104 -0
- package/templates/wevu-retail/src/pages/cart/components/cart-empty/index.vue +41 -0
- package/templates/wevu-retail/src/pages/cart/components/cart-group/index.vue +333 -0
- package/templates/wevu-retail/src/pages/cart/components/cart-group/index.wxs +5 -0
- package/templates/wevu-retail/src/pages/cart/components/cart-group/utils.wxs +20 -0
- package/templates/wevu-retail/src/pages/cart/components/goods-card/index.vue +334 -0
- package/templates/wevu-retail/src/pages/cart/components/specs-popup/index.vue +100 -0
- package/templates/wevu-retail/src/pages/cart/index.vue +342 -0
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/README.md +95 -0
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.vue +73 -0
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/index.vue +121 -0
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.vue +74 -0
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-tabbar/index.vue +102 -0
- package/templates/wevu-retail/src/pages/category/components/goods-category/index.vue +137 -0
- package/templates/wevu-retail/src/pages/category/index.vue +50 -0
- package/templates/wevu-retail/src/pages/coupon/components/coupon-card/index.vue +95 -0
- package/templates/wevu-retail/src/pages/coupon/components/floating-button/index.vue +44 -0
- package/templates/wevu-retail/src/pages/coupon/coupon-activity-goods/index.vue +135 -0
- package/templates/wevu-retail/src/pages/coupon/coupon-detail/index.vue +94 -0
- package/templates/wevu-retail/src/pages/coupon/coupon-list/index.vue +136 -0
- package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/images-videos/assets/play.png +0 -0
- package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/images-videos/index.vue +65 -0
- package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/my-video/index.vue +92 -0
- package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/index.vue +93 -0
- package/templates/wevu-retail/src/pages/goods/comments/create/index.vue +196 -0
- package/templates/wevu-retail/src/pages/goods/comments/index.vue +293 -0
- package/templates/wevu-retail/src/pages/goods/details/components/buy-bar/index.vue +117 -0
- package/templates/wevu-retail/src/pages/goods/details/components/goods-specs-popup/index.vue +440 -0
- package/templates/wevu-retail/src/pages/goods/details/components/promotion-popup/index.vue +83 -0
- package/templates/wevu-retail/src/pages/goods/details/index.vue +598 -0
- package/templates/wevu-retail/src/pages/goods/list/index.vue +299 -0
- package/templates/wevu-retail/src/pages/goods/result/index.vue +350 -0
- package/templates/wevu-retail/src/pages/goods/search/index.vue +196 -0
- package/templates/wevu-retail/src/pages/home/home.vue +215 -0
- package/templates/wevu-retail/src/pages/home/readme +8 -0
- package/templates/wevu-retail/src/pages/order/after-service-detail/api.ts +34 -0
- package/templates/wevu-retail/src/pages/order/after-service-detail/index.vue +430 -0
- package/templates/wevu-retail/src/pages/order/after-service-list/api.ts +1262 -0
- package/templates/wevu-retail/src/pages/order/after-service-list/index.vue +299 -0
- package/templates/wevu-retail/src/pages/order/apply-service/index.vue +665 -0
- package/templates/wevu-retail/src/pages/order/components/after-service-button-bar/index.vue +142 -0
- package/templates/wevu-retail/src/pages/order/components/customer-service/index.vue +75 -0
- package/templates/wevu-retail/src/pages/order/components/goods-card/index.vue +356 -0
- package/templates/wevu-retail/src/pages/order/components/noGoods/noGood.wxs +17 -0
- package/templates/wevu-retail/src/pages/order/components/noGoods/noGoods.vue +125 -0
- package/templates/wevu-retail/src/pages/order/components/order-button-bar/index.vue +262 -0
- package/templates/wevu-retail/src/pages/order/components/order-card/index.vue +126 -0
- package/templates/wevu-retail/src/pages/order/components/order-goods-card/index.vue +86 -0
- package/templates/wevu-retail/src/pages/order/components/reason-sheet/index.vue +161 -0
- package/templates/wevu-retail/src/pages/order/components/reason-sheet/reasonSheet.ts +25 -0
- package/templates/wevu-retail/src/pages/order/components/selectCoupons/mock.ts +22 -0
- package/templates/wevu-retail/src/pages/order/components/selectCoupons/selectCoupon.wxs +16 -0
- package/templates/wevu-retail/src/pages/order/components/selectCoupons/selectCoupons.vue +207 -0
- package/templates/wevu-retail/src/pages/order/components/specs-goods-card/index.vue +185 -0
- package/templates/wevu-retail/src/pages/order/config.ts +94 -0
- package/templates/wevu-retail/src/pages/order/delivery-detail/index.vue +145 -0
- package/templates/wevu-retail/src/pages/order/delivery-detail/isUrl.wxs +7 -0
- package/templates/wevu-retail/src/pages/order/fill-tracking-no/api.ts +71 -0
- package/templates/wevu-retail/src/pages/order/fill-tracking-no/index.vue +267 -0
- package/templates/wevu-retail/src/pages/order/invoice/index.vue +94 -0
- package/templates/wevu-retail/src/pages/order/order-confirm/components/address-card/index.vue +78 -0
- package/templates/wevu-retail/src/pages/order/order-confirm/getNotes.wxs +11 -0
- package/templates/wevu-retail/src/pages/order/order-confirm/handleInvoice.wxs +11 -0
- package/templates/wevu-retail/src/pages/order/order-confirm/index.vue +707 -0
- package/templates/wevu-retail/src/pages/order/order-confirm/order.wxs +8 -0
- package/templates/wevu-retail/src/pages/order/order-confirm/pay.ts +115 -0
- package/templates/wevu-retail/src/pages/order/order-detail/index.vue +456 -0
- package/templates/wevu-retail/src/pages/order/order-list/index.vue +288 -0
- package/templates/wevu-retail/src/pages/order/pay-result/index.vue +77 -0
- package/templates/wevu-retail/src/pages/order/receipt/index.vue +336 -0
- package/templates/wevu-retail/src/pages/promotion/promotion-detail/index.vue +145 -0
- package/templates/wevu-retail/src/pages/user/address/edit/index.vue +514 -0
- package/templates/wevu-retail/src/pages/user/address/list/index.vue +249 -0
- package/templates/wevu-retail/src/pages/user/components/t-location/index.vue +156 -0
- package/templates/wevu-retail/src/pages/user/components/ui-address-item/index.vue +92 -0
- package/templates/wevu-retail/src/pages/user/name-edit/index.vue +49 -0
- package/templates/wevu-retail/src/pages/user/person-info/index.vue +198 -0
- package/templates/wevu-retail/src/pages/usercenter/address/edit/util.ts +33 -0
- package/templates/wevu-retail/src/pages/usercenter/components/order-group/index.vue +90 -0
- package/templates/wevu-retail/src/pages/usercenter/components/ui-select-picker/index.vue +108 -0
- package/templates/wevu-retail/src/pages/usercenter/components/user-center-card/index.vue +82 -0
- package/templates/wevu-retail/src/pages/usercenter/index.vue +301 -0
- package/templates/wevu-retail/src/services/_utils/delay.ts +3 -0
- package/templates/wevu-retail/src/services/_utils/timeout.ts +3 -0
- package/templates/wevu-retail/src/services/activity/fetchActivity.ts +20 -0
- package/templates/wevu-retail/src/services/activity/fetchActivityList.ts +20 -0
- package/templates/wevu-retail/src/services/address/edit.ts +33 -0
- package/templates/wevu-retail/src/services/address/fetchAddress.ts +48 -0
- package/templates/wevu-retail/src/services/address/list.ts +31 -0
- package/templates/wevu-retail/src/services/cart/cart.ts +20 -0
- package/templates/wevu-retail/src/services/comments/fetchComments.ts +18 -0
- package/templates/wevu-retail/src/services/comments/fetchCommentsCount.ts +18 -0
- package/templates/wevu-retail/src/services/coupon/index.ts +65 -0
- package/templates/wevu-retail/src/services/good/comments/fetchCommentDetail.ts +20 -0
- package/templates/wevu-retail/src/services/good/fetchCategoryList.ts +18 -0
- package/templates/wevu-retail/src/services/good/fetchGood.ts +18 -0
- package/templates/wevu-retail/src/services/good/fetchGoods.ts +29 -0
- package/templates/wevu-retail/src/services/good/fetchGoodsDetailsComments.ts +37 -0
- package/templates/wevu-retail/src/services/good/fetchGoodsList.ts +39 -0
- package/templates/wevu-retail/src/services/good/fetchSearchHistory.ts +35 -0
- package/templates/wevu-retail/src/services/good/fetchSearchResult.ts +38 -0
- package/templates/wevu-retail/src/services/home/home.ts +53 -0
- package/templates/wevu-retail/src/services/order/applyService.ts +70 -0
- package/templates/wevu-retail/src/services/order/orderConfirm.ts +69 -0
- package/templates/wevu-retail/src/services/order/orderDetail.ts +39 -0
- package/templates/wevu-retail/src/services/order/orderList.ts +39 -0
- package/templates/wevu-retail/src/services/order/orderSubmitComment.ts +22 -0
- package/templates/wevu-retail/src/services/promotion/detail.ts +18 -0
- package/templates/wevu-retail/src/services/usercenter/fetchPerson.ts +28 -0
- package/templates/wevu-retail/src/services/usercenter/fetchUsercenter.ts +18 -0
- package/templates/wevu-retail/src/sitemap.json +7 -0
- package/templates/wevu-retail/src/utils/addressParse.ts +25 -0
- package/templates/wevu-retail/src/utils/getPermission.ts +45 -0
- package/templates/wevu-retail/src/utils/mock.ts +51 -0
- package/templates/wevu-retail/src/utils/util.ts +134 -0
- package/templates/wevu-retail/src/vite-env.d.ts +1 -0
- package/templates/wevu-retail/tailwind.config.ts +15 -0
- package/templates/wevu-retail/tsconfig.app.json +58 -0
- package/templates/wevu-retail/tsconfig.json +11 -0
- package/templates/wevu-retail/tsconfig.node.json +33 -0
- package/templates/wevu-retail/vite.config.ts +14 -0
- package/templates/wevu-tdesign/package.json +1 -1
|
@@ -0,0 +1,707 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Toast from 'tdesign-miniprogram/toast/index';
|
|
3
|
+
import { fetchSettleDetail } from '../../../services/order/orderConfirm';
|
|
4
|
+
import { commitPay, wechatPayOrder } from './pay';
|
|
5
|
+
import { getAddressPromise } from '../../../services/address/list';
|
|
6
|
+
|
|
7
|
+
const stripeImg = `https://tdesign.gtimg.com/miniprogram/template/retail/order/stripe.png`;
|
|
8
|
+
|
|
9
|
+
Page({
|
|
10
|
+
data: {
|
|
11
|
+
placeholder: '备注信息',
|
|
12
|
+
stripeImg,
|
|
13
|
+
loading: false,
|
|
14
|
+
settleDetailData: {
|
|
15
|
+
storeGoodsList: [], //正常下单商品列表
|
|
16
|
+
outOfStockGoodsList: [], //库存不足商品
|
|
17
|
+
abnormalDeliveryGoodsList: [], // 不能正常配送商品
|
|
18
|
+
inValidGoodsList: [], // 失效或者库存不足
|
|
19
|
+
limitGoodsList: [], //限购商品
|
|
20
|
+
couponList: [], //门店优惠券信息
|
|
21
|
+
}, // 获取结算页详情 data
|
|
22
|
+
orderCardList: [], // 仅用于商品卡片展示
|
|
23
|
+
couponsShow: false, // 显示优惠券的弹框
|
|
24
|
+
invoiceData: {
|
|
25
|
+
email: '', // 发票发送邮箱
|
|
26
|
+
buyerTaxNo: '', // 税号
|
|
27
|
+
invoiceType: null, // 开票类型 1:增值税专用发票; 2:增值税普通发票; 3:增值税电子发票;4:增值税卷式发票;5:区块链电子发票。
|
|
28
|
+
buyerPhone: '', //手机号
|
|
29
|
+
buyerName: '', //个人或公司名称
|
|
30
|
+
titleType: '', // 发票抬头 1-公司 2-个人
|
|
31
|
+
contentType: '', //发票内容 1-明细 2-类别
|
|
32
|
+
},
|
|
33
|
+
goodsRequestList: [],
|
|
34
|
+
userAddressReq: null,
|
|
35
|
+
popupShow: false, // 不在配送范围 失效 库存不足 商品展示弹框
|
|
36
|
+
notesPosition: 'center',
|
|
37
|
+
storeInfoList: [],
|
|
38
|
+
storeNoteIndex: 0, //当前填写备注门店index
|
|
39
|
+
promotionGoodsList: [], //当前门店商品列表(优惠券)
|
|
40
|
+
couponList: [], //当前门店所选优惠券
|
|
41
|
+
submitCouponList: [], //所有门店所选优惠券
|
|
42
|
+
currentStoreId: null, //当前优惠券storeId
|
|
43
|
+
userAddress: null,
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
payLock: false,
|
|
47
|
+
noteInfo: [],
|
|
48
|
+
tempNoteInfo: [],
|
|
49
|
+
onLoad(options) {
|
|
50
|
+
this.setData({
|
|
51
|
+
loading: true,
|
|
52
|
+
});
|
|
53
|
+
this.handleOptionsParams(options);
|
|
54
|
+
},
|
|
55
|
+
onShow() {
|
|
56
|
+
const invoiceData = wx.getStorageSync('invoiceData');
|
|
57
|
+
if (invoiceData) {
|
|
58
|
+
//处理发票
|
|
59
|
+
this.invoiceData = invoiceData;
|
|
60
|
+
this.setData({
|
|
61
|
+
invoiceData,
|
|
62
|
+
});
|
|
63
|
+
wx.removeStorageSync('invoiceData');
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
init() {
|
|
68
|
+
this.setData({
|
|
69
|
+
loading: true,
|
|
70
|
+
});
|
|
71
|
+
const { goodsRequestList } = this;
|
|
72
|
+
this.handleOptionsParams({ goodsRequestList });
|
|
73
|
+
},
|
|
74
|
+
// 处理不同情况下跳转到结算页时需要的参数
|
|
75
|
+
handleOptionsParams(options, couponList) {
|
|
76
|
+
let { goodsRequestList } = this; // 商品列表
|
|
77
|
+
let { userAddressReq } = this; // 收货地址
|
|
78
|
+
|
|
79
|
+
const storeInfoList = []; // 门店列表
|
|
80
|
+
// 如果是从地址选择页面返回,则使用地址显选择页面新选择的地址去获取结算数据
|
|
81
|
+
if (options.userAddressReq) {
|
|
82
|
+
userAddressReq = options.userAddressReq;
|
|
83
|
+
}
|
|
84
|
+
if (options.type === 'cart') {
|
|
85
|
+
// 从购物车跳转过来时,获取传入的商品列表数据
|
|
86
|
+
const goodsRequestListJson = wx.getStorageSync('order.goodsRequestList');
|
|
87
|
+
goodsRequestList = JSON.parse(goodsRequestListJson);
|
|
88
|
+
} else if (typeof options.goodsRequestList === 'string') {
|
|
89
|
+
goodsRequestList = JSON.parse(options.goodsRequestList);
|
|
90
|
+
}
|
|
91
|
+
//获取结算页请求数据列表
|
|
92
|
+
const storeMap = {};
|
|
93
|
+
goodsRequestList.forEach((goods) => {
|
|
94
|
+
if (!storeMap[goods.storeId]) {
|
|
95
|
+
storeInfoList.push({
|
|
96
|
+
storeId: goods.storeId,
|
|
97
|
+
storeName: goods.storeName,
|
|
98
|
+
});
|
|
99
|
+
storeMap[goods.storeId] = true;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
this.goodsRequestList = goodsRequestList;
|
|
103
|
+
this.storeInfoList = storeInfoList;
|
|
104
|
+
const params = {
|
|
105
|
+
goodsRequestList,
|
|
106
|
+
storeInfoList,
|
|
107
|
+
userAddressReq,
|
|
108
|
+
couponList,
|
|
109
|
+
};
|
|
110
|
+
fetchSettleDetail(params).then(
|
|
111
|
+
(res) => {
|
|
112
|
+
this.setData({
|
|
113
|
+
loading: false,
|
|
114
|
+
});
|
|
115
|
+
this.initData(res.data);
|
|
116
|
+
},
|
|
117
|
+
() => {
|
|
118
|
+
//接口异常处理
|
|
119
|
+
this.handleError();
|
|
120
|
+
},
|
|
121
|
+
);
|
|
122
|
+
},
|
|
123
|
+
initData(resData) {
|
|
124
|
+
// 转换商品卡片显示数据
|
|
125
|
+
const data = this.handleResToGoodsCard(resData);
|
|
126
|
+
this.userAddressReq = resData.userAddress;
|
|
127
|
+
|
|
128
|
+
if (resData.userAddress) {
|
|
129
|
+
this.setData({ userAddress: resData.userAddress });
|
|
130
|
+
}
|
|
131
|
+
this.setData({ settleDetailData: data });
|
|
132
|
+
this.isInvalidOrder(data);
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
isInvalidOrder(data) {
|
|
136
|
+
// 失效 不在配送范围 限购的商品 提示弹窗
|
|
137
|
+
if (
|
|
138
|
+
(data.limitGoodsList && data.limitGoodsList.length > 0) ||
|
|
139
|
+
(data.abnormalDeliveryGoodsList && data.abnormalDeliveryGoodsList.length > 0) ||
|
|
140
|
+
(data.inValidGoodsList && data.inValidGoodsList.length > 0)
|
|
141
|
+
) {
|
|
142
|
+
this.setData({ popupShow: true });
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
this.setData({ popupShow: false });
|
|
146
|
+
if (data.settleType === 0) {
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
return false;
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
handleError() {
|
|
153
|
+
Toast({
|
|
154
|
+
context: this,
|
|
155
|
+
selector: '#t-toast',
|
|
156
|
+
message: '结算异常, 请稍后重试',
|
|
157
|
+
duration: 2000,
|
|
158
|
+
icon: '',
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
setTimeout(() => {
|
|
162
|
+
wx.navigateBack();
|
|
163
|
+
}, 1500);
|
|
164
|
+
this.setData({
|
|
165
|
+
loading: false,
|
|
166
|
+
});
|
|
167
|
+
},
|
|
168
|
+
getRequestGoodsList(storeGoodsList) {
|
|
169
|
+
const filterStoreGoodsList = [];
|
|
170
|
+
storeGoodsList &&
|
|
171
|
+
storeGoodsList.forEach((store) => {
|
|
172
|
+
const { storeName } = store;
|
|
173
|
+
store.skuDetailVos &&
|
|
174
|
+
store.skuDetailVos.forEach((goods) => {
|
|
175
|
+
const data = goods;
|
|
176
|
+
data.storeName = storeName;
|
|
177
|
+
filterStoreGoodsList.push(data);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
return filterStoreGoodsList;
|
|
181
|
+
},
|
|
182
|
+
handleGoodsRequest(goods, isOutStock = false) {
|
|
183
|
+
const { reminderStock, quantity, storeId, uid, saasId, spuId, goodsName, skuId, storeName, roomId } = goods;
|
|
184
|
+
const resQuantity = isOutStock ? reminderStock : quantity;
|
|
185
|
+
return {
|
|
186
|
+
quantity: resQuantity,
|
|
187
|
+
storeId,
|
|
188
|
+
uid,
|
|
189
|
+
saasId,
|
|
190
|
+
spuId,
|
|
191
|
+
goodsName,
|
|
192
|
+
skuId,
|
|
193
|
+
storeName,
|
|
194
|
+
roomId,
|
|
195
|
+
};
|
|
196
|
+
},
|
|
197
|
+
handleResToGoodsCard(data) {
|
|
198
|
+
// 转换数据 符合 goods-card展示
|
|
199
|
+
const orderCardList = []; // 订单卡片列表
|
|
200
|
+
const storeInfoList = [];
|
|
201
|
+
const submitCouponList = []; //使用优惠券列表;
|
|
202
|
+
|
|
203
|
+
data.storeGoodsList &&
|
|
204
|
+
data.storeGoodsList.forEach((ele) => {
|
|
205
|
+
const orderCard = {
|
|
206
|
+
id: ele.storeId,
|
|
207
|
+
storeName: ele.storeName,
|
|
208
|
+
status: 0,
|
|
209
|
+
statusDesc: '',
|
|
210
|
+
amount: ele.storeTotalPayAmount,
|
|
211
|
+
goodsList: [],
|
|
212
|
+
}; // 订单卡片
|
|
213
|
+
ele.skuDetailVos.forEach((item, index) => {
|
|
214
|
+
orderCard.goodsList.push({
|
|
215
|
+
id: index,
|
|
216
|
+
thumb: item.image,
|
|
217
|
+
title: item.goodsName,
|
|
218
|
+
specs: item.skuSpecLst.map((s) => s.specValue), // 规格列表 string[]
|
|
219
|
+
price: item.tagPrice || item.settlePrice || '0', // 优先取限时活动价
|
|
220
|
+
settlePrice: item.settlePrice,
|
|
221
|
+
titlePrefixTags: item.tagText ? [{ text: item.tagText }] : [],
|
|
222
|
+
num: item.quantity,
|
|
223
|
+
skuId: item.skuId,
|
|
224
|
+
spuId: item.spuId,
|
|
225
|
+
storeId: item.storeId,
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
storeInfoList.push({
|
|
230
|
+
storeId: ele.storeId,
|
|
231
|
+
storeName: ele.storeName,
|
|
232
|
+
remark: '',
|
|
233
|
+
});
|
|
234
|
+
submitCouponList.push({
|
|
235
|
+
storeId: ele.storeId,
|
|
236
|
+
couponList: ele.couponList || [],
|
|
237
|
+
});
|
|
238
|
+
this.noteInfo.push('');
|
|
239
|
+
this.tempNoteInfo.push('');
|
|
240
|
+
orderCardList.push(orderCard);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
this.setData({ orderCardList, storeInfoList, submitCouponList });
|
|
244
|
+
return data;
|
|
245
|
+
},
|
|
246
|
+
onGotoAddress() {
|
|
247
|
+
/** 获取一个Promise */
|
|
248
|
+
getAddressPromise()
|
|
249
|
+
.then((address) => {
|
|
250
|
+
this.handleOptionsParams({
|
|
251
|
+
userAddressReq: { ...address, checked: true },
|
|
252
|
+
});
|
|
253
|
+
})
|
|
254
|
+
.catch(() => {});
|
|
255
|
+
|
|
256
|
+
const { userAddressReq } = this; // 收货地址
|
|
257
|
+
|
|
258
|
+
let id = '';
|
|
259
|
+
|
|
260
|
+
if (userAddressReq?.id) {
|
|
261
|
+
id = `&id=${userAddressReq.id}`;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
wx.navigateTo({
|
|
265
|
+
url: `/pages/user/address/list/index?selectMode=1&isOrderSure=1${id}`,
|
|
266
|
+
});
|
|
267
|
+
},
|
|
268
|
+
onNotes(e) {
|
|
269
|
+
const { storenoteindex: storeNoteIndex } = e.currentTarget.dataset;
|
|
270
|
+
// 添加备注信息
|
|
271
|
+
this.setData({
|
|
272
|
+
dialogShow: true,
|
|
273
|
+
storeNoteIndex,
|
|
274
|
+
});
|
|
275
|
+
},
|
|
276
|
+
onInput(e) {
|
|
277
|
+
const { storeNoteIndex } = this.data;
|
|
278
|
+
this.noteInfo[storeNoteIndex] = e.detail.value;
|
|
279
|
+
},
|
|
280
|
+
onBlur() {
|
|
281
|
+
this.setData({
|
|
282
|
+
notesPosition: 'center',
|
|
283
|
+
});
|
|
284
|
+
},
|
|
285
|
+
onFocus() {
|
|
286
|
+
this.setData({
|
|
287
|
+
notesPosition: 'self',
|
|
288
|
+
});
|
|
289
|
+
},
|
|
290
|
+
onTap() {
|
|
291
|
+
this.setData({
|
|
292
|
+
placeholder: '',
|
|
293
|
+
});
|
|
294
|
+
},
|
|
295
|
+
onNoteConfirm() {
|
|
296
|
+
// 备注信息 确认按钮
|
|
297
|
+
const { storeInfoList, storeNoteIndex } = this.data;
|
|
298
|
+
this.tempNoteInfo[storeNoteIndex] = this.noteInfo[storeNoteIndex];
|
|
299
|
+
storeInfoList[storeNoteIndex].remark = this.noteInfo[storeNoteIndex];
|
|
300
|
+
|
|
301
|
+
this.setData({
|
|
302
|
+
dialogShow: false,
|
|
303
|
+
storeInfoList,
|
|
304
|
+
});
|
|
305
|
+
},
|
|
306
|
+
onNoteCancel() {
|
|
307
|
+
// 备注信息 取消按钮
|
|
308
|
+
const { storeNoteIndex } = this.data;
|
|
309
|
+
this.noteInfo[storeNoteIndex] = this.tempNoteInfo[storeNoteIndex];
|
|
310
|
+
this.setData({
|
|
311
|
+
dialogShow: false,
|
|
312
|
+
});
|
|
313
|
+
},
|
|
314
|
+
|
|
315
|
+
onSureCommit() {
|
|
316
|
+
// 商品库存不足继续结算
|
|
317
|
+
const { settleDetailData } = this.data;
|
|
318
|
+
const { outOfStockGoodsList, storeGoodsList, inValidGoodsList } = settleDetailData;
|
|
319
|
+
if ((outOfStockGoodsList && outOfStockGoodsList.length > 0) || (inValidGoodsList && storeGoodsList)) {
|
|
320
|
+
// 合并正常商品 和 库存 不足商品继续支付
|
|
321
|
+
// 过滤不必要的参数
|
|
322
|
+
const filterOutGoodsList = [];
|
|
323
|
+
outOfStockGoodsList &&
|
|
324
|
+
outOfStockGoodsList.forEach((outOfStockGoods) => {
|
|
325
|
+
const { storeName } = outOfStockGoods;
|
|
326
|
+
outOfStockGoods.unSettlementGoods.forEach((ele) => {
|
|
327
|
+
const data = ele;
|
|
328
|
+
data.quantity = ele.reminderStock;
|
|
329
|
+
data.storeName = storeName;
|
|
330
|
+
filterOutGoodsList.push(data);
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
const filterStoreGoodsList = this.getRequestGoodsList(storeGoodsList);
|
|
334
|
+
const goodsRequestList = filterOutGoodsList.concat(filterStoreGoodsList);
|
|
335
|
+
this.handleOptionsParams({ goodsRequestList });
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
// 提交订单
|
|
339
|
+
submitOrder() {
|
|
340
|
+
const { settleDetailData, userAddressReq, invoiceData, storeInfoList, submitCouponList } = this.data;
|
|
341
|
+
const { goodsRequestList } = this;
|
|
342
|
+
|
|
343
|
+
if (!userAddressReq && !settleDetailData.userAddress) {
|
|
344
|
+
Toast({
|
|
345
|
+
context: this,
|
|
346
|
+
selector: '#t-toast',
|
|
347
|
+
message: '请添加收货地址',
|
|
348
|
+
duration: 2000,
|
|
349
|
+
icon: 'help-circle',
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
if (this.payLock || !settleDetailData.settleType || !settleDetailData.totalAmount) {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
this.payLock = true;
|
|
358
|
+
const resSubmitCouponList = this.handleCouponList(submitCouponList);
|
|
359
|
+
const params = {
|
|
360
|
+
userAddressReq: settleDetailData.userAddress || userAddressReq,
|
|
361
|
+
goodsRequestList: goodsRequestList,
|
|
362
|
+
userName: settleDetailData.userAddress.name || userAddressReq.name,
|
|
363
|
+
totalAmount: settleDetailData.totalPayAmount, //取优惠后的结算金额
|
|
364
|
+
invoiceRequest: null,
|
|
365
|
+
storeInfoList,
|
|
366
|
+
couponList: resSubmitCouponList,
|
|
367
|
+
};
|
|
368
|
+
if (invoiceData && invoiceData.email) {
|
|
369
|
+
params.invoiceRequest = invoiceData;
|
|
370
|
+
}
|
|
371
|
+
commitPay(params).then(
|
|
372
|
+
(res) => {
|
|
373
|
+
this.payLock = false;
|
|
374
|
+
const { data } = res;
|
|
375
|
+
// 提交出现 失效 不在配送范围 限购的商品 提示弹窗
|
|
376
|
+
if (this.isInvalidOrder(data)) {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
if (res.code === 'Success') {
|
|
380
|
+
this.handlePay(data, settleDetailData);
|
|
381
|
+
} else {
|
|
382
|
+
Toast({
|
|
383
|
+
context: this,
|
|
384
|
+
selector: '#t-toast',
|
|
385
|
+
message: res.msg || '提交订单超时,请稍后重试',
|
|
386
|
+
duration: 2000,
|
|
387
|
+
icon: '',
|
|
388
|
+
});
|
|
389
|
+
setTimeout(() => {
|
|
390
|
+
// 提交支付失败 返回购物车
|
|
391
|
+
wx.navigateBack();
|
|
392
|
+
}, 2000);
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
(err) => {
|
|
396
|
+
this.payLock = false;
|
|
397
|
+
if (err.code === 'CONTAINS_INSUFFICIENT_GOODS' || err.code === 'TOTAL_AMOUNT_DIFFERENT') {
|
|
398
|
+
Toast({
|
|
399
|
+
context: this,
|
|
400
|
+
selector: '#t-toast',
|
|
401
|
+
message: err.msg || '支付异常',
|
|
402
|
+
duration: 2000,
|
|
403
|
+
icon: '',
|
|
404
|
+
});
|
|
405
|
+
this.init();
|
|
406
|
+
} else if (err.code === 'ORDER_PAY_FAIL') {
|
|
407
|
+
Toast({
|
|
408
|
+
context: this,
|
|
409
|
+
selector: '#t-toast',
|
|
410
|
+
message: '支付失败',
|
|
411
|
+
duration: 2000,
|
|
412
|
+
icon: 'close-circle',
|
|
413
|
+
});
|
|
414
|
+
setTimeout(() => {
|
|
415
|
+
wx.redirectTo({ url: '/pages/order/order-list/index' });
|
|
416
|
+
});
|
|
417
|
+
} else if (err.code === 'ILLEGAL_CONFIG_PARAM') {
|
|
418
|
+
Toast({
|
|
419
|
+
context: this,
|
|
420
|
+
selector: '#t-toast',
|
|
421
|
+
message: '支付失败,微信支付商户号设置有误,请商家重新检查支付设置。',
|
|
422
|
+
duration: 2000,
|
|
423
|
+
icon: 'close-circle',
|
|
424
|
+
});
|
|
425
|
+
setTimeout(() => {
|
|
426
|
+
wx.redirectTo({ url: '/pages/order/order-list/index' });
|
|
427
|
+
});
|
|
428
|
+
} else {
|
|
429
|
+
Toast({
|
|
430
|
+
context: this,
|
|
431
|
+
selector: '#t-toast',
|
|
432
|
+
message: err.msg || '提交支付超时,请稍后重试',
|
|
433
|
+
duration: 2000,
|
|
434
|
+
icon: '',
|
|
435
|
+
});
|
|
436
|
+
setTimeout(() => {
|
|
437
|
+
// 提交支付失败 返回购物车
|
|
438
|
+
wx.navigateBack();
|
|
439
|
+
}, 2000);
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
);
|
|
443
|
+
},
|
|
444
|
+
|
|
445
|
+
// 处理支付
|
|
446
|
+
handlePay(data, settleDetailData) {
|
|
447
|
+
const { channel, payInfo, tradeNo, interactId, transactionId } = data;
|
|
448
|
+
const { totalAmount, totalPayAmount } = settleDetailData;
|
|
449
|
+
const payOrderInfo = {
|
|
450
|
+
payInfo: payInfo,
|
|
451
|
+
orderId: tradeNo,
|
|
452
|
+
orderAmt: totalAmount,
|
|
453
|
+
payAmt: totalPayAmount,
|
|
454
|
+
interactId: interactId,
|
|
455
|
+
tradeNo: tradeNo,
|
|
456
|
+
transactionId: transactionId,
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
if (channel === 'wechat') {
|
|
460
|
+
wechatPayOrder(payOrderInfo);
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
|
|
464
|
+
hide() {
|
|
465
|
+
// 隐藏 popup
|
|
466
|
+
this.setData({
|
|
467
|
+
'settleDetailData.abnormalDeliveryGoodsList': [],
|
|
468
|
+
});
|
|
469
|
+
},
|
|
470
|
+
onReceipt() {
|
|
471
|
+
// 跳转 开发票
|
|
472
|
+
const invoiceData = this.invoiceData || {};
|
|
473
|
+
wx.navigateTo({
|
|
474
|
+
url: `/pages/order/receipt/index?invoiceData=${JSON.stringify(invoiceData)}`,
|
|
475
|
+
});
|
|
476
|
+
},
|
|
477
|
+
|
|
478
|
+
onCoupons(e) {
|
|
479
|
+
const { submitCouponList, currentStoreId } = this.data;
|
|
480
|
+
const { goodsRequestList } = this;
|
|
481
|
+
const { selectedList } = e.detail;
|
|
482
|
+
const tempSubmitCouponList = submitCouponList.map((storeCoupon) => {
|
|
483
|
+
return {
|
|
484
|
+
couponList: storeCoupon.storeId === currentStoreId ? selectedList : storeCoupon.couponList,
|
|
485
|
+
};
|
|
486
|
+
});
|
|
487
|
+
const resSubmitCouponList = this.handleCouponList(tempSubmitCouponList);
|
|
488
|
+
//确定选择优惠券
|
|
489
|
+
this.handleOptionsParams({ goodsRequestList }, resSubmitCouponList);
|
|
490
|
+
this.setData({ couponsShow: false });
|
|
491
|
+
},
|
|
492
|
+
onOpenCoupons(e) {
|
|
493
|
+
const { storeid } = e.currentTarget.dataset;
|
|
494
|
+
this.setData({
|
|
495
|
+
couponsShow: true,
|
|
496
|
+
currentStoreId: storeid,
|
|
497
|
+
});
|
|
498
|
+
},
|
|
499
|
+
|
|
500
|
+
handleCouponList(storeCouponList) {
|
|
501
|
+
//处理门店优惠券 转换成接口需要
|
|
502
|
+
if (!storeCouponList) return [];
|
|
503
|
+
const resSubmitCouponList = [];
|
|
504
|
+
storeCouponList.forEach((ele) => {
|
|
505
|
+
resSubmitCouponList.push(...ele.couponList);
|
|
506
|
+
});
|
|
507
|
+
return resSubmitCouponList;
|
|
508
|
+
},
|
|
509
|
+
|
|
510
|
+
onGoodsNumChange(e) {
|
|
511
|
+
const {
|
|
512
|
+
detail: { value },
|
|
513
|
+
currentTarget: {
|
|
514
|
+
dataset: { goods },
|
|
515
|
+
},
|
|
516
|
+
} = e;
|
|
517
|
+
const index = this.goodsRequestList.findIndex(
|
|
518
|
+
({ storeId, spuId, skuId }) => goods.storeId === storeId && goods.spuId === spuId && goods.skuId === skuId,
|
|
519
|
+
);
|
|
520
|
+
if (index >= 0) {
|
|
521
|
+
// eslint-disable-next-line no-confusing-arrow
|
|
522
|
+
const goodsRequestList = this.goodsRequestList.map((item, i) =>
|
|
523
|
+
i === index ? { ...item, quantity: value } : item,
|
|
524
|
+
);
|
|
525
|
+
this.handleOptionsParams({ goodsRequestList });
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
|
|
529
|
+
onPopupChange() {
|
|
530
|
+
this.setData({
|
|
531
|
+
popupShow: !this.data.popupShow,
|
|
532
|
+
});
|
|
533
|
+
},
|
|
534
|
+
});
|
|
535
|
+
</script>
|
|
536
|
+
|
|
537
|
+
<template>
|
|
538
|
+
<wxs module="order" src="./order.wxs" />
|
|
539
|
+
|
|
540
|
+
<wxs module="handleInvoice" src="./handleInvoice.wxs" />
|
|
541
|
+
<wxs module="getNotes" src="./getNotes.wxs" />
|
|
542
|
+
<view class="order-sure [box-sizing:border-box] [background:#f6f6f6] [padding:24rpx_0_calc(env(safe-area-inset-bottom)_+_136rpx)] [min-height:100vh] [&_.wx-pay-cover]:[position:fixed] [&_.wx-pay-cover]:[left:0] [&_.wx-pay-cover]:[bottom:0] [&_.wx-pay-cover]:[right:0] [&_.wx-pay-cover]:[z-index:10] [&_.wx-pay-cover]:[background:#fff] [&_.wx-pay-cover]:[height:112rpx] [&_.wx-pay-cover]:[padding-bottom:env(safe-area-inset-bottom)] [&_.wx-pay-cover_.wx-pay]:[width:100%] [&_.wx-pay-cover_.wx-pay]:[height:100rpx] [&_.wx-pay-cover_.wx-pay]:[box-sizing:border-box] [&_.wx-pay-cover_.wx-pay]:[padding:0rpx_32rpx] [&_.wx-pay-cover_.wx-pay]:[display:flex] [&_.wx-pay-cover_.wx-pay]:[justify-content:space-between] [&_.wx-pay-cover_.wx-pay]:[align-items:center] [&_.wx-pay-cover_.wx-pay_.price]:[color:#fa4126] [&_.wx-pay-cover_.wx-pay_.price]:[font-weight:bold] [&_.wx-pay-cover_.wx-pay_.price]:[font-size:63rpx] [&_.wx-pay-cover_.wx-pay_.price]:[line-height:88rpx] [&_.wx-pay-cover_.wx-pay_.submit-btn]:[height:80rpx] [&_.wx-pay-cover_.wx-pay_.submit-btn]:[width:240rpx] [&_.wx-pay-cover_.wx-pay_.submit-btn]:[border-radius:40rpx] [&_.wx-pay-cover_.wx-pay_.submit-btn]:[background-color:#fa4126] [&_.wx-pay-cover_.wx-pay_.submit-btn]:[color:#ffffff] [&_.wx-pay-cover_.wx-pay_.submit-btn]:[line-height:80rpx] [&_.wx-pay-cover_.wx-pay_.submit-btn]:[font-weight:bold] [&_.wx-pay-cover_.wx-pay_.submit-btn]:[font-size:28rpx] [&_.wx-pay-cover_.wx-pay_.submit-btn]:[text-align:center] [&_.wx-pay-cover_.wx-pay_.btn-gray]:[background:#cccccc] [&_.pay-detail]:[background-color:#ffffff] [&_.pay-detail]:[padding:16rpx_32rpx] [&_.pay-detail]:[width:100%] [&_.pay-detail]:[box-sizing:border-box] [&_.pay-detail_.pay-item]:[width:100%] [&_.pay-detail_.pay-item]:[height:72rpx] [&_.pay-detail_.pay-item]:[display:flex] [&_.pay-detail_.pay-item]:[align-items:center] [&_.pay-detail_.pay-item]:[justify-content:space-between] [&_.pay-detail_.pay-item]:[font-size:26rpx] [&_.pay-detail_.pay-item]:[line-height:36rpx] [&_.pay-detail_.pay-item]:[color:#666666] [&_.pay-detail_.pay-item_.pay-item__right]:[color:#333333] [&_.pay-detail_.pay-item_.pay-item__right]:[font-size:24rpx] [&_.pay-detail_.pay-item_.pay-item__right]:[display:flex] [&_.pay-detail_.pay-item_.pay-item__right]:[align-items:center] [&_.pay-detail_.pay-item_.pay-item__right]:[justify-content:flex-end] [&_.pay-detail_.pay-item_.pay-item__right]:[max-width:400rpx] [&_.pay-detail_.pay-item_.pay-item__right_.pay-remark]:[display:-webkit-box] [&_.pay-detail_.pay-item_.pay-item__right_.pay-remark]:[-webkit-box-orient:vertical] [&_.pay-detail_.pay-item_.pay-item__right_.pay-remark]:[-webkit-line-clamp:2] [&_.pay-detail_.pay-item_.pay-item__right_.pay-remark]:[max-width:400rpx] [&_.pay-detail_.pay-item_.pay-item__right_.pay-remark]:[text-overflow:ellipsis] [&_.pay-detail_.pay-item_.pay-item__right_.pay-remark]:[overflow:hidden] [&_.pay-detail_.pay-item_.font-bold]:[font-weight:bold] [&_.pay-detail_.pay-item_.primary]:[color:#fa4126] [&_.add-notes_.dialog__message]:[border-radius:8rpx] [&_.amount-wrapper]:[width:100%] [&_.amount-wrapper]:[box-sizing:border-box] [&_.amount-wrapper]:[background-color:#ffffff] [&_.amount-wrapper]:[padding:0rpx_32rpx] [&_.amount-wrapper]:[height:96rpx] [&_.pay-amount]:[width:100%] [&_.pay-amount]:[height:96rpx] [&_.pay-amount]:[display:flex] [&_.pay-amount]:[align-items:center] [&_.pay-amount]:[justify-content:flex-end] [&_.pay-amount]:[font-size:28rpx] [&_.pay-amount]:[color:#333333] [&_.pay-amount]:[position:relative] [&_.pay-amount_.order-num]:[color:#999999] [&_.pay-amount_.order-num]:[padding-right:8rpx] [&_.pay-amount_.total-price]:[font-size:36rpx] [&_.pay-amount_.total-price]:[color:#fa4126] [&_.pay-amount_.total-price]:[font-weight:bold] [&_.pay-amount_.total-price]:[padding-left:8rpx]" wx:if="{{!loading}}">
|
|
543
|
+
<address-card addressData="{{userAddress}}" bind:addclick="onGotoAddress" bind:addressclick="onGotoAddress" />
|
|
544
|
+
<view
|
|
545
|
+
class="order-wrapper [&_.store-wrapper]:[width:100%] [&_.store-wrapper]:[height:96rpx] [&_.store-wrapper]:[box-sizing:border-box] [&_.store-wrapper]:[padding:0_32rpx] [&_.store-wrapper]:[display:flex] [&_.store-wrapper]:[align-items:center] [&_.store-wrapper]:[font-size:28rpx] [&_.store-wrapper]:[line-height:40rpx] [&_.store-wrapper]:[color:#333333] [&_.store-wrapper]:[background-color:#ffffff] [&_.store-wrapper_.store-logo]:[margin-right:16rpx] [&_.goods-wrapper]:[width:100%] [&_.goods-wrapper]:[box-sizing:border-box] [&_.goods-wrapper]:[padding:16rpx_32rpx] [&_.goods-wrapper]:[display:flex] [&_.goods-wrapper]:[align-items:flex-start] [&_.goods-wrapper]:[justify-content:space-between] [&_.goods-wrapper]:[font-size:24rpx] [&_.goods-wrapper]:[line-height:32rpx] [&_.goods-wrapper]:[color:#999999] [&_.goods-wrapper]:[background-color:#ffffff]"
|
|
546
|
+
wx:for="{{settleDetailData.storeGoodsList}}"
|
|
547
|
+
wx:for-item="stores"
|
|
548
|
+
wx:for-index="storeIndex"
|
|
549
|
+
wx:key="storeIndex"
|
|
550
|
+
>
|
|
551
|
+
<view class="store-wrapper">
|
|
552
|
+
<t-icon prefix="wr" size="40rpx" color="#333333" name="store" class="store-logo" />
|
|
553
|
+
{{stores.storeName}}
|
|
554
|
+
</view>
|
|
555
|
+
<view
|
|
556
|
+
wx:if="{{orderCardList[storeIndex].goodsList.length > 0}}"
|
|
557
|
+
wx:for="{{orderCardList[storeIndex].goodsList}}"
|
|
558
|
+
wx:for-item="goods"
|
|
559
|
+
wx:for-index="gIndex"
|
|
560
|
+
wx:key="id"
|
|
561
|
+
class="goods-wrapper [&_.goods-image]:[width:176rpx] [&_.goods-image]:[height:176rpx] [&_.goods-image]:[border-radius:8rpx] [&_.goods-image]:[overflow:hidden] [&_.goods-image]:[margin-right:16rpx] [&_.goods-content]:[flex:1] [&_.goods-content_.goods-title]:[display:-webkit-box] [&_.goods-content_.goods-title]:[-webkit-box-orient:vertical] [&_.goods-content_.goods-title]:[-webkit-line-clamp:2] [&_.goods-content_.goods-title]:[overflow:hidden] [&_.goods-content_.goods-title]:[text-overflow:ellipsis] [&_.goods-content_.goods-title]:[font-size:28rpx] [&_.goods-content_.goods-title]:[line-height:40rpx] [&_.goods-content_.goods-title]:[margin-bottom:12rpx] [&_.goods-content_.goods-title]:[color:#333333] [&_.goods-content_.goods-title]:[margin-right:16rpx] [&_.goods-right]:[min-width:128rpx] [&_.goods-right]:[display:flex] [&_.goods-right]:[flex-direction:column] [&_.goods-right]:[align-items:flex-end]"
|
|
562
|
+
>
|
|
563
|
+
<t-image src="{{goods.thumb}}" t-class="goods-image" mode="aspectFill" />
|
|
564
|
+
<view class="goods-content">
|
|
565
|
+
<view class="goods-title">{{goods.title}}</view>
|
|
566
|
+
<view>{{goods.specs}}</view>
|
|
567
|
+
</view>
|
|
568
|
+
<view class="goods-right [&_.goods-price]:[color:#333333] [&_.goods-price]:[font-size:32rpx] [&_.goods-price]:[line-height:48rpx] [&_.goods-price]:[font-weight:bold] [&_.goods-price]:[margin-bottom:16rpx] [&_.goods-num]:[text-align:right]">
|
|
569
|
+
<price wr-class="goods-price" price="{{goods.price}}" fill="{{true}}" decimalSmaller />
|
|
570
|
+
<view class="goods-num">x{{goods.num}}</view>
|
|
571
|
+
</view>
|
|
572
|
+
</view>
|
|
573
|
+
</view>
|
|
574
|
+
<view class="pay-detail">
|
|
575
|
+
<view class="pay-item">
|
|
576
|
+
<text>商品总额</text>
|
|
577
|
+
<price
|
|
578
|
+
fill
|
|
579
|
+
decimalSmaller
|
|
580
|
+
wr-class="pay-item__right font-bold"
|
|
581
|
+
price="{{settleDetailData.totalSalePrice || '0'}}"
|
|
582
|
+
/>
|
|
583
|
+
</view>
|
|
584
|
+
<view class="pay-item">
|
|
585
|
+
<text>运费</text>
|
|
586
|
+
<view class="pay-item__right font-bold">
|
|
587
|
+
<block wx:if="{{settleDetailData.totalDeliveryFee && settleDetailData.totalDeliveryFee != 0}}">
|
|
588
|
+
+
|
|
589
|
+
<price fill decimalSmaller price="{{settleDetailData.totalDeliveryFee}}" />
|
|
590
|
+
</block>
|
|
591
|
+
<text wx:else>免运费</text>
|
|
592
|
+
</view>
|
|
593
|
+
</view>
|
|
594
|
+
<view class="pay-item">
|
|
595
|
+
<text>活动优惠</text>
|
|
596
|
+
<view class="pay-item__right primary font-bold">
|
|
597
|
+
-
|
|
598
|
+
<price fill price="{{settleDetailData.totalPromotionAmount || 0}}" />
|
|
599
|
+
</view>
|
|
600
|
+
</view>
|
|
601
|
+
<view class="pay-item">
|
|
602
|
+
<text>优惠券</text>
|
|
603
|
+
<view
|
|
604
|
+
class="pay-item__right"
|
|
605
|
+
data-storeid="{{settleDetailData.storeGoodsList[0].storeId}}"
|
|
606
|
+
catchtap="onOpenCoupons"
|
|
607
|
+
>
|
|
608
|
+
<block wx:if="{{submitCouponList.length}}">
|
|
609
|
+
<block wx:if="{{settleDetailData.totalCouponAmount && settleDetailData.totalCouponAmount !== '0'}}">
|
|
610
|
+
-<price fill decimalSmaller price="{{settleDetailData.totalCouponAmount}}" />
|
|
611
|
+
</block>
|
|
612
|
+
<block wx:else>选择优惠券</block>
|
|
613
|
+
</block>
|
|
614
|
+
<text wx:else>无可用</text>
|
|
615
|
+
<t-icon name="chevron-right" size="32rpx" color="#BBBBBB" />
|
|
616
|
+
</view>
|
|
617
|
+
</view>
|
|
618
|
+
<view class="pay-item" wx:if="{{settleDetailData.invoiceSupport}}">
|
|
619
|
+
<text>发票</text>
|
|
620
|
+
<view class="pay-item__right" catchtap="onReceipt">
|
|
621
|
+
<text>{{handleInvoice(invoiceData)}}</text>
|
|
622
|
+
<t-icon name="chevron-right" size="32rpx" color="#BBBBBB" />
|
|
623
|
+
</view>
|
|
624
|
+
</view>
|
|
625
|
+
<view class="pay-item">
|
|
626
|
+
<text>订单备注</text>
|
|
627
|
+
<view class="pay-item__right" data-storenoteindex="{{0}}" catchtap="onNotes">
|
|
628
|
+
<text class="pay-remark"
|
|
629
|
+
>{{getNotes(storeInfoList, 0) ? getNotes(storeInfoList, 0) :'选填,建议先和商家沟通确认'}}</text
|
|
630
|
+
>
|
|
631
|
+
<t-icon name="chevron-right" size="32rpx" color="#BBBBBB" />
|
|
632
|
+
</view>
|
|
633
|
+
</view>
|
|
634
|
+
</view>
|
|
635
|
+
<view class="amount-wrapper">
|
|
636
|
+
<view class="pay-amount">
|
|
637
|
+
<text class="order-num">共{{settleDetailData.totalGoodsCount}}件</text>
|
|
638
|
+
<text>小计</text>
|
|
639
|
+
<price class="total-price" price="{{settleDetailData.totalPayAmount}}" fill="{{false}}" decimalSmaller />
|
|
640
|
+
</view>
|
|
641
|
+
</view>
|
|
642
|
+
<view class="wx-pay-cover">
|
|
643
|
+
<view class="wx-pay">
|
|
644
|
+
<price decimalSmaller fill class="price" price="{{settleDetailData.totalPayAmount || '0'}}" />
|
|
645
|
+
<view class="submit-btn {{ settleDetailData.settleType === 1 ? '':'btn-gray'}}" bindtap="submitOrder">
|
|
646
|
+
提交订单
|
|
647
|
+
</view>
|
|
648
|
+
</view>
|
|
649
|
+
</view>
|
|
650
|
+
<t-dialog
|
|
651
|
+
t-class="add-notes [&_.t-textarea__placeholder]:[color:#aeb3b7] [&_.add-notes__textarea__font]:[font-size:26rpx] [&_.add-notes__textarea]:[margin-top:32rpx]"
|
|
652
|
+
title="填写备注信息"
|
|
653
|
+
visible="{{dialogShow}}"
|
|
654
|
+
confirm-btn="确认"
|
|
655
|
+
cancel-btn="取消"
|
|
656
|
+
t-class-content="add-notes__content"
|
|
657
|
+
t-class-confirm="dialog__button-confirm"
|
|
658
|
+
t-class-cancel="dialog__button-cancel"
|
|
659
|
+
bindconfirm="onNoteConfirm"
|
|
660
|
+
bindcancel="onNoteCancel"
|
|
661
|
+
>
|
|
662
|
+
<t-textarea
|
|
663
|
+
slot="content"
|
|
664
|
+
focus="{{dialogShow}}"
|
|
665
|
+
class="notes"
|
|
666
|
+
t-class="add-notes__textarea"
|
|
667
|
+
value="{{storeInfoList[storeNoteIndex] && storeInfoList[storeNoteIndex].remark}}"
|
|
668
|
+
placeholder="备注信息"
|
|
669
|
+
t-class-textarea="add-notes__textarea__font"
|
|
670
|
+
bindfocus="onFocus"
|
|
671
|
+
bindblur="onBlur"
|
|
672
|
+
bindchange="onInput"
|
|
673
|
+
maxlength="{{50}}"
|
|
674
|
+
/>
|
|
675
|
+
</t-dialog>
|
|
676
|
+
<t-popup visible="{{popupShow}}" placement="bottom" bind:visible-change="onPopupChange">
|
|
677
|
+
<no-goods slot="content" bind:change="onSureCommit" settleDetailData="{{settleDetailData}}" />
|
|
678
|
+
</t-popup>
|
|
679
|
+
<select-coupons
|
|
680
|
+
bind:sure="onCoupons"
|
|
681
|
+
storeId="{{currentStoreId}}"
|
|
682
|
+
orderSureCouponList="{{couponList}}"
|
|
683
|
+
promotionGoodsList="{{promotionGoodsList}}"
|
|
684
|
+
couponsShow="{{couponsShow}}"
|
|
685
|
+
/>
|
|
686
|
+
</view>
|
|
687
|
+
<t-toast id="t-toast" />
|
|
688
|
+
<t-dialog id="t-dialog" />
|
|
689
|
+
</template>
|
|
690
|
+
|
|
691
|
+
<json>
|
|
692
|
+
{
|
|
693
|
+
"navigationBarTitleText": "订单确认",
|
|
694
|
+
"usingComponents": {
|
|
695
|
+
"t-popup": "tdesign-miniprogram/popup/popup",
|
|
696
|
+
"t-toast": "tdesign-miniprogram/toast/toast",
|
|
697
|
+
"t-icon": "tdesign-miniprogram/icon/icon",
|
|
698
|
+
"t-cell": "tdesign-miniprogram/cell/cell",
|
|
699
|
+
"t-dialog": "tdesign-miniprogram/dialog/dialog",
|
|
700
|
+
"t-textarea": "tdesign-miniprogram/textarea/textarea",
|
|
701
|
+
"price": "/components/price/index",
|
|
702
|
+
"select-coupons": "../components/selectCoupons/selectCoupons",
|
|
703
|
+
"no-goods": "../components/noGoods/noGoods",
|
|
704
|
+
"t-image": "/components/webp-image/index",
|
|
705
|
+
"address-card": "./components/address-card/index"
|
|
706
|
+
}
|
|
707
|
+
}</json>
|