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,334 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
Component({
|
|
3
|
-
options: {
|
|
4
|
-
multipleSlots: true, // 在组件定义时的选项中启用多slot支持
|
|
5
|
-
addGlobalClass: true,
|
|
6
|
-
},
|
|
7
|
-
intersectionObserverContext: null,
|
|
8
|
-
|
|
9
|
-
externalClasses: [
|
|
10
|
-
'card-class',
|
|
11
|
-
'title-class',
|
|
12
|
-
'desc-class',
|
|
13
|
-
'num-class',
|
|
14
|
-
'thumb-class',
|
|
15
|
-
'specs-class',
|
|
16
|
-
'price-class',
|
|
17
|
-
'origin-price-class',
|
|
18
|
-
'price-prefix-class',
|
|
19
|
-
],
|
|
20
|
-
|
|
21
|
-
properties: {
|
|
22
|
-
hidden: {
|
|
23
|
-
// 设置为null代表不做类型转换
|
|
24
|
-
type: null,
|
|
25
|
-
value: false,
|
|
26
|
-
observer(hidden) {
|
|
27
|
-
// null就是代表没有设置,没有设置的话不setData,防止祖先组件触发的setHidden操作被覆盖
|
|
28
|
-
if (hidden !== null) {
|
|
29
|
-
this.setHidden(!!hidden);
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
id: {
|
|
34
|
-
type: String,
|
|
35
|
-
// `goods-card-88888888`
|
|
36
|
-
// 不能在这里写生成逻辑,如果在这里写,那么假设有多个goods-list时,他们将共享这个值
|
|
37
|
-
value: '',
|
|
38
|
-
observer: (id) => {
|
|
39
|
-
this.genIndependentID(id);
|
|
40
|
-
if (this.properties.thresholds?.length) {
|
|
41
|
-
this.createIntersectionObserverHandle();
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
data: {
|
|
46
|
-
type: Object,
|
|
47
|
-
observer(goods) {
|
|
48
|
-
// 有ID的商品才渲染
|
|
49
|
-
if (!goods) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/** 划线价是否有效 */
|
|
54
|
-
let isValidityLinePrice = true;
|
|
55
|
-
// 判断一次划线价格是否合理
|
|
56
|
-
if (
|
|
57
|
-
goods.originPrice &&
|
|
58
|
-
goods.price &&
|
|
59
|
-
goods.originPrice < goods.price
|
|
60
|
-
) {
|
|
61
|
-
isValidityLinePrice = false;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// 敲定换行数量默认值
|
|
65
|
-
if (goods.lineClamp === undefined || goods.lineClamp <= 0) {
|
|
66
|
-
// tag数组长度 大于0 且 可见
|
|
67
|
-
// 指定换行为1行
|
|
68
|
-
if ((goods.tags?.length || 0) > 0 && !goods.hideKey?.tags) {
|
|
69
|
-
goods.lineClamp = 1;
|
|
70
|
-
} else {
|
|
71
|
-
goods.lineClamp = 2;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
this.setData({ goods, isValidityLinePrice });
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
layout: {
|
|
79
|
-
type: String,
|
|
80
|
-
value: 'horizontal',
|
|
81
|
-
},
|
|
82
|
-
thumbMode: {
|
|
83
|
-
type: String,
|
|
84
|
-
value: 'aspectFill',
|
|
85
|
-
},
|
|
86
|
-
priceFill: {
|
|
87
|
-
type: Boolean,
|
|
88
|
-
value: true,
|
|
89
|
-
},
|
|
90
|
-
currency: {
|
|
91
|
-
type: String,
|
|
92
|
-
value: '¥',
|
|
93
|
-
},
|
|
94
|
-
lazyLoad: {
|
|
95
|
-
type: Boolean,
|
|
96
|
-
value: false,
|
|
97
|
-
},
|
|
98
|
-
centered: {
|
|
99
|
-
type: Boolean,
|
|
100
|
-
value: false,
|
|
101
|
-
},
|
|
102
|
-
pricePrefix: {
|
|
103
|
-
type: String,
|
|
104
|
-
value: '',
|
|
105
|
-
},
|
|
106
|
-
/** 元素可见监控阈值, 数组长度大于0就创建 */
|
|
107
|
-
thresholds: {
|
|
108
|
-
type: Array,
|
|
109
|
-
value: [],
|
|
110
|
-
observer(current) {
|
|
111
|
-
if (current && current.length) {
|
|
112
|
-
this.createIntersectionObserverHandle();
|
|
113
|
-
} else {
|
|
114
|
-
this.clearIntersectionObserverHandle();
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
specsIconClassPrefix: {
|
|
119
|
-
type: String,
|
|
120
|
-
value: 'wr',
|
|
121
|
-
},
|
|
122
|
-
specsIcon: {
|
|
123
|
-
type: String,
|
|
124
|
-
value: 'expand_more',
|
|
125
|
-
},
|
|
126
|
-
addCartIconClassPrefix: {
|
|
127
|
-
type: String,
|
|
128
|
-
value: 'wr',
|
|
129
|
-
},
|
|
130
|
-
addCartIcon: {
|
|
131
|
-
type: String,
|
|
132
|
-
value: 'cart',
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
data: {
|
|
137
|
-
hiddenInData: false,
|
|
138
|
-
independentID: '',
|
|
139
|
-
goods: { id: '' },
|
|
140
|
-
/** 保证划线价格不小于原价,否则不渲染划线价 */
|
|
141
|
-
isValidityLinePrice: false,
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
lifetimes: {
|
|
145
|
-
ready() {
|
|
146
|
-
this.init();
|
|
147
|
-
},
|
|
148
|
-
detached() {
|
|
149
|
-
this.clear();
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
methods: {
|
|
154
|
-
clickHandle() {
|
|
155
|
-
this.triggerEvent('click', { goods: this.data.goods });
|
|
156
|
-
},
|
|
157
|
-
clickThumbHandle() {
|
|
158
|
-
this.triggerEvent('thumb', { goods: this.data.goods });
|
|
159
|
-
},
|
|
160
|
-
clickSpecsHandle() {
|
|
161
|
-
this.triggerEvent('specs', { goods: this.data.goods });
|
|
162
|
-
},
|
|
163
|
-
clickTagHandle(evt) {
|
|
164
|
-
const { index } = evt.currentTarget.dataset;
|
|
165
|
-
this.triggerEvent('tag', { goods: this.data.goods, index });
|
|
166
|
-
},
|
|
167
|
-
// 加入购物车
|
|
168
|
-
addCartHandle(e) {
|
|
169
|
-
const { id } = e.currentTarget;
|
|
170
|
-
const { id: cardID } = e.currentTarget.dataset;
|
|
171
|
-
this.triggerEvent('add-cart', {
|
|
172
|
-
...e.detail,
|
|
173
|
-
id,
|
|
174
|
-
cardID,
|
|
175
|
-
goods: this.data.goods,
|
|
176
|
-
});
|
|
177
|
-
},
|
|
178
|
-
genIndependentID(id, cb) {
|
|
179
|
-
let independentID;
|
|
180
|
-
if (id) {
|
|
181
|
-
independentID = id;
|
|
182
|
-
} else {
|
|
183
|
-
independentID = `goods-card-${~~(Math.random() * 10 ** 8)}`;
|
|
184
|
-
}
|
|
185
|
-
this.setData({ independentID }, cb);
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
init() {
|
|
189
|
-
const { thresholds, id, hidden } = this.properties;
|
|
190
|
-
if (hidden !== null) {
|
|
191
|
-
this.setHidden(!!hidden);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
this.genIndependentID(id || '', () => {
|
|
195
|
-
if (thresholds && thresholds.length) {
|
|
196
|
-
this.createIntersectionObserverHandle();
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
clear() {
|
|
202
|
-
this.clearIntersectionObserverHandle();
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
setHidden(hidden) {
|
|
206
|
-
this.setData({ hiddenInData: !!hidden });
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
createIntersectionObserverHandle() {
|
|
210
|
-
if (this.intersectionObserverContext || !this.data.independentID) {
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
this.intersectionObserverContext = wx
|
|
215
|
-
.createIntersectionObserver(this, {
|
|
216
|
-
thresholds: this.properties.thresholds,
|
|
217
|
-
})
|
|
218
|
-
.relativeToViewport();
|
|
219
|
-
|
|
220
|
-
this.intersectionObserverContext.observe(
|
|
221
|
-
`#${this.data.independentID}`,
|
|
222
|
-
(res) => {
|
|
223
|
-
this.intersectionObserverCB(res);
|
|
224
|
-
},
|
|
225
|
-
);
|
|
226
|
-
},
|
|
227
|
-
intersectionObserverCB(ob) {
|
|
228
|
-
this.triggerEvent('ob', {
|
|
229
|
-
goods: this.data.goods,
|
|
230
|
-
context: this.intersectionObserverContext,
|
|
231
|
-
ob,
|
|
232
|
-
});
|
|
233
|
-
},
|
|
234
|
-
clearIntersectionObserverHandle() {
|
|
235
|
-
if (this.intersectionObserverContext) {
|
|
236
|
-
try {
|
|
237
|
-
this.intersectionObserverContext.disconnect();
|
|
238
|
-
} catch (e) {}
|
|
239
|
-
|
|
240
|
-
this.intersectionObserverContext = null;
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
});
|
|
245
|
-
</script>
|
|
246
|
-
|
|
247
|
-
<template>
|
|
248
|
-
<view
|
|
249
|
-
id="{{independentID}}"
|
|
250
|
-
class="wr-goods-card card-class {{ layout }} {{ centered ? 'center' : ''}} [box-sizing:border-box] [font-size:24rpx] [&_.center_.wr-goods-card__main]:[align-items:flex-start] [&_.center_.wr-goods-card__main]:[justify-content:center] [&_.horizontal-wrap_.wr-goods-card__thumb]:[width:192rpx] [&_.horizontal-wrap_.wr-goods-card__thumb]:[height:192rpx] [&_.horizontal-wrap_.wr-goods-card__thumb]:[border-radius:8rpx] [&_.horizontal-wrap_.wr-goods-card__thumb]:[overflow:hidden] [&_.horizontal-wrap_.wr-goods-card__body]:[flex-direction:column] [&_.horizontal-wrap_.wr-goods-card__short_content]:[flex-direction:row] [&_.horizontal-wrap_.wr-goods-card__short_content]:[align-items:center] [&_.horizontal-wrap_.wr-goods-card__short_content]:[margin:16rpx_0_0_0] [&_.horizontal-wrap_.wr-goods-card__num]:[margin:0_0_0_auto] [&_.vertical_.wr-goods-card__main]:[padding:0_0_22rpx_0] [&_.vertical_.wr-goods-card__main]:[flex-direction:column] [&_.vertical_.wr-goods-card__thumb]:[width:340rpx] [&_.vertical_.wr-goods-card__thumb]:[height:340rpx] [&_.vertical_.wr-goods-card__body]:[margin:20rpx_20rpx_0_20rpx] [&_.vertical_.wr-goods-card__body]:[flex-direction:column] [&_.vertical_.wr-goods-card__long_content]:[overflow:hidden] [&_.vertical_.wr-goods-card__title]:[line-height:36rpx] [&_.vertical_.wr-goods-card__short_content]:[margin:20rpx_0_0_0] [&_.vertical_.wr-goods-card__price]:[order:2] [&_.vertical_.wr-goods-card__price]:[color:#fa4126] [&_.vertical_.wr-goods-card__price]:[margin:20rpx_0_0_0] [&_.vertical_.wr-goods-card__origin-price]:[order:1] [&_.vertical_.wr-goods-card__add-cart]:[position:absolute] [&_.vertical_.wr-goods-card__add-cart]:[bottom:20rpx] [&_.vertical_.wr-goods-card__add-cart]:[right:20rpx]"
|
|
251
|
-
bind:tap="clickHandle"
|
|
252
|
-
data-goods="{{ goods }}"
|
|
253
|
-
hidden="{{hiddenInData}}"
|
|
254
|
-
>
|
|
255
|
-
<view class="wr-goods-card__main [position:relative] [display:flex] [padding:0] [background:transparent]">
|
|
256
|
-
<view class="wr-goods-card__thumb thumb-class [flex-shrink:0] [position:relative] [width:140rpx] [height:140rpx] [&:empty]:[display:none] [&:empty]:[margin:0]" bind:tap="clickThumbHandle">
|
|
257
|
-
<!-- data-src 是方便加购动画读取图片用的 -->
|
|
258
|
-
<t-image
|
|
259
|
-
t-class="wr-goods-card__thumb-com [width:192rpx] [height:192rpx] [border-radius:8rpx] [overflow:hidden]"
|
|
260
|
-
wx:if="{{ !!goods.thumb && !goods.hideKey.thumb }}"
|
|
261
|
-
src="{{ goods.thumb }}"
|
|
262
|
-
mode="{{ thumbMode }}"
|
|
263
|
-
lazy-load="{{ lazyLoad }}"
|
|
264
|
-
/>
|
|
265
|
-
<slot name="thumb-cover" />
|
|
266
|
-
</view>
|
|
267
|
-
<view class="wr-goods-card__body [display:flex] [margin:0_0_0_20rpx] [flex-direction:row] [flex:1_1_auto] [min-height:192rpx]">
|
|
268
|
-
<view class="wr-goods-card__long_content [display:flex] [flex-direction:column] [overflow:hidden] [flex:1_1_auto] [&_.goods_tips]:[width:100%] [&_.goods_tips]:[margin-top:16rpx] [&_.goods_tips]:[text-align:right] [&_.goods_tips]:[color:#fa4126] [&_.goods_tips]:[font-size:24rpx] [&_.goods_tips]:[line-height:32rpx] [&_.goods_tips]:[font-weight:bold]">
|
|
269
|
-
<view wx:if="{{ goods.title && !goods.hideKey.title }}" class="wr-goods-card__title title-class [flex-shrink:0] [font-size:28rpx] [color:#333] [line-height:40rpx] [font-weight:400] [display:-webkit-box] [-webkit-box-orient:vertical] [overflow:hidden] [word-break:break-word]" style="-webkit-line-clamp: {{ goods.lineClamp }};">
|
|
270
|
-
<slot name="before-title" />
|
|
271
|
-
{{ goods.title }}
|
|
272
|
-
</view>
|
|
273
|
-
<slot name="after-title" />
|
|
274
|
-
<view wx:if="{{ goods.desc && !goods.hideKey.desc }}" class="wr-goods-card__desc desc-class [font-size:24rpx] [color:#f5f5f5] [line-height:40rpx] [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2] [overflow:hidden]">{{ goods.desc }}</view>
|
|
275
|
-
<slot name="after-desc" />
|
|
276
|
-
<view wx:if="{{ goods.specs && goods.specs.length > 0 && !goods.hideKey.specs }}" class="wr-goods-card__specs__desc specs-class [font-size:24rpx] [height:32rpx] [line-height:32rpx] [color:#999999] [margin:8rpx_0] [display:flex] [align-self:flex-start] [flex-direction:row] [background:#f5f5f5] [border-radius:8rpx] [padding:4rpx_8rpx]" bind:tap="clickSpecsHandle">
|
|
277
|
-
<view class="wr-goods-card__specs__desc-text [height:100%] [max-width:380rpx] [word-break:break-all] [overflow:hidden] [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:1]">{{ goods.specs }}</view>
|
|
278
|
-
<t-icon name="chevron-down" size="32rpx" color="#999999" />
|
|
279
|
-
</view>
|
|
280
|
-
<view class="goods_tips" wx:if="{{goods.stockQuantity !== 0 && goods.quantity >= goods.stockQuantity}}">库存不足</view>
|
|
281
|
-
</view>
|
|
282
|
-
<view class="wr-goods-card__short_content [display:flex] [flex-direction:column] [justify-content:flex-start] [align-items:flex-end] [margin:0_0_0_46rpx] [&_.no_storage]:[display:flex] [&_.no_storage]:[align-items:center] [&_.no_storage]:[justify-content:space-between] [&_.no_storage]:[height:40rpx] [&_.no_storage]:[color:#333] [&_.no_storage]:[font-size:24rpx] [&_.no_storage]:[line-height:32rpx] [&_.no_storage]:[width:100%]">
|
|
283
|
-
<block wx:if="{{goods.stockQuantity !== 0}}">
|
|
284
|
-
<view wx:if="{{ pricePrefix }}" class="wr-goods-card__price__prefix price-prefix-class [order:0] [color:#666] [margin:0]">{{ pricePrefix }}</view>
|
|
285
|
-
<slot name="price-prefix" />
|
|
286
|
-
<view wx:if="{{ goods.price && !goods.hideKey.price }}" class="wr-goods-card__price [white-space:nowrap] [font-weight:bold] [order:1] [color:#fa4126] [font-size:36rpx] [margin:0] [line-height:48rpx]">
|
|
287
|
-
<price
|
|
288
|
-
wr-class="price-class"
|
|
289
|
-
symbol="{{currency}}"
|
|
290
|
-
price="{{goods.price}}"
|
|
291
|
-
fill="{{priceFill}}"
|
|
292
|
-
decimalSmaller
|
|
293
|
-
/>
|
|
294
|
-
</view>
|
|
295
|
-
<view wx:if="{{ goods.originPrice && !goods.hideKey.originPrice && isValidityLinePrice }}" class="wr-goods-card__origin-price [white-space:nowrap] [font-weight:normal] [order:2] [color:#aaaaaa] [font-size:24rpx] [margin:0]">
|
|
296
|
-
<price
|
|
297
|
-
wr-class="origin-price-class"
|
|
298
|
-
symbol="{{currency}}"
|
|
299
|
-
price="{{goods.originPrice}}"
|
|
300
|
-
fill="{{priceFill}}"
|
|
301
|
-
/>
|
|
302
|
-
</view>
|
|
303
|
-
<slot name="origin-price" />
|
|
304
|
-
<view wx:if="{{goods.num && !goods.hideKey.num}}" class="wr-goods-card__num num-class [white-space:nowrap] [order:4] [font-size:24rpx] [color:#999] [margin:20rpx_0_0_auto]">
|
|
305
|
-
<text class="wr-goods-card__num__prefix [color:inherit]">x </text>
|
|
306
|
-
{{ goods.num }}
|
|
307
|
-
</view>
|
|
308
|
-
</block>
|
|
309
|
-
<block wx:else>
|
|
310
|
-
<view class="no_storage [&_.no_storage__right]:[width:80rpx] [&_.no_storage__right]:[height:40rpx] [&_.no_storage__right]:[border-radius:20rpx] [&_.no_storage__right]:[border:2rpx_solid_#fa4126] [&_.no_storage__right]:[line-height:40rpx] [&_.no_storage__right]:[text-align:center] [&_.no_storage__right]:[color:#fa4126]">
|
|
311
|
-
<view>请重新选择商品规格</view>
|
|
312
|
-
<view class="no_storage__right">重选</view>
|
|
313
|
-
</view>
|
|
314
|
-
</block>
|
|
315
|
-
</view>
|
|
316
|
-
<slot name="append-body" />
|
|
317
|
-
</view>
|
|
318
|
-
<slot name="footer" />
|
|
319
|
-
</view>
|
|
320
|
-
<slot name="append-card" />
|
|
321
|
-
</view>
|
|
322
|
-
|
|
323
|
-
</template>
|
|
324
|
-
|
|
325
|
-
<json>
|
|
326
|
-
{
|
|
327
|
-
"component": true,
|
|
328
|
-
"usingComponents": {
|
|
329
|
-
"price": "/components/price/index",
|
|
330
|
-
"t-tag": "tdesign-miniprogram/tag/tag",
|
|
331
|
-
"t-image": "/components/webp-image/index",
|
|
332
|
-
"t-icon": "tdesign-miniprogram/icon/icon"
|
|
333
|
-
}
|
|
334
|
-
}</json>
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
Component({
|
|
3
|
-
options: {
|
|
4
|
-
addGlobalClass: true,
|
|
5
|
-
multipleSlots: true, // 在组件定义时的选项中启用多slot支持
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
properties: {
|
|
9
|
-
show: {
|
|
10
|
-
type: Boolean,
|
|
11
|
-
value: false,
|
|
12
|
-
},
|
|
13
|
-
value: {
|
|
14
|
-
type: String,
|
|
15
|
-
value: '',
|
|
16
|
-
},
|
|
17
|
-
title: {
|
|
18
|
-
type: String,
|
|
19
|
-
observer(newVal) {
|
|
20
|
-
this.setData({ 'goods.title': newVal });
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
price: {
|
|
24
|
-
type: String,
|
|
25
|
-
value: '',
|
|
26
|
-
observer(newVal) {
|
|
27
|
-
this.setData({ 'goods.price': newVal });
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
thumb: {
|
|
31
|
-
type: String,
|
|
32
|
-
value: '',
|
|
33
|
-
observer(newVal) {
|
|
34
|
-
this.setData({ 'goods.thumb': newVal });
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
thumbMode: {
|
|
38
|
-
type: String,
|
|
39
|
-
value: 'aspectFit',
|
|
40
|
-
},
|
|
41
|
-
zIndex: {
|
|
42
|
-
type: Number,
|
|
43
|
-
value: 99,
|
|
44
|
-
},
|
|
45
|
-
specs: {
|
|
46
|
-
type: Array,
|
|
47
|
-
value: [],
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
data: {
|
|
52
|
-
goods: {
|
|
53
|
-
title: '',
|
|
54
|
-
thumb: '',
|
|
55
|
-
price: '',
|
|
56
|
-
hideKey: {
|
|
57
|
-
originPrice: true,
|
|
58
|
-
tags: true,
|
|
59
|
-
specs: true,
|
|
60
|
-
num: true,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
methods: {
|
|
65
|
-
onClose() {
|
|
66
|
-
this.triggerEvent('close');
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
onCloseOver() {
|
|
70
|
-
this.triggerEvent('closeover');
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
</script>
|
|
75
|
-
|
|
76
|
-
<template>
|
|
77
|
-
<t-popup visible="{{show}}" placement="bottom" z-index="{{zIndex}}" bind:visible-change="onClose">
|
|
78
|
-
<view class="specs-popup [width:100vw] [box-sizing:border-box] [padding:32rpx_32rpx_calc(20rpx_+_env(safe-area-inset-bottom))_32rpx] [max-height:80vh] [display:flex] [flex-direction:column] [background-color:white] [border-radius:20rpx_20rpx_0_0] [&_.section]:[margin-top:44rpx] [&_.section]:[flex:auto] [&_.section]:[overflow-y:scroll] [&_.section]:[overflow-x:hidden] [&_.section]:[-webkit-overflow-scrolling:touch] [&_.section_.title]:[font-size:26rpx] [&_.section_.title]:[color:#4f5356] [&_.section_.options]:[color:#333333] [&_.section_.options]:[font-size:24rpx] [&_.section_.options]:[margin-right:-26rpx] [&_.section_.options_.option]:[display:inline-block] [&_.section_.options_.option]:[margin-top:24rpx] [&_.section_.options_.option]:[height:56rpx] [&_.section_.options_.option]:[line-height:56rpx] [&_.section_.options_.option]:[padding:0_16rpx] [&_.section_.options_.option]:[border-radius:8rpx] [&_.section_.options_.option]:[background-color:#f5f5f5] [&_.section_.options_.option]:[max-width:100%] [&_.section_.options_.option]:[box-sizing:border-box] [&_.section_.options_.option]:[white-space:nowrap] [&_.section_.options_.option]:[overflow:hidden] [&_.section_.options_.option]:[text-overflow:ellipsis] [&_.bottom-btn]:[margin-top:42rpx] [&_.bottom-btn]:[position:relative] [&_.bottom-btn]:[height:80rpx] [&_.bottom-btn]:[line-height:80rpx] [&_.bottom-btn]:[text-align:center] [&_.bottom-btn]:[background-color:white] [&_.bottom-btn]:[color:#fa4126] [&_.bottom-btn--active]:[opacity:0.5]">
|
|
79
|
-
<view>
|
|
80
|
-
<goods-card data="{{goods}}" layout="horizontal-wrap" thumb-mode="{{thumbMode}}" />
|
|
81
|
-
<view class="section">
|
|
82
|
-
<view class="title">已选规格</view>
|
|
83
|
-
<view class="options">
|
|
84
|
-
<view wx:for="{{specs}}" wx:for-item="spec" wx:key="spec" class="option">{{spec}} </view>
|
|
85
|
-
</view>
|
|
86
|
-
</view>
|
|
87
|
-
</view>
|
|
88
|
-
<view class="bottom-btn" hover-class="bottom-btn--active" bindtap="onClose">我知道了</view>
|
|
89
|
-
</view>
|
|
90
|
-
</t-popup>
|
|
91
|
-
</template>
|
|
92
|
-
|
|
93
|
-
<json>
|
|
94
|
-
{
|
|
95
|
-
"component": true,
|
|
96
|
-
"usingComponents": {
|
|
97
|
-
"t-popup": "tdesign-miniprogram/popup/popup",
|
|
98
|
-
"goods-card": "../../components/goods-card/index"
|
|
99
|
-
}
|
|
100
|
-
}</json>
|