create-weapp-vite 2.0.31 → 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.
Files changed (175) hide show
  1. package/README.md +1 -0
  2. package/dist/{chunk-FGMHC2DJ.js → chunk-IT75MAH3.js} +3 -2
  3. package/dist/cli.js +5 -1
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +1 -1
  6. package/package.json +1 -1
  7. package/templates/wevu-retail/.editorconfig +9 -0
  8. package/templates/wevu-retail/.vscode/settings.json +10 -0
  9. package/templates/wevu-retail/AGENTS.md +35 -0
  10. package/templates/wevu-retail/README.md +26 -0
  11. package/templates/wevu-retail/auto-import-components.json +1 -0
  12. package/templates/wevu-retail/gitignore +35 -0
  13. package/templates/wevu-retail/package.json +42 -0
  14. package/templates/wevu-retail/postcss.config.js +6 -0
  15. package/templates/wevu-retail/project.config.json +44 -0
  16. package/templates/wevu-retail/project.private.config.json +8 -0
  17. package/templates/wevu-retail/src/app.vue +104 -0
  18. package/templates/wevu-retail/src/common/updateManager.ts +29 -0
  19. package/templates/wevu-retail/src/components/filter/index.vue +134 -0
  20. package/templates/wevu-retail/src/components/filter-popup/index.vue +67 -0
  21. package/templates/wevu-retail/src/components/goods-card/index.vue +219 -0
  22. package/templates/wevu-retail/src/components/goods-list/index.vue +91 -0
  23. package/templates/wevu-retail/src/components/load-more/index.vue +99 -0
  24. package/templates/wevu-retail/src/components/loading-content/index.vue +48 -0
  25. package/templates/wevu-retail/src/components/price/index.vue +104 -0
  26. package/templates/wevu-retail/src/components/promotion/ui-coupon-card/index.vue +143 -0
  27. package/templates/wevu-retail/src/components/promotion/ui-coupon-card/tools.wxs +18 -0
  28. package/templates/wevu-retail/src/components/swipeout/index.vue +118 -0
  29. package/templates/wevu-retail/src/components/swipeout/swipe.wxs +151 -0
  30. package/templates/wevu-retail/src/components/webp-image/index.vue +105 -0
  31. package/templates/wevu-retail/src/components/webp-image/utils.wxs +140 -0
  32. package/templates/wevu-retail/src/config/index.ts +20437 -0
  33. package/templates/wevu-retail/src/custom-tab-bar/data.ts +22 -0
  34. package/templates/wevu-retail/src/custom-tab-bar/index.vue +62 -0
  35. package/templates/wevu-retail/src/model/activities.ts +7 -0
  36. package/templates/wevu-retail/src/model/activity.ts +18 -0
  37. package/templates/wevu-retail/src/model/address.ts +31 -0
  38. package/templates/wevu-retail/src/model/cart.ts +306 -0
  39. package/templates/wevu-retail/src/model/category.ts +175 -0
  40. package/templates/wevu-retail/src/model/comments/queryDetail.ts +50 -0
  41. package/templates/wevu-retail/src/model/comments.ts +298 -0
  42. package/templates/wevu-retail/src/model/coupon.ts +39 -0
  43. package/templates/wevu-retail/src/model/detailsComments.ts +30 -0
  44. package/templates/wevu-retail/src/model/good.ts +1904 -0
  45. package/templates/wevu-retail/src/model/goods.ts +7 -0
  46. package/templates/wevu-retail/src/model/order/applyService.ts +329 -0
  47. package/templates/wevu-retail/src/model/order/orderConfirm.ts +147 -0
  48. package/templates/wevu-retail/src/model/order/orderDetail.ts +1191 -0
  49. package/templates/wevu-retail/src/model/order/orderList.ts +1033 -0
  50. package/templates/wevu-retail/src/model/promotion.ts +20 -0
  51. package/templates/wevu-retail/src/model/search.ts +60 -0
  52. package/templates/wevu-retail/src/model/submitComment.ts +58 -0
  53. package/templates/wevu-retail/src/model/swiper.ts +39 -0
  54. package/templates/wevu-retail/src/model/usercenter.ts +52 -0
  55. package/templates/wevu-retail/src/pages/cart/components/cart-bar/index.vue +104 -0
  56. package/templates/wevu-retail/src/pages/cart/components/cart-empty/index.vue +41 -0
  57. package/templates/wevu-retail/src/pages/cart/components/cart-group/index.vue +333 -0
  58. package/templates/wevu-retail/src/pages/cart/components/cart-group/index.wxs +5 -0
  59. package/templates/wevu-retail/src/pages/cart/components/cart-group/utils.wxs +20 -0
  60. package/templates/wevu-retail/src/pages/cart/components/goods-card/index.vue +334 -0
  61. package/templates/wevu-retail/src/pages/cart/components/specs-popup/index.vue +100 -0
  62. package/templates/wevu-retail/src/pages/cart/index.vue +342 -0
  63. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/README.md +95 -0
  64. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.vue +73 -0
  65. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/index.vue +121 -0
  66. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.vue +74 -0
  67. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-tabbar/index.vue +102 -0
  68. package/templates/wevu-retail/src/pages/category/components/goods-category/index.vue +137 -0
  69. package/templates/wevu-retail/src/pages/category/index.vue +50 -0
  70. package/templates/wevu-retail/src/pages/coupon/components/coupon-card/index.vue +95 -0
  71. package/templates/wevu-retail/src/pages/coupon/components/floating-button/index.vue +44 -0
  72. package/templates/wevu-retail/src/pages/coupon/coupon-activity-goods/index.vue +135 -0
  73. package/templates/wevu-retail/src/pages/coupon/coupon-detail/index.vue +94 -0
  74. package/templates/wevu-retail/src/pages/coupon/coupon-list/index.vue +136 -0
  75. package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/images-videos/assets/play.png +0 -0
  76. package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/images-videos/index.vue +65 -0
  77. package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/my-video/index.vue +92 -0
  78. package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/index.vue +93 -0
  79. package/templates/wevu-retail/src/pages/goods/comments/create/index.vue +196 -0
  80. package/templates/wevu-retail/src/pages/goods/comments/index.vue +293 -0
  81. package/templates/wevu-retail/src/pages/goods/details/components/buy-bar/index.vue +117 -0
  82. package/templates/wevu-retail/src/pages/goods/details/components/goods-specs-popup/index.vue +440 -0
  83. package/templates/wevu-retail/src/pages/goods/details/components/promotion-popup/index.vue +83 -0
  84. package/templates/wevu-retail/src/pages/goods/details/index.vue +598 -0
  85. package/templates/wevu-retail/src/pages/goods/list/index.vue +299 -0
  86. package/templates/wevu-retail/src/pages/goods/result/index.vue +350 -0
  87. package/templates/wevu-retail/src/pages/goods/search/index.vue +196 -0
  88. package/templates/wevu-retail/src/pages/home/home.vue +215 -0
  89. package/templates/wevu-retail/src/pages/home/readme +8 -0
  90. package/templates/wevu-retail/src/pages/order/after-service-detail/api.ts +34 -0
  91. package/templates/wevu-retail/src/pages/order/after-service-detail/index.vue +430 -0
  92. package/templates/wevu-retail/src/pages/order/after-service-list/api.ts +1262 -0
  93. package/templates/wevu-retail/src/pages/order/after-service-list/index.vue +299 -0
  94. package/templates/wevu-retail/src/pages/order/apply-service/index.vue +665 -0
  95. package/templates/wevu-retail/src/pages/order/components/after-service-button-bar/index.vue +142 -0
  96. package/templates/wevu-retail/src/pages/order/components/customer-service/index.vue +75 -0
  97. package/templates/wevu-retail/src/pages/order/components/goods-card/index.vue +356 -0
  98. package/templates/wevu-retail/src/pages/order/components/noGoods/noGood.wxs +17 -0
  99. package/templates/wevu-retail/src/pages/order/components/noGoods/noGoods.vue +125 -0
  100. package/templates/wevu-retail/src/pages/order/components/order-button-bar/index.vue +262 -0
  101. package/templates/wevu-retail/src/pages/order/components/order-card/index.vue +126 -0
  102. package/templates/wevu-retail/src/pages/order/components/order-goods-card/index.vue +86 -0
  103. package/templates/wevu-retail/src/pages/order/components/reason-sheet/index.vue +161 -0
  104. package/templates/wevu-retail/src/pages/order/components/reason-sheet/reasonSheet.ts +25 -0
  105. package/templates/wevu-retail/src/pages/order/components/selectCoupons/mock.ts +22 -0
  106. package/templates/wevu-retail/src/pages/order/components/selectCoupons/selectCoupon.wxs +16 -0
  107. package/templates/wevu-retail/src/pages/order/components/selectCoupons/selectCoupons.vue +207 -0
  108. package/templates/wevu-retail/src/pages/order/components/specs-goods-card/index.vue +185 -0
  109. package/templates/wevu-retail/src/pages/order/config.ts +94 -0
  110. package/templates/wevu-retail/src/pages/order/delivery-detail/index.vue +145 -0
  111. package/templates/wevu-retail/src/pages/order/delivery-detail/isUrl.wxs +7 -0
  112. package/templates/wevu-retail/src/pages/order/fill-tracking-no/api.ts +71 -0
  113. package/templates/wevu-retail/src/pages/order/fill-tracking-no/index.vue +267 -0
  114. package/templates/wevu-retail/src/pages/order/invoice/index.vue +94 -0
  115. package/templates/wevu-retail/src/pages/order/order-confirm/components/address-card/index.vue +78 -0
  116. package/templates/wevu-retail/src/pages/order/order-confirm/getNotes.wxs +11 -0
  117. package/templates/wevu-retail/src/pages/order/order-confirm/handleInvoice.wxs +11 -0
  118. package/templates/wevu-retail/src/pages/order/order-confirm/index.vue +707 -0
  119. package/templates/wevu-retail/src/pages/order/order-confirm/order.wxs +8 -0
  120. package/templates/wevu-retail/src/pages/order/order-confirm/pay.ts +115 -0
  121. package/templates/wevu-retail/src/pages/order/order-detail/index.vue +456 -0
  122. package/templates/wevu-retail/src/pages/order/order-list/index.vue +288 -0
  123. package/templates/wevu-retail/src/pages/order/pay-result/index.vue +77 -0
  124. package/templates/wevu-retail/src/pages/order/receipt/index.vue +336 -0
  125. package/templates/wevu-retail/src/pages/promotion/promotion-detail/index.vue +145 -0
  126. package/templates/wevu-retail/src/pages/user/address/edit/index.vue +514 -0
  127. package/templates/wevu-retail/src/pages/user/address/list/index.vue +249 -0
  128. package/templates/wevu-retail/src/pages/user/components/t-location/index.vue +156 -0
  129. package/templates/wevu-retail/src/pages/user/components/ui-address-item/index.vue +92 -0
  130. package/templates/wevu-retail/src/pages/user/name-edit/index.vue +49 -0
  131. package/templates/wevu-retail/src/pages/user/person-info/index.vue +198 -0
  132. package/templates/wevu-retail/src/pages/usercenter/address/edit/util.ts +33 -0
  133. package/templates/wevu-retail/src/pages/usercenter/components/order-group/index.vue +90 -0
  134. package/templates/wevu-retail/src/pages/usercenter/components/ui-select-picker/index.vue +108 -0
  135. package/templates/wevu-retail/src/pages/usercenter/components/user-center-card/index.vue +82 -0
  136. package/templates/wevu-retail/src/pages/usercenter/index.vue +301 -0
  137. package/templates/wevu-retail/src/services/_utils/delay.ts +3 -0
  138. package/templates/wevu-retail/src/services/_utils/timeout.ts +3 -0
  139. package/templates/wevu-retail/src/services/activity/fetchActivity.ts +20 -0
  140. package/templates/wevu-retail/src/services/activity/fetchActivityList.ts +20 -0
  141. package/templates/wevu-retail/src/services/address/edit.ts +33 -0
  142. package/templates/wevu-retail/src/services/address/fetchAddress.ts +48 -0
  143. package/templates/wevu-retail/src/services/address/list.ts +31 -0
  144. package/templates/wevu-retail/src/services/cart/cart.ts +20 -0
  145. package/templates/wevu-retail/src/services/comments/fetchComments.ts +18 -0
  146. package/templates/wevu-retail/src/services/comments/fetchCommentsCount.ts +18 -0
  147. package/templates/wevu-retail/src/services/coupon/index.ts +65 -0
  148. package/templates/wevu-retail/src/services/good/comments/fetchCommentDetail.ts +20 -0
  149. package/templates/wevu-retail/src/services/good/fetchCategoryList.ts +18 -0
  150. package/templates/wevu-retail/src/services/good/fetchGood.ts +18 -0
  151. package/templates/wevu-retail/src/services/good/fetchGoods.ts +29 -0
  152. package/templates/wevu-retail/src/services/good/fetchGoodsDetailsComments.ts +37 -0
  153. package/templates/wevu-retail/src/services/good/fetchGoodsList.ts +39 -0
  154. package/templates/wevu-retail/src/services/good/fetchSearchHistory.ts +35 -0
  155. package/templates/wevu-retail/src/services/good/fetchSearchResult.ts +38 -0
  156. package/templates/wevu-retail/src/services/home/home.ts +53 -0
  157. package/templates/wevu-retail/src/services/order/applyService.ts +70 -0
  158. package/templates/wevu-retail/src/services/order/orderConfirm.ts +69 -0
  159. package/templates/wevu-retail/src/services/order/orderDetail.ts +39 -0
  160. package/templates/wevu-retail/src/services/order/orderList.ts +39 -0
  161. package/templates/wevu-retail/src/services/order/orderSubmitComment.ts +22 -0
  162. package/templates/wevu-retail/src/services/promotion/detail.ts +18 -0
  163. package/templates/wevu-retail/src/services/usercenter/fetchPerson.ts +28 -0
  164. package/templates/wevu-retail/src/services/usercenter/fetchUsercenter.ts +18 -0
  165. package/templates/wevu-retail/src/sitemap.json +7 -0
  166. package/templates/wevu-retail/src/utils/addressParse.ts +25 -0
  167. package/templates/wevu-retail/src/utils/getPermission.ts +45 -0
  168. package/templates/wevu-retail/src/utils/mock.ts +51 -0
  169. package/templates/wevu-retail/src/utils/util.ts +134 -0
  170. package/templates/wevu-retail/src/vite-env.d.ts +1 -0
  171. package/templates/wevu-retail/tailwind.config.ts +15 -0
  172. package/templates/wevu-retail/tsconfig.app.json +58 -0
  173. package/templates/wevu-retail/tsconfig.json +11 -0
  174. package/templates/wevu-retail/tsconfig.node.json +33 -0
  175. package/templates/wevu-retail/vite.config.ts +14 -0
