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,293 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { fetchComments } from '../../../services/comments/fetchComments';
|
|
3
|
+
import { fetchCommentsCount } from '../../../services/comments/fetchCommentsCount';
|
|
4
|
+
import dayjs from 'dayjs';
|
|
5
|
+
const layoutMap = {
|
|
6
|
+
0: 'vertical',
|
|
7
|
+
};
|
|
8
|
+
Page({
|
|
9
|
+
data: {
|
|
10
|
+
pageLoading: false,
|
|
11
|
+
commentList: [],
|
|
12
|
+
pageNum: 1,
|
|
13
|
+
myPageNum: 1,
|
|
14
|
+
pageSize: 10,
|
|
15
|
+
total: 0,
|
|
16
|
+
myTotal: 0,
|
|
17
|
+
hasLoaded: false,
|
|
18
|
+
layoutText: layoutMap[0],
|
|
19
|
+
loadMoreStatus: 0,
|
|
20
|
+
myLoadStatus: 0,
|
|
21
|
+
spuId: '1060004',
|
|
22
|
+
commentLevel: '',
|
|
23
|
+
hasImage: '',
|
|
24
|
+
commentType: '',
|
|
25
|
+
totalCount: 0,
|
|
26
|
+
countObj: {
|
|
27
|
+
badCount: '0',
|
|
28
|
+
commentCount: '0',
|
|
29
|
+
goodCount: '0',
|
|
30
|
+
middleCount: '0',
|
|
31
|
+
hasImageCount: '0',
|
|
32
|
+
uidCount: '0',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
onLoad(options) {
|
|
36
|
+
this.getCount(options);
|
|
37
|
+
this.getComments(options);
|
|
38
|
+
},
|
|
39
|
+
async getCount(options) {
|
|
40
|
+
try {
|
|
41
|
+
const result = await fetchCommentsCount(
|
|
42
|
+
{
|
|
43
|
+
spuId: options.spuId,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
method: 'POST',
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
this.setData({
|
|
50
|
+
countObj: result,
|
|
51
|
+
});
|
|
52
|
+
// const { data, code = '' } = result;
|
|
53
|
+
// if (code.toUpperCase() === 'SUCCESS') {
|
|
54
|
+
// wx.setNavigationBarTitle({
|
|
55
|
+
// title: `全部评价(${data.commentCount})`,
|
|
56
|
+
// });
|
|
57
|
+
// this.setData({
|
|
58
|
+
// countObj: data,
|
|
59
|
+
// });
|
|
60
|
+
// } else {
|
|
61
|
+
// wx.showToast({
|
|
62
|
+
// title: '查询失败,请稍候重试',
|
|
63
|
+
// });
|
|
64
|
+
// }
|
|
65
|
+
} catch (error) {}
|
|
66
|
+
},
|
|
67
|
+
generalQueryData(reset) {
|
|
68
|
+
const { hasImage, pageNum, pageSize, spuId, commentLevel } = this.data;
|
|
69
|
+
const params = {
|
|
70
|
+
pageNum: 1,
|
|
71
|
+
pageSize: 30,
|
|
72
|
+
queryParameter: {
|
|
73
|
+
spuId,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
if (
|
|
77
|
+
Number(commentLevel) === 3 ||
|
|
78
|
+
Number(commentLevel) === 2 ||
|
|
79
|
+
Number(commentLevel) === 1
|
|
80
|
+
) {
|
|
81
|
+
params.queryParameter.commentLevel = Number(commentLevel);
|
|
82
|
+
}
|
|
83
|
+
if (hasImage && hasImage === '1') {
|
|
84
|
+
params.queryParameter.hasImage = true;
|
|
85
|
+
} else {
|
|
86
|
+
delete params.queryParameter.hasImage;
|
|
87
|
+
}
|
|
88
|
+
// 重置请求
|
|
89
|
+
if (reset) return params;
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
...params,
|
|
93
|
+
pageNum: pageNum + 1,
|
|
94
|
+
pageSize,
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
async init(reset = true) {
|
|
98
|
+
const { loadMoreStatus, commentList = [] } = this.data;
|
|
99
|
+
const params = this.generalQueryData(reset);
|
|
100
|
+
|
|
101
|
+
// 在加载中或者无更多数据,直接返回
|
|
102
|
+
if (loadMoreStatus !== 0) return;
|
|
103
|
+
|
|
104
|
+
this.setData({
|
|
105
|
+
loadMoreStatus: 1,
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
const data = await fetchComments(params, {
|
|
110
|
+
method: 'POST',
|
|
111
|
+
});
|
|
112
|
+
const code = 'SUCCESS';
|
|
113
|
+
if (code.toUpperCase() === 'SUCCESS') {
|
|
114
|
+
const { pageList, totalCount = 0 } = data;
|
|
115
|
+
pageList.forEach((item) => {
|
|
116
|
+
// eslint-disable-next-line no-param-reassign
|
|
117
|
+
item.commentTime = dayjs(Number(item.commentTime)).format(
|
|
118
|
+
'YYYY/MM/DD HH:mm',
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
if (Number(totalCount) === 0 && reset) {
|
|
123
|
+
this.setData({
|
|
124
|
+
commentList: [],
|
|
125
|
+
hasLoaded: true,
|
|
126
|
+
total: totalCount,
|
|
127
|
+
loadMoreStatus: 2,
|
|
128
|
+
});
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const _commentList = reset ? pageList : commentList.concat(pageList);
|
|
132
|
+
const _loadMoreStatus =
|
|
133
|
+
_commentList.length === Number(totalCount) ? 2 : 0;
|
|
134
|
+
this.setData({
|
|
135
|
+
commentList: _commentList,
|
|
136
|
+
pageNum: params.pageNum || 1,
|
|
137
|
+
totalCount: Number(totalCount),
|
|
138
|
+
loadMoreStatus: _loadMoreStatus,
|
|
139
|
+
});
|
|
140
|
+
} else {
|
|
141
|
+
wx.showToast({
|
|
142
|
+
title: '查询失败,请稍候重试',
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
} catch (error) {}
|
|
146
|
+
this.setData({
|
|
147
|
+
hasLoaded: true,
|
|
148
|
+
});
|
|
149
|
+
},
|
|
150
|
+
getScoreArray(score) {
|
|
151
|
+
var array = [];
|
|
152
|
+
for (let i = 0; i < 5; i++) {
|
|
153
|
+
if (i < score) {
|
|
154
|
+
array.push(2);
|
|
155
|
+
} else {
|
|
156
|
+
array.push(0);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return array;
|
|
160
|
+
},
|
|
161
|
+
getComments(options) {
|
|
162
|
+
const { commentLevel = -1, spuId, hasImage = '' } = options;
|
|
163
|
+
if (commentLevel !== -1) {
|
|
164
|
+
this.setData({
|
|
165
|
+
commentLevel: commentLevel,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
this.setData({
|
|
169
|
+
hasImage: hasImage,
|
|
170
|
+
commentType: hasImage ? '4' : '',
|
|
171
|
+
spuId: spuId,
|
|
172
|
+
});
|
|
173
|
+
this.init(true);
|
|
174
|
+
},
|
|
175
|
+
changeTag(e) {
|
|
176
|
+
var { commenttype } = e.currentTarget.dataset;
|
|
177
|
+
var { commentType } = this.data;
|
|
178
|
+
if (commentType === commenttype) return;
|
|
179
|
+
this.setData({
|
|
180
|
+
loadMoreStatus: 0,
|
|
181
|
+
commentList: [],
|
|
182
|
+
total: 0,
|
|
183
|
+
myTotal: 0,
|
|
184
|
+
myPageNum: 1,
|
|
185
|
+
pageNum: 1,
|
|
186
|
+
});
|
|
187
|
+
if (commenttype === '' || commenttype === '5') {
|
|
188
|
+
this.setData({
|
|
189
|
+
hasImage: '',
|
|
190
|
+
commentLevel: '',
|
|
191
|
+
});
|
|
192
|
+
} else if (commenttype === '4') {
|
|
193
|
+
this.setData({
|
|
194
|
+
hasImage: '1',
|
|
195
|
+
commentLevel: '',
|
|
196
|
+
});
|
|
197
|
+
} else {
|
|
198
|
+
this.setData({
|
|
199
|
+
hasImage: '',
|
|
200
|
+
commentLevel: commenttype,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
if (commenttype === '5') {
|
|
204
|
+
this.setData({
|
|
205
|
+
myLoadStatus: 1,
|
|
206
|
+
commentType: commenttype,
|
|
207
|
+
});
|
|
208
|
+
this.getMyCommentsList();
|
|
209
|
+
} else {
|
|
210
|
+
this.setData({
|
|
211
|
+
myLoadStatus: 0,
|
|
212
|
+
commentType: commenttype,
|
|
213
|
+
});
|
|
214
|
+
this.init(true);
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
onReachBottom() {
|
|
218
|
+
const { total = 0, commentList } = this.data;
|
|
219
|
+
if (commentList.length === total) {
|
|
220
|
+
this.setData({
|
|
221
|
+
loadMoreStatus: 2,
|
|
222
|
+
});
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
this.init(false);
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
</script>
|
|
230
|
+
|
|
231
|
+
<template>
|
|
232
|
+
<view class="comments-header [display:flex] [flex-wrap:wrap] [padding:32rpx_32rpx_0rpx] [background-color:#fff] [margin-top:-24rpx] [margin-left:-24rpx]">
|
|
233
|
+
<t-tag t-class="comments-header-tag {{commentType === '' ? 'comments-header-active' : ''}} [margin-top:24rpx] [margin-left:24rpx] ![height:56rpx] ![font-size:24rpx] [justify-content:center] ![background-color:#F5F5F5] ![border-radius:8rpx] ![border:1px_solid_#F5F5F5] [background-color:#FFECE9] [color:#FA4126] [border:1px_solid_#FA4126]" data-commentType="" bindtap="changeTag">
|
|
234
|
+
全部({{countObj.commentCount}})
|
|
235
|
+
</t-tag>
|
|
236
|
+
<t-tag
|
|
237
|
+
t-class="comments-header-tag {{commentType === '5' ? 'comments-header-active' : ''}} [margin-top:24rpx] [margin-left:24rpx] ![height:56rpx] ![font-size:24rpx] [justify-content:center] ![background-color:#F5F5F5] ![border-radius:8rpx] ![border:1px_solid_#F5F5F5] [background-color:#FFECE9] [color:#FA4126] [border:1px_solid_#FA4126]"
|
|
238
|
+
wx:if="{{countObj.uidCount !== '0'}}"
|
|
239
|
+
data-commentType="5"
|
|
240
|
+
bindtap="changeTag"
|
|
241
|
+
>
|
|
242
|
+
自己({{countObj.uidCount}})
|
|
243
|
+
</t-tag>
|
|
244
|
+
<t-tag t-class="comments-header-tag {{commentType === '4' ? 'comments-header-active' : ''}} [margin-top:24rpx] [margin-left:24rpx] ![height:56rpx] ![font-size:24rpx] [justify-content:center] ![background-color:#F5F5F5] ![border-radius:8rpx] ![border:1px_solid_#F5F5F5] [background-color:#FFECE9] [color:#FA4126] [border:1px_solid_#FA4126]" data-commentType="4" bindtap="changeTag">
|
|
245
|
+
带图({{countObj.hasImageCount}})
|
|
246
|
+
</t-tag>
|
|
247
|
+
<t-tag t-class="comments-header-tag {{commentType === '3' ? 'comments-header-active' : ''}} [margin-top:24rpx] [margin-left:24rpx] ![height:56rpx] ![font-size:24rpx] [justify-content:center] ![background-color:#F5F5F5] ![border-radius:8rpx] ![border:1px_solid_#F5F5F5] [background-color:#FFECE9] [color:#FA4126] [border:1px_solid_#FA4126]" data-commentType="3" bindtap="changeTag">
|
|
248
|
+
好评({{countObj.goodCount}})
|
|
249
|
+
</t-tag>
|
|
250
|
+
<t-tag t-class="comments-header-tag {{commentType === '2' ? 'comments-header-active' : ''}} [margin-top:24rpx] [margin-left:24rpx] ![height:56rpx] ![font-size:24rpx] [justify-content:center] ![background-color:#F5F5F5] ![border-radius:8rpx] ![border:1px_solid_#F5F5F5] [background-color:#FFECE9] [color:#FA4126] [border:1px_solid_#FA4126]" data-commentType="2" bindtap="changeTag">
|
|
251
|
+
中评({{countObj.middleCount}})
|
|
252
|
+
</t-tag>
|
|
253
|
+
<t-tag t-class="comments-header-tag {{commentType === '1' ? 'comments-header-active' : ''}} [margin-top:24rpx] [margin-left:24rpx] ![height:56rpx] ![font-size:24rpx] [justify-content:center] ![background-color:#F5F5F5] ![border-radius:8rpx] ![border:1px_solid_#F5F5F5] [background-color:#FFECE9] [color:#FA4126] [border:1px_solid_#FA4126]" data-commentType="1" bindtap="changeTag">
|
|
254
|
+
差评({{countObj.badCount}})
|
|
255
|
+
</t-tag>
|
|
256
|
+
</view>
|
|
257
|
+
<view class="comments-card-list">
|
|
258
|
+
<block wx:for="{{commentList}}" wx:key="index">
|
|
259
|
+
<comments-card
|
|
260
|
+
commentScore="{{item.commentScore}}"
|
|
261
|
+
userName="{{item.userName}}"
|
|
262
|
+
commentResources="{{item.commentResources || []}}"
|
|
263
|
+
commentContent="{{item.commentContent}}"
|
|
264
|
+
isAnonymity="{{item.isAnonymity}}"
|
|
265
|
+
commentTime="{{item.commentTime}}"
|
|
266
|
+
isAutoComment="{{item.isAutoComment}}"
|
|
267
|
+
userHeadUrl="{{item.userHeadUrl}}"
|
|
268
|
+
specInfo="{{item.specInfo}}"
|
|
269
|
+
sellerReply="{{item.sellerReply || ''}}"
|
|
270
|
+
goodsDetailInfo="{{item.goodsDetailInfo || ''}}"
|
|
271
|
+
/>
|
|
272
|
+
</block>
|
|
273
|
+
<t-load-more
|
|
274
|
+
t-class="no-more [padding-left:20rpx] [padding-right:20rpx]"
|
|
275
|
+
status="{{loadMoreStatus}}"
|
|
276
|
+
no-more-text="没有更多了"
|
|
277
|
+
color="#BBBBBB"
|
|
278
|
+
failedColor="#FA550F"
|
|
279
|
+
/>
|
|
280
|
+
</view>
|
|
281
|
+
|
|
282
|
+
</template>
|
|
283
|
+
|
|
284
|
+
<json>
|
|
285
|
+
{
|
|
286
|
+
"navigationBarTitleText": "全部评价",
|
|
287
|
+
"usingComponents": {
|
|
288
|
+
"t-tag": "tdesign-miniprogram/tag/tag",
|
|
289
|
+
"comments-card": "./components/comments-card/index",
|
|
290
|
+
"t-load-more": "/components/load-more/index"
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
</json>
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
Component({
|
|
3
|
+
externalClasses: ['wr-sold-out', 'wr-class'],
|
|
4
|
+
|
|
5
|
+
options: { multipleSlots: true },
|
|
6
|
+
|
|
7
|
+
properties: {
|
|
8
|
+
soldout: {
|
|
9
|
+
// 商品是否下架
|
|
10
|
+
type: Boolean,
|
|
11
|
+
value: false,
|
|
12
|
+
},
|
|
13
|
+
jumpArray: {
|
|
14
|
+
type: Array,
|
|
15
|
+
value: [],
|
|
16
|
+
},
|
|
17
|
+
isStock: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
value: true,
|
|
20
|
+
}, // 是否有库存
|
|
21
|
+
isSlotButton: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
value: false,
|
|
24
|
+
}, // 是否开启按钮插槽
|
|
25
|
+
shopCartNum: {
|
|
26
|
+
type: Number, // 购物车气泡数量
|
|
27
|
+
},
|
|
28
|
+
buttonType: {
|
|
29
|
+
type: Number,
|
|
30
|
+
value: 0,
|
|
31
|
+
},
|
|
32
|
+
minDiscountPrice: {
|
|
33
|
+
type: String,
|
|
34
|
+
value: '',
|
|
35
|
+
},
|
|
36
|
+
minSalePrice: {
|
|
37
|
+
type: String,
|
|
38
|
+
value: '',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
data: {
|
|
43
|
+
fillPrice: false,
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
methods: {
|
|
47
|
+
toAddCart() {
|
|
48
|
+
const { isStock } = this.properties;
|
|
49
|
+
if (!isStock) return;
|
|
50
|
+
this.triggerEvent('toAddCart');
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
toBuyNow(e) {
|
|
54
|
+
const { isStock } = this.properties;
|
|
55
|
+
if (!isStock) return;
|
|
56
|
+
this.triggerEvent('toBuyNow', e);
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
toNav(e) {
|
|
60
|
+
const { url } = e.currentTarget.dataset;
|
|
61
|
+
return this.triggerEvent('toNav', {
|
|
62
|
+
e,
|
|
63
|
+
url,
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<view class="flex soldout flex-center wr-sold-out [height:80rpx] [background:rgba(170,_170,_170,_1)] [width:100%] [color:#fff] [display:flex] [display:-webkit-flex] [justify-content:center] [-webkit-justify-content:center] [align-items:center] [-webkit-align-items:center]" wx:if="{{soldout || !isStock}}">
|
|
72
|
+
{{soldout ? '商品已下架' : '商品已售馨'}}
|
|
73
|
+
</view>
|
|
74
|
+
<view class="footer-cont flex flex-between wr-class [background-color:#fff] [padding:16rpx] [display:flex] [display:-webkit-flex] [justify-content:space-between] [-webkit-justify-content:space-between]">
|
|
75
|
+
<view class="flex flex-between bottom-operate-left [width:100%] [display:flex] [display:-webkit-flex] [justify-content:space-between] [-webkit-justify-content:space-between] [&_.icon-warp]:[width:50%]" wx:if="{{jumpArray.length > 0}}">
|
|
76
|
+
<view
|
|
77
|
+
wx:for="{{jumpArray}}"
|
|
78
|
+
wx:key="index"
|
|
79
|
+
class="icon-warp operate-wrap [width:110rpx] [display:flex] [justify-content:center] [align-items:center] [text-align:center] [position:relative] [display:-webkit-flex]"
|
|
80
|
+
bindtap="toNav"
|
|
81
|
+
data-ele="foot_navigation"
|
|
82
|
+
data-index="{{index}}"
|
|
83
|
+
data-url="{{item.url}}"
|
|
84
|
+
>
|
|
85
|
+
<view>
|
|
86
|
+
<text wx:if="{{shopCartNum > 0 && item.showCartNum}}" class="tag-cart-num [display:inline-block] [position:absolute] [left:50rpx] [right:auto] [top:6rpx] [color:#fff] [line-height:24rpx] [text-align:center] [z-index:99] [white-space:nowrap] [min-width:28rpx] [border-radius:14rpx] ![background-color:#fa550f] [font-size:20rpx] [font-weight:400] [padding:2rpx_6rpx]">
|
|
87
|
+
{{shopCartNum > 99 ? '99+' : shopCartNum}}
|
|
88
|
+
</text>
|
|
89
|
+
<t-icon prefix="wr" name="{{item.iconName}}" size="40rpx" />
|
|
90
|
+
<view class="operate-text [color:#666] [font-size:20rpx]">{{item.title}}</view>
|
|
91
|
+
</view>
|
|
92
|
+
</view>
|
|
93
|
+
</view>
|
|
94
|
+
<block wx:if="{{buttonType === 1}}">
|
|
95
|
+
<view class="flex buy-buttons [display:flex] [display:-webkit-flex]">
|
|
96
|
+
<view class="bar-separately {{soldout || !isStock ? 'bar-addCart-disabled' : ''}} [width:254rpx] [height:80rpx] [color:#fff] [display:flex] [align-items:center] [justify-content:center] [background:#ffece9] [color:#fa4126] [border-radius:40rpx_0_0_40rpx] [background:rgba(170,_170,_170,_1)] [width:100%] [background:rgba(221,_221,_221,_1)] [font-size:28rpx] [display:-webkit-flex]" bindtap="toAddCart">
|
|
97
|
+
加入购物车
|
|
98
|
+
</view>
|
|
99
|
+
<view class="bar-buy {{soldout || !isStock ? 'bar-buyNow-disabled' : ''}} [width:254rpx] [height:80rpx] [color:#fff] [display:flex] [align-items:center] [justify-content:center] [background-color:#fa4126] [border-radius:0rpx_40rpx_40rpx_0rpx] [background:rgba(170,_170,_170,_1)] [width:100%] [background:rgba(198,_198,_198,_1)] [font-size:28rpx] [display:-webkit-flex]" bindtap="toBuyNow">
|
|
100
|
+
立即购买
|
|
101
|
+
</view>
|
|
102
|
+
</view>
|
|
103
|
+
</block>
|
|
104
|
+
<block wx:if="{{isSlotButton}}">
|
|
105
|
+
<slot name="buyButton" />
|
|
106
|
+
</block>
|
|
107
|
+
</view>
|
|
108
|
+
|
|
109
|
+
</template>
|
|
110
|
+
|
|
111
|
+
<json>
|
|
112
|
+
{
|
|
113
|
+
"component": true,
|
|
114
|
+
"usingComponents": {
|
|
115
|
+
"t-icon": "tdesign-miniprogram/icon/icon"
|
|
116
|
+
}
|
|
117
|
+
}</json>
|