create-weapp-vite 2.0.32 → 2.0.34
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 +0 -1
- package/dist/{chunk-IT75MAH3.js → chunk-6CRKNZN2.js} +2 -3
- package/dist/cli.js +1 -5
- package/dist/index.d.ts +0 -1
- 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/package.json +1 -1
- package/templates/wevu-tdesign/package.json +2 -2
- package/templates/wevu-retail/.editorconfig +0 -9
- package/templates/wevu-retail/.vscode/settings.json +0 -10
- package/templates/wevu-retail/AGENTS.md +0 -35
- package/templates/wevu-retail/README.md +0 -26
- package/templates/wevu-retail/auto-import-components.json +0 -1
- package/templates/wevu-retail/gitignore +0 -35
- package/templates/wevu-retail/package.json +0 -42
- package/templates/wevu-retail/postcss.config.js +0 -6
- package/templates/wevu-retail/project.config.json +0 -44
- package/templates/wevu-retail/project.private.config.json +0 -8
- package/templates/wevu-retail/src/app.vue +0 -104
- package/templates/wevu-retail/src/common/updateManager.ts +0 -29
- package/templates/wevu-retail/src/components/filter/index.vue +0 -134
- package/templates/wevu-retail/src/components/filter-popup/index.vue +0 -67
- package/templates/wevu-retail/src/components/goods-card/index.vue +0 -219
- package/templates/wevu-retail/src/components/goods-list/index.vue +0 -91
- package/templates/wevu-retail/src/components/load-more/index.vue +0 -99
- package/templates/wevu-retail/src/components/loading-content/index.vue +0 -48
- package/templates/wevu-retail/src/components/price/index.vue +0 -104
- package/templates/wevu-retail/src/components/promotion/ui-coupon-card/index.vue +0 -143
- package/templates/wevu-retail/src/components/promotion/ui-coupon-card/tools.wxs +0 -18
- package/templates/wevu-retail/src/components/swipeout/index.vue +0 -118
- package/templates/wevu-retail/src/components/swipeout/swipe.wxs +0 -151
- package/templates/wevu-retail/src/components/webp-image/index.vue +0 -105
- package/templates/wevu-retail/src/components/webp-image/utils.wxs +0 -140
- package/templates/wevu-retail/src/config/index.ts +0 -20437
- package/templates/wevu-retail/src/custom-tab-bar/data.ts +0 -22
- package/templates/wevu-retail/src/custom-tab-bar/index.vue +0 -62
- package/templates/wevu-retail/src/model/activities.ts +0 -7
- package/templates/wevu-retail/src/model/activity.ts +0 -18
- package/templates/wevu-retail/src/model/address.ts +0 -31
- package/templates/wevu-retail/src/model/cart.ts +0 -306
- package/templates/wevu-retail/src/model/category.ts +0 -175
- package/templates/wevu-retail/src/model/comments/queryDetail.ts +0 -50
- package/templates/wevu-retail/src/model/comments.ts +0 -298
- package/templates/wevu-retail/src/model/coupon.ts +0 -39
- package/templates/wevu-retail/src/model/detailsComments.ts +0 -30
- package/templates/wevu-retail/src/model/good.ts +0 -1904
- package/templates/wevu-retail/src/model/goods.ts +0 -7
- package/templates/wevu-retail/src/model/order/applyService.ts +0 -329
- package/templates/wevu-retail/src/model/order/orderConfirm.ts +0 -147
- package/templates/wevu-retail/src/model/order/orderDetail.ts +0 -1191
- package/templates/wevu-retail/src/model/order/orderList.ts +0 -1033
- package/templates/wevu-retail/src/model/promotion.ts +0 -20
- package/templates/wevu-retail/src/model/search.ts +0 -60
- package/templates/wevu-retail/src/model/submitComment.ts +0 -58
- package/templates/wevu-retail/src/model/swiper.ts +0 -39
- package/templates/wevu-retail/src/model/usercenter.ts +0 -52
- package/templates/wevu-retail/src/pages/cart/components/cart-bar/index.vue +0 -104
- package/templates/wevu-retail/src/pages/cart/components/cart-empty/index.vue +0 -41
- package/templates/wevu-retail/src/pages/cart/components/cart-group/index.vue +0 -333
- package/templates/wevu-retail/src/pages/cart/components/cart-group/index.wxs +0 -5
- package/templates/wevu-retail/src/pages/cart/components/cart-group/utils.wxs +0 -20
- package/templates/wevu-retail/src/pages/cart/components/goods-card/index.vue +0 -334
- package/templates/wevu-retail/src/pages/cart/components/specs-popup/index.vue +0 -100
- package/templates/wevu-retail/src/pages/cart/index.vue +0 -342
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/README.md +0 -95
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.vue +0 -73
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/index.vue +0 -121
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.vue +0 -74
- package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-tabbar/index.vue +0 -102
- package/templates/wevu-retail/src/pages/category/components/goods-category/index.vue +0 -137
- package/templates/wevu-retail/src/pages/category/index.vue +0 -50
- package/templates/wevu-retail/src/pages/coupon/components/coupon-card/index.vue +0 -95
- package/templates/wevu-retail/src/pages/coupon/components/floating-button/index.vue +0 -44
- package/templates/wevu-retail/src/pages/coupon/coupon-activity-goods/index.vue +0 -135
- package/templates/wevu-retail/src/pages/coupon/coupon-detail/index.vue +0 -94
- package/templates/wevu-retail/src/pages/coupon/coupon-list/index.vue +0 -136
- 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 +0 -65
- package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/my-video/index.vue +0 -92
- package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/index.vue +0 -93
- package/templates/wevu-retail/src/pages/goods/comments/create/index.vue +0 -196
- package/templates/wevu-retail/src/pages/goods/comments/index.vue +0 -293
- package/templates/wevu-retail/src/pages/goods/details/components/buy-bar/index.vue +0 -117
- package/templates/wevu-retail/src/pages/goods/details/components/goods-specs-popup/index.vue +0 -440
- package/templates/wevu-retail/src/pages/goods/details/components/promotion-popup/index.vue +0 -83
- package/templates/wevu-retail/src/pages/goods/details/index.vue +0 -598
- package/templates/wevu-retail/src/pages/goods/list/index.vue +0 -299
- package/templates/wevu-retail/src/pages/goods/result/index.vue +0 -350
- package/templates/wevu-retail/src/pages/goods/search/index.vue +0 -196
- package/templates/wevu-retail/src/pages/home/home.vue +0 -215
- package/templates/wevu-retail/src/pages/home/readme +0 -8
- package/templates/wevu-retail/src/pages/order/after-service-detail/api.ts +0 -34
- package/templates/wevu-retail/src/pages/order/after-service-detail/index.vue +0 -430
- package/templates/wevu-retail/src/pages/order/after-service-list/api.ts +0 -1262
- package/templates/wevu-retail/src/pages/order/after-service-list/index.vue +0 -299
- package/templates/wevu-retail/src/pages/order/apply-service/index.vue +0 -665
- package/templates/wevu-retail/src/pages/order/components/after-service-button-bar/index.vue +0 -142
- package/templates/wevu-retail/src/pages/order/components/customer-service/index.vue +0 -75
- package/templates/wevu-retail/src/pages/order/components/goods-card/index.vue +0 -356
- package/templates/wevu-retail/src/pages/order/components/noGoods/noGood.wxs +0 -17
- package/templates/wevu-retail/src/pages/order/components/noGoods/noGoods.vue +0 -125
- package/templates/wevu-retail/src/pages/order/components/order-button-bar/index.vue +0 -262
- package/templates/wevu-retail/src/pages/order/components/order-card/index.vue +0 -126
- package/templates/wevu-retail/src/pages/order/components/order-goods-card/index.vue +0 -86
- package/templates/wevu-retail/src/pages/order/components/reason-sheet/index.vue +0 -161
- package/templates/wevu-retail/src/pages/order/components/reason-sheet/reasonSheet.ts +0 -25
- package/templates/wevu-retail/src/pages/order/components/selectCoupons/mock.ts +0 -22
- package/templates/wevu-retail/src/pages/order/components/selectCoupons/selectCoupon.wxs +0 -16
- package/templates/wevu-retail/src/pages/order/components/selectCoupons/selectCoupons.vue +0 -207
- package/templates/wevu-retail/src/pages/order/components/specs-goods-card/index.vue +0 -185
- package/templates/wevu-retail/src/pages/order/config.ts +0 -94
- package/templates/wevu-retail/src/pages/order/delivery-detail/index.vue +0 -145
- package/templates/wevu-retail/src/pages/order/delivery-detail/isUrl.wxs +0 -7
- package/templates/wevu-retail/src/pages/order/fill-tracking-no/api.ts +0 -71
- package/templates/wevu-retail/src/pages/order/fill-tracking-no/index.vue +0 -267
- package/templates/wevu-retail/src/pages/order/invoice/index.vue +0 -94
- package/templates/wevu-retail/src/pages/order/order-confirm/components/address-card/index.vue +0 -78
- package/templates/wevu-retail/src/pages/order/order-confirm/getNotes.wxs +0 -11
- package/templates/wevu-retail/src/pages/order/order-confirm/handleInvoice.wxs +0 -11
- package/templates/wevu-retail/src/pages/order/order-confirm/index.vue +0 -707
- package/templates/wevu-retail/src/pages/order/order-confirm/order.wxs +0 -8
- package/templates/wevu-retail/src/pages/order/order-confirm/pay.ts +0 -115
- package/templates/wevu-retail/src/pages/order/order-detail/index.vue +0 -456
- package/templates/wevu-retail/src/pages/order/order-list/index.vue +0 -288
- package/templates/wevu-retail/src/pages/order/pay-result/index.vue +0 -77
- package/templates/wevu-retail/src/pages/order/receipt/index.vue +0 -336
- package/templates/wevu-retail/src/pages/promotion/promotion-detail/index.vue +0 -145
- package/templates/wevu-retail/src/pages/user/address/edit/index.vue +0 -514
- package/templates/wevu-retail/src/pages/user/address/list/index.vue +0 -249
- package/templates/wevu-retail/src/pages/user/components/t-location/index.vue +0 -156
- package/templates/wevu-retail/src/pages/user/components/ui-address-item/index.vue +0 -92
- package/templates/wevu-retail/src/pages/user/name-edit/index.vue +0 -49
- package/templates/wevu-retail/src/pages/user/person-info/index.vue +0 -198
- package/templates/wevu-retail/src/pages/usercenter/address/edit/util.ts +0 -33
- package/templates/wevu-retail/src/pages/usercenter/components/order-group/index.vue +0 -90
- package/templates/wevu-retail/src/pages/usercenter/components/ui-select-picker/index.vue +0 -108
- package/templates/wevu-retail/src/pages/usercenter/components/user-center-card/index.vue +0 -82
- package/templates/wevu-retail/src/pages/usercenter/index.vue +0 -301
- package/templates/wevu-retail/src/services/_utils/delay.ts +0 -3
- package/templates/wevu-retail/src/services/_utils/timeout.ts +0 -3
- package/templates/wevu-retail/src/services/activity/fetchActivity.ts +0 -20
- package/templates/wevu-retail/src/services/activity/fetchActivityList.ts +0 -20
- package/templates/wevu-retail/src/services/address/edit.ts +0 -33
- package/templates/wevu-retail/src/services/address/fetchAddress.ts +0 -48
- package/templates/wevu-retail/src/services/address/list.ts +0 -31
- package/templates/wevu-retail/src/services/cart/cart.ts +0 -20
- package/templates/wevu-retail/src/services/comments/fetchComments.ts +0 -18
- package/templates/wevu-retail/src/services/comments/fetchCommentsCount.ts +0 -18
- package/templates/wevu-retail/src/services/coupon/index.ts +0 -65
- package/templates/wevu-retail/src/services/good/comments/fetchCommentDetail.ts +0 -20
- package/templates/wevu-retail/src/services/good/fetchCategoryList.ts +0 -18
- package/templates/wevu-retail/src/services/good/fetchGood.ts +0 -18
- package/templates/wevu-retail/src/services/good/fetchGoods.ts +0 -29
- package/templates/wevu-retail/src/services/good/fetchGoodsDetailsComments.ts +0 -37
- package/templates/wevu-retail/src/services/good/fetchGoodsList.ts +0 -39
- package/templates/wevu-retail/src/services/good/fetchSearchHistory.ts +0 -35
- package/templates/wevu-retail/src/services/good/fetchSearchResult.ts +0 -38
- package/templates/wevu-retail/src/services/home/home.ts +0 -53
- package/templates/wevu-retail/src/services/order/applyService.ts +0 -70
- package/templates/wevu-retail/src/services/order/orderConfirm.ts +0 -69
- package/templates/wevu-retail/src/services/order/orderDetail.ts +0 -39
- package/templates/wevu-retail/src/services/order/orderList.ts +0 -39
- package/templates/wevu-retail/src/services/order/orderSubmitComment.ts +0 -22
- package/templates/wevu-retail/src/services/promotion/detail.ts +0 -18
- package/templates/wevu-retail/src/services/usercenter/fetchPerson.ts +0 -28
- package/templates/wevu-retail/src/services/usercenter/fetchUsercenter.ts +0 -18
- package/templates/wevu-retail/src/sitemap.json +0 -7
- package/templates/wevu-retail/src/utils/addressParse.ts +0 -25
- package/templates/wevu-retail/src/utils/getPermission.ts +0 -45
- package/templates/wevu-retail/src/utils/mock.ts +0 -51
- package/templates/wevu-retail/src/utils/util.ts +0 -134
- package/templates/wevu-retail/src/vite-env.d.ts +0 -1
- package/templates/wevu-retail/tailwind.config.ts +0 -15
- package/templates/wevu-retail/tsconfig.app.json +0 -58
- package/templates/wevu-retail/tsconfig.json +0 -11
- package/templates/wevu-retail/tsconfig.node.json +0 -33
- package/templates/wevu-retail/vite.config.ts +0 -14
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
Component({
|
|
3
|
-
properties: {
|
|
4
|
-
settleDetailData: {
|
|
5
|
-
type: Object,
|
|
6
|
-
value: {},
|
|
7
|
-
observer(settleDetailData) {
|
|
8
|
-
const {
|
|
9
|
-
outOfStockGoodsList,
|
|
10
|
-
abnormalDeliveryGoodsList,
|
|
11
|
-
inValidGoodsList,
|
|
12
|
-
limitGoodsList,
|
|
13
|
-
} = settleDetailData;
|
|
14
|
-
// 弹窗逻辑 限购 超出配送范围 失效 库存不足;
|
|
15
|
-
const tempList =
|
|
16
|
-
limitGoodsList ||
|
|
17
|
-
abnormalDeliveryGoodsList ||
|
|
18
|
-
inValidGoodsList ||
|
|
19
|
-
outOfStockGoodsList ||
|
|
20
|
-
[];
|
|
21
|
-
|
|
22
|
-
tempList.forEach((goods, index) => {
|
|
23
|
-
goods.id = index;
|
|
24
|
-
goods.unSettlementGoods &&
|
|
25
|
-
goods.unSettlementGoods.forEach((ele) => {
|
|
26
|
-
ele.name = ele.goodsName;
|
|
27
|
-
ele.price = ele.payPrice;
|
|
28
|
-
ele.imgUrl = ele.image;
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
this.setData({
|
|
32
|
-
// settleDetailData,
|
|
33
|
-
goodsList: tempList,
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
data: {
|
|
40
|
-
goodList: [],
|
|
41
|
-
},
|
|
42
|
-
methods: {
|
|
43
|
-
onCard(e) {
|
|
44
|
-
const { item } = e.currentTarget.dataset;
|
|
45
|
-
if (item === 'cart') {
|
|
46
|
-
// 购物车
|
|
47
|
-
Navigator.gotoPage('/cart');
|
|
48
|
-
} else if (item === 'orderSure') {
|
|
49
|
-
// 结算页
|
|
50
|
-
this.triggerEvent('change', undefined);
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
onDelive() {
|
|
54
|
-
// 修改配送地址
|
|
55
|
-
Navigator.gotoPage('/address', { type: 'orderSure' });
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
<template>
|
|
62
|
-
<wxs src="./noGood.wxs" module="order" />
|
|
63
|
-
|
|
64
|
-
<view class="goods-fail [display:block] [background:#fff] [font-size:30rpx] [border-radius:20rpx_20rpx_0_0] [&_.title]:[display:inline-block] [&_.title]:[width:100%] [&_.title]:[text-align:center] [&_.title]:[margin-top:30rpx] [&_.title]:[line-height:42rpx] [&_.title]:[font-weight:bold] [&_.title]:[font-size:32rpx] [&_.info]:[display:block] [&_.info]:[font-size:26rpx] [&_.info]:[font-weight:400] [&_.info]:[line-height:36rpx] [&_.info]:[margin:20rpx_auto_10rpx] [&_.info]:[text-align:center] [&_.info]:[width:560rpx] [&_.info]:[color:#999] [&_.goods-fail-btn]:[display:flex] [&_.goods-fail-btn]:[padding:30rpx] [&_.goods-fail-btn]:[justify-content:space-between] [&_.goods-fail-btn]:[align-items:center] [&_.goods-fail-btn]:[font-size:30rpx] [&_.goods-fail-btn_.btn]:[width:330rpx] [&_.goods-fail-btn_.btn]:[height:80rpx] [&_.goods-fail-btn_.btn]:[line-height:80rpx] [&_.goods-fail-btn_.btn]:[border-radius:8rpx] [&_.goods-fail-btn_.btn]:[text-align:center] [&_.goods-fail-btn_.btn]:[border:1rpx_solid_#999] [&_.goods-fail-btn_.btn]:[background:#fff] [&_.goods-fail-btn_.btn]:[font-size:32rpx] [&_.goods-fail-btn_.btn]:[color:#666] [&_.goods-fail-btn_.btn_.origin]:[color:#fa550f] [&_.goods-fail-btn_.btn_.origin]:[color:var(--color-primary,_#fa550f)] [&_.goods-fail-btn_.btn_.origin]:[border:1rpx_solid_#fa550f] [&_.goods-fail-btn_.btn_.origin]:[border:1rpx_solid_var(--color-primary,_#fa550f)] [&_.goods-fail-btn_.btn_.limit]:[color:#fa550f] [&_.goods-fail-btn_.btn_.limit]:[color:var(--color-primary,_#fa550f)] [&_.goods-fail-btn_.btn_.limit]:[border:1rpx_solid_#fa550f] [&_.goods-fail-btn_.btn_.limit]:[border:1rpx_solid_var(--color-primary,_#fa550f)] [&_.goods-fail-btn_.btn_.limit]:[flex-grow:1]">
|
|
65
|
-
<block wx:if="{{settleDetailData.limitGoodsList && settleDetailData.limitGoodsList.length >0}}">
|
|
66
|
-
<view class="title">限购商品信息</view>
|
|
67
|
-
<view class="info">以下商品限购数量,建议您修改商品数量</view>
|
|
68
|
-
</block>
|
|
69
|
-
<block
|
|
70
|
-
wx:elif="{{settleDetailData.abnormalDeliveryGoodsList && settleDetailData.abnormalDeliveryGoodsList.length >0}}"
|
|
71
|
-
>
|
|
72
|
-
<view class="title">不支持配送</view>
|
|
73
|
-
<view class="info">以下店铺的商品不支持配送,请更改地址或去掉对应店铺商品再进行结算</view>
|
|
74
|
-
</block>
|
|
75
|
-
<block wx:elif="{{order.isShowKeepPay(settleDetailData)}}">
|
|
76
|
-
<view class="title">部分商品库存不足或失效</view>
|
|
77
|
-
<view class="info">请返回购物车重新选择商品,如果继续结算将自动忽略库存不足或失效的商品。</view>
|
|
78
|
-
</block>
|
|
79
|
-
<block wx:elif="{{settleDetailData.inValidGoodsList && settleDetailData.inValidGoodsList.length > 0}}">
|
|
80
|
-
<view class="title">全部商品库存不足或失效</view>
|
|
81
|
-
<view class="info">请返回购物车重新选择商品</view>
|
|
82
|
-
</block>
|
|
83
|
-
<scroll-view
|
|
84
|
-
scroll-y="true"
|
|
85
|
-
style="max-height: 500rpx"
|
|
86
|
-
bindscrolltoupper="upper"
|
|
87
|
-
bindscrolltolower="lower"
|
|
88
|
-
bindscroll="scroll"
|
|
89
|
-
>
|
|
90
|
-
<view class="goods-list" wx:for="{{goodsList}}" wx:for-item="goods" wx:key="index">
|
|
91
|
-
<wr-order-card wx:if="{{goods}}" order="{{goods}}">
|
|
92
|
-
<wr-order-goods-card
|
|
93
|
-
wx:for="{{goods.unSettlementGoods}}"
|
|
94
|
-
wx:key="id"
|
|
95
|
-
wx:for-item="goods"
|
|
96
|
-
wx:for-index="gIndex"
|
|
97
|
-
goods="{{goods}}"
|
|
98
|
-
no-top-line="{{gIndex === 0}}"
|
|
99
|
-
/>
|
|
100
|
-
</wr-order-card>
|
|
101
|
-
</view>
|
|
102
|
-
</scroll-view>
|
|
103
|
-
<view class="goods-fail-btn">
|
|
104
|
-
<view bindtap="onCard" data-item="cart" class="btn {{order.isOnlyBack(settleDetailData) ? 'limit' : ''}}">
|
|
105
|
-
返回购物车
|
|
106
|
-
</view>
|
|
107
|
-
<view wx:if="{{order.isShowChangeAddress(settleDetailData)}}" bindtap="onDelive" class="btn origin">
|
|
108
|
-
修改配送地址
|
|
109
|
-
</view>
|
|
110
|
-
<view wx:elif="{{order.isShowKeepPay(settleDetailData)}}" bindtap="onCard" data-item="orderSure" class="btn origin">
|
|
111
|
-
继续结算
|
|
112
|
-
</view>
|
|
113
|
-
</view>
|
|
114
|
-
</view>
|
|
115
|
-
</template>
|
|
116
|
-
|
|
117
|
-
<json>
|
|
118
|
-
{
|
|
119
|
-
"component": true,
|
|
120
|
-
"usingComponents": {
|
|
121
|
-
"wr-order-card": "/pages/order/components/order-card/index",
|
|
122
|
-
"wr-goods-card": "/components/goods-card/index",
|
|
123
|
-
"wr-order-goods-card": "/pages/order/components/order-goods-card/index"
|
|
124
|
-
}
|
|
125
|
-
}</json>
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Toast from 'tdesign-miniprogram/toast/index';
|
|
3
|
-
import Dialog from 'tdesign-miniprogram/dialog/index';
|
|
4
|
-
import { OrderButtonTypes } from '../../config';
|
|
5
|
-
|
|
6
|
-
Component({
|
|
7
|
-
options: {
|
|
8
|
-
addGlobalClass: true,
|
|
9
|
-
},
|
|
10
|
-
properties: {
|
|
11
|
-
order: {
|
|
12
|
-
type: Object,
|
|
13
|
-
observer(order) {
|
|
14
|
-
// 判定有传goodsIndex ,则认为是商品button bar, 仅显示申请售后按钮
|
|
15
|
-
if (this.properties?.goodsIndex !== null) {
|
|
16
|
-
const goods = order.goodsList[Number(this.properties.goodsIndex)];
|
|
17
|
-
this.setData({
|
|
18
|
-
buttons: {
|
|
19
|
-
left: [],
|
|
20
|
-
right: (goods.buttons || []).filter((b) => b.type == OrderButtonTypes.APPLY_REFUND),
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
// 订单的button bar 不显示申请售后按钮
|
|
26
|
-
const buttonsRight = (order.buttons || [])
|
|
27
|
-
// .filter((b) => b.type !== OrderButtonTypes.APPLY_REFUND)
|
|
28
|
-
.map((button) => {
|
|
29
|
-
//邀请好友拼团按钮
|
|
30
|
-
if (button.type === OrderButtonTypes.INVITE_GROUPON && order.groupInfoVo) {
|
|
31
|
-
const {
|
|
32
|
-
groupInfoVo: { groupId, promotionId, remainMember, groupPrice },
|
|
33
|
-
goodsList,
|
|
34
|
-
} = order;
|
|
35
|
-
const goodsImg = goodsList[0] && goodsList[0].imgUrl;
|
|
36
|
-
const goodsName = goodsList[0] && goodsList[0].name;
|
|
37
|
-
return {
|
|
38
|
-
...button,
|
|
39
|
-
openType: 'share',
|
|
40
|
-
dataShare: {
|
|
41
|
-
goodsImg,
|
|
42
|
-
goodsName,
|
|
43
|
-
groupId,
|
|
44
|
-
promotionId,
|
|
45
|
-
remainMember,
|
|
46
|
-
groupPrice,
|
|
47
|
-
storeId: order.storeId,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
return button;
|
|
52
|
-
});
|
|
53
|
-
// 删除订单按钮单独挪到左侧
|
|
54
|
-
const deleteBtnIndex = buttonsRight.findIndex((b) => b.type === OrderButtonTypes.DELETE);
|
|
55
|
-
let buttonsLeft = [];
|
|
56
|
-
if (deleteBtnIndex > -1) {
|
|
57
|
-
buttonsLeft = buttonsRight.splice(deleteBtnIndex, 1);
|
|
58
|
-
}
|
|
59
|
-
this.setData({
|
|
60
|
-
buttons: {
|
|
61
|
-
left: buttonsLeft,
|
|
62
|
-
right: buttonsRight,
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
goodsIndex: {
|
|
68
|
-
type: Number,
|
|
69
|
-
value: null,
|
|
70
|
-
},
|
|
71
|
-
isBtnMax: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
value: false,
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
data: {
|
|
78
|
-
order: {},
|
|
79
|
-
buttons: {
|
|
80
|
-
left: [],
|
|
81
|
-
right: [],
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
methods: {
|
|
86
|
-
// 点击【订单操作】按钮,根据按钮类型分发
|
|
87
|
-
onOrderBtnTap(e) {
|
|
88
|
-
const { type } = e.currentTarget.dataset;
|
|
89
|
-
switch (type) {
|
|
90
|
-
case OrderButtonTypes.DELETE:
|
|
91
|
-
this.onDelete(this.data.order);
|
|
92
|
-
break;
|
|
93
|
-
case OrderButtonTypes.CANCEL:
|
|
94
|
-
this.onCancel(this.data.order);
|
|
95
|
-
break;
|
|
96
|
-
case OrderButtonTypes.CONFIRM:
|
|
97
|
-
this.onConfirm(this.data.order);
|
|
98
|
-
break;
|
|
99
|
-
case OrderButtonTypes.PAY:
|
|
100
|
-
this.onPay(this.data.order);
|
|
101
|
-
break;
|
|
102
|
-
case OrderButtonTypes.APPLY_REFUND:
|
|
103
|
-
this.onApplyRefund(this.data.order);
|
|
104
|
-
break;
|
|
105
|
-
case OrderButtonTypes.VIEW_REFUND:
|
|
106
|
-
this.onViewRefund(this.data.order);
|
|
107
|
-
break;
|
|
108
|
-
case OrderButtonTypes.COMMENT:
|
|
109
|
-
this.onAddComment(this.data.order);
|
|
110
|
-
break;
|
|
111
|
-
case OrderButtonTypes.INVITE_GROUPON:
|
|
112
|
-
//分享邀请好友拼团
|
|
113
|
-
break;
|
|
114
|
-
case OrderButtonTypes.REBUY:
|
|
115
|
-
this.onBuyAgain(this.data.order);
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
onCancel() {
|
|
120
|
-
Toast({
|
|
121
|
-
context: this,
|
|
122
|
-
selector: '#t-toast',
|
|
123
|
-
message: '你点击了取消订单',
|
|
124
|
-
icon: 'check-circle',
|
|
125
|
-
});
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
onConfirm() {
|
|
129
|
-
Dialog.confirm({
|
|
130
|
-
title: '确认是否已经收到货?',
|
|
131
|
-
content: '',
|
|
132
|
-
confirmBtn: '确认收货',
|
|
133
|
-
cancelBtn: '取消',
|
|
134
|
-
})
|
|
135
|
-
.then(() => {
|
|
136
|
-
Toast({
|
|
137
|
-
context: this,
|
|
138
|
-
selector: '#t-toast',
|
|
139
|
-
message: '你确认了确认收货',
|
|
140
|
-
icon: 'check-circle',
|
|
141
|
-
});
|
|
142
|
-
})
|
|
143
|
-
.catch(() => {
|
|
144
|
-
Toast({
|
|
145
|
-
context: this,
|
|
146
|
-
selector: '#t-toast',
|
|
147
|
-
message: '你取消了确认收货',
|
|
148
|
-
icon: 'check-circle',
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
onPay() {
|
|
154
|
-
Toast({
|
|
155
|
-
context: this,
|
|
156
|
-
selector: '#t-toast',
|
|
157
|
-
message: '你点击了去支付',
|
|
158
|
-
icon: 'check-circle',
|
|
159
|
-
});
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
onBuyAgain() {
|
|
163
|
-
Toast({
|
|
164
|
-
context: this,
|
|
165
|
-
selector: '#t-toast',
|
|
166
|
-
message: '你点击了再次购买',
|
|
167
|
-
icon: 'check-circle',
|
|
168
|
-
});
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
onApplyRefund(order) {
|
|
172
|
-
const goods = order.goodsList[this.properties.goodsIndex];
|
|
173
|
-
const params = {
|
|
174
|
-
orderNo: order.orderNo,
|
|
175
|
-
skuId: goods?.skuId ?? '19384938948343',
|
|
176
|
-
spuId: goods?.spuId ?? '28373847384343',
|
|
177
|
-
orderStatus: order.status,
|
|
178
|
-
logisticsNo: order.logisticsNo,
|
|
179
|
-
price: goods?.price ?? 89,
|
|
180
|
-
num: goods?.num ?? 89,
|
|
181
|
-
createTime: order.createTime,
|
|
182
|
-
orderAmt: order.totalAmount,
|
|
183
|
-
payAmt: order.amount,
|
|
184
|
-
canApplyReturn: true,
|
|
185
|
-
};
|
|
186
|
-
const paramsStr = Object.keys(params)
|
|
187
|
-
.map((k) => `${k}=${params[k]}`)
|
|
188
|
-
.join('&');
|
|
189
|
-
wx.navigateTo({ url: `/pages/order/apply-service/index?${paramsStr}` });
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
onViewRefund() {
|
|
193
|
-
Toast({
|
|
194
|
-
context: this,
|
|
195
|
-
selector: '#t-toast',
|
|
196
|
-
message: '你点击了查看退款',
|
|
197
|
-
icon: '',
|
|
198
|
-
});
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
/** 添加订单评论 */
|
|
202
|
-
onAddComment(order) {
|
|
203
|
-
const imgUrl = order?.goodsList?.[0]?.thumb;
|
|
204
|
-
const title = order?.goodsList?.[0]?.title;
|
|
205
|
-
const specs = order?.goodsList?.[0]?.specs;
|
|
206
|
-
wx.navigateTo({
|
|
207
|
-
url: `/pages/goods/comments/create/index?specs=${specs}&title=${title}&orderNo=${order?.orderNo}&imgUrl=${imgUrl}`,
|
|
208
|
-
});
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
});
|
|
212
|
-
</script>
|
|
213
|
-
|
|
214
|
-
<template>
|
|
215
|
-
<view class="btn-bar [display:flex] [justify-content:space-between] [align-items:center] [line-height:1] [&_.order-btn]:[line-height:1] [&_.right]:[display:flex] [&_.right]:[align-items:center] [&_.t-button]:[width:160rpx] [&_.t-button]:[font-weight:400] [&_.t-button]:[margin-left:24rpx] [&_.t-button--max]:[width:176rpx] [&_.t-button--max]:[margin-left:24rpx] [&_.left_.delete-btn]:[font-size:22rpx]">
|
|
216
|
-
<view class="left">
|
|
217
|
-
<t-button
|
|
218
|
-
wx:for="{{buttons.left}}"
|
|
219
|
-
wx:key="type"
|
|
220
|
-
wx:for-item="leftBtn"
|
|
221
|
-
size="extra-small"
|
|
222
|
-
shape="round"
|
|
223
|
-
t-class="{{isBtnMax ? 't-button--max':'t-button'}} order-btn delete-btn"
|
|
224
|
-
hover-class="order-btn--active"
|
|
225
|
-
catchtap="onOrderBtnTap"
|
|
226
|
-
data-type="{{leftBtn.type}}"
|
|
227
|
-
>
|
|
228
|
-
{{leftBtn.name}}
|
|
229
|
-
</t-button>
|
|
230
|
-
</view>
|
|
231
|
-
<view class="right">
|
|
232
|
-
<t-button
|
|
233
|
-
wx:for="{{buttons.right}}"
|
|
234
|
-
wx:key="type"
|
|
235
|
-
wx:for-item="rightBtn"
|
|
236
|
-
size="extra-small"
|
|
237
|
-
variant="{{ rightBtn.primary ? 'base' : 'outline'}}"
|
|
238
|
-
shape="round"
|
|
239
|
-
t-class="{{isBtnMax ? 't-button--max':'t-button'}} order-btn {{rightBtn.primary ? 'primary' : 'normal'}}"
|
|
240
|
-
hover-class="order-btn--active"
|
|
241
|
-
catchtap="onOrderBtnTap"
|
|
242
|
-
data-type="{{rightBtn.type}}"
|
|
243
|
-
open-type="{{ rightBtn.openType }}"
|
|
244
|
-
data-share="{{ rightBtn.dataShare }}"
|
|
245
|
-
>
|
|
246
|
-
{{rightBtn.name}}
|
|
247
|
-
</t-button>
|
|
248
|
-
</view>
|
|
249
|
-
</view>
|
|
250
|
-
<t-toast id="t-toast" />
|
|
251
|
-
<t-dialog id="t-dialog" />
|
|
252
|
-
</template>
|
|
253
|
-
|
|
254
|
-
<json>
|
|
255
|
-
{
|
|
256
|
-
"component": true,
|
|
257
|
-
"usingComponents": {
|
|
258
|
-
"t-button": "tdesign-miniprogram/button/button",
|
|
259
|
-
"t-toast": "tdesign-miniprogram/toast/toast",
|
|
260
|
-
"t-dialog": "tdesign-miniprogram/dialog/dialog"
|
|
261
|
-
}
|
|
262
|
-
}</json>
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
Component({
|
|
3
|
-
externalClasses: ['wr-class', 'header-class', 'title-class'],
|
|
4
|
-
|
|
5
|
-
options: {
|
|
6
|
-
multipleSlots: true,
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
relations: {
|
|
10
|
-
'../order-goods-card/index': {
|
|
11
|
-
type: 'descendant',
|
|
12
|
-
linked(target) {
|
|
13
|
-
this.children.push(target);
|
|
14
|
-
this.setHidden();
|
|
15
|
-
},
|
|
16
|
-
unlinked(target) {
|
|
17
|
-
this.children = this.children.filter((item) => item !== target);
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
'../goods-card/index': {
|
|
21
|
-
type: 'descendant',
|
|
22
|
-
linked(target) {
|
|
23
|
-
this.children.push(target);
|
|
24
|
-
this.setHidden();
|
|
25
|
-
},
|
|
26
|
-
unlinked(target) {
|
|
27
|
-
this.children = this.children.filter((item) => item !== target);
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
'../specs-goods-card/index': {
|
|
31
|
-
type: 'descendant',
|
|
32
|
-
linked(target) {
|
|
33
|
-
this.children.push(target);
|
|
34
|
-
this.setHidden();
|
|
35
|
-
},
|
|
36
|
-
unlinked(target) {
|
|
37
|
-
this.children = this.children.filter((item) => item !== target);
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
created() {
|
|
43
|
-
this.children = [];
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
properties: {
|
|
47
|
-
order: {
|
|
48
|
-
type: Object,
|
|
49
|
-
observer(order) {
|
|
50
|
-
if (!order?.goodsList) return;
|
|
51
|
-
const goodsCount = order.goodsList.length;
|
|
52
|
-
this.setData({
|
|
53
|
-
goodsCount,
|
|
54
|
-
});
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
useTopRightSlot: Boolean,
|
|
58
|
-
// 初始显示的商品数量,超出部分会隐藏。
|
|
59
|
-
defaultShowNum: {
|
|
60
|
-
type: null,
|
|
61
|
-
value: 10,
|
|
62
|
-
},
|
|
63
|
-
useLogoSlot: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
value: false,
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
data: {
|
|
70
|
-
showAll: true, // 是否展示所有商品,设置为false,可以使用展开更多功能
|
|
71
|
-
goodsCount: 0,
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
methods: {
|
|
75
|
-
setHidden() {
|
|
76
|
-
const isHidden = !this.data.showAll;
|
|
77
|
-
this.children.forEach(
|
|
78
|
-
(c, i) => i >= this.properties.defaultShowNum && c.setHidden(isHidden),
|
|
79
|
-
);
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
onOrderCardTap() {
|
|
83
|
-
this.triggerEvent('cardtap');
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
onShowMoreTap() {
|
|
87
|
-
this.setData({ showAll: true }, () => this.setHidden());
|
|
88
|
-
this.triggerEvent('showall');
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
});
|
|
92
|
-
</script>
|
|
93
|
-
|
|
94
|
-
<template>
|
|
95
|
-
<view class="order-card wr-class [margin:24rpx_0] [padding:24rpx_32rpx_24rpx] [background-color:white] [border-radius:8rpx] [&_.header]:[display:flex] [&_.header]:[justify-content:space-between] [&_.header]:[align-items:center] [&_.header]:[margin-bottom:24rpx] [&_.header_.store-name]:[font-size:28rpx] [&_.header_.store-name]:[font-weight:normal] [&_.header_.store-name]:[color:#333333] [&_.header_.store-name]:[display:flex] [&_.header_.store-name]:[align-items:center] [&_.header_.store-name]:[line-height:40rpx] [&_.header_.store-name__logo]:[margin-right:16rpx] [&_.header_.store-name__logo]:[font-size:40rpx] [&_.header_.store-name__logo]:[width:48rpx] [&_.header_.store-name__logo]:[height:48rpx] [&_.header_.store-name__label]:[max-width:500rpx] [&_.header_.store-name__label]:[overflow:hidden] [&_.header_.store-name__label]:[text-overflow:ellipsis] [&_.header_.store-name__label]:[word-break:break-all] [&_.header_.store-name__label]:[white-space:nowrap] [&_.header_.order-status]:[font-size:26rpx] [&_.header_.order-status]:[line-height:40rpx] [&_.header_.order-status]:[color:#fa4126] [&_.more-mask]:[padding:20rpx_0] [&_.more-mask]:[text-align:center] [&_.more-mask]:[background-color:white] [&_.more-mask]:[color:#fa4126] [&_.more-mask]:[font-size:24rpx]" bind:tap="onOrderCardTap">
|
|
96
|
-
<view class="header header-class">
|
|
97
|
-
<view class="store-name title-class">
|
|
98
|
-
<block wx:if="{{!useLogoSlot}}">
|
|
99
|
-
<t-image wx:if="{{order.storeLogo}}" t-class="store-name__logo" src="{{order.storeLogo}}" />
|
|
100
|
-
<t-icon wx:else prefix="wr" class="store-name__logo" name="store" size="40rpx" color="inherit" />
|
|
101
|
-
<view class="store-name__label">{{order.storeName}}</view>
|
|
102
|
-
</block>
|
|
103
|
-
<slot wx:else name="top-left" />
|
|
104
|
-
</view>
|
|
105
|
-
<view wx:if="{{!useTopRightSlot}}" class="order-status">{{order.statusDesc}}</view>
|
|
106
|
-
<slot wx:else name="top-right" />
|
|
107
|
-
</view>
|
|
108
|
-
<view class="slot-wrapper">
|
|
109
|
-
<slot />
|
|
110
|
-
</view>
|
|
111
|
-
<view wx:if="{{goodsCount > defaultShowNum && !showAll}}" class="more-mask" catchtap="onShowMoreTap">
|
|
112
|
-
展开商品信息(共 {{goodsCount}} 个)
|
|
113
|
-
<t-icon name="chevron-down" size="32rpx" />
|
|
114
|
-
</view>
|
|
115
|
-
<slot name="more" />
|
|
116
|
-
</view>
|
|
117
|
-
</template>
|
|
118
|
-
|
|
119
|
-
<json>
|
|
120
|
-
{
|
|
121
|
-
"component": true,
|
|
122
|
-
"usingComponents": {
|
|
123
|
-
"t-image": "/components/webp-image/index",
|
|
124
|
-
"t-icon": "tdesign-miniprogram/icon/icon"
|
|
125
|
-
}
|
|
126
|
-
}</json>
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
Component({
|
|
3
|
-
options: {
|
|
4
|
-
addGlobalClass: true,
|
|
5
|
-
multipleSlots: true, // 在组件定义时的选项中启用多slot支持
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
relations: {
|
|
9
|
-
'../order-card/index': {
|
|
10
|
-
type: 'ancestor',
|
|
11
|
-
linked(target) {
|
|
12
|
-
this.parent = target;
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
properties: {
|
|
18
|
-
goods: Object,
|
|
19
|
-
thumbWidth: Number,
|
|
20
|
-
thumbHeight: Number,
|
|
21
|
-
thumbWidthInPopup: Number,
|
|
22
|
-
thumbHeightInPopup: Number,
|
|
23
|
-
noTopLine: Boolean,
|
|
24
|
-
step: Boolean,
|
|
25
|
-
stepDisabled: Boolean,
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
data: {
|
|
29
|
-
goods: {},
|
|
30
|
-
hidden: false,
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
methods: {
|
|
34
|
-
setHidden(hidden) {
|
|
35
|
-
if (this.data.hidden === hidden) return;
|
|
36
|
-
this.setData({ hidden });
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
onNumChange(e) {
|
|
40
|
-
const { value } = e.detail;
|
|
41
|
-
this.triggerEvent('num-change', { value });
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<template>
|
|
48
|
-
<goods-card
|
|
49
|
-
class="order-goods-card {{ step ? 'order-goods-card--step' : '' }}"
|
|
50
|
-
wx:if="{{!hidden}}"
|
|
51
|
-
data="{{goods}}"
|
|
52
|
-
thumb-width="{{thumbWidth}}"
|
|
53
|
-
thumb-height="{{thumbHeight}}"
|
|
54
|
-
thumb-width-in-popup="{{thumbWidthInPopup}}"
|
|
55
|
-
thumb-height-in-popup="{{thumbHeightInPopup}}"
|
|
56
|
-
>
|
|
57
|
-
<t-stepper
|
|
58
|
-
wx:if="{{ step }}"
|
|
59
|
-
slot="append-body"
|
|
60
|
-
disabled="{{ step ? stepDisabled : ''}}"
|
|
61
|
-
value="{{goods.quantity}}"
|
|
62
|
-
min="{{ 1 }}"
|
|
63
|
-
theme="filled"
|
|
64
|
-
bindminus="onNumChange"
|
|
65
|
-
bindplus="onNumChange"
|
|
66
|
-
bindblur="onNumChange"
|
|
67
|
-
/>
|
|
68
|
-
<!-- 透传good-card组件的slot -->
|
|
69
|
-
<slot name="thumb-cover" slot="thumb-cover" />
|
|
70
|
-
<slot name="after-title" slot="after-title" />
|
|
71
|
-
<slot name="after-desc" slot="after-desc" />
|
|
72
|
-
<slot name="price-prefix" slot="price-prefix" />
|
|
73
|
-
<slot name="append-body" slot="append-body" />
|
|
74
|
-
<slot name="footer" slot="footer" />
|
|
75
|
-
<slot name="append-card" slot="append-card" />
|
|
76
|
-
</goods-card>
|
|
77
|
-
</template>
|
|
78
|
-
|
|
79
|
-
<json>
|
|
80
|
-
{
|
|
81
|
-
"component": true,
|
|
82
|
-
"usingComponents": {
|
|
83
|
-
"t-stepper": "tdesign-miniprogram/stepper/stepper",
|
|
84
|
-
"goods-card": "../specs-goods-card/index"
|
|
85
|
-
}
|
|
86
|
-
}</json>
|