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,196 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
getSearchHistory,
|
|
4
|
-
getSearchPopular,
|
|
5
|
-
} from '../../../services/good/fetchSearchHistory';
|
|
6
|
-
|
|
7
|
-
Page({
|
|
8
|
-
data: {
|
|
9
|
-
historyWords: [],
|
|
10
|
-
popularWords: [],
|
|
11
|
-
searchValue: '',
|
|
12
|
-
dialog: {
|
|
13
|
-
title: '确认删除当前历史记录',
|
|
14
|
-
showCancelButton: true,
|
|
15
|
-
message: '',
|
|
16
|
-
},
|
|
17
|
-
dialogShow: false,
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
deleteType: 0,
|
|
21
|
-
deleteIndex: '',
|
|
22
|
-
|
|
23
|
-
onShow() {
|
|
24
|
-
this.queryHistory();
|
|
25
|
-
this.queryPopular();
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
async queryHistory() {
|
|
29
|
-
try {
|
|
30
|
-
const data = await getSearchHistory();
|
|
31
|
-
const code = 'Success';
|
|
32
|
-
if (String(code).toUpperCase() === 'SUCCESS') {
|
|
33
|
-
const { historyWords = [] } = data;
|
|
34
|
-
this.setData({
|
|
35
|
-
historyWords,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
} catch (error) {
|
|
39
|
-
console.error(error);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
async queryPopular() {
|
|
44
|
-
try {
|
|
45
|
-
const data = await getSearchPopular();
|
|
46
|
-
const code = 'Success';
|
|
47
|
-
if (String(code).toUpperCase() === 'SUCCESS') {
|
|
48
|
-
const { popularWords = [] } = data;
|
|
49
|
-
this.setData({
|
|
50
|
-
popularWords,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
} catch (error) {
|
|
54
|
-
console.error(error);
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
confirm() {
|
|
59
|
-
const { historyWords } = this.data;
|
|
60
|
-
const { deleteType, deleteIndex } = this;
|
|
61
|
-
historyWords.splice(deleteIndex, 1);
|
|
62
|
-
if (deleteType === 0) {
|
|
63
|
-
this.setData({
|
|
64
|
-
historyWords,
|
|
65
|
-
dialogShow: false,
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
this.setData({ historyWords: [], dialogShow: false });
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
close() {
|
|
73
|
-
this.setData({ dialogShow: false });
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
handleClearHistory() {
|
|
77
|
-
const { dialog } = this.data;
|
|
78
|
-
this.deleteType = 1;
|
|
79
|
-
this.setData({
|
|
80
|
-
dialog: {
|
|
81
|
-
...dialog,
|
|
82
|
-
message: '确认删除所有历史记录',
|
|
83
|
-
},
|
|
84
|
-
dialogShow: true,
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
deleteCurr(e) {
|
|
89
|
-
const { index } = e.currentTarget.dataset;
|
|
90
|
-
const { dialog } = this.data;
|
|
91
|
-
this.deleteIndex = index;
|
|
92
|
-
this.setData({
|
|
93
|
-
dialog: {
|
|
94
|
-
...dialog,
|
|
95
|
-
message: '确认删除当前历史记录',
|
|
96
|
-
deleteType: 0,
|
|
97
|
-
},
|
|
98
|
-
dialogShow: true,
|
|
99
|
-
});
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
handleHistoryTap(e) {
|
|
103
|
-
const { historyWords } = this.data;
|
|
104
|
-
const { dataset } = e.currentTarget;
|
|
105
|
-
const _searchValue = historyWords[dataset.index || 0] || '';
|
|
106
|
-
if (_searchValue) {
|
|
107
|
-
wx.navigateTo({
|
|
108
|
-
url: `/pages/goods/result/index?searchValue=${_searchValue}`,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
handleSubmit(e) {
|
|
114
|
-
const { value } = e.detail.value;
|
|
115
|
-
if (value.length === 0) return;
|
|
116
|
-
wx.navigateTo({
|
|
117
|
-
url: `/pages/goods/result/index?searchValue=${value}`,
|
|
118
|
-
});
|
|
119
|
-
},
|
|
120
|
-
});
|
|
121
|
-
</script>
|
|
122
|
-
|
|
123
|
-
<template>
|
|
124
|
-
<view class="search-page [box-sizing:border-box] [width:100vw] [height:100vh] [padding:0_30rpx] [&_.t-class__input-container]:[height:64rpx] [&_.t-class__input-container]:[border-radius:32rpx] [&_.t-search__input]:[font-size:28rpx] [&_.t-search__input]:[color:#333] [&_.search-wrap]:[margin-top:44rpx] [&_.history-wrap]:[margin-bottom:20px] [&_.search-header]:[display:flex] [&_.search-header]:[flex-flow:row_nowrap] [&_.search-header]:[justify-content:space-between] [&_.search-header]:[align-items:center] [&_.search-title]:[font-size:30rpx] [&_.search-title]:[font-family:PingFangSC-Semibold,_PingFang_SC] [&_.search-title]:[font-weight:600] [&_.search-title]:[color:rgba(51,_51,_51,_1)] [&_.search-title]:[line-height:42rpx] [&_.search-clear]:[font-size:24rpx] [&_.search-clear]:[font-family:PingFang_SC] [&_.search-clear]:[line-height:32rpx] [&_.search-clear]:[color:#999999] [&_.search-clear]:[font-weight:normal] [&_.search-content]:[overflow:hidden] [&_.search-content]:[display:flex] [&_.search-content]:[flex-flow:row_wrap] [&_.search-content]:[justify-content:flex-start] [&_.search-content]:[align-items:flex-start] [&_.search-content]:[margin-top:24rpx] [&_.search-item]:[color:#333333] [&_.search-item]:[font-size:24rpx] [&_.search-item]:[line-height:32rpx] [&_.search-item]:[font-weight:normal] [&_.search-item]:[margin-right:24rpx] [&_.search-item]:[margin-bottom:24rpx] [&_.search-item]:[background:#f5f5f5] [&_.search-item]:[border-radius:38rpx] [&_.search-item]:[padding:12rpx_24rpx] [&_.hover-history-item]:[position:relative] [&_.hover-history-item]:[top:3rpx] [&_.hover-history-item]:[left:3rpx] [&_.hover-history-item]:[box-shadow:0px_0px_8px_rgba(0,_0,_0,_0.1)_inset]">
|
|
125
|
-
<t-search
|
|
126
|
-
t-class-input-container="t-class__input-container"
|
|
127
|
-
t-class-input="t-search__input"
|
|
128
|
-
value="{{searchValue}}"
|
|
129
|
-
leftIcon=""
|
|
130
|
-
placeholder="iPhone12pro"
|
|
131
|
-
bind:submit="handleSubmit"
|
|
132
|
-
focus
|
|
133
|
-
>
|
|
134
|
-
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
|
|
135
|
-
</t-search>
|
|
136
|
-
<view class="search-wrap">
|
|
137
|
-
<view class="history-wrap">
|
|
138
|
-
<view class="search-header">
|
|
139
|
-
<text class="search-title">历史搜索</text>
|
|
140
|
-
<text class="search-clear" bind:tap="handleClearHistory">清除</text>
|
|
141
|
-
</view>
|
|
142
|
-
<view class="search-content">
|
|
143
|
-
<view
|
|
144
|
-
class="search-item"
|
|
145
|
-
hover-class="hover-history-item"
|
|
146
|
-
wx:for="{{historyWords}}"
|
|
147
|
-
bind:tap="handleHistoryTap"
|
|
148
|
-
bindlongpress="deleteCurr"
|
|
149
|
-
data-index="{{index}}"
|
|
150
|
-
wx:key="*this"
|
|
151
|
-
>
|
|
152
|
-
{{item}}
|
|
153
|
-
</view>
|
|
154
|
-
</view>
|
|
155
|
-
</view>
|
|
156
|
-
<view class="popular-wrap">
|
|
157
|
-
<view class="search-header">
|
|
158
|
-
<text class="search-title">热门搜索</text>
|
|
159
|
-
</view>
|
|
160
|
-
<view class="search-content">
|
|
161
|
-
<view
|
|
162
|
-
class="search-item"
|
|
163
|
-
hover-class="hover-history-item"
|
|
164
|
-
wx:for="{{popularWords}}"
|
|
165
|
-
bind:tap="handleHistoryTap"
|
|
166
|
-
data-index="{{index}}"
|
|
167
|
-
wx:key="*this"
|
|
168
|
-
>
|
|
169
|
-
{{item}}
|
|
170
|
-
</view>
|
|
171
|
-
</view>
|
|
172
|
-
</view>
|
|
173
|
-
</view>
|
|
174
|
-
<t-dialog
|
|
175
|
-
visible="{{dialogShow}}"
|
|
176
|
-
content="{{dialog.message}}"
|
|
177
|
-
bindconfirm="confirm"
|
|
178
|
-
bind:close="close"
|
|
179
|
-
confirm-btn="确定"
|
|
180
|
-
cancel-btn="{{dialog.showCancelButton ? '取消' : null}}"
|
|
181
|
-
t-class-confirm="dialog__button-confirm"
|
|
182
|
-
t-class-cancel="dialog__button-cancel"
|
|
183
|
-
/>
|
|
184
|
-
</view>
|
|
185
|
-
</template>
|
|
186
|
-
|
|
187
|
-
<json>
|
|
188
|
-
{
|
|
189
|
-
"navigationBarTitleText": "搜索",
|
|
190
|
-
"usingComponents": {
|
|
191
|
-
"t-search": "tdesign-miniprogram/search/search",
|
|
192
|
-
"t-icon": "tdesign-miniprogram/icon/icon",
|
|
193
|
-
"t-dialog": "tdesign-miniprogram/dialog/dialog"
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
</json>
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { fetchHome } from '../../services/home/home';
|
|
3
|
-
import { fetchGoodsList } from '../../services/good/fetchGoods';
|
|
4
|
-
import Toast from 'tdesign-miniprogram/toast/index';
|
|
5
|
-
|
|
6
|
-
Page({
|
|
7
|
-
data: {
|
|
8
|
-
imgSrcs: [],
|
|
9
|
-
tabList: [],
|
|
10
|
-
goodsList: [],
|
|
11
|
-
goodsListLoadStatus: 0,
|
|
12
|
-
pageLoading: false,
|
|
13
|
-
current: 1,
|
|
14
|
-
autoplay: true,
|
|
15
|
-
duration: '500',
|
|
16
|
-
interval: 5000,
|
|
17
|
-
navigation: { type: 'dots' },
|
|
18
|
-
swiperImageProps: { mode: 'scaleToFill' },
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
goodListPagination: {
|
|
22
|
-
index: 0,
|
|
23
|
-
num: 20,
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
privateData: {
|
|
27
|
-
tabIndex: 0,
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
onShow() {
|
|
31
|
-
this.getTabBar().init();
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
onLoad() {
|
|
35
|
-
this.init();
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
onReachBottom() {
|
|
39
|
-
if (this.data.goodsListLoadStatus === 0) {
|
|
40
|
-
this.loadGoodsList();
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
onPullDownRefresh() {
|
|
45
|
-
this.init();
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
init() {
|
|
49
|
-
this.loadHomePage();
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
loadHomePage() {
|
|
53
|
-
wx.stopPullDownRefresh();
|
|
54
|
-
|
|
55
|
-
this.setData({
|
|
56
|
-
pageLoading: true,
|
|
57
|
-
});
|
|
58
|
-
fetchHome().then(({ swiper, tabList }) => {
|
|
59
|
-
this.setData({
|
|
60
|
-
tabList,
|
|
61
|
-
imgSrcs: swiper,
|
|
62
|
-
pageLoading: false,
|
|
63
|
-
});
|
|
64
|
-
this.loadGoodsList(true);
|
|
65
|
-
});
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
tabChangeHandle(e) {
|
|
69
|
-
this.privateData.tabIndex = e.detail;
|
|
70
|
-
this.loadGoodsList(true);
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
onReTry() {
|
|
74
|
-
this.loadGoodsList();
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
async loadGoodsList(fresh = false) {
|
|
78
|
-
if (fresh) {
|
|
79
|
-
wx.pageScrollTo({
|
|
80
|
-
scrollTop: 0,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
this.setData({ goodsListLoadStatus: 1 });
|
|
85
|
-
|
|
86
|
-
const pageSize = this.goodListPagination.num;
|
|
87
|
-
let pageIndex = this.privateData.tabIndex * pageSize + this.goodListPagination.index + 1;
|
|
88
|
-
if (fresh) {
|
|
89
|
-
pageIndex = 0;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
try {
|
|
93
|
-
const nextList = await fetchGoodsList(pageIndex, pageSize);
|
|
94
|
-
this.setData({
|
|
95
|
-
goodsList: fresh ? nextList : this.data.goodsList.concat(nextList),
|
|
96
|
-
goodsListLoadStatus: 0,
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
this.goodListPagination.index = pageIndex;
|
|
100
|
-
this.goodListPagination.num = pageSize;
|
|
101
|
-
} catch (err) {
|
|
102
|
-
this.setData({ goodsListLoadStatus: 3 });
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
goodListClickHandle(e) {
|
|
107
|
-
const { index } = e.detail;
|
|
108
|
-
const { spuId } = this.data.goodsList[index];
|
|
109
|
-
wx.navigateTo({
|
|
110
|
-
url: `/pages/goods/details/index?spuId=${spuId}`,
|
|
111
|
-
});
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
goodListAddCartHandle() {
|
|
115
|
-
Toast({
|
|
116
|
-
context: this,
|
|
117
|
-
selector: '#t-toast',
|
|
118
|
-
message: '点击加入购物车',
|
|
119
|
-
});
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
navToSearchPage() {
|
|
123
|
-
wx.navigateTo({ url: '/pages/goods/search/index' });
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
navToActivityDetail({ detail }) {
|
|
127
|
-
const { index: promotionID = 0 } = detail || {};
|
|
128
|
-
wx.navigateTo({
|
|
129
|
-
url: `/pages/promotion/promotion-detail/index?promotion_id=${promotionID}`,
|
|
130
|
-
});
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
</script>
|
|
134
|
-
|
|
135
|
-
<template>
|
|
136
|
-
<view style="text-align: center; color: #b9b9b9" wx:if="{{pageLoading}}">
|
|
137
|
-
<t-loading theme="circular" size="40rpx" text="加载中..." inherit-color />
|
|
138
|
-
</view>
|
|
139
|
-
<view class="home-page-header [background:linear-gradient(#fff,_#f5f5f5)] [display:block] [padding:0_24rpx] [&_.t-search__input-container]:[border-radius:32rpx] [&_.t-search__input-container]:[height:64rpx] [&_.t-search__input]:[font-size:28rpx] [&_.t-search__input]:[color:rgb(116,_116,_116)] [&_.swiper-wrap]:[margin-top:20rpx] [&_.t-image__swiper]:[width:100%] [&_.t-image__swiper]:[height:300rpx] [&_.t-image__swiper]:[border-radius:10rpx]">
|
|
140
|
-
<view class="search" bind:tap="navToSearchPage">
|
|
141
|
-
<t-search
|
|
142
|
-
t-class-input="t-search__input"
|
|
143
|
-
t-class-input-container="t-search__input-container"
|
|
144
|
-
placeholder="iphone 13 火热发售中"
|
|
145
|
-
leftIcon=""
|
|
146
|
-
disabled
|
|
147
|
-
>
|
|
148
|
-
<t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" />
|
|
149
|
-
</t-search>
|
|
150
|
-
</view>
|
|
151
|
-
<view class="swiper-wrap">
|
|
152
|
-
<t-swiper
|
|
153
|
-
wx:if="{{imgSrcs.length > 0}}"
|
|
154
|
-
current="{{current}}"
|
|
155
|
-
autoplay="{{autoplay}}"
|
|
156
|
-
duration="{{duration}}"
|
|
157
|
-
interval="{{interval}}"
|
|
158
|
-
navigation="{{navigation}}"
|
|
159
|
-
imageProps="{{swiperImageProps}}"
|
|
160
|
-
list="{{imgSrcs}}"
|
|
161
|
-
bind:click="navToActivityDetail"
|
|
162
|
-
/>
|
|
163
|
-
</view>
|
|
164
|
-
</view>
|
|
165
|
-
<view class="home-page-container [background:#f5f5f5] [display:block] [padding:0_24rpx] [&_.t-tabs]:[background:#f5f5f5] [&_.t-tabs_.t-tabs-nav]:[background-color:transparent] [&_.t-tabs_.t-tabs-nav]:[line-height:80rpx] [&_.t-tabs_.t-tabs-nav]:[font-size:28rpx] [&_.t-tabs_.t-tabs-nav]:[color:#333] [&_.t-tabs_.t-tabs-scroll]:[border:none] [&_.tab_.order-nav_.order-nav-item_.scroll-width]:[min-width:165rpx] [&_.tab_.order-nav-item_.active]:[color:#fa550f] [&_.tab_.bottom-line]:[border-radius:4rpx] [&_.tab_.order-nav-item_.active_.bottom-line]:[background-color:#fa550f] [&_.tabs-external__item]:[font-size:28rpx] [&_.tabs-external__active]:[color:#333333] [&_.tabs-external__active]:[font-size:32rpx] [&_.tabs-external__track]:[height:6rpx] [&_.tabs-external__track]:[border-radius:4rpx] [&_.tabs-external__track]:[width:48rpx] [&_.goods-list-container]:[background:#f5f5f5] [&_.goods-list-container]:[margin-top:16rpx]">
|
|
166
|
-
<view class="home-page-tabs [--td-tab-nav-bg-color:transparent] [--td-tab-border-color:transparent] [--td-tab-item-color:#666] [--td-tab-track-color:red]">
|
|
167
|
-
<t-tabs
|
|
168
|
-
t-class="t-tabs [&_.t-tabs--top_.t-tabs__scroll]:[border-bottom:none] [&_.t-tabs--top_.t-tabs__item]:[height:86rpx] [&_.t-tabs--bottom_.t-tabs__item]:[height:86rpx]"
|
|
169
|
-
t-class-active="tabs-external__active"
|
|
170
|
-
t-class-item="tabs-external__item"
|
|
171
|
-
defaultValue="{{0}}"
|
|
172
|
-
space-evenly="{{false}}"
|
|
173
|
-
bind:change="tabChangeHandle"
|
|
174
|
-
>
|
|
175
|
-
<t-tab-panel
|
|
176
|
-
wx:for="{{tabList}}"
|
|
177
|
-
wx:for-index="index"
|
|
178
|
-
wx:key="index"
|
|
179
|
-
label="{{item.text}}"
|
|
180
|
-
value="{{item.key}}"
|
|
181
|
-
/>
|
|
182
|
-
</t-tabs>
|
|
183
|
-
</view>
|
|
184
|
-
|
|
185
|
-
<goods-list
|
|
186
|
-
wr-class="goods-list-container"
|
|
187
|
-
goodsList="{{goodsList}}"
|
|
188
|
-
bind:click="goodListClickHandle"
|
|
189
|
-
bind:addcart="goodListAddCartHandle"
|
|
190
|
-
/>
|
|
191
|
-
<load-more list-is-empty="{{!goodsList.length}}" status="{{goodsListLoadStatus}}" bind:retry="onReTry" />
|
|
192
|
-
<t-toast id="t-toast" />
|
|
193
|
-
</view>
|
|
194
|
-
</template>
|
|
195
|
-
|
|
196
|
-
<json>
|
|
197
|
-
{
|
|
198
|
-
"navigationBarTitleText": "首页",
|
|
199
|
-
"onReachBottomDistance": 10,
|
|
200
|
-
"backgroundTextStyle": "light",
|
|
201
|
-
"enablePullDownRefresh": true,
|
|
202
|
-
"usingComponents": {
|
|
203
|
-
"t-search": "tdesign-miniprogram/search/search",
|
|
204
|
-
"t-loading": "tdesign-miniprogram/loading/loading",
|
|
205
|
-
"t-swiper": "tdesign-miniprogram/swiper/swiper",
|
|
206
|
-
"t-swiper-nav": "tdesign-miniprogram/swiper-nav/swiper-nav",
|
|
207
|
-
"t-image": "/components/webp-image/index",
|
|
208
|
-
"t-icon": "tdesign-miniprogram/icon/icon",
|
|
209
|
-
"t-toast": "tdesign-miniprogram/toast/toast",
|
|
210
|
-
"t-tabs": "tdesign-miniprogram/tabs/tabs",
|
|
211
|
-
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
|
|
212
|
-
"goods-list": "/components/goods-list/index",
|
|
213
|
-
"load-more": "/components/load-more/index"
|
|
214
|
-
}
|
|
215
|
-
}</json>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { resp } from '../after-service-list/api';
|
|
2
|
-
import dayjs from 'dayjs';
|
|
3
|
-
import { mockIp, mockReqId } from '../../../utils/mock';
|
|
4
|
-
|
|
5
|
-
export const formatTime = (date, template) => dayjs(date).format(template);
|
|
6
|
-
|
|
7
|
-
export function getRightsDetail({ rightsNo }) {
|
|
8
|
-
const _resq = {
|
|
9
|
-
data: {},
|
|
10
|
-
code: 'Success',
|
|
11
|
-
msg: null,
|
|
12
|
-
requestId: mockReqId(),
|
|
13
|
-
clientIp: mockIp(),
|
|
14
|
-
rt: 79,
|
|
15
|
-
success: true,
|
|
16
|
-
};
|
|
17
|
-
_resq.data =
|
|
18
|
-
resp.data.dataList.filter((item) => item.rights.rightsNo === rightsNo) ||
|
|
19
|
-
{};
|
|
20
|
-
return Promise.resolve(_resq);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function cancelRights() {
|
|
24
|
-
const _resq = {
|
|
25
|
-
data: {},
|
|
26
|
-
code: 'Success',
|
|
27
|
-
msg: null,
|
|
28
|
-
requestId: mockReqId(),
|
|
29
|
-
clientIp: mockIp(),
|
|
30
|
-
rt: 79,
|
|
31
|
-
success: true,
|
|
32
|
-
};
|
|
33
|
-
return Promise.resolve(_resq);
|
|
34
|
-
}
|