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,20 @@
|
|
|
1
|
+
import { getGoodsList } from './goods';
|
|
2
|
+
|
|
3
|
+
export function getPromotion(baseID = 0, length = 10) {
|
|
4
|
+
return {
|
|
5
|
+
list: getGoodsList(baseID, length).map((item) => {
|
|
6
|
+
return {
|
|
7
|
+
spuId: item.spuId,
|
|
8
|
+
thumb: item.primaryImage,
|
|
9
|
+
title: item.title,
|
|
10
|
+
price: item.minSalePrice,
|
|
11
|
+
originPrice: item.maxLinePrice,
|
|
12
|
+
tags: item.spuTagList.map((tag) => ({ title: tag.title })),
|
|
13
|
+
};
|
|
14
|
+
}),
|
|
15
|
+
banner: 'https://tdesign.gtimg.com/miniprogram/template/retail/promotion/banner-promotion.png',
|
|
16
|
+
time: 1000 * 60 * 60 * 20,
|
|
17
|
+
showBannerDesc: true,
|
|
18
|
+
statusTag: 'running',
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { getGoodsList } from './goods';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param {number} sort
|
|
5
|
+
* @param {number} pageNum
|
|
6
|
+
* @param {number} pageSize
|
|
7
|
+
* @param {number} minPrice
|
|
8
|
+
* @param {number} maxPrice
|
|
9
|
+
* @param {string} keyword
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export function getSearchHistory() {
|
|
13
|
+
return {
|
|
14
|
+
historyWords: [
|
|
15
|
+
'鸡',
|
|
16
|
+
'电脑',
|
|
17
|
+
'iPhone12',
|
|
18
|
+
'车载手机支架',
|
|
19
|
+
'自然堂',
|
|
20
|
+
'小米10',
|
|
21
|
+
'原浆古井贡酒',
|
|
22
|
+
'欧米伽',
|
|
23
|
+
'华为',
|
|
24
|
+
'针织半身裙',
|
|
25
|
+
'氢跑鞋',
|
|
26
|
+
'三盒处理器',
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function getSearchPopular() {
|
|
32
|
+
return {
|
|
33
|
+
popularWords: [
|
|
34
|
+
'鸡',
|
|
35
|
+
'电脑',
|
|
36
|
+
'iPhone12',
|
|
37
|
+
'车载手机支架',
|
|
38
|
+
'自然堂',
|
|
39
|
+
'小米10',
|
|
40
|
+
'原浆古井贡酒',
|
|
41
|
+
'欧米伽',
|
|
42
|
+
'华为',
|
|
43
|
+
'针织半身裙',
|
|
44
|
+
'氢跑鞋',
|
|
45
|
+
'三盒处理器',
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function getSearchResult() {
|
|
51
|
+
return {
|
|
52
|
+
saasId: null,
|
|
53
|
+
storeId: null,
|
|
54
|
+
pageNum: 1,
|
|
55
|
+
pageSize: 30,
|
|
56
|
+
totalCount: 1,
|
|
57
|
+
spuList: getGoodsList(7),
|
|
58
|
+
algId: 0,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export function getGoods() {
|
|
2
|
+
return {
|
|
3
|
+
goods: [
|
|
4
|
+
{
|
|
5
|
+
squid: '1',
|
|
6
|
+
checkItems: [
|
|
7
|
+
{
|
|
8
|
+
name: '匿名评价',
|
|
9
|
+
value: 'anonymous',
|
|
10
|
+
checked: false,
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
detail: {
|
|
14
|
+
image:
|
|
15
|
+
'https://wx.qlogo.cn/mmopen/vi_32/51VSMNuy1CyHiaAhAjLJ00kMZVqqnCqXeZduCLXHUBr52zFHRGxwL7kGia3fHj8GSNzFcqFDInQmRGM1eWjtQgqA/132',
|
|
16
|
+
title: '',
|
|
17
|
+
},
|
|
18
|
+
goodComment: {
|
|
19
|
+
/** 商品评价 */
|
|
20
|
+
rate: 0,
|
|
21
|
+
/** 评价内容 */
|
|
22
|
+
label: '123',
|
|
23
|
+
/** 上传图片 */
|
|
24
|
+
images: [],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
squid: '2',
|
|
29
|
+
checkItems: [
|
|
30
|
+
{
|
|
31
|
+
name: '匿名评价',
|
|
32
|
+
value: 'anonymous',
|
|
33
|
+
checked: false,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
detail: {
|
|
37
|
+
image:
|
|
38
|
+
'https://wx.qlogo.cn/mmopen/vi_32/51VSMNuy1CyHiaAhAjLJ00kMZVqqnCqXeZduCLXHUBr52zFHRGxwL7kGia3fHj8GSNzFcqFDInQmRGM1eWjtQgqA/132',
|
|
39
|
+
title: '评价内容 山姆智利进口',
|
|
40
|
+
},
|
|
41
|
+
goodComment: {
|
|
42
|
+
/** 商品评价 */
|
|
43
|
+
rate: 0,
|
|
44
|
+
/** 评价内容 */
|
|
45
|
+
label: '山姆智利进口',
|
|
46
|
+
/** 上传图片 */
|
|
47
|
+
images: [],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
storeComment: {
|
|
52
|
+
/** 物流评价 */
|
|
53
|
+
logisticsRate: 0,
|
|
54
|
+
/** 服务评价 */
|
|
55
|
+
servicesRate: 0,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// const images = [
|
|
2
|
+
// {
|
|
3
|
+
// img: 'https://tdesign.gtimg.com/miniprogram/template/retail/home/v2/banner1.png',
|
|
4
|
+
// text: '1',
|
|
5
|
+
// },
|
|
6
|
+
// {
|
|
7
|
+
// img: 'https://tdesign.gtimg.com/miniprogram/template/retail/home/v2/banner2.png',
|
|
8
|
+
// text: '2',
|
|
9
|
+
// },
|
|
10
|
+
// {
|
|
11
|
+
// img: 'https://tdesign.gtimg.com/miniprogram/template/retail/home/v2/banner3.png',
|
|
12
|
+
// text: '3',
|
|
13
|
+
// },
|
|
14
|
+
// {
|
|
15
|
+
// img: 'https://tdesign.gtimg.com/miniprogram/template/retail/home/v2/banner4.png',
|
|
16
|
+
// text: '4',
|
|
17
|
+
// },
|
|
18
|
+
// {
|
|
19
|
+
// img: 'https://tdesign.gtimg.com/miniprogram/template/retail/home/v2/banner5.png',
|
|
20
|
+
// text: '5',
|
|
21
|
+
// },
|
|
22
|
+
// {
|
|
23
|
+
// img: 'https://tdesign.gtimg.com/miniprogram/template/retail/home/v2/banner6.png',
|
|
24
|
+
// text: '6',
|
|
25
|
+
// },
|
|
26
|
+
// ];
|
|
27
|
+
|
|
28
|
+
const images = [
|
|
29
|
+
'https://tdesign.gtimg.com/miniprogram/template/retail/home/v2/banner1.png',
|
|
30
|
+
'https://tdesign.gtimg.com/miniprogram/template/retail/home/v2/banner2.png',
|
|
31
|
+
'https://tdesign.gtimg.com/miniprogram/template/retail/home/v2/banner3.png',
|
|
32
|
+
'https://tdesign.gtimg.com/miniprogram/template/retail/home/v2/banner4.png',
|
|
33
|
+
'https://tdesign.gtimg.com/miniprogram/template/retail/home/v2/banner5.png',
|
|
34
|
+
'https://tdesign.gtimg.com/miniprogram/template/retail/home/v2/banner6.png',
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
export function genSwiperImageList() {
|
|
38
|
+
return images;
|
|
39
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const userInfo = {
|
|
2
|
+
avatarUrl:
|
|
3
|
+
'https://we-retail-static-1300977798.cos.ap-guangzhou.myqcloud.com/retail-ui/components-exp/avatar/avatar-1.jpg',
|
|
4
|
+
nickName: 'TDesign 🌟',
|
|
5
|
+
phoneNumber: '13438358888',
|
|
6
|
+
gender: 2,
|
|
7
|
+
};
|
|
8
|
+
const countsData = [
|
|
9
|
+
{
|
|
10
|
+
num: 2,
|
|
11
|
+
name: '积分',
|
|
12
|
+
type: 'point',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
num: 10,
|
|
16
|
+
name: '优惠券',
|
|
17
|
+
type: 'coupon',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
const orderTagInfos = [
|
|
22
|
+
{
|
|
23
|
+
orderNum: 1,
|
|
24
|
+
tabType: 5,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
orderNum: 1,
|
|
28
|
+
tabType: 10,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
orderNum: 1,
|
|
32
|
+
tabType: 40,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
orderNum: 0,
|
|
36
|
+
tabType: 0,
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
const customerServiceInfo = {
|
|
41
|
+
servicePhone: '4006336868',
|
|
42
|
+
serviceTimeDuration: '每周三至周五 9:00-12:00 13:00-15:00',
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const genSimpleUserInfo = () => ({ ...userInfo });
|
|
46
|
+
|
|
47
|
+
export const genUsercenter = () => ({
|
|
48
|
+
userInfo,
|
|
49
|
+
countsData,
|
|
50
|
+
orderTagInfos,
|
|
51
|
+
customerServiceInfo,
|
|
52
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
Component({
|
|
3
|
+
options: {
|
|
4
|
+
addGlobalClass: true,
|
|
5
|
+
},
|
|
6
|
+
/**
|
|
7
|
+
* 组件的属性列表
|
|
8
|
+
*/
|
|
9
|
+
properties: {
|
|
10
|
+
isAllSelected: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
value: false,
|
|
13
|
+
},
|
|
14
|
+
totalAmount: {
|
|
15
|
+
type: Number,
|
|
16
|
+
value: 1,
|
|
17
|
+
},
|
|
18
|
+
totalGoodsNum: {
|
|
19
|
+
type: Number,
|
|
20
|
+
value: 0,
|
|
21
|
+
observer(num) {
|
|
22
|
+
const isDisabled = num == 0;
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
this.setData({
|
|
25
|
+
isDisabled,
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
totalDiscountAmount: {
|
|
31
|
+
type: Number,
|
|
32
|
+
value: 0,
|
|
33
|
+
},
|
|
34
|
+
bottomHeight: {
|
|
35
|
+
type: Number,
|
|
36
|
+
value: 100,
|
|
37
|
+
},
|
|
38
|
+
fixed: Boolean,
|
|
39
|
+
},
|
|
40
|
+
data: {
|
|
41
|
+
isDisabled: false,
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
methods: {
|
|
45
|
+
handleSelectAll() {
|
|
46
|
+
const { isAllSelected } = this.data;
|
|
47
|
+
this.setData({
|
|
48
|
+
isAllSelected: !isAllSelected,
|
|
49
|
+
});
|
|
50
|
+
this.triggerEvent('handleSelectAll', {
|
|
51
|
+
isAllSelected: isAllSelected,
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
handleToSettle() {
|
|
56
|
+
if (this.data.isDisabled) return;
|
|
57
|
+
this.triggerEvent('handleToSettle');
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
<view class="cart-bar__placeholder [height:100rpx]" wx:if="{{fixed}}" />
|
|
65
|
+
<view class="cart-bar {{fixed ? 'cart-bar--fixed' : ''}} flex flex-v-center [display:flex] [align-items:center] [height:112rpx] [background-color:#fff] [border-top:1rpx_solid_#e5e5e5] [padding:16rpx_32rpx] [box-sizing:border-box] [font-size:24rpx] [line-height:36rpx] [color:#333] [position:fixed] [left:0] [right:0] [z-index:99] [bottom:calc(100rpx_+_env(safe-area-inset-bottom))] [&_.cart-bar__check]:[margin-right:12rpx] [&_.cart-bar__total]:[margin-left:24rpx] [&_.account-btn]:[width:192rpx] [&_.account-btn]:[height:80rpx] [&_.account-btn]:[border-radius:40rpx] [&_.account-btn]:[background-color:#fa4126] [&_.account-btn]:[font-size:28rpx] [&_.account-btn]:[font-weight:bold] [&_.account-btn]:[line-height:80rpx] [&_.account-btn]:[color:#ffffff] [&_.account-btn]:[text-align:center] [&_.disabled-btn]:[background-color:#cccccc] [&_.hover-btn]:[opacity:0.5]" style="bottom: {{fixed ? 'calc(' + bottomHeight + 'rpx + env(safe-area-inset-bottom))' : ''}};">
|
|
66
|
+
<t-icon
|
|
67
|
+
size="40rpx"
|
|
68
|
+
color="{{isAllSelected ? '#FA4126' : '#BBBBBB'}}"
|
|
69
|
+
name="{{isAllSelected ? 'check-circle-filled' : 'circle'}}"
|
|
70
|
+
class="cart-bar__check"
|
|
71
|
+
catchtap="handleSelectAll"
|
|
72
|
+
/>
|
|
73
|
+
<text>全选</text>
|
|
74
|
+
<view class="cart-bar__total flex1 [flex:1] [display:flex] [&_.cart-bar__total--bold]:[font-size:28rpx] [&_.cart-bar__total--bold]:[line-height:40rpx] [&_.cart-bar__total--bold]:[color:#333] [&_.cart-bar__total--bold]:[font-weight:bold] [&_.cart-bar__total--normal]:[font-size:24rpx] [&_.cart-bar__total--normal]:[line-height:32rpx] [&_.cart-bar__total--normal]:[color:#999] [&_.cart-bar__total--price]:[color:#fa4126] [&_.cart-bar__total--price]:[font-weight:bold]">
|
|
75
|
+
<view>
|
|
76
|
+
<text class="cart-bar__total--bold text-padding-right [padding-right:4rpx]">总计</text>
|
|
77
|
+
<price
|
|
78
|
+
price="{{totalAmount || '0'}}"
|
|
79
|
+
fill="{{false}}"
|
|
80
|
+
decimalSmaller
|
|
81
|
+
class="cart-bar__total--bold cart-bar__total--price"
|
|
82
|
+
/>
|
|
83
|
+
<text class="cart-bar__total--normal">(不含运费)</text>
|
|
84
|
+
</view>
|
|
85
|
+
<view wx:if="{{totalDiscountAmount}}">
|
|
86
|
+
<text class="cart-bar__total--normal text-padding-right [padding-right:4rpx]">已优惠</text>
|
|
87
|
+
<price class="cart-bar__total--normal" price="{{totalDiscountAmount || '0'}}" fill="{{false}}" />
|
|
88
|
+
</view>
|
|
89
|
+
</view>
|
|
90
|
+
<view catchtap="handleToSettle" class="{{!isDisabled ? '' : 'disabled-btn'}} account-btn" hover-class="{{!isDisabled ? '' : 'hover-btn'}}">
|
|
91
|
+
去结算({{totalGoodsNum}})
|
|
92
|
+
</view>
|
|
93
|
+
</view>
|
|
94
|
+
|
|
95
|
+
</template>
|
|
96
|
+
|
|
97
|
+
<json>
|
|
98
|
+
{
|
|
99
|
+
"component": true,
|
|
100
|
+
"usingComponents": {
|
|
101
|
+
"price": "/components/price/index",
|
|
102
|
+
"t-icon": "tdesign-miniprogram/icon/icon"
|
|
103
|
+
}
|
|
104
|
+
}</json>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
Component({
|
|
3
|
+
properties: {
|
|
4
|
+
imgUrl: {
|
|
5
|
+
type: String,
|
|
6
|
+
value: 'https://tdesign.gtimg.com/miniprogram/template/retail/template/empty-cart.png',
|
|
7
|
+
},
|
|
8
|
+
tip: {
|
|
9
|
+
type: String,
|
|
10
|
+
value: '购物车是空的',
|
|
11
|
+
},
|
|
12
|
+
btnText: {
|
|
13
|
+
type: String,
|
|
14
|
+
value: '去首页',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
data: {},
|
|
18
|
+
methods: {
|
|
19
|
+
handleClick() {
|
|
20
|
+
this.triggerEvent('handleClick');
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<view class="cart-empty [padding:64rpx_0rpx] [display:flex] [flex-direction:column] [align-items:center] [box-sizing:border-box] [height:calc(100vh_-_100rpx)] [background-color:#f5f5f5] [&_.cart-img]:[width:160rpx] [&_.cart-img]:[height:160rpx] [&_.cart-img]:[margin-bottom:24rpx] [&_.tip]:[font-size:28rpx] [&_.tip]:[line-height:40rpx] [&_.tip]:[color:#999] [&_.tip]:[margin-bottom:24rpx] [&_.btn]:[width:240rpx] [&_.btn]:[height:72rpx] [&_.btn]:[border-radius:36rpx] [&_.btn]:[text-align:center] [&_.btn]:[line-height:72rpx] [&_.btn]:[border:2rpx_solid_#fa4126] [&_.btn]:[color:#fa4126] [&_.btn]:[background-color:transparent] [&_.btn]:[font-size:28rpx] [&_.btn]:[font-weight:bold]">
|
|
28
|
+
<t-image t-class="cart-img" src="{{imgUrl}}" />
|
|
29
|
+
<view class="tip">{{tip}}</view>
|
|
30
|
+
<view class="btn" bind:tap="handleClick">{{btnText}}</view>
|
|
31
|
+
</view>
|
|
32
|
+
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<json>
|
|
36
|
+
{
|
|
37
|
+
"component": true,
|
|
38
|
+
"usingComponents": {
|
|
39
|
+
"t-image": "/components/webp-image/index"
|
|
40
|
+
}
|
|
41
|
+
}</json>
|