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.
Files changed (179) hide show
  1. package/README.md +1 -0
  2. package/dist/{chunk-HT7GOIHP.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 +2 -2
  7. package/templates/tailwindcss/package.json +1 -1
  8. package/templates/tdesign/package.json +1 -1
  9. package/templates/vant/package.json +1 -1
  10. package/templates/wevu-retail/.editorconfig +9 -0
  11. package/templates/wevu-retail/.vscode/settings.json +10 -0
  12. package/templates/wevu-retail/AGENTS.md +35 -0
  13. package/templates/wevu-retail/README.md +26 -0
  14. package/templates/wevu-retail/auto-import-components.json +1 -0
  15. package/templates/wevu-retail/gitignore +35 -0
  16. package/templates/wevu-retail/package.json +42 -0
  17. package/templates/wevu-retail/postcss.config.js +6 -0
  18. package/templates/wevu-retail/project.config.json +44 -0
  19. package/templates/wevu-retail/project.private.config.json +8 -0
  20. package/templates/wevu-retail/src/app.vue +104 -0
  21. package/templates/wevu-retail/src/common/updateManager.ts +29 -0
  22. package/templates/wevu-retail/src/components/filter/index.vue +134 -0
  23. package/templates/wevu-retail/src/components/filter-popup/index.vue +67 -0
  24. package/templates/wevu-retail/src/components/goods-card/index.vue +219 -0
  25. package/templates/wevu-retail/src/components/goods-list/index.vue +91 -0
  26. package/templates/wevu-retail/src/components/load-more/index.vue +99 -0
  27. package/templates/wevu-retail/src/components/loading-content/index.vue +48 -0
  28. package/templates/wevu-retail/src/components/price/index.vue +104 -0
  29. package/templates/wevu-retail/src/components/promotion/ui-coupon-card/index.vue +143 -0
  30. package/templates/wevu-retail/src/components/promotion/ui-coupon-card/tools.wxs +18 -0
  31. package/templates/wevu-retail/src/components/swipeout/index.vue +118 -0
  32. package/templates/wevu-retail/src/components/swipeout/swipe.wxs +151 -0
  33. package/templates/wevu-retail/src/components/webp-image/index.vue +105 -0
  34. package/templates/wevu-retail/src/components/webp-image/utils.wxs +140 -0
  35. package/templates/wevu-retail/src/config/index.ts +20437 -0
  36. package/templates/wevu-retail/src/custom-tab-bar/data.ts +22 -0
  37. package/templates/wevu-retail/src/custom-tab-bar/index.vue +62 -0
  38. package/templates/wevu-retail/src/model/activities.ts +7 -0
  39. package/templates/wevu-retail/src/model/activity.ts +18 -0
  40. package/templates/wevu-retail/src/model/address.ts +31 -0
  41. package/templates/wevu-retail/src/model/cart.ts +306 -0
  42. package/templates/wevu-retail/src/model/category.ts +175 -0
  43. package/templates/wevu-retail/src/model/comments/queryDetail.ts +50 -0
  44. package/templates/wevu-retail/src/model/comments.ts +298 -0
  45. package/templates/wevu-retail/src/model/coupon.ts +39 -0
  46. package/templates/wevu-retail/src/model/detailsComments.ts +30 -0
  47. package/templates/wevu-retail/src/model/good.ts +1904 -0
  48. package/templates/wevu-retail/src/model/goods.ts +7 -0
  49. package/templates/wevu-retail/src/model/order/applyService.ts +329 -0
  50. package/templates/wevu-retail/src/model/order/orderConfirm.ts +147 -0
  51. package/templates/wevu-retail/src/model/order/orderDetail.ts +1191 -0
  52. package/templates/wevu-retail/src/model/order/orderList.ts +1033 -0
  53. package/templates/wevu-retail/src/model/promotion.ts +20 -0
  54. package/templates/wevu-retail/src/model/search.ts +60 -0
  55. package/templates/wevu-retail/src/model/submitComment.ts +58 -0
  56. package/templates/wevu-retail/src/model/swiper.ts +39 -0
  57. package/templates/wevu-retail/src/model/usercenter.ts +52 -0
  58. package/templates/wevu-retail/src/pages/cart/components/cart-bar/index.vue +104 -0
  59. package/templates/wevu-retail/src/pages/cart/components/cart-empty/index.vue +41 -0
  60. package/templates/wevu-retail/src/pages/cart/components/cart-group/index.vue +333 -0
  61. package/templates/wevu-retail/src/pages/cart/components/cart-group/index.wxs +5 -0
  62. package/templates/wevu-retail/src/pages/cart/components/cart-group/utils.wxs +20 -0
  63. package/templates/wevu-retail/src/pages/cart/components/goods-card/index.vue +334 -0
  64. package/templates/wevu-retail/src/pages/cart/components/specs-popup/index.vue +100 -0
  65. package/templates/wevu-retail/src/pages/cart/index.vue +342 -0
  66. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/README.md +95 -0
  67. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/c-sidebar-item/index.vue +73 -0
  68. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-sidebar/index.vue +121 -0
  69. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-tabbar/c-tabbar-more/index.vue +74 -0
  70. package/templates/wevu-retail/src/pages/category/components/goods-category/components/c-tabbar/index.vue +102 -0
  71. package/templates/wevu-retail/src/pages/category/components/goods-category/index.vue +137 -0
  72. package/templates/wevu-retail/src/pages/category/index.vue +50 -0
  73. package/templates/wevu-retail/src/pages/coupon/components/coupon-card/index.vue +95 -0
  74. package/templates/wevu-retail/src/pages/coupon/components/floating-button/index.vue +44 -0
  75. package/templates/wevu-retail/src/pages/coupon/coupon-activity-goods/index.vue +135 -0
  76. package/templates/wevu-retail/src/pages/coupon/coupon-detail/index.vue +94 -0
  77. package/templates/wevu-retail/src/pages/coupon/coupon-list/index.vue +136 -0
  78. package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/images-videos/assets/play.png +0 -0
  79. package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/images-videos/index.vue +65 -0
  80. package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/components/my-video/index.vue +92 -0
  81. package/templates/wevu-retail/src/pages/goods/comments/components/comments-card/index.vue +93 -0
  82. package/templates/wevu-retail/src/pages/goods/comments/create/index.vue +196 -0
  83. package/templates/wevu-retail/src/pages/goods/comments/index.vue +293 -0
  84. package/templates/wevu-retail/src/pages/goods/details/components/buy-bar/index.vue +117 -0
  85. package/templates/wevu-retail/src/pages/goods/details/components/goods-specs-popup/index.vue +440 -0
  86. package/templates/wevu-retail/src/pages/goods/details/components/promotion-popup/index.vue +83 -0
  87. package/templates/wevu-retail/src/pages/goods/details/index.vue +598 -0
  88. package/templates/wevu-retail/src/pages/goods/list/index.vue +299 -0
  89. package/templates/wevu-retail/src/pages/goods/result/index.vue +350 -0
  90. package/templates/wevu-retail/src/pages/goods/search/index.vue +196 -0
  91. package/templates/wevu-retail/src/pages/home/home.vue +215 -0
  92. package/templates/wevu-retail/src/pages/home/readme +8 -0
  93. package/templates/wevu-retail/src/pages/order/after-service-detail/api.ts +34 -0
  94. package/templates/wevu-retail/src/pages/order/after-service-detail/index.vue +430 -0
  95. package/templates/wevu-retail/src/pages/order/after-service-list/api.ts +1262 -0
  96. package/templates/wevu-retail/src/pages/order/after-service-list/index.vue +299 -0
  97. package/templates/wevu-retail/src/pages/order/apply-service/index.vue +665 -0
  98. package/templates/wevu-retail/src/pages/order/components/after-service-button-bar/index.vue +142 -0
  99. package/templates/wevu-retail/src/pages/order/components/customer-service/index.vue +75 -0
  100. package/templates/wevu-retail/src/pages/order/components/goods-card/index.vue +356 -0
  101. package/templates/wevu-retail/src/pages/order/components/noGoods/noGood.wxs +17 -0
  102. package/templates/wevu-retail/src/pages/order/components/noGoods/noGoods.vue +125 -0
  103. package/templates/wevu-retail/src/pages/order/components/order-button-bar/index.vue +262 -0
  104. package/templates/wevu-retail/src/pages/order/components/order-card/index.vue +126 -0
  105. package/templates/wevu-retail/src/pages/order/components/order-goods-card/index.vue +86 -0
  106. package/templates/wevu-retail/src/pages/order/components/reason-sheet/index.vue +161 -0
  107. package/templates/wevu-retail/src/pages/order/components/reason-sheet/reasonSheet.ts +25 -0
  108. package/templates/wevu-retail/src/pages/order/components/selectCoupons/mock.ts +22 -0
  109. package/templates/wevu-retail/src/pages/order/components/selectCoupons/selectCoupon.wxs +16 -0
  110. package/templates/wevu-retail/src/pages/order/components/selectCoupons/selectCoupons.vue +207 -0
  111. package/templates/wevu-retail/src/pages/order/components/specs-goods-card/index.vue +185 -0
  112. package/templates/wevu-retail/src/pages/order/config.ts +94 -0
  113. package/templates/wevu-retail/src/pages/order/delivery-detail/index.vue +145 -0
  114. package/templates/wevu-retail/src/pages/order/delivery-detail/isUrl.wxs +7 -0
  115. package/templates/wevu-retail/src/pages/order/fill-tracking-no/api.ts +71 -0
  116. package/templates/wevu-retail/src/pages/order/fill-tracking-no/index.vue +267 -0
  117. package/templates/wevu-retail/src/pages/order/invoice/index.vue +94 -0
  118. package/templates/wevu-retail/src/pages/order/order-confirm/components/address-card/index.vue +78 -0
  119. package/templates/wevu-retail/src/pages/order/order-confirm/getNotes.wxs +11 -0
  120. package/templates/wevu-retail/src/pages/order/order-confirm/handleInvoice.wxs +11 -0
  121. package/templates/wevu-retail/src/pages/order/order-confirm/index.vue +707 -0
  122. package/templates/wevu-retail/src/pages/order/order-confirm/order.wxs +8 -0
  123. package/templates/wevu-retail/src/pages/order/order-confirm/pay.ts +115 -0
  124. package/templates/wevu-retail/src/pages/order/order-detail/index.vue +456 -0
  125. package/templates/wevu-retail/src/pages/order/order-list/index.vue +288 -0
  126. package/templates/wevu-retail/src/pages/order/pay-result/index.vue +77 -0
  127. package/templates/wevu-retail/src/pages/order/receipt/index.vue +336 -0
  128. package/templates/wevu-retail/src/pages/promotion/promotion-detail/index.vue +145 -0
  129. package/templates/wevu-retail/src/pages/user/address/edit/index.vue +514 -0
  130. package/templates/wevu-retail/src/pages/user/address/list/index.vue +249 -0
  131. package/templates/wevu-retail/src/pages/user/components/t-location/index.vue +156 -0
  132. package/templates/wevu-retail/src/pages/user/components/ui-address-item/index.vue +92 -0
  133. package/templates/wevu-retail/src/pages/user/name-edit/index.vue +49 -0
  134. package/templates/wevu-retail/src/pages/user/person-info/index.vue +198 -0
  135. package/templates/wevu-retail/src/pages/usercenter/address/edit/util.ts +33 -0
  136. package/templates/wevu-retail/src/pages/usercenter/components/order-group/index.vue +90 -0
  137. package/templates/wevu-retail/src/pages/usercenter/components/ui-select-picker/index.vue +108 -0
  138. package/templates/wevu-retail/src/pages/usercenter/components/user-center-card/index.vue +82 -0
  139. package/templates/wevu-retail/src/pages/usercenter/index.vue +301 -0
  140. package/templates/wevu-retail/src/services/_utils/delay.ts +3 -0
  141. package/templates/wevu-retail/src/services/_utils/timeout.ts +3 -0
  142. package/templates/wevu-retail/src/services/activity/fetchActivity.ts +20 -0
  143. package/templates/wevu-retail/src/services/activity/fetchActivityList.ts +20 -0
  144. package/templates/wevu-retail/src/services/address/edit.ts +33 -0
  145. package/templates/wevu-retail/src/services/address/fetchAddress.ts +48 -0
  146. package/templates/wevu-retail/src/services/address/list.ts +31 -0
  147. package/templates/wevu-retail/src/services/cart/cart.ts +20 -0
  148. package/templates/wevu-retail/src/services/comments/fetchComments.ts +18 -0
  149. package/templates/wevu-retail/src/services/comments/fetchCommentsCount.ts +18 -0
  150. package/templates/wevu-retail/src/services/coupon/index.ts +65 -0
  151. package/templates/wevu-retail/src/services/good/comments/fetchCommentDetail.ts +20 -0
  152. package/templates/wevu-retail/src/services/good/fetchCategoryList.ts +18 -0
  153. package/templates/wevu-retail/src/services/good/fetchGood.ts +18 -0
  154. package/templates/wevu-retail/src/services/good/fetchGoods.ts +29 -0
  155. package/templates/wevu-retail/src/services/good/fetchGoodsDetailsComments.ts +37 -0
  156. package/templates/wevu-retail/src/services/good/fetchGoodsList.ts +39 -0
  157. package/templates/wevu-retail/src/services/good/fetchSearchHistory.ts +35 -0
  158. package/templates/wevu-retail/src/services/good/fetchSearchResult.ts +38 -0
  159. package/templates/wevu-retail/src/services/home/home.ts +53 -0
  160. package/templates/wevu-retail/src/services/order/applyService.ts +70 -0
  161. package/templates/wevu-retail/src/services/order/orderConfirm.ts +69 -0
  162. package/templates/wevu-retail/src/services/order/orderDetail.ts +39 -0
  163. package/templates/wevu-retail/src/services/order/orderList.ts +39 -0
  164. package/templates/wevu-retail/src/services/order/orderSubmitComment.ts +22 -0
  165. package/templates/wevu-retail/src/services/promotion/detail.ts +18 -0
  166. package/templates/wevu-retail/src/services/usercenter/fetchPerson.ts +28 -0
  167. package/templates/wevu-retail/src/services/usercenter/fetchUsercenter.ts +18 -0
  168. package/templates/wevu-retail/src/sitemap.json +7 -0
  169. package/templates/wevu-retail/src/utils/addressParse.ts +25 -0
  170. package/templates/wevu-retail/src/utils/getPermission.ts +45 -0
  171. package/templates/wevu-retail/src/utils/mock.ts +51 -0
  172. package/templates/wevu-retail/src/utils/util.ts +134 -0
  173. package/templates/wevu-retail/src/vite-env.d.ts +1 -0
  174. package/templates/wevu-retail/tailwind.config.ts +15 -0
  175. package/templates/wevu-retail/tsconfig.app.json +58 -0
  176. package/templates/wevu-retail/tsconfig.json +11 -0
  177. package/templates/wevu-retail/tsconfig.node.json +33 -0
  178. package/templates/wevu-retail/vite.config.ts +14 -0
  179. package/templates/wevu-tdesign/package.json +1 -1
@@ -0,0 +1,336 @@
1
+ <script lang="ts">
2
+ /* eslint-disable no-nested-ternary */
3
+ import Dialog from 'tdesign-miniprogram/dialog/index';
4
+ import Toast from 'tdesign-miniprogram/toast/index';
5
+ import { dispatchSupplementInvoice } from '../../../services/order/orderConfirm';
6
+
7
+ const invoiceJson = {
8
+ info: [
9
+ '1.根据当地税务局的要求,开具有效的企业发票需填写税务局登记证号。开具个人发票不需要填写纳税人识别码。 ',
10
+ '2.电子普通发票: 电子普通发票是税局认可的有效首付款凭证,其法律效力、基本用途及使用规定同纸质发票,如需纸质发票可自行下载打印。 ',
11
+ '3.增值税专用发票: 增值税发票暂时不可开,可查看《开局增值税发票》或致电400-633-6868。',
12
+ ],
13
+ codeTitle: [
14
+ '1.什么是纳税人识别号/统一社会信用代码? 纳税人识别号,一律由15位、17位、18或者20位码(字符型)组成,其中:企业、事业单位等组织机构纳税人,以国家质量监督检验检疫总局编制的9位码(其中区分主码位与校检位之间的“—”符省略不打印)并在其“纳税人识别号”。国家税务总局下达的纳税人代码为15位,其中:1—2位为省、市代码,3—6位为地区代码,7—8位为经济性质代码,9—10位行业代码,11—15位为各地区自设的顺序码。',
15
+ '2.入户获取/知晓纳税人识别号/统一社会信用代码? 纳税人识别号是税务登记证上的号码,通常简称为“税号”,每个企业的纳税人识别号都是唯一的。这个属于每个人自己且终身不变的数字代码很可能成为我们的第二张“身份证”。 ',
16
+ ],
17
+ };
18
+
19
+ Page({
20
+ orderNo: '',
21
+ data: {
22
+ receiptIndex: 0,
23
+ addressTagsIndex: 0,
24
+ goodsClassesIndex: 0,
25
+ dialogShow: false,
26
+ codeShow: false,
27
+ receipts: [
28
+ { title: '不开发票', id: 0, name: 'receipt' },
29
+ { title: '电子发票', id: 1, name: 'receipt' },
30
+ ],
31
+ addressTags: [
32
+ { title: '个人', id: 0, name: 'addressTags', type: 1 },
33
+ { title: '公司', id: 1, name: 'addressTags', type: 2 },
34
+ ],
35
+ goodsClasses: [
36
+ { title: '商品明细', id: 0, name: 'goodsClasses' },
37
+ { title: '商品类别', id: 1, name: 'goodsClasses' },
38
+ ],
39
+ name: '',
40
+ componentName: '',
41
+ code: '',
42
+ phone: '',
43
+ email: '',
44
+ invoiceInfo: invoiceJson,
45
+ },
46
+ onLoad(query) {
47
+ const { orderNo, invoiceData } = query;
48
+ const tempData = JSON.parse(invoiceData || '{}');
49
+ const invoice = {
50
+ receiptIndex: tempData.invoiceType === 5 ? 1 : 0,
51
+ name: tempData.buyerName || '',
52
+ email: tempData.email || '',
53
+ phone: tempData.buyerPhone || '',
54
+ addressTagsIndex: tempData.titleType === 2 ? 1 : 0,
55
+ goodsClassesIndex: tempData.contentType === 2 ? 1 : 0,
56
+ code: tempData.buyerTaxNo || '',
57
+ componentName: tempData.titleType === 2 ? tempData.buyerName : '',
58
+ };
59
+ this.orderNo = orderNo;
60
+ this.setData({ ...invoice });
61
+ },
62
+ onLabels(e) {
63
+ const { item } = e.currentTarget.dataset;
64
+ const nameIndex = `${item.name}Index`;
65
+ this.setData({ [nameIndex]: item.id });
66
+ },
67
+ onInput(e) {
68
+ const { addressTagsIndex } = this.data;
69
+ const { item } = e.currentTarget.dataset;
70
+ const { value } = e.detail;
71
+ const key =
72
+ item === 'name'
73
+ ? addressTagsIndex === 0
74
+ ? 'name'
75
+ : 'componentName'
76
+ : item === 'code'
77
+ ? addressTagsIndex === 0
78
+ ? 'phone'
79
+ : 'code'
80
+ : 'email';
81
+ this.setData({ [key]: value });
82
+ },
83
+ onSure() {
84
+ const result = this.checkSure();
85
+ if (!result) {
86
+ Dialog.alert({
87
+ title: '请填写发票信息',
88
+ content: '',
89
+ confirmBtn: '确认',
90
+ });
91
+ return;
92
+ }
93
+ const {
94
+ receiptIndex,
95
+ addressTagsIndex,
96
+ receipts,
97
+ addressTags,
98
+ name,
99
+ componentName,
100
+ code,
101
+ phone,
102
+ email,
103
+ goodsClassesIndex,
104
+ } = this.data;
105
+
106
+ const data = {
107
+ buyerName: addressTagsIndex === 0 ? name : componentName,
108
+ buyerTaxNo: code,
109
+ buyerPhone: phone,
110
+ email,
111
+ titleType: addressTags[addressTagsIndex].type,
112
+ contentType: goodsClassesIndex === 0 ? 1 : 2,
113
+ invoiceType: receiptIndex === 1 ? 5 : 0,
114
+ };
115
+ if (this.orderNo) {
116
+ if (this.submitting) return;
117
+ const params = {
118
+ parameter: {
119
+ orderNo: this.orderNo,
120
+ invoiceVO: data,
121
+ },
122
+ };
123
+ this.submitting = true;
124
+ dispatchSupplementInvoice(params)
125
+ .then(() => {
126
+ Toast({
127
+ context: this,
128
+ selector: '#t-toast',
129
+ message: '保存成功',
130
+ duration: 2000,
131
+ icon: '',
132
+ });
133
+ setTimeout(() => {
134
+ this.submitting = false;
135
+ wx.navigateBack({ delta: 1 });
136
+ }, 1000);
137
+ })
138
+ .catch((err) => {
139
+ this.submitting = false;
140
+ console.error(err);
141
+ });
142
+ } else {
143
+ Object.assign(data, {
144
+ receipts: receipts[receiptIndex],
145
+ addressTags: addressTags[addressTagsIndex],
146
+ });
147
+ wx.setStorageSync('invoiceData', data);
148
+ wx.navigateBack({ delta: 1 });
149
+ }
150
+ },
151
+ checkSure() {
152
+ const { name, componentName, code, phone, email, addressTagsIndex, receiptIndex } = this.data;
153
+ if (receiptIndex === 0) {
154
+ return true;
155
+ }
156
+ if (addressTagsIndex === 0) {
157
+ if (!name.length || !phone.length) {
158
+ return false;
159
+ }
160
+ } else if (addressTagsIndex === 1) {
161
+ if (!componentName.length || !code.length) {
162
+ return false;
163
+ }
164
+ }
165
+ if (!email.length) {
166
+ return false;
167
+ }
168
+ return true;
169
+ },
170
+ onDialogTap() {
171
+ const { dialogShow } = this.data;
172
+ this.setData({
173
+ dialogShow: !dialogShow,
174
+ codeShow: false,
175
+ });
176
+ },
177
+ onKnowCode() {
178
+ this.setData({
179
+ dialogShow: !this.data.dialogShow,
180
+ codeShow: true,
181
+ });
182
+ },
183
+ });
184
+ </script>
185
+
186
+ <template>
187
+ <view class="receipt [height:100vh] [background:#f5f5f5] [position:relative] [padding-top:20rpx] [&_.t-input__wrapper]:[margin:0] [&_.flex]:[display:flex] [&_.flex]:[align-items:center] [&_.flex]:[justify-content:space-between] [&_.head-title]:[color:#333] [&_.head-title]:[font-size:30rpx] [&_.head-title]:[font-weight:bold] [&_.btn-wrap]:[display:flex] [&_.btn-wrap_.btn]:[width:128rpx] [&_.btn-wrap_.btn]:[background:#f5f5f5] [&_.btn-wrap_.btn]:[font-size:24rpx] [&_.btn-wrap_.btn]:[color:#333] [&_.btn-wrap_.btn]:[margin-right:22rpx] [&_.btn-wrap_.btn]:[text-align:center] [&_.btn-wrap_.btn]:[border-radius:8rpx] [&_.btn-wrap_.btn]:[position:relative] [&_.btn-wrap_.btn]:[border:2rpx_solid_#f5f5f5] [&_.btn-wrap_.active-btn]:[background-color:transparent] [&_.btn-wrap_.active-btn]:[border-color:#fa4126] [&_.btn-wrap_.active-btn]:[color:#fa4126] [&_.title]:[width:100%] [&_.title]:[background-color:#fff] [&_.title]:[margin-bottom:20rpx] [&_.receipt-label]:[display:flex] [&_.receipt-label_.btn]:[width:128rpx] [&_.receipt-label_.btn]:[background:#f5f5f5] [&_.receipt-label_.btn]:[font-size:24rpx] [&_.receipt-label_.btn]:[color:#333] [&_.receipt-label_.btn]:[margin-left:22rpx] [&_.receipt-label_.btn]:[text-align:center] [&_.receipt-label_.btn]:[border-radius:8rpx] [&_.receipt-label_.btn]:[border:2rpx_solid_#f5f5f5] [&_.receipt-label_.active-btn]:[background-color:transparent] [&_.receipt-label_.active-btn]:[border-color:#fa4126] [&_.receipt-label_.active-btn]:[color:#fa4126] [&_.receipt-label_.wr-cell__title]:[font-size:30rpx] [&_.receipt-label_.wr-cell__title]:[color:#333] [&_.receipt-label_.wr-cell__title]:[font-weight:bold] [&_.receipt-content]:[background:#fff] [&_.receipt-content]:[margin-top:20rpx] [&_.receipt-content_.addressTags]:[padding:0_30rpx] [&_.receipt-content_.addressTags]:[height:100rpx] [&_.receipt-content_.addressTags_.btn-wrap]:[display:flex] [&_.receipt-content_.line]:[width:720rpx] [&_.receipt-content_.line]:[margin-left:30rpx] [&_.receipt-content_.line]:[background-color:#e6e6e6] [&_.receipt-content_.line]:[height:1rpx] [&_.receipt-content_.receipt-input]:[display:flex] [&_.receipt-content_.receipt-input]:[padding:0_30rpx] [&_.receipt-content_.receipt-input]:[align-items:center] [&_.receipt-content_.receipt-input]:[height:100rpx] [&_.receipt-content_.receipt-input]:[color:#666] [&_.receipt-content_.receipt-input_.title]:[color:#333] [&_.receipt-content_.receipt-input_.title]:[display:inline-block] [&_.receipt-content_.receipt-input_.title]:[width:140rpx] [&_.receipt-content_.receipt-input_.title]:[margin-right:30rpx] [&_.receipt-content_.receipt-input_.title]:[font-size:30rpx] [&_.receipt-content_.receipt-input_.title]:[font-weight:bold] [&_.receipt-content_.receipt-input_.wr-icon]:[font-size:28rpx] [&_.receipt-content_.receipt-input_.wr-icon]:[margin-left:20rpx] [&_.receipt-info]:[background:#fff] [&_.receipt-info]:[margin-top:20rpx] [&_.receipt-info_.info-con]:[padding:0_30rpx] [&_.receipt-info_.info-con]:[height:100rpx] [&_.receipt-info_.title]:[font-size:24rpx] [&_.receipt-info_.title]:[color:#999999] [&_.receipt-info_.title]:[line-height:36rpx] [&_.receipt-info_.title]:[padding:0_30rpx_20rpx] [&_.receipt-info_.title]:[box-sizing:border-box] [&_.receipt-know]:[display:flex] [&_.receipt-know]:[align-items:center] [&_.receipt-know]:[font-size:26rpx] [&_.receipt-know]:[font-weight:400] [&_.receipt-know]:[color:#999999] [&_.receipt-know]:[padding:20rpx_30rpx] [&_.receipt-know]:[line-height:26rpx] [&_.receipt-know_.icon]:[margin-left:16rpx] [&_.receipt-know_.icon]:[font-size:26rpx] [&_.dialog-receipt_.dialog__message]:[padding:0] [&_.dialog-receipt_.dialog-info]:[max-height:622rpx] [&_.dialog-receipt_.info-wrap]:[padding:0_18rpx] [&_.dialog-receipt_.info_.title]:[display:inline-block] [&_.dialog-receipt_.info_.title]:[font-size:28rpx] [&_.dialog-receipt_.info_.title]:[font-weight:400] [&_.dialog-receipt_.info_.title]:[color:#999] [&_.dialog-receipt_.info_.title]:[line-height:40rpx] [&_.dialog-receipt_.info_.title]:[margin-bottom:40rpx] [&_.dialog-receipt_.info_.title]:[text-align:left] [&_.receipt-btn]:[position:fixed] [&_.receipt-btn]:[bottom:0] [&_.receipt-btn]:[left:0] [&_.receipt-btn]:[right:0] [&_.receipt-btn]:[z-index:100] [&_.receipt-btn]:[background:#fff] [&_.receipt-btn]:[width:100%] [&_.receipt-btn]:[padding:0_20rpx] [&_.receipt-btn]:[box-sizing:border-box] [&_.receipt-btn]:[padding-bottom:calc(20rpx_+_env(safe-area-inset-bottom))] [&_.receipt-btn_.receipt-btn-con]:[margin-top:20rpx] [&_.receipt-btn_.receipt-btn-con]:[display:inline-block] [&_.receipt-btn_.receipt-btn-con]:[width:100%] [&_.receipt-btn_.receipt-btn-con]:[line-height:80rpx] [&_.receipt-btn_.receipt-btn-con]:[background:#fa4126] [&_.receipt-btn_.receipt-btn-con]:[text-align:center] [&_.receipt-btn_.receipt-btn-con]:[color:#fff] [&_.receipt-btn_.receipt-btn-con]:[border-radius:48rpx]">
188
+ <view class="title">
189
+ <t-cell class="receipt-cell [&_.t-cell__title]:[width:144rpx] [&_.t-cell__title]:[padding-right:32rpx] [&_.t-cell__title]:[flex:none]" title="发票" bordered="{{false}}" t-class-left="cell-left">
190
+ <view slot="right-icon" class="btn-wrap">
191
+ <view
192
+ bindtap="onLabels"
193
+ data-item="{{item}}"
194
+ class="btn {{receiptIndex === index ? 'active-btn' : ''}}"
195
+ wx:for="{{receipts}}"
196
+ wx:for-item="item"
197
+ wx:key="index"
198
+ >
199
+ {{item.title}}
200
+ </view>
201
+ </view>
202
+ </t-cell>
203
+ </view>
204
+ <block wx:if="{{receiptIndex === 1}}">
205
+ <t-cell class="receipt-cell [&_.t-cell__title]:[width:144rpx] [&_.t-cell__title]:[padding-right:32rpx] [&_.t-cell__title]:[flex:none]" title="发票抬头" t-class-left="cell-left">
206
+ <view class="btn-wrap" slot="right-icon">
207
+ <view
208
+ class="btn {{addressTagsIndex === index ? 'active-btn':'' }}"
209
+ bindtap="onLabels"
210
+ data-item="{{tag}}"
211
+ wx:for="{{addressTags}}"
212
+ wx:for-item="tag"
213
+ wx:key="index"
214
+ >
215
+ {{tag.title}}
216
+ </view>
217
+ </view>
218
+ </t-cell>
219
+ <t-cell
220
+ class="receipt-cell [&_.t-cell__title]:[width:144rpx] [&_.t-cell__title]:[padding-right:32rpx] [&_.t-cell__title]:[flex:none]"
221
+ title="{{addressTagsIndex === 0 ? '姓名':'公司名称'}}"
222
+ t-class-left="cell-left"
223
+ t-class-right="cell-right"
224
+ >
225
+ <t-input
226
+ slot="right-icon"
227
+ borderless
228
+ t-class="input-com [display:inline-block] [flex:1] [font-size:30rpx] [font-weight:400] [line-height:30rpx] ![padding:0] [color:#666]"
229
+ value="{{addressTagsIndex === 0 ? name:componentName}}"
230
+ bindchange="onInput"
231
+ data-item="name"
232
+ type=""
233
+ placeholder="{{addressTagsIndex === 0 ? '请输入您的姓名':'请输入公司名称'}}"
234
+ />
235
+ </t-cell>
236
+ <t-cell
237
+ class="receipt-cell [&_.t-cell__title]:[width:144rpx] [&_.t-cell__title]:[padding-right:32rpx] [&_.t-cell__title]:[flex:none]"
238
+ title="{{addressTagsIndex === 0 ? '手机号':'识别号'}}"
239
+ t-class-left="cell-left"
240
+ t-class-right="cell-right"
241
+ >
242
+ <view class="addressTagsIndex-cell [display:flex] [align-items:center] [justify-content:space-between] [width:100%]" slot="right-icon">
243
+ <t-input
244
+ t-class="input-com [display:inline-block] [flex:1] [font-size:30rpx] [font-weight:400] [line-height:30rpx] ![padding:0] [color:#666]"
245
+ borderless
246
+ value="{{addressTagsIndex === 0 ? phone:code}}"
247
+ bindchange="onInput"
248
+ data-item="code"
249
+ type=""
250
+ placeholder="{{addressTagsIndex === 0 ? '请输入您的手机号':'请输入纳税人识别号'}}"
251
+ />
252
+ <t-icon wx:if="{{addressTagsIndex === 1}}" name="help-circle" size="30rpx" bindtap="onKnowCode" />
253
+ </view>
254
+ </t-cell>
255
+ <t-cell
256
+ class="receipt-cell [&_.t-cell__title]:[width:144rpx] [&_.t-cell__title]:[padding-right:32rpx] [&_.t-cell__title]:[flex:none]"
257
+ title="电子邮箱"
258
+ bordered="{{false}}"
259
+ t-class-left="cell-left"
260
+ t-class-right="cell-right"
261
+ >
262
+ <t-input
263
+ slot="right-icon"
264
+ t-class="input-com [display:inline-block] [flex:1] [font-size:30rpx] [font-weight:400] [line-height:30rpx] ![padding:0] [color:#666]"
265
+ borderless
266
+ value="{{email}}"
267
+ bindchange="onInput"
268
+ data-item="email"
269
+ type=""
270
+ placeholder="请输入邮箱用于接收电子发票"
271
+ />
272
+ </t-cell>
273
+ <view class="receipt-info">
274
+ <t-cell class="receipt-cell [&_.t-cell__title]:[width:144rpx] [&_.t-cell__title]:[padding-right:32rpx] [&_.t-cell__title]:[flex:none]" title="发票内容" bordered="{{false}}" t-class-left="cell-left">
275
+ <view class="btn-wrap" slot="right-icon">
276
+ <view
277
+ class="btn {{goodsClassesIndex ===index ? 'active-btn':''}}"
278
+ bindtap="onLabels"
279
+ data-item="{{good}}"
280
+ wx:for="{{goodsClasses}}"
281
+ wx:for-item="good"
282
+ wx:key="index"
283
+ >
284
+ {{good.title}}
285
+ </view>
286
+ </view>
287
+ </t-cell>
288
+ <view class="title">发票内容将显示详细商品名称与价格信息,发票金额为实际支付金额,不包含优惠等扣减金额</view>
289
+ </view>
290
+ <view class="receipt-know" bindtap="onDialogTap">
291
+ 发票须知
292
+ <t-icon name="help-circle" size="30rpx" />
293
+ </view>
294
+ <t-dialog
295
+ title="{{codeShow ? '纳税人识别号说明':'发票须知'}}"
296
+ bindconfirm="onDialogTap"
297
+ class="dialog-receipt"
298
+ visible="{{dialogShow}}"
299
+ confirm-btn="我知道了"
300
+ >
301
+ <view class="srcoll-view-wrap [margin-top:20rpx]" slot="content">
302
+ <scroll-view class="dialog-info" scroll-x="{{false}}" scroll-y="{{true}}">
303
+ <view class="info-wrap">
304
+ <view class="info" wx:if="{{!codeShow}}">
305
+ <view class="title" wx:for="{{invoiceInfo.info}}" wx:key="index" wx:for-item="item"> {{item}} </view>
306
+ </view>
307
+ <view class="info" wx:else>
308
+ <view class="title" wx:for="{{invoiceInfo.codeTitle}}" wx:key="index" wx:for-item="item"> {{item}} </view>
309
+ </view>
310
+ </view>
311
+ </scroll-view>
312
+ </view>
313
+ </t-dialog>
314
+ </block>
315
+ <view wx:else></view>
316
+ <view class="safe-area-bottom receipt-btn">
317
+ <t-button t-class="receipt-btn-con" bindtap="onSure">确定</t-button>
318
+ </view>
319
+ </view>
320
+ <t-toast id="t-toast" />
321
+ <t-dialog id="t-dialog" />
322
+ </template>
323
+
324
+ <json>
325
+ {
326
+ "navigationBarTitleText": "发票",
327
+ "usingComponents": {
328
+ "t-cell": "tdesign-miniprogram/cell/cell",
329
+ "t-dialog": "tdesign-miniprogram/dialog/dialog",
330
+ "t-toast": "tdesign-miniprogram/toast/toast",
331
+ "t-icon": "tdesign-miniprogram/icon/icon",
332
+ "t-input": "tdesign-miniprogram/input/input",
333
+ "t-button": "tdesign-miniprogram/button/button"
334
+ }
335
+ }
336
+ </json>
@@ -0,0 +1,145 @@
1
+ <script lang="ts">
2
+ import Toast from 'tdesign-miniprogram/toast/index';
3
+ import { fetchPromotion } from '../../../services/promotion/detail';
4
+
5
+ Page({
6
+ data: {
7
+ list: [],
8
+ banner: '',
9
+ time: 0,
10
+ showBannerDesc: false,
11
+ statusTag: '',
12
+ },
13
+
14
+ onLoad(query) {
15
+ const promotionID = parseInt(query.promotion_id);
16
+ this.getGoodsList(promotionID);
17
+ },
18
+
19
+ getGoodsList(promotionID) {
20
+ fetchPromotion(promotionID).then(({ list, banner, time, showBannerDesc, statusTag }) => {
21
+ const goods = list.map((item) => ({
22
+ ...item,
23
+ tags: item.tags.map((v) => v.title),
24
+ }));
25
+ this.setData({
26
+ list: goods,
27
+ banner,
28
+ time,
29
+ showBannerDesc,
30
+ statusTag,
31
+ });
32
+ });
33
+ },
34
+
35
+ goodClickHandle(e) {
36
+ const { index } = e.detail;
37
+ const { spuId } = this.data.list[index];
38
+ wx.navigateTo({ url: `/pages/goods/details/index?spuId=${spuId}` });
39
+ },
40
+
41
+ cardClickHandle() {
42
+ Toast({
43
+ context: this,
44
+ selector: '#t-toast',
45
+ message: '点击加购',
46
+ });
47
+ },
48
+
49
+ bannerClickHandle() {
50
+ Toast({
51
+ context: this,
52
+ selector: '#t-toast',
53
+ message: '点击规则详情',
54
+ });
55
+ },
56
+ });
57
+ </script>
58
+
59
+ <template>
60
+ <view id="js-page-wrap" class="promotion-detail-container [&_.wrap]:[display:block] [&_.wrap]:[padding:0_24rpx] [&_.wrap]:[background:linear-gradient(#fff,_#f5f5f5)] [&_.t-class-promotion-head]:[width:702rpx] [&_.t-class-promotion-head]:[height:160rpx] [&_.t-class-promotion-head]:[border-radius:8rpx] [&_.wrap_.count-down-wrap]:[display:flex] [&_.wrap_.count-down-wrap]:[flex-direction:row] [&_.wrap_.count-down-wrap]:[justify-content:flex-start] [&_.wrap_.count-down-wrap]:[align-items:baseline] [&_.wrap_.count-down-wrap]:[line-height:34rpx] [&_.wrap_.count-down-wrap_.in-banner-count-down-wrap]:[position:absolute] [&_.wrap_.count-down-wrap_.in-banner-count-down-wrap]:[bottom:32rpx] [&_.wrap_.count-down-wrap_.in-banner-count-down-wrap]:[left:32rpx] [&_.wrap_.count-down-wrap_.in-banner-count-down-wrap]:[right:32rpx] [&_.wrap_.count-down-wrap_.status-tag]:[height:32rpx] [&_.wrap_.count-down-wrap_.status-tag]:[line-height:32rpx] [&_.wrap_.count-down-wrap_.status-tag]:[font-size:20rpx] [&_.wrap_.count-down-wrap_.status-tag]:[margin-right:12rpx] [&_.wrap_.count-down-wrap_.status-tag]:[border-radius:16rpx] [&_.wrap_.count-down-wrap_.status-tag]:[padding:0_12rpx] [&_.wrap_.count-down-wrap_.status-tag_.before]:[color:#fff] [&_.wrap_.count-down-wrap_.status-tag_.before]:[background-color:#ff9853] [&_.wrap_.count-down-wrap_.status-tag_.finish]:[color:#fff] [&_.wrap_.count-down-wrap_.status-tag_.finish]:[background-color:#ccc] [&_.wrap_.count-down-wrap_.count-down-label]:[color:#666] [&_.wrap_.count-down-wrap_.count-down-label]:[font-size:24rpx] [&_.wrap_.count-down-wrap_.count-down-label]:[margin-right:0.5em] [&_.wrap_.count-down-wrap_.detail-entry]:[margin-left:auto] [&_.wrap_.count-down-wrap_.detail-entry]:[height:40rpx] [&_.wrap_.count-down-wrap_.detail-entry-label]:[color:#fff] [&_.wrap_.count-down-wrap_.detail-entry-label]:[font-size:24rpx] [&_.wrap_.count-down-wrap_.detail-entry-label]:[margin-right:12rpx] [&_.wrap_.count-down-wrap_.after-banner-count-down-wrap]:[padding:10rpx] [&_.wrap_.count-down-wrap_.after-banner-count-down-wrap_.detail-entry]:[display:flex] [&_.wrap_.count-down-wrap_.after-banner-count-down-wrap_.detail-entry]:[align-items:center] [&_.wrap_.count-down-wrap_.after-banner-count-down-wrap_.detail-entry-label]:[color:#999] [&_.wrap_.count-down-wrap_.after-banner-count-down-wrap_.detail-entry-label]:[margin-right:0] [&_.wrap_.gl-empty-wrap]:[margin-top:180rpx] [&_.wrap_.gl-empty-img]:[width:240rpx] [&_.wrap_.gl-empty-img]:[height:240rpx] [&_.wrap_.gl-empty-img]:[display:block] [&_.wrap_.gl-empty-img]:[margin:0_auto] [&_.wrap_.gl-empty-label]:[font-size:28rpx] [&_.wrap_.gl-empty-label]:[color:#999] [&_.wrap_.gl-empty-label]:[margin-top:40rpx] [&_.wrap_.gl-empty-label]:[text-align:center] [&_.goods-list-container]:[background:#f5f5f5] [&_.promotion-goods-list]:[padding:20rpx_24rpx] [&_.promotion-goods-list]:[background-color:#f5f5f5]">
61
+ <view wx:if="{{banner}}" class="wrap" id="{{independentID}}">
62
+ <view class="banner-wrap">
63
+ <t-image src="{{banner}}" mode="aspectFill" webp="{{true}}" t-class="t-class-promotion-head" />
64
+ <view
65
+ wx:if="{{!showBannerDesc && (time >= 0 || statusTag === 'finish')}}"
66
+ class="count-down-wrap in-banner-count-down-wrap"
67
+ >
68
+ <block wx:if="{{statusTag === 'finish'}}">
69
+ <view class="status-tag {{statusTag}}">已结束</view>
70
+ <text class="count-down-label">活动已结束</text>
71
+ </block>
72
+ <block wx:else>
73
+ <view wx:if="{{statusTag === 'before'}}" class="status-tag {{statusTag}}"> 未开始 </view>
74
+ <text class="count-down-label">距结束仅剩</text>
75
+ <count-down
76
+ wx:if="{{time > 0}}"
77
+ t-class="wr-cd-class"
78
+ time="{{time}}"
79
+ format="DD天 HH:mm:ss"
80
+ bind:finish="countDownFinishHandle"
81
+ />
82
+ </block>
83
+ <view class="detail-entry" bind:tap="bannerClickHandle">
84
+ <text class="detail-entry-label">规则详情</text>
85
+ <t-icon name="chevron-right" size="34rpx" style="color: #999" />
86
+ </view>
87
+ </view>
88
+ <view
89
+ wx:if="{{showBannerDesc && (useBannerDescSlot || time >= 0 || statusTag === 'finish')}}"
90
+ class="banner-desc-wrap"
91
+ >
92
+ <block wx:if="{{useBannerDescSlot}}">
93
+ <slot name="banner-desc" />
94
+ </block>
95
+ <block wx:else>
96
+ <view class="count-down-wrap after-banner-count-down-wrap">
97
+ <block wx:if="{{statusTag === 'finish'}}">
98
+ <view class="status-tag {{statusTag}}">已结束</view>
99
+ <text class="count-down-label">活动已结束</text>
100
+ </block>
101
+ <block wx:else>
102
+ <view wx:if="{{statusTag === 'before'}}" class="status-tag {{statusTag}}"> 未开始 </view>
103
+ <text class="count-down-label">距结束仅剩</text>
104
+ <count-down
105
+ class="{{cdClass}}"
106
+ wr-class="wr-cd-class"
107
+ wx:if="{{time > 0}}"
108
+ time="{{time}}"
109
+ format="DD天 HH:mm:ss"
110
+ bind:finish="countDownFinishHandle"
111
+ />
112
+ </block>
113
+ <view class="detail-entry" bind:tap="bannerClickHandle">
114
+ <text class="detail-entry-label">规则详情</text>
115
+ <t-icon name="chevron-right" size="34rpx" style="color: #999" />
116
+ </view>
117
+ </view>
118
+ </block>
119
+ </view>
120
+ </view>
121
+ </view>
122
+ <view wx:if="{{list && list.length>0}}" class="promotion-goods-list">
123
+ <goods-list
124
+ wr-class="goods-list-container"
125
+ goodsList="{{list}}"
126
+ bind:click="goodClickHandle"
127
+ bind:addcart="cardClickHandle"
128
+ />
129
+ </view>
130
+ <t-toast id="t-toast" />
131
+ </view>
132
+ </template>
133
+
134
+ <json>
135
+ {
136
+ "navigationBarTitleText": "营销详情",
137
+ "usingComponents": {
138
+ "t-toast": "tdesign-miniprogram/toast/toast",
139
+ "t-image": "/components/webp-image/index",
140
+ "t-icon": "tdesign-miniprogram/icon/icon",
141
+ "count-down": "tdesign-miniprogram/count-down/count-down",
142
+ "goods-list": "/components/goods-list/index"
143
+ }
144
+ }
145
+ </json>