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,598 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Toast from 'tdesign-miniprogram/toast/index';
|
|
3
|
-
import { fetchGood } from '../../../services/good/fetchGood';
|
|
4
|
-
import { fetchActivityList } from '../../../services/activity/fetchActivityList';
|
|
5
|
-
import {
|
|
6
|
-
getGoodsDetailsCommentList,
|
|
7
|
-
getGoodsDetailsCommentsCount,
|
|
8
|
-
} from '../../../services/good/fetchGoodsDetailsComments';
|
|
9
|
-
|
|
10
|
-
import { cdnBase } from '../../../config/index';
|
|
11
|
-
|
|
12
|
-
const imgPrefix = `${cdnBase}/`;
|
|
13
|
-
|
|
14
|
-
const recLeftImg = `${imgPrefix}common/rec-left.png`;
|
|
15
|
-
const recRightImg = `${imgPrefix}common/rec-right.png`;
|
|
16
|
-
const obj2Params = (obj = {}, encode = false) => {
|
|
17
|
-
const result = [];
|
|
18
|
-
Object.keys(obj).forEach((key) => result.push(`${key}=${encode ? encodeURIComponent(obj[key]) : obj[key]}`));
|
|
19
|
-
|
|
20
|
-
return result.join('&');
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
Page({
|
|
24
|
-
data: {
|
|
25
|
-
commentsList: [],
|
|
26
|
-
commentsStatistics: {
|
|
27
|
-
badCount: 0,
|
|
28
|
-
commentCount: 0,
|
|
29
|
-
goodCount: 0,
|
|
30
|
-
goodRate: 0,
|
|
31
|
-
hasImageCount: 0,
|
|
32
|
-
middleCount: 0,
|
|
33
|
-
},
|
|
34
|
-
isShowPromotionPop: false,
|
|
35
|
-
activityList: [],
|
|
36
|
-
recLeftImg,
|
|
37
|
-
recRightImg,
|
|
38
|
-
details: {},
|
|
39
|
-
goodsTabArray: [
|
|
40
|
-
{
|
|
41
|
-
name: '商品',
|
|
42
|
-
value: '', // 空字符串代表置顶
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: '详情',
|
|
46
|
-
value: 'goods-page',
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
storeLogo: `${imgPrefix}common/store-logo.png`,
|
|
50
|
-
storeName: '云mall标准版旗舰店',
|
|
51
|
-
jumpArray: [
|
|
52
|
-
{
|
|
53
|
-
title: '首页',
|
|
54
|
-
url: '/pages/home/home',
|
|
55
|
-
iconName: 'home',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
title: '购物车',
|
|
59
|
-
url: '/pages/cart/index',
|
|
60
|
-
iconName: 'cart',
|
|
61
|
-
showCartNum: true,
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
isStock: true,
|
|
65
|
-
cartNum: 0,
|
|
66
|
-
soldout: false,
|
|
67
|
-
buttonType: 1,
|
|
68
|
-
buyNum: 1,
|
|
69
|
-
selectedAttrStr: '',
|
|
70
|
-
skuArray: [],
|
|
71
|
-
primaryImage: '',
|
|
72
|
-
specImg: '',
|
|
73
|
-
isSpuSelectPopupShow: false,
|
|
74
|
-
isAllSelectedSku: false,
|
|
75
|
-
buyType: 0,
|
|
76
|
-
outOperateStatus: false, // 是否外层加入购物车
|
|
77
|
-
operateType: 0,
|
|
78
|
-
selectSkuSellsPrice: 0,
|
|
79
|
-
maxLinePrice: 0,
|
|
80
|
-
minSalePrice: 0,
|
|
81
|
-
maxSalePrice: 0,
|
|
82
|
-
list: [],
|
|
83
|
-
spuId: '',
|
|
84
|
-
navigation: { type: 'fraction' },
|
|
85
|
-
current: 0,
|
|
86
|
-
autoplay: true,
|
|
87
|
-
duration: 500,
|
|
88
|
-
interval: 5000,
|
|
89
|
-
soldNum: 0, // 已售数量
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
handlePopupHide() {
|
|
93
|
-
this.setData({
|
|
94
|
-
isSpuSelectPopupShow: false,
|
|
95
|
-
});
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
showSkuSelectPopup(type) {
|
|
99
|
-
this.setData({
|
|
100
|
-
buyType: type || 0,
|
|
101
|
-
outOperateStatus: type >= 1,
|
|
102
|
-
isSpuSelectPopupShow: true,
|
|
103
|
-
});
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
buyItNow() {
|
|
107
|
-
this.showSkuSelectPopup(1);
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
toAddCart() {
|
|
111
|
-
this.showSkuSelectPopup(2);
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
toNav(e) {
|
|
115
|
-
const { url } = e.detail;
|
|
116
|
-
wx.switchTab({
|
|
117
|
-
url: url,
|
|
118
|
-
});
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
showCurImg(e) {
|
|
122
|
-
const { index } = e.detail;
|
|
123
|
-
const { images } = this.data.details;
|
|
124
|
-
wx.previewImage({
|
|
125
|
-
current: images[index],
|
|
126
|
-
urls: images, // 需要预览的图片http链接列表
|
|
127
|
-
});
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
onPageScroll({ scrollTop }) {
|
|
131
|
-
const goodsTab = this.selectComponent('#goodsTab');
|
|
132
|
-
goodsTab && goodsTab.onScroll(scrollTop);
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
chooseSpecItem(e) {
|
|
136
|
-
const { specList } = this.data.details;
|
|
137
|
-
const { selectedSku, isAllSelectedSku } = e.detail;
|
|
138
|
-
if (!isAllSelectedSku) {
|
|
139
|
-
this.setData({
|
|
140
|
-
selectSkuSellsPrice: 0,
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
this.setData({
|
|
144
|
-
isAllSelectedSku,
|
|
145
|
-
});
|
|
146
|
-
this.getSkuItem(specList, selectedSku);
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
getSkuItem(specList, selectedSku) {
|
|
150
|
-
const { skuArray, primaryImage } = this.data;
|
|
151
|
-
const selectedSkuValues = this.getSelectedSkuValues(specList, selectedSku);
|
|
152
|
-
let selectedAttrStr = ` 件 `;
|
|
153
|
-
selectedSkuValues.forEach((item) => {
|
|
154
|
-
selectedAttrStr += `,${item.specValue} `;
|
|
155
|
-
});
|
|
156
|
-
// eslint-disable-next-line array-callback-return
|
|
157
|
-
const skuItem = skuArray.filter((item) => {
|
|
158
|
-
let status = true;
|
|
159
|
-
(item.specInfo || []).forEach((subItem) => {
|
|
160
|
-
if (!selectedSku[subItem.specId] || selectedSku[subItem.specId] !== subItem.specValueId) {
|
|
161
|
-
status = false;
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
if (status) return item;
|
|
165
|
-
});
|
|
166
|
-
this.selectSpecsName(selectedSkuValues.length > 0 ? selectedAttrStr : '');
|
|
167
|
-
if (skuItem) {
|
|
168
|
-
this.setData({
|
|
169
|
-
selectItem: skuItem,
|
|
170
|
-
selectSkuSellsPrice: skuItem.price || 0,
|
|
171
|
-
});
|
|
172
|
-
} else {
|
|
173
|
-
this.setData({
|
|
174
|
-
selectItem: null,
|
|
175
|
-
selectSkuSellsPrice: 0,
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
this.setData({
|
|
179
|
-
specImg: skuItem && skuItem.skuImage ? skuItem.skuImage : primaryImage,
|
|
180
|
-
});
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
// 获取已选择的sku名称
|
|
184
|
-
getSelectedSkuValues(skuTree, selectedSku) {
|
|
185
|
-
const normalizedTree = this.normalizeSkuTree(skuTree);
|
|
186
|
-
return Object.keys(selectedSku).reduce((selectedValues, skuKeyStr) => {
|
|
187
|
-
const skuValues = normalizedTree[skuKeyStr];
|
|
188
|
-
const skuValueId = selectedSku[skuKeyStr];
|
|
189
|
-
if (skuValueId !== '') {
|
|
190
|
-
const skuValue = skuValues.filter((value) => {
|
|
191
|
-
return value.specValueId === skuValueId;
|
|
192
|
-
})[0];
|
|
193
|
-
skuValue && selectedValues.push(skuValue);
|
|
194
|
-
}
|
|
195
|
-
return selectedValues;
|
|
196
|
-
}, []);
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
normalizeSkuTree(skuTree) {
|
|
200
|
-
const normalizedTree = {};
|
|
201
|
-
skuTree.forEach((treeItem) => {
|
|
202
|
-
normalizedTree[treeItem.specId] = treeItem.specValueList;
|
|
203
|
-
});
|
|
204
|
-
return normalizedTree;
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
-
selectSpecsName(selectSpecsName) {
|
|
208
|
-
if (selectSpecsName) {
|
|
209
|
-
this.setData({
|
|
210
|
-
selectedAttrStr: selectSpecsName,
|
|
211
|
-
});
|
|
212
|
-
} else {
|
|
213
|
-
this.setData({
|
|
214
|
-
selectedAttrStr: '',
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
|
|
219
|
-
addCart() {
|
|
220
|
-
const { isAllSelectedSku } = this.data;
|
|
221
|
-
Toast({
|
|
222
|
-
context: this,
|
|
223
|
-
selector: '#t-toast',
|
|
224
|
-
message: isAllSelectedSku ? '点击加入购物车' : '请选择规格',
|
|
225
|
-
icon: '',
|
|
226
|
-
duration: 1000,
|
|
227
|
-
});
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
gotoBuy(type) {
|
|
231
|
-
const { isAllSelectedSku, buyNum } = this.data;
|
|
232
|
-
if (!isAllSelectedSku) {
|
|
233
|
-
Toast({
|
|
234
|
-
context: this,
|
|
235
|
-
selector: '#t-toast',
|
|
236
|
-
message: '请选择规格',
|
|
237
|
-
icon: '',
|
|
238
|
-
duration: 1000,
|
|
239
|
-
});
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
this.handlePopupHide();
|
|
243
|
-
const query = {
|
|
244
|
-
quantity: buyNum,
|
|
245
|
-
storeId: '1',
|
|
246
|
-
spuId: this.data.spuId,
|
|
247
|
-
goodsName: this.data.details.title,
|
|
248
|
-
skuId: type === 1 ? this.data.skuList[0].skuId : this.data.selectItem.skuId,
|
|
249
|
-
available: this.data.details.available,
|
|
250
|
-
price: this.data.details.minSalePrice,
|
|
251
|
-
specInfo: this.data.details.specList?.map((item) => ({
|
|
252
|
-
specTitle: item.title,
|
|
253
|
-
specValue: item.specValueList[0].specValue,
|
|
254
|
-
})),
|
|
255
|
-
primaryImage: this.data.details.primaryImage,
|
|
256
|
-
spuId: this.data.details.spuId,
|
|
257
|
-
thumb: this.data.details.primaryImage,
|
|
258
|
-
title: this.data.details.title,
|
|
259
|
-
};
|
|
260
|
-
let urlQueryStr = obj2Params({
|
|
261
|
-
goodsRequestList: JSON.stringify([query]),
|
|
262
|
-
});
|
|
263
|
-
urlQueryStr = urlQueryStr ? `?${urlQueryStr}` : '';
|
|
264
|
-
const path = `/pages/order/order-confirm/index${urlQueryStr}`;
|
|
265
|
-
wx.navigateTo({
|
|
266
|
-
url: path,
|
|
267
|
-
});
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
specsConfirm() {
|
|
271
|
-
const { buyType } = this.data;
|
|
272
|
-
if (buyType === 1) {
|
|
273
|
-
this.gotoBuy();
|
|
274
|
-
} else {
|
|
275
|
-
this.addCart();
|
|
276
|
-
}
|
|
277
|
-
// this.handlePopupHide();
|
|
278
|
-
},
|
|
279
|
-
|
|
280
|
-
changeNum(e) {
|
|
281
|
-
this.setData({
|
|
282
|
-
buyNum: e.detail.buyNum,
|
|
283
|
-
});
|
|
284
|
-
},
|
|
285
|
-
|
|
286
|
-
closePromotionPopup() {
|
|
287
|
-
this.setData({
|
|
288
|
-
isShowPromotionPop: false,
|
|
289
|
-
});
|
|
290
|
-
},
|
|
291
|
-
|
|
292
|
-
promotionChange(e) {
|
|
293
|
-
const { index } = e.detail;
|
|
294
|
-
wx.navigateTo({
|
|
295
|
-
url: `/pages/promotion/promotion-detail/index?promotion_id=${index}`,
|
|
296
|
-
});
|
|
297
|
-
},
|
|
298
|
-
|
|
299
|
-
showPromotionPopup() {
|
|
300
|
-
this.setData({
|
|
301
|
-
isShowPromotionPop: true,
|
|
302
|
-
});
|
|
303
|
-
},
|
|
304
|
-
|
|
305
|
-
getDetail(spuId) {
|
|
306
|
-
Promise.all([fetchGood(spuId), fetchActivityList()]).then((res) => {
|
|
307
|
-
const [details, activityList] = res;
|
|
308
|
-
const skuArray = [];
|
|
309
|
-
const { skuList, primaryImage, isPutOnSale, minSalePrice, maxSalePrice, maxLinePrice, soldNum } = details;
|
|
310
|
-
skuList.forEach((item) => {
|
|
311
|
-
skuArray.push({
|
|
312
|
-
skuId: item.skuId,
|
|
313
|
-
quantity: item.stockInfo ? item.stockInfo.stockQuantity : 0,
|
|
314
|
-
specInfo: item.specInfo,
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
const promotionArray = [];
|
|
318
|
-
activityList.forEach((item) => {
|
|
319
|
-
promotionArray.push({
|
|
320
|
-
tag: item.promotionSubCode === 'MYJ' ? '满减' : '满折',
|
|
321
|
-
label: '满100元减99.9元',
|
|
322
|
-
});
|
|
323
|
-
});
|
|
324
|
-
this.setData({
|
|
325
|
-
details,
|
|
326
|
-
activityList,
|
|
327
|
-
isStock: details.spuStockQuantity > 0,
|
|
328
|
-
maxSalePrice: maxSalePrice ? parseInt(maxSalePrice) : 0,
|
|
329
|
-
maxLinePrice: maxLinePrice ? parseInt(maxLinePrice) : 0,
|
|
330
|
-
minSalePrice: minSalePrice ? parseInt(minSalePrice) : 0,
|
|
331
|
-
list: promotionArray,
|
|
332
|
-
skuArray: skuArray,
|
|
333
|
-
primaryImage,
|
|
334
|
-
soldout: isPutOnSale === 0,
|
|
335
|
-
soldNum,
|
|
336
|
-
});
|
|
337
|
-
});
|
|
338
|
-
},
|
|
339
|
-
|
|
340
|
-
async getCommentsList() {
|
|
341
|
-
try {
|
|
342
|
-
const code = 'Success';
|
|
343
|
-
const data = await getGoodsDetailsCommentList();
|
|
344
|
-
const { homePageComments } = data;
|
|
345
|
-
if (code.toUpperCase() === 'SUCCESS') {
|
|
346
|
-
const nextState = {
|
|
347
|
-
commentsList: homePageComments.map((item) => {
|
|
348
|
-
return {
|
|
349
|
-
goodsSpu: item.spuId,
|
|
350
|
-
userName: item.userName || '',
|
|
351
|
-
commentScore: item.commentScore,
|
|
352
|
-
commentContent: item.commentContent || '用户未填写评价',
|
|
353
|
-
userHeadUrl: item.isAnonymity ? this.anonymityAvatar : item.userHeadUrl || this.anonymityAvatar,
|
|
354
|
-
};
|
|
355
|
-
}),
|
|
356
|
-
};
|
|
357
|
-
this.setData(nextState);
|
|
358
|
-
}
|
|
359
|
-
} catch (error) {
|
|
360
|
-
console.error('comments error:', error);
|
|
361
|
-
}
|
|
362
|
-
},
|
|
363
|
-
|
|
364
|
-
onShareAppMessage() {
|
|
365
|
-
// 自定义的返回信息
|
|
366
|
-
const { selectedAttrStr } = this.data;
|
|
367
|
-
let shareSubTitle = '';
|
|
368
|
-
if (selectedAttrStr.indexOf('件') > -1) {
|
|
369
|
-
const count = selectedAttrStr.indexOf('件');
|
|
370
|
-
shareSubTitle = selectedAttrStr.slice(count + 1, selectedAttrStr.length);
|
|
371
|
-
}
|
|
372
|
-
const customInfo = {
|
|
373
|
-
imageUrl: this.data.details.primaryImage,
|
|
374
|
-
title: this.data.details.title + shareSubTitle,
|
|
375
|
-
path: `/pages/goods/details/index?spuId=${this.data.spuId}`,
|
|
376
|
-
};
|
|
377
|
-
return customInfo;
|
|
378
|
-
},
|
|
379
|
-
|
|
380
|
-
/** 获取评价统计 */
|
|
381
|
-
async getCommentsStatistics() {
|
|
382
|
-
try {
|
|
383
|
-
const code = 'Success';
|
|
384
|
-
const data = await getGoodsDetailsCommentsCount();
|
|
385
|
-
if (code.toUpperCase() === 'SUCCESS') {
|
|
386
|
-
const { badCount, commentCount, goodCount, goodRate, hasImageCount, middleCount } = data;
|
|
387
|
-
const nextState = {
|
|
388
|
-
commentsStatistics: {
|
|
389
|
-
badCount: parseInt(`${badCount}`),
|
|
390
|
-
commentCount: parseInt(`${commentCount}`),
|
|
391
|
-
goodCount: parseInt(`${goodCount}`),
|
|
392
|
-
/** 后端返回百分比后数据但没有限制位数 */
|
|
393
|
-
goodRate: Math.floor(goodRate * 10) / 10,
|
|
394
|
-
hasImageCount: parseInt(`${hasImageCount}`),
|
|
395
|
-
middleCount: parseInt(`${middleCount}`),
|
|
396
|
-
},
|
|
397
|
-
};
|
|
398
|
-
this.setData(nextState);
|
|
399
|
-
}
|
|
400
|
-
} catch (error) {
|
|
401
|
-
console.error('comments statiistics error:', error);
|
|
402
|
-
}
|
|
403
|
-
},
|
|
404
|
-
|
|
405
|
-
/** 跳转到评价列表 */
|
|
406
|
-
navToCommentsListPage() {
|
|
407
|
-
wx.navigateTo({
|
|
408
|
-
url: `/pages/goods/comments/index?spuId=${this.data.spuId}`,
|
|
409
|
-
});
|
|
410
|
-
},
|
|
411
|
-
|
|
412
|
-
onLoad(query) {
|
|
413
|
-
const { spuId } = query;
|
|
414
|
-
this.setData({
|
|
415
|
-
spuId: spuId,
|
|
416
|
-
});
|
|
417
|
-
this.getDetail(spuId);
|
|
418
|
-
this.getCommentsList(spuId);
|
|
419
|
-
this.getCommentsStatistics(spuId);
|
|
420
|
-
},
|
|
421
|
-
});
|
|
422
|
-
</script>
|
|
423
|
-
|
|
424
|
-
<template>
|
|
425
|
-
<view class="goods-detail-page [&_.goods-info]:[margin:0_auto] [&_.goods-info]:[padding:26rpx_0_28rpx_30rpx] [&_.goods-info]:[background-color:#fff] [&_.swipe-img]:[width:100%] [&_.swipe-img]:[height:750rpx] [&_.goods-info_.goods-price]:[display:flex] [&_.goods-info_.goods-price]:[align-items:baseline] [&_.goods-info_.goods-price-up]:[color:#fa4126] [&_.goods-info_.goods-price-up]:[font-size:28rpx] [&_.goods-info_.goods-price-up]:[position:relative] [&_.goods-info_.goods-price-up]:[bottom:4rpx] [&_.goods-info_.goods-price-up]:[left:8rpx] [&_.goods-info_.goods-price_.class-goods-price]:[font-size:64rpx] [&_.goods-info_.goods-price_.class-goods-price]:[color:#fa4126] [&_.goods-info_.goods-price_.class-goods-price]:[font-weight:bold] [&_.goods-info_.goods-price_.class-goods-price]:[font-family:DIN_Alternate] [&_.goods-info_.goods-price_.class-goods-symbol]:[font-size:36rpx] [&_.goods-info_.goods-price_.class-goods-symbol]:[color:#fa4126] [&_.goods-info_.goods-price_.class-goods-del]:[position:relative] [&_.goods-info_.goods-price_.class-goods-del]:[font-weight:normal] [&_.goods-info_.goods-price_.class-goods-del]:[left:16rpx] [&_.goods-info_.goods-price_.class-goods-del]:[bottom:2rpx] [&_.goods-info_.goods-price_.class-goods-del]:[color:#999999] [&_.goods-info_.goods-price_.class-goods-del]:[font-size:32rpx] [&_.goods-info_.goods-number]:[display:flex] [&_.goods-info_.goods-number]:[align-items:center] [&_.goods-info_.goods-number]:[justify-content:space-between] [&_.goods-info_.goods-number_.sold-num]:[font-size:24rpx] [&_.goods-info_.goods-number_.sold-num]:[color:#999999] [&_.goods-info_.goods-number_.sold-num]:[display:flex] [&_.goods-info_.goods-number_.sold-num]:[align-items:flex-end] [&_.goods-info_.goods-number_.sold-num]:[margin-right:32rpx] [&_.goods-info_.goods-activity]:[display:flex] [&_.goods-info_.goods-activity]:[margin-top:16rpx] [&_.goods-info_.goods-activity]:[justify-content:space-between] [&_.goods-info_.goods-activity_.tags-container]:[display:flex] [&_.goods-info_.goods-activity_.tags-container_.goods-activity-tag]:[background:#ffece9] [&_.goods-info_.goods-activity_.tags-container_.goods-activity-tag]:[color:#fa4126] [&_.goods-info_.goods-activity_.tags-container_.goods-activity-tag]:[font-size:24rpx] [&_.goods-info_.goods-activity_.tags-container_.goods-activity-tag]:[margin-right:16rpx] [&_.goods-info_.goods-activity_.tags-container_.goods-activity-tag]:[padding:4rpx_8rpx] [&_.goods-info_.goods-activity_.tags-container_.goods-activity-tag]:[border-radius:4rpx] [&_.goods-info_.goods-activity_.activity-show]:[display:flex] [&_.goods-info_.goods-activity_.activity-show]:[justify-content:center] [&_.goods-info_.goods-activity_.activity-show]:[align-items:center] [&_.goods-info_.goods-activity_.activity-show]:[color:#fa4126] [&_.goods-info_.goods-activity_.activity-show]:[font-size:24rpx] [&_.goods-info_.goods-activity_.activity-show]:[padding-right:32rpx] [&_.goods-info_.goods-activity_.activity-show-text]:[line-height:42rpx] [&_.goods-info_.goods-title]:[display:flex] [&_.goods-info_.goods-title]:[justify-content:space-between] [&_.goods-info_.goods-title]:[align-items:center] [&_.goods-info_.goods-title]:[margin-top:20rpx] [&_.goods-info_.goods-title_.goods-name]:[width:600rpx] [&_.goods-info_.goods-title_.goods-name]:[font-weight:500] [&_.goods-info_.goods-title_.goods-name]:[display:-webkit-box] [&_.goods-info_.goods-title_.goods-name]:[-webkit-box-orient:vertical] [&_.goods-info_.goods-title_.goods-name]:[-webkit-line-clamp:2] [&_.goods-info_.goods-title_.goods-name]:[overflow:hidden] [&_.goods-info_.goods-title_.goods-name]:[font-size:32rpx] [&_.goods-info_.goods-title_.goods-name]:[word-break:break-all] [&_.goods-info_.goods-title_.goods-name]:[color:#333333] [&_.goods-info_.goods-title_.goods-tag]:[width:104rpx] [&_.goods-info_.goods-title_.goods-tag]:[margin-left:26rpx] [&_.goods-info_.goods-title_.goods-tag_.shareBtn]:[border-radius:200rpx_0px_0px_200rpx] [&_.goods-info_.goods-title_.goods-tag_.shareBtn]:[width:100rpx] [&_.goods-info_.goods-title_.goods-tag_.shareBtn]:[height:96rpx] [&_.goods-info_.goods-title_.goods-tag_.shareBtn]:[border:none] [&_.goods-info_.goods-title_.goods-tag_.shareBtn]:[padding-right:36rpx] [&_.goods-info_.goods-title_.goods-tag_.btn-icon]:[font-size:20rpx] [&_.goods-info_.goods-title_.goods-tag_.btn-icon]:[display:flex] [&_.goods-info_.goods-title_.goods-tag_.btn-icon]:[flex-direction:column] [&_.goods-info_.goods-title_.goods-tag_.btn-icon]:[align-items:center] [&_.goods-info_.goods-title_.goods-tag_.btn-icon]:[justify-content:center] [&_.goods-info_.goods-title_.goods-tag_.btn-icon]:[height:96rpx] [&_.goods-info_.goods-title_.goods-tag_.btn-icon]:[color:#999] [&_.goods-info_.goods-title_.goods-tag_.btn-icon_.share-text]:[padding-top:8rpx] [&_.goods-info_.goods-title_.goods-tag_.btn-icon_.share-text]:[font-size:20rpx] [&_.goods-info_.goods-title_.goods-tag_.btn-icon_.share-text]:[line-height:24rpx] [&_.goods-info_.goods-intro]:[font-size:26rpx] [&_.goods-info_.goods-intro]:[color:#888] [&_.goods-info_.goods-intro]:[line-height:36rpx] [&_.goods-info_.goods-intro]:[word-break:break-all] [&_.goods-info_.goods-intro]:[padding-right:30rpx] [&_.goods-info_.goods-intro]:[display:-webkit-box] [&_.goods-info_.goods-intro]:[-webkit-line-clamp:2] [&_.goods-info_.goods-intro]:[-webkit-box-orient:vertical] [&_.goods-info_.goods-intro]:[white-space:normal] [&_.goods-info_.goods-intro]:[overflow:hidden] [&_.desc-content]:[margin-top:20rpx] [&_.desc-content]:[background-color:#fff] [&_.desc-content]:[padding-bottom:120rpx] [&_.desc-content__title]:[font-size:28rpx] [&_.desc-content__title]:[line-height:36rpx] [&_.desc-content__title]:[text-align:center] [&_.desc-content__title]:[display:flex] [&_.desc-content__title]:[justify-content:center] [&_.desc-content__title]:[align-items:center] [&_.desc-content__title]:[padding:30rpx_20rpx] [&_.desc-content__title_.img]:[width:206rpx] [&_.desc-content__title_.img]:[height:10rpx] [&_.desc-content__title--text]:[font-size:26rpx] [&_.desc-content__title--text]:[margin:0_32rpx] [&_.desc-content__title--text]:[font-weight:600] [&_.desc-content__img]:[width:100%] [&_.desc-content__img]:[height:auto]">
|
|
426
|
-
<view class="goods-head">
|
|
427
|
-
<t-swiper
|
|
428
|
-
wx:if="{{details.images.length > 0}}"
|
|
429
|
-
height="750rpx"
|
|
430
|
-
current="{{current}}"
|
|
431
|
-
autoplay="{{autoplay}}"
|
|
432
|
-
duration="{{duration}}"
|
|
433
|
-
interval="{{interval}}"
|
|
434
|
-
navigation="{{navigation}}"
|
|
435
|
-
list="{{details.images}}"
|
|
436
|
-
></t-swiper>
|
|
437
|
-
<view class="goods-info">
|
|
438
|
-
<view class="goods-number">
|
|
439
|
-
<view class="goods-price">
|
|
440
|
-
<price
|
|
441
|
-
wr-class="class-goods-price"
|
|
442
|
-
symbol-class="class-goods-symbol"
|
|
443
|
-
price="{{minSalePrice}}"
|
|
444
|
-
type="lighter"
|
|
445
|
-
/>
|
|
446
|
-
<view class="goods-price-up">起</view>
|
|
447
|
-
<price wr-class="class-goods-del" price="{{maxLinePrice}}" type="delthrough" />
|
|
448
|
-
</view>
|
|
449
|
-
<view class="sold-num">已售{{soldNum}}</view>
|
|
450
|
-
</view>
|
|
451
|
-
<view wx:if="{{activityList.length > 0}}" class="goods-activity" bindtap="showPromotionPopup">
|
|
452
|
-
<view class="tags-container">
|
|
453
|
-
<view wx:for="{{activityList}}" data-promotionId="{{item.promotionId}}" wx:key="index" wx:if="{{index<4}}">
|
|
454
|
-
<view class="goods-activity-tag">{{item.tag}}</view>
|
|
455
|
-
</view>
|
|
456
|
-
</view>
|
|
457
|
-
<view class="activity-show">
|
|
458
|
-
<view class="activity-show-text">领劵</view>
|
|
459
|
-
<t-icon name="chevron-right" size="42rpx" />
|
|
460
|
-
</view>
|
|
461
|
-
</view>
|
|
462
|
-
<view class="goods-title">
|
|
463
|
-
<view class="goods-name">{{details.title}}</view>
|
|
464
|
-
<view class="goods-tag">
|
|
465
|
-
<t-button open-type="share" t-class="shareBtn" variant="text">
|
|
466
|
-
<view class="btn-icon">
|
|
467
|
-
<t-icon name="share" size="40rpx" color="#000" />
|
|
468
|
-
<view class="share-text">分享</view>
|
|
469
|
-
</view>
|
|
470
|
-
</t-button>
|
|
471
|
-
</view>
|
|
472
|
-
</view>
|
|
473
|
-
<view class="goods-intro">{{intro}}</view>
|
|
474
|
-
</view>
|
|
475
|
-
<view class="spu-select [height:80rpx] [background-color:#fff] [margin-top:20rpx] [display:flex] [align-items:center] [padding:30rpx] [font-size:28rpx] [&_.label]:[margin-right:30rpx] [&_.label]:[text-align:center] [&_.label]:[flex-shrink:0] [&_.label]:[color:#999999] [&_.label]:[font-weight:normal] [&_.content]:[display:flex] [&_.content]:[flex:1] [&_.content]:[justify-content:space-between] [&_.content]:[align-items:center] [&_.content_.tintColor]:[color:#aaa]" bindtap="showSkuSelectPopup">
|
|
476
|
-
<view class="label">已选</view>
|
|
477
|
-
<view class="content">
|
|
478
|
-
<view class="{{!selectedAttrStr ? 'tintColor' : ''}}">
|
|
479
|
-
{{selectedAttrStr ? buyNum : ''}}{{selectedAttrStr || '请选择'}}
|
|
480
|
-
</view>
|
|
481
|
-
<t-icon name="chevron-right" size="40rpx" color="#BBBBBB" />
|
|
482
|
-
</view>
|
|
483
|
-
</view>
|
|
484
|
-
<view wx:if="{{ commentsStatistics.commentCount > 0 }}" class="comments-wrap [margin-top:20rpx] [padding:32rpx] [background-color:#fff] [&_.comments-head]:[display:flex] [&_.comments-head]:[flex-direction:row] [&_.comments-head]:[align-items:center] [&_.comments-head]:[justify-content:space-between] [&_.comments-head_.comments-title-wrap]:[display:flex]">
|
|
485
|
-
<view class="comments-head" bindtap="navToCommentsListPage">
|
|
486
|
-
<view class="comments-title-wrap">
|
|
487
|
-
<view class="comments-title-label [color:#333333] [font-size:32rpx] [font-weight:500] [line-height:48rpx]">商品评价</view>
|
|
488
|
-
<view class="comments-title-count [color:#333333] [font-size:32rpx] [font-weight:500] [line-height:48rpx]"> ({{ commentsStatistics.commentCount }}) </view>
|
|
489
|
-
</view>
|
|
490
|
-
<view class="comments-rate-wrap [display:flex] [justify-content:center] [align-items:center] [font-size:24rpx] [&_.comments-good-rate]:[color:#999999] [&_.comments-good-rate]:[font-size:26rpx] [&_.comments-good-rate]:[font-weight:400] [&_.comments-good-rate]:[font-style:normal] [&_.comments-good-rate]:[line-height:36rpx]">
|
|
491
|
-
<view class="comments-good-rate">{{commentsStatistics.goodRate}}% 好评</view>
|
|
492
|
-
<t-icon name="chevron-right" size="40rpx" color="#BBBBBB" />
|
|
493
|
-
</view>
|
|
494
|
-
</view>
|
|
495
|
-
<view class="comment-item-wrap [&_.comment-item-head]:[display:flex] [&_.comment-item-head]:[flex-direction:row] [&_.comment-item-head]:[align-items:center] [&_.comment-item-head]:[margin-top:32rpx] [&_.comment-item-head_.comment-item-avatar]:[width:64rpx] [&_.comment-item-head_.comment-item-avatar]:[height:64rpx] [&_.comment-item-head_.comment-item-avatar]:[border-radius:64rpx] [&_.comment-item-head_.comment-head-right]:[margin-left:24rpx] [&_.comment-item-content]:[margin-top:20rpx] [&_.comment-item-content]:[color:#333333] [&_.comment-item-content]:[line-height:40rpx] [&_.comment-item-content]:[font-size:28rpx] [&_.comment-item-content]:[font-weight:400]" wx:for="{{ commentsList }}" wx:for-item="commentItem" wx:key="goodsSpu">
|
|
496
|
-
<view class="comment-item-head">
|
|
497
|
-
<t-image src="{{commentItem.userHeadUrl}}" t-class="comment-item-avatar" />
|
|
498
|
-
<view class="comment-head-right [&_.comment-username]:[font-size:26rpx] [&_.comment-username]:[color:#333333] [&_.comment-username]:[line-height:36rpx] [&_.comment-username]:[font-weight:400]">
|
|
499
|
-
<view class="comment-username">{{commentItem.userName}}</view>
|
|
500
|
-
<t-rate
|
|
501
|
-
value="{{ commentItem.commentScore }}"
|
|
502
|
-
count="{{5}}"
|
|
503
|
-
size="12"
|
|
504
|
-
gap="2"
|
|
505
|
-
color="{{['#ffc51c', '#ddd']}}"
|
|
506
|
-
/>
|
|
507
|
-
</view>
|
|
508
|
-
</view>
|
|
509
|
-
<view class="comment-item-content"> {{commentItem.commentContent}} </view>
|
|
510
|
-
</view>
|
|
511
|
-
</view>
|
|
512
|
-
</view>
|
|
513
|
-
<view class="desc-content">
|
|
514
|
-
<view class="desc-content__title" wx:if="{{details.desc.length > 0}}">
|
|
515
|
-
<t-image t-class="img" src="{{recLeftImg}}" />
|
|
516
|
-
<span class="desc-content__title--text">详情介绍</span>
|
|
517
|
-
<t-image t-class="img" src="{{recRightImg}}" />
|
|
518
|
-
</view>
|
|
519
|
-
<view wx:if="{{details.desc.length > 0}}" wx:for="{{details.desc}}" wx:key="index">
|
|
520
|
-
<t-image t-class="desc-content__img" src="{{item}}" mode="widthFix" />
|
|
521
|
-
</view>
|
|
522
|
-
</view>
|
|
523
|
-
<view class="goods-bottom-operation [position:fixed] [left:0] [bottom:0] [width:100%] [background-color:#fff] [padding-bottom:env(safe-area-inset-bottom)]">
|
|
524
|
-
<buy-bar
|
|
525
|
-
jumpArray="{{jumpArray}}"
|
|
526
|
-
soldout="{{soldout}}"
|
|
527
|
-
isStock="{{isStock}}"
|
|
528
|
-
shopCartNum="{{cartNum}}"
|
|
529
|
-
buttonType="{{buttonType}}"
|
|
530
|
-
bind:toAddCart="toAddCart"
|
|
531
|
-
bind:toNav="toNav"
|
|
532
|
-
bind:toBuyNow="buyItNow"
|
|
533
|
-
class="goods-details-card"
|
|
534
|
-
/>
|
|
535
|
-
</view>
|
|
536
|
-
<goods-specs-popup
|
|
537
|
-
id="goodsSpecsPopup"
|
|
538
|
-
show="{{isSpuSelectPopupShow}}"
|
|
539
|
-
title="{{details.title || ''}}"
|
|
540
|
-
src="{{specImg ? specImg : primaryImage}}"
|
|
541
|
-
specList="{{details.specList || []}}"
|
|
542
|
-
skuList="{{skuArray}}"
|
|
543
|
-
limitBuyInfo="{{details.limitInfo[0].text || ''}}"
|
|
544
|
-
bind:closeSpecsPopup="handlePopupHide"
|
|
545
|
-
bind:change="chooseSpecItem"
|
|
546
|
-
bind:changeNum="changeNum"
|
|
547
|
-
bind:addCart="addCart"
|
|
548
|
-
bind:buyNow="gotoBuy"
|
|
549
|
-
bind:specsConfirm="specsConfirm"
|
|
550
|
-
isStock="{{isStock}}"
|
|
551
|
-
outOperateStatus="{{outOperateStatus}}"
|
|
552
|
-
>
|
|
553
|
-
<view slot="goods-price">
|
|
554
|
-
<view class="popup-sku__price">
|
|
555
|
-
<price
|
|
556
|
-
wx:if="{{!isAllSelectedSku || (!promotionSubCode && isAllSelectedSku)}}"
|
|
557
|
-
price="{{selectSkuSellsPrice ? selectSkuSellsPrice : minSalePrice }}"
|
|
558
|
-
wr-class="popup-sku__price-num"
|
|
559
|
-
symbol-class="popup-sku__price-symbol"
|
|
560
|
-
/>
|
|
561
|
-
<price
|
|
562
|
-
wx:if="{{selectSkuSellsPrice === 0 && minSalePrice !== maxSalePrice && !isAllSelectedSku}}"
|
|
563
|
-
price="{{maxSalePrice}}"
|
|
564
|
-
wr-class="popup-sku__price-del"
|
|
565
|
-
type="delthrough"
|
|
566
|
-
/>
|
|
567
|
-
</view>
|
|
568
|
-
</view>
|
|
569
|
-
</goods-specs-popup>
|
|
570
|
-
<promotion-popup
|
|
571
|
-
list="{{list}}"
|
|
572
|
-
bind:closePromotionPopup="closePromotionPopup"
|
|
573
|
-
show="{{isShowPromotionPop}}"
|
|
574
|
-
bind:promotionChange="promotionChange"
|
|
575
|
-
/>
|
|
576
|
-
</view>
|
|
577
|
-
<t-toast id="t-toast" />
|
|
578
|
-
</template>
|
|
579
|
-
|
|
580
|
-
<json>
|
|
581
|
-
{
|
|
582
|
-
"navigationBarTitleText": "商品详情",
|
|
583
|
-
"usingComponents": {
|
|
584
|
-
"t-image": "/components/webp-image/index",
|
|
585
|
-
"t-tag": "tdesign-miniprogram/tag/tag",
|
|
586
|
-
"t-toast": "tdesign-miniprogram/toast/toast",
|
|
587
|
-
"t-rate": "tdesign-miniprogram/rate/rate",
|
|
588
|
-
"t-swiper": "tdesign-miniprogram/swiper/swiper",
|
|
589
|
-
"t-swiper-nav": "tdesign-miniprogram/swiper-nav/swiper-nav",
|
|
590
|
-
"t-button": "tdesign-miniprogram/button/button",
|
|
591
|
-
"t-icon": "tdesign-miniprogram/icon/icon",
|
|
592
|
-
"t-popup": "tdesign-miniprogram/popup/popup",
|
|
593
|
-
"price": "/components/price/index",
|
|
594
|
-
"buy-bar": "./components/buy-bar/index",
|
|
595
|
-
"promotion-popup": "./components/promotion-popup/index",
|
|
596
|
-
"goods-specs-popup": "./components/goods-specs-popup/index"
|
|
597
|
-
}
|
|
598
|
-
}</json>
|