create-weapp-vite 2.0.32 → 2.0.33

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.
Files changed (177) hide show
  1. package/README.md +0 -1
  2. package/dist/{chunk-IT75MAH3.js → chunk-MXKCD6NA.js} +2 -3
  3. package/dist/cli.js +1 -5
  4. package/dist/index.d.ts +0 -1
  5. package/dist/index.js +1 -1
  6. package/package.json +2 -2
  7. package/templates/wevu/package.json +1 -1
  8. package/templates/wevu-tdesign/package.json +1 -1
  9. package/templates/wevu-retail/.editorconfig +0 -9
  10. package/templates/wevu-retail/.vscode/settings.json +0 -10
  11. package/templates/wevu-retail/AGENTS.md +0 -35
  12. package/templates/wevu-retail/README.md +0 -26
  13. package/templates/wevu-retail/auto-import-components.json +0 -1
  14. package/templates/wevu-retail/gitignore +0 -35
  15. package/templates/wevu-retail/package.json +0 -42
  16. package/templates/wevu-retail/postcss.config.js +0 -6
  17. package/templates/wevu-retail/project.config.json +0 -44
  18. package/templates/wevu-retail/project.private.config.json +0 -8
  19. package/templates/wevu-retail/src/app.vue +0 -104
  20. package/templates/wevu-retail/src/common/updateManager.ts +0 -29
  21. package/templates/wevu-retail/src/components/filter/index.vue +0 -134
  22. package/templates/wevu-retail/src/components/filter-popup/index.vue +0 -67
  23. package/templates/wevu-retail/src/components/goods-card/index.vue +0 -219
  24. package/templates/wevu-retail/src/components/goods-list/index.vue +0 -91
  25. package/templates/wevu-retail/src/components/load-more/index.vue +0 -99
  26. package/templates/wevu-retail/src/components/loading-content/index.vue +0 -48
  27. package/templates/wevu-retail/src/components/price/index.vue +0 -104
  28. package/templates/wevu-retail/src/components/promotion/ui-coupon-card/index.vue +0 -143
  29. package/templates/wevu-retail/src/components/promotion/ui-coupon-card/tools.wxs +0 -18
  30. package/templates/wevu-retail/src/components/swipeout/index.vue +0 -118
  31. package/templates/wevu-retail/src/components/swipeout/swipe.wxs +0 -151
  32. package/templates/wevu-retail/src/components/webp-image/index.vue +0 -105
  33. package/templates/wevu-retail/src/components/webp-image/utils.wxs +0 -140
  34. package/templates/wevu-retail/src/config/index.ts +0 -20437
  35. package/templates/wevu-retail/src/custom-tab-bar/data.ts +0 -22
  36. package/templates/wevu-retail/src/custom-tab-bar/index.vue +0 -62
  37. package/templates/wevu-retail/src/model/activities.ts +0 -7
  38. package/templates/wevu-retail/src/model/activity.ts +0 -18
  39. package/templates/wevu-retail/src/model/address.ts +0 -31
  40. package/templates/wevu-retail/src/model/cart.ts +0 -306
  41. package/templates/wevu-retail/src/model/category.ts +0 -175
  42. package/templates/wevu-retail/src/model/comments/queryDetail.ts +0 -50
  43. package/templates/wevu-retail/src/model/comments.ts +0 -298
  44. package/templates/wevu-retail/src/model/coupon.ts +0 -39
  45. package/templates/wevu-retail/src/model/detailsComments.ts +0 -30
  46. package/templates/wevu-retail/src/model/good.ts +0 -1904
  47. package/templates/wevu-retail/src/model/goods.ts +0 -7
  48. package/templates/wevu-retail/src/model/order/applyService.ts +0 -329
  49. package/templates/wevu-retail/src/model/order/orderConfirm.ts +0 -147
  50. package/templates/wevu-retail/src/model/order/orderDetail.ts +0 -1191
  51. package/templates/wevu-retail/src/model/order/orderList.ts +0 -1033
  52. package/templates/wevu-retail/src/model/promotion.ts +0 -20
  53. package/templates/wevu-retail/src/model/search.ts +0 -60
  54. package/templates/wevu-retail/src/model/submitComment.ts +0 -58
  55. package/templates/wevu-retail/src/model/swiper.ts +0 -39
  56. package/templates/wevu-retail/src/model/usercenter.ts +0 -52
  57. package/templates/wevu-retail/src/pages/cart/components/cart-bar/index.vue +0 -104
  58. package/templates/wevu-retail/src/pages/cart/components/cart-empty/index.vue +0 -41
  59. package/templates/wevu-retail/src/pages/cart/components/cart-group/index.vue +0 -333
  60. package/templates/wevu-retail/src/pages/cart/components/cart-group/index.wxs +0 -5
  61. package/templates/wevu-retail/src/pages/cart/components/cart-group/utils.wxs +0 -20
  62. package/templates/wevu-retail/src/pages/cart/components/goods-card/index.vue +0 -334
  63. package/templates/wevu-retail/src/pages/cart/components/specs-popup/index.vue +0 -100
  64. package/templates/wevu-retail/src/pages/cart/index.vue +0 -342
  65. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/README.md +0 -95
  66. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.vue +0 -73
  67. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/index.vue +0 -121
  68. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.vue +0 -74
  69. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-tabbar/index.vue +0 -102
  70. package/templates/wevu-retail/src/pages/category/components/goods-category/index.vue +0 -137
  71. package/templates/wevu-retail/src/pages/category/index.vue +0 -50
  72. package/templates/wevu-retail/src/pages/coupon/components/coupon-card/index.vue +0 -95
  73. package/templates/wevu-retail/src/pages/coupon/components/floating-button/index.vue +0 -44
  74. package/templates/wevu-retail/src/pages/coupon/coupon-activity-goods/index.vue +0 -135
  75. package/templates/wevu-retail/src/pages/coupon/coupon-detail/index.vue +0 -94
  76. package/templates/wevu-retail/src/pages/coupon/coupon-list/index.vue +0 -136
  77. package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/images-videos/assets/play.png +0 -0
  78. package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/images-videos/index.vue +0 -65
  79. package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/my-video/index.vue +0 -92
  80. package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/index.vue +0 -93
  81. package/templates/wevu-retail/src/pages/goods/comments/create/index.vue +0 -196
  82. package/templates/wevu-retail/src/pages/goods/comments/index.vue +0 -293
  83. package/templates/wevu-retail/src/pages/goods/details/components/buy-bar/index.vue +0 -117
  84. package/templates/wevu-retail/src/pages/goods/details/components/goods-specs-popup/index.vue +0 -440
  85. package/templates/wevu-retail/src/pages/goods/details/components/promotion-popup/index.vue +0 -83
  86. package/templates/wevu-retail/src/pages/goods/details/index.vue +0 -598
  87. package/templates/wevu-retail/src/pages/goods/list/index.vue +0 -299
  88. package/templates/wevu-retail/src/pages/goods/result/index.vue +0 -350
  89. package/templates/wevu-retail/src/pages/goods/search/index.vue +0 -196
  90. package/templates/wevu-retail/src/pages/home/home.vue +0 -215
  91. package/templates/wevu-retail/src/pages/home/readme +0 -8
  92. package/templates/wevu-retail/src/pages/order/after-service-detail/api.ts +0 -34
  93. package/templates/wevu-retail/src/pages/order/after-service-detail/index.vue +0 -430
  94. package/templates/wevu-retail/src/pages/order/after-service-list/api.ts +0 -1262
  95. package/templates/wevu-retail/src/pages/order/after-service-list/index.vue +0 -299
  96. package/templates/wevu-retail/src/pages/order/apply-service/index.vue +0 -665
  97. package/templates/wevu-retail/src/pages/order/components/after-service-button-bar/index.vue +0 -142
  98. package/templates/wevu-retail/src/pages/order/components/customer-service/index.vue +0 -75
  99. package/templates/wevu-retail/src/pages/order/components/goods-card/index.vue +0 -356
  100. package/templates/wevu-retail/src/pages/order/components/noGoods/noGood.wxs +0 -17
  101. package/templates/wevu-retail/src/pages/order/components/noGoods/noGoods.vue +0 -125
  102. package/templates/wevu-retail/src/pages/order/components/order-button-bar/index.vue +0 -262
  103. package/templates/wevu-retail/src/pages/order/components/order-card/index.vue +0 -126
  104. package/templates/wevu-retail/src/pages/order/components/order-goods-card/index.vue +0 -86
  105. package/templates/wevu-retail/src/pages/order/components/reason-sheet/index.vue +0 -161
  106. package/templates/wevu-retail/src/pages/order/components/reason-sheet/reasonSheet.ts +0 -25
  107. package/templates/wevu-retail/src/pages/order/components/selectCoupons/mock.ts +0 -22
  108. package/templates/wevu-retail/src/pages/order/components/selectCoupons/selectCoupon.wxs +0 -16
  109. package/templates/wevu-retail/src/pages/order/components/selectCoupons/selectCoupons.vue +0 -207
  110. package/templates/wevu-retail/src/pages/order/components/specs-goods-card/index.vue +0 -185
  111. package/templates/wevu-retail/src/pages/order/config.ts +0 -94
  112. package/templates/wevu-retail/src/pages/order/delivery-detail/index.vue +0 -145
  113. package/templates/wevu-retail/src/pages/order/delivery-detail/isUrl.wxs +0 -7
  114. package/templates/wevu-retail/src/pages/order/fill-tracking-no/api.ts +0 -71
  115. package/templates/wevu-retail/src/pages/order/fill-tracking-no/index.vue +0 -267
  116. package/templates/wevu-retail/src/pages/order/invoice/index.vue +0 -94
  117. package/templates/wevu-retail/src/pages/order/order-confirm/components/address-card/index.vue +0 -78
  118. package/templates/wevu-retail/src/pages/order/order-confirm/getNotes.wxs +0 -11
  119. package/templates/wevu-retail/src/pages/order/order-confirm/handleInvoice.wxs +0 -11
  120. package/templates/wevu-retail/src/pages/order/order-confirm/index.vue +0 -707
  121. package/templates/wevu-retail/src/pages/order/order-confirm/order.wxs +0 -8
  122. package/templates/wevu-retail/src/pages/order/order-confirm/pay.ts +0 -115
  123. package/templates/wevu-retail/src/pages/order/order-detail/index.vue +0 -456
  124. package/templates/wevu-retail/src/pages/order/order-list/index.vue +0 -288
  125. package/templates/wevu-retail/src/pages/order/pay-result/index.vue +0 -77
  126. package/templates/wevu-retail/src/pages/order/receipt/index.vue +0 -336
  127. package/templates/wevu-retail/src/pages/promotion/promotion-detail/index.vue +0 -145
  128. package/templates/wevu-retail/src/pages/user/address/edit/index.vue +0 -514
  129. package/templates/wevu-retail/src/pages/user/address/list/index.vue +0 -249
  130. package/templates/wevu-retail/src/pages/user/components/t-location/index.vue +0 -156
  131. package/templates/wevu-retail/src/pages/user/components/ui-address-item/index.vue +0 -92
  132. package/templates/wevu-retail/src/pages/user/name-edit/index.vue +0 -49
  133. package/templates/wevu-retail/src/pages/user/person-info/index.vue +0 -198
  134. package/templates/wevu-retail/src/pages/usercenter/address/edit/util.ts +0 -33
  135. package/templates/wevu-retail/src/pages/usercenter/components/order-group/index.vue +0 -90
  136. package/templates/wevu-retail/src/pages/usercenter/components/ui-select-picker/index.vue +0 -108
  137. package/templates/wevu-retail/src/pages/usercenter/components/user-center-card/index.vue +0 -82
  138. package/templates/wevu-retail/src/pages/usercenter/index.vue +0 -301
  139. package/templates/wevu-retail/src/services/_utils/delay.ts +0 -3
  140. package/templates/wevu-retail/src/services/_utils/timeout.ts +0 -3
  141. package/templates/wevu-retail/src/services/activity/fetchActivity.ts +0 -20
  142. package/templates/wevu-retail/src/services/activity/fetchActivityList.ts +0 -20
  143. package/templates/wevu-retail/src/services/address/edit.ts +0 -33
  144. package/templates/wevu-retail/src/services/address/fetchAddress.ts +0 -48
  145. package/templates/wevu-retail/src/services/address/list.ts +0 -31
  146. package/templates/wevu-retail/src/services/cart/cart.ts +0 -20
  147. package/templates/wevu-retail/src/services/comments/fetchComments.ts +0 -18
  148. package/templates/wevu-retail/src/services/comments/fetchCommentsCount.ts +0 -18
  149. package/templates/wevu-retail/src/services/coupon/index.ts +0 -65
  150. package/templates/wevu-retail/src/services/good/comments/fetchCommentDetail.ts +0 -20
  151. package/templates/wevu-retail/src/services/good/fetchCategoryList.ts +0 -18
  152. package/templates/wevu-retail/src/services/good/fetchGood.ts +0 -18
  153. package/templates/wevu-retail/src/services/good/fetchGoods.ts +0 -29
  154. package/templates/wevu-retail/src/services/good/fetchGoodsDetailsComments.ts +0 -37
  155. package/templates/wevu-retail/src/services/good/fetchGoodsList.ts +0 -39
  156. package/templates/wevu-retail/src/services/good/fetchSearchHistory.ts +0 -35
  157. package/templates/wevu-retail/src/services/good/fetchSearchResult.ts +0 -38
  158. package/templates/wevu-retail/src/services/home/home.ts +0 -53
  159. package/templates/wevu-retail/src/services/order/applyService.ts +0 -70
  160. package/templates/wevu-retail/src/services/order/orderConfirm.ts +0 -69
  161. package/templates/wevu-retail/src/services/order/orderDetail.ts +0 -39
  162. package/templates/wevu-retail/src/services/order/orderList.ts +0 -39
  163. package/templates/wevu-retail/src/services/order/orderSubmitComment.ts +0 -22
  164. package/templates/wevu-retail/src/services/promotion/detail.ts +0 -18
  165. package/templates/wevu-retail/src/services/usercenter/fetchPerson.ts +0 -28
  166. package/templates/wevu-retail/src/services/usercenter/fetchUsercenter.ts +0 -18
  167. package/templates/wevu-retail/src/sitemap.json +0 -7
  168. package/templates/wevu-retail/src/utils/addressParse.ts +0 -25
  169. package/templates/wevu-retail/src/utils/getPermission.ts +0 -45
  170. package/templates/wevu-retail/src/utils/mock.ts +0 -51
  171. package/templates/wevu-retail/src/utils/util.ts +0 -134
  172. package/templates/wevu-retail/src/vite-env.d.ts +0 -1
  173. package/templates/wevu-retail/tailwind.config.ts +0 -15
  174. package/templates/wevu-retail/tsconfig.app.json +0 -58
  175. package/templates/wevu-retail/tsconfig.json +0 -11
  176. package/templates/wevu-retail/tsconfig.node.json +0 -33
  177. package/templates/wevu-retail/vite.config.ts +0 -14