@@ -0,0 +1,7 @@
1
+ import { genGood } from './good';
2
+
3
+ export function getGoodsList(baseID = 0, length = 10) {
4
+ return new Array(length).fill(0).map((_, idx) => genGood(idx + baseID));
5
+ }
6
+
7
+ export const goodsList = getGoodsList();
@@ -0,0 +1,329 @@
1
+ import { mockIp, mockReqId } from '../../utils/mock';
2
+
3
+ const orderResps = [
4
+ {
5
+ data: {
6
+ saasId: '88888888',
7
+ uid: '88888888205468',
8
+ storeId: '1000',
9
+ skuId: '135691625',
10
+ numOfSku: 1,
11
+ numOfSkuAvailable: 1,
12
+ refundableAmount: '26900',
13
+ refundableDiscountAmount: '0',
14
+ shippingFeeIncluded: '0',
15
+ paidAmountEach: '26900',
16
+ boughtQuantity: 1,
17
+ orderNo: '132222623132329291',
18
+ goodsInfo: {
19
+ goodsName: '迷你便携高颜值蓝牙无线耳机立体声只能触控式操作简约立体声耳机',
20
+ skuImage: 'https://tdesign.gtimg.com/miniprogram/template/retail/goods/dz-2a.png',
21
+ specInfo: [
22
+ {
23
+ specId: '50456',
24
+ specTitle: '颜色',
25
+ specValue: '黑色',
26
+ },
27
+ {
28
+ specId: '50459',
29
+ specTitle: '尺码',
30
+ specValue: '简约款',
31
+ },
32
+ ],
33
+ },
34
+ },
35
+ code: 'Success',
36
+ msg: null,
37
+ requestId: mockReqId(),
38
+ clientIp: mockIp(),
39
+ rt: 36,
40
+ success: true,
41
+ },
42
+ {
43
+ data: {
44
+ saasId: '88888888',
45
+ uid: '88888888205468',
46
+ storeId: '1000',
47
+ skuId: '135676631',
48
+ numOfSku: 1,
49
+ numOfSkuAvailable: 1,
50
+ refundableAmount: '26900',
51
+ refundableDiscountAmount: '0',
52
+ shippingFeeIncluded: '0',
53
+ paidAmountEach: '26900',
54
+ boughtQuantity: 1,
55
+ orderNo: '132222623132329291',
56
+ goodsInfo: {
57
+ goodsName: '白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙',
58
+ skuImage: 'https://tdesign.gtimg.com/miniprogram/template/retail/goods/nz-09a.png',
59
+ specInfo: [
60
+ {
61
+ specId: '50456',
62
+ specTitle: '颜色',
63
+ specValue: '米色荷叶边',
64
+ },
65
+ {
66
+ specId: '50459',
67
+ specTitle: '尺码',
68
+ specValue: 'S',
69
+ },
70
+ ],
71
+ },
72
+ },
73
+ code: 'Success',
74
+ msg: null,
75
+ requestId: mockReqId(),
76
+ clientIp: mockIp(),
77
+ rt: 36,
78
+ success: true,
79
+ },
80
+ {
81
+ data: {
82
+ saasId: '88888888',
83
+ uid: '88888888205468',
84
+ storeId: '1000',
85
+ skuId: '135691622',
86
+ numOfSku: 1,
87
+ numOfSkuAvailable: 1,
88
+ refundableAmount: '26900',
89
+ refundableDiscountAmount: '0',
90
+ shippingFeeIncluded: '0',
91
+ paidAmountEach: '26900',
92
+ boughtQuantity: 1,
93
+ orderNo: '132222623132329291',
94
+ goodsInfo: {
95
+ goodsName: '腾讯极光盒子4智能网络电视机顶盒6K千兆网络机顶盒4K高分辨率',
96
+ skuImage: 'https://tdesign.gtimg.com/miniprogram/template/retail/goods/dz-3a.png',
97
+ specInfo: [
98
+ {
99
+ specId: '50456',
100
+ specTitle: '颜色',
101
+ specValue: '经典白',
102
+ },
103
+ {
104
+ specId: '50459',
105
+ specTitle: '类型',
106
+ specValue: '经典套装',
107
+ },
108
+ ],
109
+ },
110
+ },
111
+ code: 'Success',
112
+ msg: null,
113
+ requestId: mockReqId(),
114
+ clientIp: mockIp(),
115
+ rt: 36,
116
+ success: true,
117
+ },
118
+ {
119
+ data: {
120
+ saasId: '88888888',
121
+ uid: '88888888205468',
122
+ storeId: '1000',
123
+ skuId: '135676629',
124
+ numOfSku: 1,
125
+ numOfSkuAvailable: 1,
126
+ refundableAmount: '26900',
127
+ refundableDiscountAmount: '0',
128
+ shippingFeeIncluded: '0',
129
+ paidAmountEach: '26900',
130
+ boughtQuantity: 1,
131
+ orderNo: '132222623132329291',
132
+ goodsInfo: {
133
+ goodsName: '带帽午休毯虎年款多功能加厚加大加绒简约多功能午休毯连帽披肩',
134
+ skuImage: 'https://tdesign.gtimg.com/miniprogram/template/retail/goods/muy-3a.png',
135
+ specInfo: [
136
+ {
137
+ specId: '50456',
138
+ specTitle: '颜色',
139
+ specValue: '浅灰色',
140
+ },
141
+ {
142
+ specId: '50459',
143
+ specTitle: '尺码',
144
+ specValue: 'S',
145
+ },
146
+ ],
147
+ },
148
+ },
149
+ code: 'Success',
150
+ msg: null,
151
+ requestId: mockReqId(),
152
+ clientIp: mockIp(),
153
+ rt: 36,
154
+ success: true,
155
+ },
156
+ {
157
+ data: {
158
+ saasId: '88888888',
159
+ uid: '88888888205468',
160
+ storeId: '1000',
161
+ skuId: '135686631',
162
+ numOfSku: 1,
163
+ numOfSkuAvailable: 1,
164
+ refundableAmount: '26900',
165
+ refundableDiscountAmount: '0',
166
+ shippingFeeIncluded: '0',
167
+ paidAmountEach: '26900',
168
+ boughtQuantity: 1,
169
+ orderNo: '132222623132329291',
170
+ goodsInfo: {
171
+ goodsName: '运动连帽拉链卫衣休闲开衫长袖多色运动细绒面料运动上衣',
172
+ skuImage: 'https://tdesign.gtimg.com/miniprogram/template/retail/goods/nz-17a.png',
173
+ specInfo: [
174
+ {
175
+ specId: '50456',
176
+ specTitle: '颜色',
177
+ specValue: '军绿色',
178
+ },
179
+ {
180
+ specId: '50459',
181
+ specTitle: '尺码',
182
+ specValue: 'XS',
183
+ },
184
+ ],
185
+ },
186
+ },
187
+ code: 'Success',
188
+ msg: null,
189
+ requestId: mockReqId(),
190
+ clientIp: mockIp(),
191
+ rt: 36,
192
+ success: true,
193
+ },
194
+ {
195
+ data: {
196
+ saasId: '88888888',
197
+ uid: '88888888205468',
198
+ storeId: '1000',
199
+ skuId: '19384938948343',
200
+ numOfSku: 1,
201
+ numOfSkuAvailable: 1,
202
+ refundableAmount: '26900',
203
+ refundableDiscountAmount: '0',
204
+ shippingFeeIncluded: '0',
205
+ paidAmountEach: '26900',
206
+ boughtQuantity: 1,
207
+ orderNo: '130169571554503755',
208
+ goodsInfo: {
209
+ goodsName: '纯色纯棉休闲圆领短袖T恤纯白亲肤厚柔软细腻面料纯白短袖套头T恤',
210
+ skuImage: 'https://tdesign.gtimg.com/miniprogram/template/retail/goods/nz-08b.png',
211
+ specInfo: [
212
+ {
213
+ specId: '50456',
214
+ specTitle: '颜色',
215
+ specValue: '军绿色',
216
+ },
217
+ {
218
+ specId: '50459',
219
+ specTitle: '尺码',
220
+ specValue: 'XS',
221
+ },
222
+ ],
223
+ },
224
+ },
225
+ code: 'Success',
226
+ msg: null,
227
+ requestId: mockReqId(),
228
+ clientIp: mockIp(),
229
+ rt: 36,
230
+ success: true,
231
+ },
232
+ {
233
+ data: {
234
+ saasId: '88888888',
235
+ uid: '88888888205468',
236
+ storeId: '1000',
237
+ skuId: '19384938948343',
238
+ numOfSku: 1,
239
+ numOfSkuAvailable: 1,
240
+ refundableAmount: '26900',
241
+ refundableDiscountAmount: '0',
242
+ shippingFeeIncluded: '0',
243
+ paidAmountEach: '26900',
244
+ boughtQuantity: 1,
245
+ orderNo: '130169571554503755',
246
+ goodsInfo: {
247
+ goodsName: '纯色纯棉休闲圆领短袖T恤纯白亲肤厚柔软细腻面料纯白短袖套头T恤',
248
+ skuImage: 'https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-08b.png',
249
+ specInfo: [
250
+ {
251
+ specId: '50456',
252
+ specTitle: '颜色',
253
+ specValue: '军绿色',
254
+ },
255
+ {
256
+ specId: '50459',
257
+ specTitle: '尺码',
258
+ specValue: 'XS',
259
+ },
260
+ ],
261
+ },
262
+ },
263
+ code: 'Success',
264
+ msg: null,
265
+ requestId: mockReqId(),
266
+ clientIp: mockIp(),
267
+ rt: 36,
268
+ success: true,
269
+ },
270
+ ];
271
+
272
+ export function genRightsPreview(params) {
273
+ const { orderNo, skuId } = params;
274
+ const resp = orderResps.find((r) => r.data.orderNo === orderNo && r.data.skuId === skuId);
275
+ return resp;
276
+ }
277
+
278
+ export function genApplyReasonList(params) {
279
+ const resp = {
280
+ data: {
281
+ saasId: '70000001',
282
+ rightsReasonList: [
283
+ { id: '1', desc: '实际商品与描述不符' },
284
+ { id: '2', desc: '质量问题' },
285
+ { id: '3', desc: '少件/漏发' },
286
+ { id: '4', desc: '包装/商品/污迹/裂痕/变形' },
287
+ { id: '5', desc: '发货太慢' },
288
+ { id: '6', desc: '物流配送太慢' },
289
+ { id: '7', desc: '商家发错货' },
290
+ { id: '8', desc: '不喜欢' },
291
+ ],
292
+ },
293
+ code: 'Success',
294
+ msg: null,
295
+ requestId: mockReqId(),
296
+ clientIp: mockIp(),
297
+ rt: 6,
298
+ success: true,
299
+ };
300
+ // 未收货对应的原因列表
301
+ if (params.rightsReasonType === 'REFUND_MONEY') {
302
+ resp.data.rightsReasonList = [
303
+ { id: '9', desc: '空包裹' },
304
+ { id: '10', desc: '快递/物流一直未送到' },
305
+ { id: '11', desc: '货物破损已拒签' },
306
+ { id: '12', desc: '不喜欢' },
307
+ ];
308
+ }
309
+ return resp;
310
+ }
311
+
312
+ export function applyService() {
313
+ const resp = {
314
+ data: {
315
+ rightsNo: '123123423',
316
+ saasId: '70000001',
317
+ uid: '700000011070005',
318
+ storeId: '542',
319
+ result: null,
320
+ },
321
+ code: 'Success',
322
+ msg: null,
323
+ requestId: mockReqId(),
324
+ clientIp: mockIp(),
325
+ rt: 269,
326
+ success: true,
327
+ };
328
+ return resp;
329
+ }
@@ -0,0 +1,147 @@
1
+ import { mockIp, mockReqId } from '../../utils/mock';
2
+
3
+ export const transformGoodsDataToConfirmData = (goodsDataList) => {
4
+ const list = [];
5
+
6
+ goodsDataList.forEach((goodsData) => {
7
+ list.push({
8
+ storeId: goodsData.storeId,
9
+ spuId: goodsData.spuId,
10
+ skuId: goodsData.skuId,
11
+ goodsName: goodsData.title,
12
+ image: goodsData.primaryImage,
13
+ reminderStock: 119,
14
+ quantity: goodsData.quantity,
15
+ payPrice: goodsData.price,
16
+ totalSkuPrice: goodsData.price,
17
+ discountSettlePrice: goodsData.price,
18
+ realSettlePrice: goodsData.price,
19
+ settlePrice: goodsData.price,
20
+ oriPrice: goodsData.originPrice,
21
+ tagPrice: null,
22
+ tagText: null,
23
+ skuSpecLst: goodsData.specInfo,
24
+ promotionIds: null,
25
+ weight: 0.0,
26
+ unit: 'KG',
27
+ volume: null,
28
+ masterGoodsType: 0,
29
+ viceGoodsType: 0,
30
+ roomId: goodsData.roomId,
31
+ egoodsName: null,
32
+ });
33
+ });
34
+
35
+ return list;
36
+ };
37
+
38
+ /** 生成结算数据 */
39
+ export function genSettleDetail(params) {
40
+ const { userAddressReq, couponList, goodsRequestList } = params;
41
+
42
+ const resp = {
43
+ data: {
44
+ settleType: 0,
45
+ userAddress: null,
46
+ totalGoodsCount: 3,
47
+ packageCount: 1,
48
+ totalAmount: '289997',
49
+ totalPayAmount: '',
50
+ totalDiscountAmount: '110000',
51
+ totalPromotionAmount: '1100',
52
+ totalCouponAmount: '0',
53
+ totalSalePrice: '289997',
54
+ totalGoodsAmount: '289997',
55
+ totalDeliveryFee: '0',
56
+ invoiceRequest: null,
57
+ skuImages: null,
58
+ deliveryFeeList: null,
59
+ storeGoodsList: [
60
+ {
61
+ storeId: '1000',
62
+ storeName: '云Mall深圳旗舰店',
63
+ remark: null,
64
+ goodsCount: 1,
65
+ deliveryFee: '0',
66
+ deliveryWords: null,
67
+ storeTotalAmount: '0',
68
+ storeTotalPayAmount: '179997',
69
+ storeTotalDiscountAmount: '110000',
70
+ storeTotalCouponAmount: '0',
71
+ skuDetailVos: [],
72
+ couponList: [
73
+ {
74
+ couponId: 11,
75
+ storeId: '1000',
76
+ },
77
+ ],
78
+ },
79
+ ],
80
+ inValidGoodsList: null,
81
+ outOfStockGoodsList: null,
82
+ limitGoodsList: null,
83
+ abnormalDeliveryGoodsList: null,
84
+ invoiceSupport: 1,
85
+ },
86
+ code: 'Success',
87
+ msg: null,
88
+ requestId: mockReqId(),
89
+ clientIp: mockIp(),
90
+ rt: 244,
91
+ success: true,
92
+ };
93
+
94
+ const list = transformGoodsDataToConfirmData(goodsRequestList);
95
+
96
+ // 获取购物车传递的商品数据
97
+ resp.data.storeGoodsList[0].skuDetailVos = list;
98
+
99
+ // 判断是否携带优惠券数据
100
+ const discountPrice = [];
101
+
102
+ if (couponList && couponList.length > 0) {
103
+ couponList.forEach((coupon) => {
104
+ if (coupon.status === 'default') {
105
+ discountPrice.push({
106
+ type: coupon.type,
107
+ value: coupon.value,
108
+ });
109
+ }
110
+ });
111
+ }
112
+
113
+ // 模拟计算场景
114
+
115
+ // 计算总价
116
+ const totalPrice = list.reduce((pre, cur) => {
117
+ return pre + cur.quantity * Number(cur.settlePrice);
118
+ }, 0);
119
+
120
+ // 计算折扣
121
+ const totalDiscountPrice =
122
+ discountPrice.length > 0
123
+ ? discountPrice.reduce((pre, cur) => {
124
+ if (cur.type === 1) {
125
+ return pre + cur.value;
126
+ }
127
+ if (cur.type === 2) {
128
+ return pre + (Number(totalPrice) * cur.value) / 10;
129
+ }
130
+
131
+ return pre + cur;
132
+ }, 0)
133
+ : 0;
134
+
135
+ resp.data.totalSalePrice = totalPrice;
136
+
137
+ resp.data.totalCouponAmount = totalDiscountPrice;
138
+
139
+ resp.data.totalPayAmount =
140
+ totalPrice - totalDiscountPrice - Number(resp.data.totalPromotionAmount);
141
+
142
+ if (userAddressReq) {
143
+ resp.data.settleType = 1;
144
+ resp.data.userAddress = userAddressReq;
145
+ }
146
+ return resp;
147
+ }