@@ -1,102 +0,0 @@
1
- <script lang="ts">
2
- Component({
3
- externalClasses: ['custom-class'],
4
-
5
- properties: {
6
- activeKey: {
7
- type: Number,
8
- value: 0,
9
- },
10
- tabList: {
11
- type: Array,
12
- value: [],
13
- },
14
- showMore: Boolean, // 是否需要下拉功能
15
- },
16
- observers: {
17
- activeKey(newVal) {
18
- if (this.properties.tabList && newVal) {
19
- this.setActive(newVal).catch((e) => {
20
- console.error(e);
21
- });
22
- }
23
- },
24
- },
25
-
26
- data: {
27
- currentActive: -1,
28
- },
29
- attached() {
30
- this.setActive(this.properties.activeKey).catch((e) => {
31
- console.error(e);
32
- });
33
- },
34
-
35
- methods: {
36
- setActive(activeKey) {
37
- if (!this.properties.tabList[activeKey] || this.properties.tabList[activeKey].disabled) {
38
- return Promise.reject('数据异常或不可操作');
39
- }
40
- return new Promise((resolve) => {
41
- this.setData(
42
- {
43
- currentActive: activeKey,
44
- },
45
- () => resolve(),
46
- );
47
- });
48
- },
49
- onClick(event) {
50
- let activeKey;
51
- if (event.type === 'select') {
52
- activeKey = event.detail;
53
- } else {
54
- activeKey = event.currentTarget.dataset.index;
55
- }
56
- this.setActive(activeKey)
57
- .then(() => {
58
- const { currentActive } = this.data;
59
- this.triggerEvent('change', { index: currentActive });
60
- })
61
- .catch((e) => {
62
- console.error(e);
63
- });
64
- },
65
- },
66
- });
67
- </script>
68
-
69
- <template>
70
- <view class="c-tabbar custom-class [width:100%] [height:100%] [position:relative] [--tabbar-height:100rpx] [--tabbar-fontsize:28rpx] [--tabbar-background-color:white]">
71
- <scroll-view
72
- wx:if="{{ tabList.length > 0 }}"
73
- class="c-tabbar__scroll [position:relative]"
74
- scroll-x="true"
75
- scroll-into-view="{{ 'id-' + currentActive }}"
76
- >
77
- <view class="c-tabbar__inner {{showMore && tabList.length > 4 ? 'c-tabbar__inner_more' : ''}} [display:flex] [flex-flow:row_nowrap]">
78
- <view
79
- wx:for="{{ tabList }}"
80
- wx:key="index"
81
- id="{{ 'id-' + index }}"
82
- class="c-tabbar-item {{ currentActive === index ? 'active' : '' }} {{ item.disabled ? 'disabled' : '' }} [flex:none] [height:100rpx] [color:#282828] [font-size:28rpx] [padding:0_20rpx] [&_.disabled]:[color:#ccc]"
83
- bind:tap="onClick"
84
- data-index="{{index}}"
85
- >
86
- <view class="c-tabbar-item__text [width:100%] [text-align:center] [height:100rpx] [line-height:100rpx]"> {{ item.name }} </view>
87
- </view>
88
- </view>
89
- </scroll-view>
90
- <c-tabbar-more wx:if="{{ showMore && tabList.length > 4 }}" tabList="{{tabList}}" bindselect="onClick" />
91
- <slot />
92
- </view>
93
- </template>
94
-
95
- <json>
96
- {
97
- "component": true,
98
- "usingComponents": {
99
- "c-tabbar-more": "./c-tabbar-more/index"
100
- }
101
- }
102
- </json>
@@ -1,137 +0,0 @@
1
- <script lang="ts">
2
- Component({
3
- externalClasses: ['custom-class'],
4
-
5
- properties: {
6
- category: {
7
- type: Array,
8
- },
9
- initActive: {
10
- type: Array,
11
- value: [],
12
- observer(newVal, oldVal) {
13
- if (newVal[0] !== oldVal[0]) {
14
- this.setActiveKey(newVal[0], 0);
15
- }
16
- },
17
- },
18
- isSlotRight: {
19
- type: Boolean,
20
- value: false,
21
- },
22
- level: {
23
- type: Number,
24
- value: 3,
25
- },
26
- },
27
- data: {
28
- activeKey: 0,
29
- subActiveKey: 0,
30
- },
31
- attached() {
32
- if (this.properties.initActive && this.properties.initActive.length > 0) {
33
- this.setData({
34
- activeKey: this.properties.initActive[0],
35
- subActiveKey: this.properties.initActive[1] || 0,
36
- });
37
- }
38
- },
39
- methods: {
40
- onParentChange(event) {
41
- this.setActiveKey(event.detail.index, 0).then(() => {
42
- this.triggerEvent('change', [this.data.activeKey, this.data.subActiveKey]);
43
- });
44
- },
45
- onChildChange(event) {
46
- this.setActiveKey(this.data.activeKey, event.detail.index).then(() => {
47
- this.triggerEvent('change', [this.data.activeKey, this.data.subActiveKey]);
48
- });
49
- },
50
- changCategory(event) {
51
- const { item } = event.currentTarget.dataset;
52
- this.triggerEvent('changeCategory', {
53
- item,
54
- });
55
- },
56
- setActiveKey(key, subKey) {
57
- return new Promise((resolve) => {
58
- this.setData(
59
- {
60
- activeKey: key,
61
- subActiveKey: subKey,
62
- },
63
- () => {
64
- resolve();
65
- },
66
- );
67
- });
68
- },
69
- },
70
- });
71
- </script>
72
-
73
- <template>
74
- <view class="goods-category custom-class [display:flex] [&_.custom-sidebar]:[background-color:#f5f5f5]">
75
- <c-sidebar custom-class="custom-sidebar [height:100%] [width:180rpx] [height:100vh]" bindchange="onParentChange" activeKey="{{activeKey}}">
76
- <c-sidebar-item wx:for="{{ category }}" wx:key="index" title="{{ item.name }}" disabled="{{ item.disabled }}" />
77
- </c-sidebar>
78
- <view class="goods-category__right [height:100%] [flex:auto] [width:0] [position:relative] [overflow:scroll] [-webkit-overflow-scrolling:touch] [background-color:white] [display:flex]">
79
- <c-tabbar wx:if="{{isSlotRight}}" activeKey="{{subActiveKey}}" bindchange="onChildChange" showMore>
80
- <slot />
81
- </c-tabbar>
82
- <view wx:if="{{!isSlotRight}}" class="goods-category-normal [margin:28rpx_34rpx_0rpx_32rpx]">
83
- <view
84
- class="goods-category-normal-item"
85
- wx:if="{{category[activeKey].children && category[activeKey].children.length > 0}}"
86
- >
87
- <block
88
- wx:for="{{category[activeKey].children}}"
89
- wx:key="index"
90
- wx:if="{{level === 3 && item.children && item.children.length > 0}}"
91
- >
92
- <view class="flex goods-category-normal-item-title [display:flex] [font-size:28rpx] [font-weight:500]"> {{item.name}} </view>
93
- <view class="goods-category-normal-item-container [background-color:#fff] [border-radius:8rpx] [padding-top:28rpx] [margin-top:-24rpx] [margin-bottom:30rpx] [display:flex] [flex-wrap:wrap]">
94
- <view
95
- class="goods-category-normal-item-container-item [height:196rpx] [display:flex] [flex-direction:column] [align-items:center] [margin-top:24rpx] [width:33.3%] [&_.image]:[width:144rpx] [&_.image]:[height:144rpx]"
96
- wx:for="{{item.children}}"
97
- wx:for-index="subIndex"
98
- wx:key="subIndex"
99
- wx:for-item="subItem"
100
- bindtap="changCategory"
101
- data-item="{{subItem}}"
102
- >
103
- <t-image src="{{subItem.thumbnail}}" t-class="image" />
104
- <view class="flex goods-category-normal-item-container-item-title [display:flex] [justify-content:center] [font-size:24rpx] [color:#666666] [margin-top:20rpx]"> {{subItem.name}} </view>
105
- </view>
106
- </view>
107
- </block>
108
- <view class="goods-category-normal-item-second-container [background-color:#fff] [border-radius:8rpx] [margin-top:8rpx] [margin-bottom:30rpx] [display:grid] [grid-template-columns:33.33%_33.33%_33.33%]" wx:if="{{level === 2}}">
109
- <block wx:for="{{category[activeKey].children}}" wx:key="index">
110
- <view
111
- class="goods-category-normal-item-second-container-item [height:200rpx] [text-align:center] [margin-top:20rpx] [&_.image]:[width:144rpx] [&_.image]:[height:144rpx]"
112
- wx:for-key="index"
113
- bindtap="changCategory"
114
- data-item="{{item}}"
115
- >
116
- <t-image src="{{item.thumbnail}}" t-class="image" />
117
- <view class="flex goods-category-normal-item-container-item-title [display:flex] [justify-content:center] [font-size:24rpx] [color:#666666] [margin-top:20rpx]"> {{item.name}} </view>
118
- </view>
119
- </block>
120
- </view>
121
- </view>
122
- </view>
123
- </view>
124
- </view>
125
- </template>
126
-
127
- <json>
128
- {
129
- "component": true,
130
- "usingComponents": {
131
- "c-tabbar": "./components/c-tabbar/index",
132
- "c-sidebar": "./components/c-sidebar/index",
133
- "c-sidebar-item": "./components/c-sidebar/c-sidebar-item/index",
134
- "t-image": "/components/webp-image/index"
135
- }
136
- }
137
- </json>
@@ -1,50 +0,0 @@
1
- <script lang="ts">
2
- import { getCategoryList } from '../../services/good/fetchCategoryList';
3
- Page({
4
- data: {
5
- list: [],
6
- },
7
- async init() {
8
- try {
9
- const result = await getCategoryList();
10
- this.setData({
11
- list: result,
12
- });
13
- } catch (error) {
14
- console.error('err:', error);
15
- }
16
- },
17
-
18
- onShow() {
19
- this.getTabBar().init();
20
- },
21
- onChange() {
22
- wx.navigateTo({
23
- url: '/pages/goods/list/index',
24
- });
25
- },
26
- onLoad() {
27
- this.init(true);
28
- },
29
- });
30
- </script>
31
-
32
- <template>
33
- <view class="wrap [height:100vh] [overflow:hidden]">
34
- <goods-category
35
- level="{{3}}"
36
- custom-class="goods-category-class ![background-color:#f6f6f6] [height:100%] [&_.goods-category-normal-item-container-item]:[margin-top:20rpx]"
37
- category="{{list}}"
38
- bind:changeCategory="onChange"
39
- />
40
- </view>
41
- </template>
42
-
43
- <json>
44
- {
45
- "navigationBarTitleText": "分类",
46
- "usingComponents": {
47
- "goods-category": "./components/goods-category/index"
48
- }
49
- }
50
- </json>
@@ -1,95 +0,0 @@
1
- <script lang="ts">
2
- const statusMap = {
3
- default: { text: '去使用', theme: 'primary' },
4
- useless: { text: '已使用', theme: 'default' },
5
- disabled: { text: '已过期', theme: 'default' },
6
- };
7
- Component({
8
- options: {
9
- addGlobalClass: true,
10
- multipleSlots: true, // 在组件定义时的选项中启用多slot支持
11
- },
12
-
13
- externalClasses: ['coupon-class'],
14
-
15
- properties: {
16
- couponDTO: {
17
- type: Object,
18
- value: {}, // 优惠券数据
19
- },
20
- },
21
-
22
- data: {
23
- btnText: '',
24
- btnTheme: '',
25
- },
26
-
27
- observers: {
28
- couponDTO: function (couponDTO) {
29
- if (!couponDTO) {
30
- return;
31
- }
32
- const statusInfo = statusMap[couponDTO.status];
33
-
34
- this.setData({
35
- btnText: statusInfo.text,
36
- btnTheme: statusInfo.theme,
37
- });
38
- },
39
- },
40
-
41
- attached() {},
42
-
43
- methods: {
44
- // 跳转到详情页
45
- gotoDetail() {
46
- wx.navigateTo({
47
- url: `/pages/coupon/coupon-detail/index?id=${this.data.couponDTO.key}`,
48
- });
49
- },
50
-
51
- // 跳转到商品列表
52
- gotoGoodsList() {
53
- wx.navigateTo({
54
- url: `/pages/coupon/coupon-activity-goods/index?id=${this.data.couponDTO.key}`,
55
- });
56
- },
57
- },
58
- });
59
- </script>
60
-
61
- <template>
62
- <ui-coupon-card
63
- title="{{couponDTO.title || ''}}"
64
- type="{{couponDTO.type || ''}}"
65
- value="{{couponDTO.value || '0'}}"
66
- tag="{{couponDTO.tag || ''}}"
67
- desc="{{couponDTO.desc || ''}}"
68
- currency="{{couponDTO.currency || ''}}"
69
- timeLimit="{{couponDTO.timeLimit || ''}}"
70
- status="{{couponDTO.status || ''}}"
71
- bind:tap="gotoDetail"
72
- >
73
- <view slot="operator" class="coupon-btn-slot">
74
- <t-button
75
- t-class="coupon-btn-{{btnTheme}}"
76
- theme="{{btnTheme}}"
77
- variant="outline"
78
- shape="round"
79
- size="extra-small"
80
- bind:tap="gotoGoodsList"
81
- >{{btnText}}
82
- </t-button>
83
- </view>
84
- </ui-coupon-card>
85
- </template>
86
-
87
- <json>
88
- {
89
- "component": true,
90
- "usingComponents": {
91
- "ui-coupon-card": "/components/promotion/ui-coupon-card/index",
92
- "t-button": "tdesign-miniprogram/button/button"
93
- }
94
- }
95
- </json>
@@ -1,44 +0,0 @@
1
- <script lang="ts">
2
- Component({
3
- data: { icon: 'cart' },
4
-
5
- properties: {
6
- count: {
7
- type: Number,
8
- },
9
- },
10
-
11
- methods: {
12
- goToCart() {
13
- wx.switchTab({
14
- url: '/pages/cart/index',
15
- });
16
- },
17
- },
18
- });
19
- </script>
20
-
21
- <template>
22
- <view class="floating-button [position:fixed] [right:20rpx] [bottom:108rpx] [&_.floating-inner-container]:[display:flex] [&_.floating-inner-container]:[align-items:center] [&_.floating-inner-container]:[justify-content:center] [&_.floating-inner-container]:[height:96rpx] [&_.floating-inner-container]:[width:96rpx] [&_.floating-inner-container]:[background-color:rgba(0,_0,_0,_0.8)] [&_.floating-inner-container]:[opacity:0.7] [&_.floating-inner-container]:[border-radius:48rpx] [&_.floating-right-top]:[position:absolute] [&_.floating-right-top]:[right:0rpx] [&_.floating-right-top]:[top:0rpx] [&_.floating-right-top]:[height:28rpx] [&_.floating-right-top]:[background:#fa4126] [&_.floating-right-top]:[border-radius:64rpx] [&_.floating-right-top]:[font-weight:bold] [&_.floating-right-top]:[font-size:22rpx] [&_.floating-right-top]:[line-height:28rpx] [&_.floating-right-top]:[color:#fff] [&_.floating-right-top]:[padding:0_8rpx]" bind:tap="goToCart">
23
- <view class="floating-inner-container">
24
- <t-icon
25
- prefix="wr"
26
- name="{{icon}}"
27
- size="42rpx"
28
- color="#FFFFFF"
29
- />
30
- </view>
31
- <view class="floating-right-top">
32
- {{count}}
33
- </view>
34
- </view>
35
-
36
- </template>
37
-
38
- <json>
39
- {
40
- "component": true,
41
- "usingComponents": {
42
- "t-icon": "tdesign-miniprogram/icon/icon"
43
- }
44
- }</json>
@@ -1,135 +0,0 @@
1
- <script lang="ts">
2
- import { fetchCouponDetail } from '../../../services/coupon/index';
3
- import { fetchGoodsList } from '../../../services/good/fetchGoods';
4
- import Toast from 'tdesign-miniprogram/toast/index';
5
-
6
- Page({
7
- data: {
8
- goods: [],
9
- detail: {},
10
- couponTypeDesc: '',
11
- showStoreInfoList: false,
12
- cartNum: 2,
13
- },
14
-
15
- id: '',
16
-
17
- onLoad(query) {
18
- const id = parseInt(query.id);
19
- this.id = id;
20
-
21
- this.getCouponDetail(id);
22
- this.getGoodsList(id);
23
- },
24
-
25
- getCouponDetail(id) {
26
- fetchCouponDetail(id).then(({ detail }) => {
27
- this.setData({ detail });
28
- if (detail.type === 2) {
29
- if (detail.base > 0) {
30
- this.setData({
31
- couponTypeDesc: `满${detail.base / 100}元${detail.value}折`,
32
- });
33
- } else {
34
- this.setData({ couponTypeDesc: `${detail.value}折` });
35
- }
36
- } else if (detail.type === 1) {
37
- if (detail.base > 0) {
38
- this.setData({
39
- couponTypeDesc: `满${detail.base / 100}元减${detail.value / 100}元`,
40
- });
41
- } else {
42
- this.setData({ couponTypeDesc: `减${detail.value / 100}元` });
43
- }
44
- }
45
- });
46
- },
47
-
48
- getGoodsList(id) {
49
- fetchGoodsList(id).then((goods) => {
50
- this.setData({ goods });
51
- });
52
- },
53
-
54
- openStoreList() {
55
- this.setData({
56
- showStoreInfoList: true,
57
- });
58
- },
59
-
60
- closeStoreList() {
61
- this.setData({
62
- showStoreInfoList: false,
63
- });
64
- },
65
-
66
- goodClickHandle(e) {
67
- const { index } = e.detail;
68
- const { spuId } = this.data.goods[index];
69
- wx.navigateTo({ url: `/pages/goods/details/index?spuId=${spuId}` });
70
- },
71
-
72
- cartClickHandle() {
73
- Toast({
74
- context: this,
75
- selector: '#t-toast',
76
- message: '点击加入购物车',
77
- });
78
- },
79
- });
80
- </script>
81
-
82
- <template>
83
- <view class="coupon-page-container [&_.notice-bar-content]:[display:flex] [&_.notice-bar-content]:[flex-direction:row] [&_.notice-bar-content]:[align-items:center] [&_.notice-bar-content]:[padding:8rpx_0] [&_.notice-bar-text]:[font-size:26rpx] [&_.notice-bar-text]:[line-height:36rpx] [&_.notice-bar-text]:[font-weight:400] [&_.notice-bar-text]:[color:#666666] [&_.notice-bar-text]:[margin-left:24rpx] [&_.notice-bar-text]:[margin-right:12rpx] [&_.notice-bar-text_.height-light]:[color:#fa550f] [&_.popup-content-wrap]:[background-color:#fff] [&_.popup-content-wrap]:[border-top-left-radius:20rpx] [&_.popup-content-wrap]:[border-top-right-radius:20rpx] [&_.popup-content-title]:[font-size:32rpx] [&_.popup-content-title]:[color:#333] [&_.popup-content-title]:[text-align:center] [&_.popup-content-title]:[height:104rpx] [&_.popup-content-title]:[line-height:104rpx] [&_.popup-content-title]:[position:relative] [&_.desc-group-wrap]:[padding-bottom:env(safe-area-inset-bottom)] [&_.desc-group-wrap_.item-wrap]:[margin:0_30rpx_30rpx] [&_.desc-group-wrap_.item-title]:[font-size:26rpx] [&_.desc-group-wrap_.item-title]:[color:#333] [&_.desc-group-wrap_.item-title]:[font-weight:500] [&_.desc-group-wrap_.item-label]:[font-size:24rpx] [&_.desc-group-wrap_.item-label]:[color:#666] [&_.desc-group-wrap_.item-label]:[margin-top:12rpx] [&_.desc-group-wrap_.item-label]:[white-space:pre-line] [&_.desc-group-wrap_.item-label]:[word-break:break-all] [&_.desc-group-wrap_.item-label]:[line-height:34rpx] [&_.goods-list-container]:[margin:0_24rpx_24rpx] [&_.goods-list-wrap]:[background:#f5f5f5]">
84
- <view class="notice-bar-content">
85
- <view class="notice-bar-text">
86
- 以下商品可使用
87
- <text class="height-light">{{couponTypeDesc}}</text>
88
- 优惠券
89
- </view>
90
- <t-icon name="help-circle" size="32rpx" color="#AAAAAA" bind:tap="openStoreList" />
91
- </view>
92
- <view class="goods-list-container">
93
- <goods-list
94
- wr-class="goods-list-wrap"
95
- goodsList="{{goods}}"
96
- bind:click="goodClickHandle"
97
- bind:addcart="cartClickHandle"
98
- />
99
- </view>
100
- <floating-button count="{{cartNum}}" />
101
- <t-popup visible="{{showStoreInfoList}}" placement="bottom" bind:visible-change="closeStoreList">
102
- <t-icon slot="closeBtn" name="close" size="40rpx" bind:tap="closeStoreList" />
103
- <view class="popup-content-wrap">
104
- <view class="popup-content-title"> 规则详情 </view>
105
- <view class="desc-group-wrap">
106
- <view wx:if="{{detail && detail.timeLimit}}" class="item-wrap">
107
- <view class="item-title">优惠券有效时间</view>
108
- <view class="item-label">{{detail.timeLimit}}</view>
109
- </view>
110
- <view wx:if="{{detail && detail.desc}}" class="item-wrap">
111
- <view class="item-title">优惠券说明</view>
112
- <view class="item-label">{{detail.desc}}</view>
113
- </view>
114
- <view wx:if="{{detail && detail.useNotes}}" class="item-wrap">
115
- <view class="item-title">使用须知</view>
116
- <view class="item-label">{{detail.useNotes}}</view>
117
- </view>
118
- </view>
119
- </view>
120
- </t-popup>
121
- </view>
122
- <t-toast id="t-toast" />
123
- </template>
124
-
125
- <json>
126
- {
127
- "navigationBarTitleText": "活动商品",
128
- "usingComponents": {
129
- "t-icon": "tdesign-miniprogram/icon/icon",
130
- "t-popup": "tdesign-miniprogram/popup/popup",
131
- "t-toast": "tdesign-miniprogram/toast/toast",
132
- "goods-list": "/components/goods-list/index",
133
- "floating-button": "../components/floating-button/index"
134
- }
135
- }</json>
@@ -1,94 +0,0 @@
1
- <script lang="ts">
2
- import { fetchCouponDetail } from '../../../services/coupon/index';
3
-
4
- Page({
5
- data: {
6
- detail: null,
7
- storeInfoList: [],
8
- storeInfoStr: '',
9
- showStoreInfoList: false,
10
- },
11
-
12
- id: '',
13
-
14
- onLoad(query) {
15
- const id = parseInt(query.id);
16
- this.id = id;
17
- this.getGoodsList(id);
18
- },
19
-
20
- getGoodsList(id) {
21
- fetchCouponDetail(id).then(({ detail }) => {
22
- this.setData({
23
- detail,
24
- });
25
- });
26
- },
27
-
28
- navGoodListHandle() {
29
- wx.navigateTo({
30
- url: `/pages/coupon/coupon-activity-goods/index?id=${this.id}`,
31
- });
32
- },
33
- });
34
- </script>
35
-
36
- <template>
37
- <!-- 优惠券 -->
38
- <view class="coupon-card-wrap [background-color:#fff] [padding:32rpx_32rpx_1rpx]">
39
- <coupon-card couponDTO="{{detail}}" />
40
- </view>
41
- <!-- 说明 -->
42
- <view class="desc-wrap [margin-top:24rpx] [&_.button-wrap]:[margin:50rpx_32rpx_0]">
43
- <t-cell-group t-class="desc-group-wrap [border-radius:8rpx] [overflow:hidden] [--cell-label-font-size:26rpx] [--cell-label-line-height:36rpx] [--cell-label-color:#999] [&_.t-class-cell]:[align-items:flex-start] [&_.t-class-title]:[font-size:26rpx] [&_.t-class-title]:[width:140rpx] [&_.t-class-title]:[flex:none] [&_.t-class-title]:[color:#888] [&_.t-class-note]:[font-size:26rpx] [&_.t-class-note]:[word-break:break-all] [&_.t-class-note]:[white-space:pre-line] [&_.t-class-note]:[justify-content:flex-start] [&_.t-class-note]:[color:#333] [&_.t-class-note]:[width:440rpx] [&_.in-popup]:[border-radius:0] [&_.in-popup]:[overflow:auto] [&_.in-popup]:[max-height:828rpx] [&_.wr-cell__title]:[color:#333] [&_.wr-cell__title]:[font-size:28rpx]">
44
- <t-cell
45
- wx:if="{{detail && detail.desc}}"
46
- t-class="t-class-cell"
47
- t-class-title="t-class-title"
48
- t-class-note="t-class-note"
49
- title="规则说明"
50
- note="{{detail && detail.desc}}"
51
- />
52
- <t-cell
53
- wx:if="{{detail && detail.timeLimit}}"
54
- t-class="t-class-cell"
55
- t-class-title="t-class-title"
56
- t-class-note="t-class-note"
57
- title="有效时间"
58
- note="{{detail && detail.timeLimit}}"
59
- />
60
- <t-cell
61
- wx:if="{{detail && detail.storeAdapt}}"
62
- t-class="t-class-cell"
63
- t-class-title="t-class-title"
64
- t-class-note="t-class-note"
65
- title="适用范围"
66
- note="{{detail && detail.storeAdapt}}"
67
- />
68
- <t-cell
69
- wx:if="{{detail && detail.useNotes}}"
70
- t-class="t-class-cell"
71
- t-class-title="t-class-title"
72
- t-class-note="t-class-note"
73
- title="使用须知"
74
- note="{{detail && detail.useNotes}}"
75
- />
76
- </t-cell-group>
77
- <!-- 查看可用商品 -->
78
- <view class="button-wrap">
79
- <t-button shape="round" block bindtap="navGoodListHandle"> 查看可用商品 </t-button>
80
- </view>
81
- </view>
82
- </template>
83
-
84
- <json>
85
- {
86
- "navigationBarTitleText": "优惠券详情",
87
- "usingComponents": {
88
- "coupon-card": "../components/coupon-card/index",
89
- "t-cell": "tdesign-miniprogram/cell/cell",
90
- "t-cell-group": "tdesign-miniprogram/cell-group/cell-group",
91
- "t-button": "tdesign-miniprogram/button/button",
92
- "t-icon": "tdesign-miniprogram/icon/icon"
93
- }
94
- }</json>