jufubao-base 1.0.240 → 1.0.242-beta1

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 (128) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbBaseBalance/Api.js +46 -0
  3. package/src/components/JfbBaseBalance/Attr.js +316 -0
  4. package/src/components/JfbBaseBalance/JfbBaseBalance.vue +336 -0
  5. package/src/components/JfbBaseBalance/JfbBaseBalanceLess.less +79 -0
  6. package/src/components/JfbBaseBalance/JfbBaseBalanceMixin.js +30 -0
  7. package/src/components/JfbBaseBalance/Mock.js +9 -0
  8. package/src/components/JfbBaseCodeOpenVip/Api.js +35 -0
  9. package/src/components/JfbBaseCodeOpenVip/Attr.js +281 -0
  10. package/src/components/JfbBaseCodeOpenVip/JfbBaseCodeOpenVip.vue +251 -0
  11. package/src/components/JfbBaseCodeOpenVip/JfbBaseCodeOpenVipLess.less +79 -0
  12. package/src/components/JfbBaseCodeOpenVip/JfbBaseCodeOpenVipMixin.js +30 -0
  13. package/src/components/JfbBaseCodeOpenVip/Mock.js +13 -0
  14. package/src/components/JfbBaseConsumpCode/Api.js +133 -0
  15. package/src/components/JfbBaseConsumpCode/Attr.js +61 -0
  16. package/src/components/JfbBaseConsumpCode/JfbBaseConsumpCode.vue +1048 -0
  17. package/src/components/JfbBaseConsumpCode/JfbBaseConsumpCodeLess.less +79 -0
  18. package/src/components/JfbBaseConsumpCode/JfbBaseConsumpCodeMixin.js +30 -0
  19. package/src/components/JfbBaseConsumpCode/Mock.js +22 -0
  20. package/src/components/JfbBaseFastLink/Attr.js +12 -1
  21. package/src/components/JfbBaseFastLink/JfbBaseFastLink.vue +66 -0
  22. package/src/components/JfbBaseHeader/Attr.js +82 -0
  23. package/src/components/JfbBaseHeader/JfbBaseHeader.vue +47 -1
  24. package/src/components/JfbBaseHeaderColumn/Attr.js +82 -0
  25. package/src/components/JfbBaseHeaderColumn/JfbBaseHeaderColumn.vue +48 -2
  26. package/src/components/JfbBaseLogin/JfbBaseLogin.vue +14 -3
  27. package/src/components/JfbBaseNoticeDialog/Api.js +1 -1
  28. package/src/components/JfbBaseNoticeDialog/Attr.js +26 -0
  29. package/src/components/JfbBaseNoticeDialog/JfbBaseNoticeDialog.vue +28 -9
  30. package/src/components/JfbBaseNoticeGroup/Api.js +23 -0
  31. package/src/components/JfbBaseNoticeGroup/Attr.js +237 -0
  32. package/src/components/JfbBaseNoticeGroup/JfbBaseNoticeGroup.vue +174 -0
  33. package/src/components/JfbBaseNoticeGroup/JfbBaseNoticeGroupLess.less +79 -0
  34. package/src/components/JfbBaseNoticeGroup/JfbBaseNoticeGroupMixin.js +30 -0
  35. package/src/components/JfbBaseNoticeGroup/Mock.js +13 -0
  36. package/src/components/JfbBaseOpenVip/Api.js +39 -0
  37. package/src/components/JfbBaseOpenVip/Attr.js +331 -0
  38. package/src/components/JfbBaseOpenVip/JfbBaseOpenVip.vue +457 -0
  39. package/src/components/JfbBaseOpenVip/JfbBaseOpenVipLess.less +79 -0
  40. package/src/components/JfbBaseOpenVip/JfbBaseOpenVipMixin.js +30 -0
  41. package/src/components/JfbBaseOpenVip/Mock.js +7 -0
  42. package/src/components/JfbBaseOpenVip/XdVipList.vue +131 -0
  43. package/src/components/JfbBaseOpenVipCard/Api.js +58 -0
  44. package/src/components/JfbBaseOpenVipCard/Attr.js +48 -0
  45. package/src/components/JfbBaseOpenVipCard/JfbBaseOpenVipCard.vue +111 -0
  46. package/src/components/JfbBaseOpenVipCard/JfbBaseOpenVipCardLess.less +79 -0
  47. package/src/components/JfbBaseOpenVipCard/JfbBaseOpenVipCardMixin.js +30 -0
  48. package/src/components/JfbBaseOpenVipCard/Mock.js +13 -0
  49. package/src/components/JfbBaseOpenVipDetail/Api.js +35 -0
  50. package/src/components/JfbBaseOpenVipDetail/Attr.js +37 -0
  51. package/src/components/JfbBaseOpenVipDetail/JfbBaseOpenVipDetail.vue +234 -0
  52. package/src/components/JfbBaseOpenVipDetail/JfbBaseOpenVipDetailLess.less +79 -0
  53. package/src/components/JfbBaseOpenVipDetail/JfbBaseOpenVipDetailMixin.js +30 -0
  54. package/src/components/JfbBaseOpenVipDetail/Mock.js +15 -0
  55. package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +176 -18
  56. package/src/components/JfbBasePay/Attr.js +52 -0
  57. package/src/components/JfbBasePay/JfbBasePay.vue +30 -6
  58. package/src/components/JfbBasePay/Mock.js +0 -9
  59. package/src/components/JfbBasePersonalData/Api.js +26 -0
  60. package/src/components/JfbBasePersonalData/Attr.js +13 -0
  61. package/src/components/JfbBasePersonalData/JfbBasePersonalData.vue +200 -0
  62. package/src/components/JfbBasePersonalData/JfbBasePersonalDataLess.less +79 -0
  63. package/src/components/JfbBasePersonalData/JfbBasePersonalDataMixin.js +30 -0
  64. package/src/components/JfbBasePersonalData/Mock.js +13 -0
  65. package/src/components/JfbBasePhoneLogin/JfbBasePhoneLogin.vue +11 -1
  66. package/src/components/JfbBasePointsCard/Api.js +18 -0
  67. package/src/components/JfbBasePointsCard/Attr.js +187 -0
  68. package/src/components/JfbBasePointsCard/JfbBasePointsCard.vue +212 -0
  69. package/src/components/JfbBasePointsCard/JfbBasePointsCardLess.less +79 -0
  70. package/src/components/JfbBasePointsCard/JfbBasePointsCardMixin.js +30 -0
  71. package/src/components/JfbBasePointsCard/Mock.js +5 -0
  72. package/src/components/JfbBasePointsDetail/Api.js +48 -0
  73. package/src/components/JfbBasePointsDetail/Attr.js +305 -0
  74. package/src/components/JfbBasePointsDetail/JfbBasePointsDetail.vue +267 -0
  75. package/src/components/JfbBasePointsDetail/JfbBasePointsDetailLess.less +79 -0
  76. package/src/components/JfbBasePointsDetail/JfbBasePointsDetailMixin.js +30 -0
  77. package/src/components/JfbBasePointsDetail/Mock.js +6 -0
  78. package/src/components/JfbBasePoster/Attr.js +1 -1
  79. package/src/components/JfbBasePosterBigSmall/JfbBasePosterBigSmall.vue +2 -2
  80. package/src/components/JfbBasePosterGroup/Api.js +22 -0
  81. package/src/components/JfbBasePosterGroup/Attr.js +156 -0
  82. package/src/components/JfbBasePosterGroup/JfbBasePosterGroup.vue +268 -0
  83. package/src/components/JfbBasePosterGroup/JfbBasePosterGroupLess.less +79 -0
  84. package/src/components/JfbBasePosterGroup/JfbBasePosterGroupMixin.js +30 -0
  85. package/src/components/JfbBasePosterGroup/Mock.js +13 -0
  86. package/src/components/JfbBaseSavingDetail/Api.js +41 -0
  87. package/src/components/JfbBaseSavingDetail/Attr.js +70 -0
  88. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetail.vue +710 -0
  89. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetailLess.less +79 -0
  90. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetailMixin.js +30 -0
  91. package/src/components/JfbBaseSavingDetail/Mock.js +10 -0
  92. package/src/components/JfbBaseSavingDetail/components/echarts.min.js +26 -0
  93. package/src/components/JfbBaseSavingDetail/components/echarts.vue +254 -0
  94. package/src/components/JfbBaseSavingDetail/components/wx-canvas.js +105 -0
  95. package/src/components/JfbBaseShare/Api.js +20 -0
  96. package/src/components/JfbBaseShare/Attr.js +59 -0
  97. package/src/components/JfbBaseShare/JfbBaseShare.vue +276 -0
  98. package/src/components/JfbBaseShare/JfbBaseShareLess.less +79 -0
  99. package/src/components/JfbBaseShare/JfbBaseShareMixin.js +30 -0
  100. package/src/components/JfbBaseShare/Mock.js +16 -0
  101. package/src/components/JfbBaseSuccess/JfbBaseSuccess.vue +8 -3
  102. package/src/components/JfbBaseTfkSearch/ContentProduct.vue +12 -22
  103. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +12 -1
  104. package/src/components/JfbBaseTfkSearch/Mock.js +51 -3
  105. package/src/components/JfbBaseTfkSearch/listMixins.js +2 -1
  106. package/src/components/JfbBaseUserInfo/Attr.js +175 -11
  107. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +337 -115
  108. package/src/components/JfbBaseUserOrder/Attr.js +16 -0
  109. package/src/components/JfbBaseUserOrder/JfbBaseUserOrder.vue +11 -2
  110. package/src/components/JfbBaseWithDrawAgain/Api.js +41 -0
  111. package/src/components/JfbBaseWithDrawAgain/Attr.js +92 -0
  112. package/src/components/JfbBaseWithDrawAgain/JfbBaseWithDrawAgain.vue +354 -0
  113. package/src/components/JfbBaseWithDrawAgain/JfbBaseWithDrawAgainLess.less +79 -0
  114. package/src/components/JfbBaseWithDrawAgain/JfbBaseWithDrawAgainMixin.js +30 -0
  115. package/src/components/JfbBaseWithDrawAgain/Mock.js +10 -0
  116. package/src/components/JfbBaseWithDrawRecord/Api.js +19 -0
  117. package/src/components/JfbBaseWithDrawRecord/Attr.js +79 -0
  118. package/src/components/JfbBaseWithDrawRecord/JfbBaseWithDrawRecord.vue +233 -0
  119. package/src/components/JfbBaseWithDrawRecord/JfbBaseWithDrawRecordLess.less +79 -0
  120. package/src/components/JfbBaseWithDrawRecord/JfbBaseWithDrawRecordMixin.js +30 -0
  121. package/src/components/JfbBaseWithDrawRecord/Mock.js +7 -0
  122. package/src/components/JfbBaseWithdraw/Api.js +48 -0
  123. package/src/components/JfbBaseWithdraw/Attr.js +328 -0
  124. package/src/components/JfbBaseWithdraw/JfbBaseWithdraw.vue +272 -0
  125. package/src/components/JfbBaseWithdraw/JfbBaseWithdrawLess.less +79 -0
  126. package/src/components/JfbBaseWithdraw/JfbBaseWithdrawMixin.js +30 -0
  127. package/src/components/JfbBaseWithdraw/Mock.js +7 -0
  128. package/src/components/JfbBaseWxAuthorize/JfbBaseWxAuthorize.vue +10 -0
@@ -0,0 +1,1048 @@
1
+ <template>
2
+ <view class="jfb-base-consump-code" @click="handleEditxSelect" :class="{ editx : isEditx && active }">
3
+ <!--#ifdef H5-->
4
+ <view class="jfb-base-consump-code__edit" :class="{ editx : isEditx && active }" v-if="isEditx && active">
5
+ <view class="jfb-base-consump-code__edit-icon" @click="delEdit">删除</view>
6
+ </view>
7
+ <!-- #endif -->
8
+ <view v-if="!showMask" class="jfb-base-consump-code__body" :style="{
9
+ minHeight: layoutInfo.bodyMinHeightRpx + 'rpx',
10
+ background: 'url(https://img.js.design/assets/img/678f560988986af5661c2876.png#a3be067970d2c78a56d08024581a9ca0)',
11
+ backgroundSize: '100% 100%'
12
+ }">
13
+ <view class="content-box">
14
+ <view class="logo-box">
15
+ <image :src="userInfo['head_url']" class="logo"></image>
16
+ </view>
17
+ <view v-if="isFlow">
18
+ <view @click="handleToShop" class="shop">
19
+ <view>{{shopName}}</view>
20
+ <XdFontIcon size="20" icon="iconxiangyou_xian"></XdFontIcon>
21
+ </view>
22
+ <view class="verification-item">
23
+ <view class="verification-item-label">提货标签</view>
24
+ <view class="verification-item-tags">
25
+ <view :style="{color:tag_id===item.value?mainColor:'',borderColor: tag_id===item.value?mainColor:''}"
26
+ v-for="(item,index) in settle_tag_list" :key="index" @click="handlerTagRadio(item)">{{item.label}}
27
+ </view>
28
+ </view>
29
+ <view class="nodata" v-if="settle_tag_list_status">结算标签为空,请联系店员设置后重试</view>
30
+ </view>
31
+ <view class="verification-item">
32
+ <view class="verification-item-label">提货点数</view>
33
+ <view class="verification-item-input">
34
+ <input v-model="total_price" @input="(value)=>handlerPrice(value)" type="text">
35
+ <xd-number v-if="curTag.is_static_price" class="xd-number" :min="1" :max="999" v-model="num"
36
+ @change="handleNumberChange"></xd-number>
37
+ <view :style="{color:mainColor}" class="tip">*提货点数请咨询店员,提货成功后无法退换</view>
38
+ </view>
39
+ </view>
40
+ <XdButton v-if="btnDisabled" style="margin-top: 200rpx;display:block" width="260rpx" type="primary" disabled>
41
+ 下一步</XdButton>
42
+ <XdButton v-else style="margin-top: 200rpx;display:block" width="260rpx" type="primary" @click="toPayOrder">
43
+ 下一步</XdButton>
44
+ <view v-if="plusDiscount">
45
+ <view class="vip" v-if="is_vip==='N'">
46
+ <view class="vip-title">
47
+ <view class="vip-title-left">PLUS会员专享</view>
48
+ <view class="vip-title-right">
49
+ <text>{{plusDiscount/1000}}</text>折
50
+ </view>
51
+ </view>
52
+ <view class="vip-open" @click="handleToOpen">
53
+ <xd-font-icon color="#FCBF28" size="20" icon="iconPLUShuiyuan"></xd-font-icon>
54
+ <text>立即开通</text>
55
+ <xd-font-icon size="20" icon="iconxiangyou_xian"></xd-font-icon>
56
+ </view>
57
+ </view>
58
+ <view class="is-vip" v-else>
59
+ <text>PLUS</text>会员消费专享 <text>{{plusDiscount/1000}}</text>折
60
+ </view>
61
+ </view>
62
+ </view>
63
+ <view v-else>
64
+ <view>
65
+ <view @click="handleToShop" class="shop">
66
+ <view>{{shopName}}</view>
67
+ <XdFontIcon size="20" icon="iconxiangyou_xian"></XdFontIcon>
68
+ </view>
69
+ <image mode="aspectFit" class="bar-code" :src="barcode_url">
70
+ </image>
71
+ <view class="bar-code-text">{{barCode}}</view>
72
+ <image mode="aspectFit" class="qrcode" :src="code_url">
73
+ </image>
74
+ <view class="code-refresh">{{expiration_sec_str}}后自动更新</view>
75
+ <view v-if="plusDiscount">
76
+ <view class="vip" v-if="is_vip==='N'">
77
+ <view class="vip-title">
78
+ <view class="vip-title-left">PLUS会员专享</view>
79
+ <view class="vip-title-right">
80
+ <text>{{plusDiscount/1000}}</text>折
81
+ </view>
82
+ </view>
83
+ <view class="vip-open" @click="handleToOpen">
84
+ <xd-font-icon color="#FCBF28" size="20" icon="iconPLUShuiyuan"></xd-font-icon>
85
+ <text>立即开通</text>
86
+ <xd-font-icon size="20" icon="iconxiangyou_xian"></xd-font-icon>
87
+ </view>
88
+ </view>
89
+ <view class="is-vip" v-else>
90
+ <text>PLUS</text>会员消费专享 <text>{{plusDiscount/1000}}</text>折
91
+ </view>
92
+ </view>
93
+ </view>
94
+ </view>
95
+
96
+ </view>
97
+ </view>
98
+ <view :style="{
99
+ minHeight: layoutInfo.bodyMinHeightRpx + 'rpx',
100
+ background: 'url(https://img1-b.jufubao.cn/uploads/20250507/1a97fda8cd8804f9bcf984da10e0a666.png?x-oss-process=style/size8)',
101
+ backgroundSize: '100% 100%'
102
+ }" v-else>
103
+ <view
104
+ style="display: flex;justify-content: center;align-items: center;height: 100vh;font-size: 30rpx;color: #333">
105
+ {{tip}}</view>
106
+ </view>
107
+ <XdDialog width="80%" :show.sync="showDialog" :showClose="false" :showTitle="true">
108
+ <view class="dialog-title" slot="title">门店确认</view>
109
+ <view class="dialog-content">
110
+ <view>当前门店:<span :style="{color:mainColor}">{{shopName}}</span></view>
111
+ <view>请确认您是否在当前门店中</view>
112
+ </view>
113
+ <view class="dialog-btns" slot="btn">
114
+ <XdButton @click="handleToShop" bgColor="#EEEEEE" color="#888888" size="small" type="info">更换门店</XdButton>
115
+ <XdButton @click="handleConfirm" size="small" type="primary">确认</XdButton>
116
+ </view>
117
+ </XdDialog>
118
+ </view>
119
+ </template>
120
+
121
+ <script>
122
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
123
+ import XdDialog from "@/components/XdDailog/XdDailog";
124
+ import XdButton from "@/components/XdButton/XdButton";
125
+ import { jfbRootExec } from "@/utils/xd.event";
126
+ import JfbBaseConsumpCodeMixin from "./JfbBaseConsumpCodeMixin";
127
+ import getServiceUrl from "@/common/getServiceUrl";
128
+ import { getContainerPropsValue, isWechat, isWechatTools } from "@/utils/xd.base";
129
+ import componentsMixins from "@/mixins/componentsMixins";
130
+ import extsMixins from "@/mixins/extsMixins";
131
+ import { mapState } from 'vuex';
132
+
133
+ export default {
134
+ name: "JfbBaseConsumpCode",
135
+ components: {
136
+ XdFontIcon,
137
+ XdDialog,
138
+ XdButton
139
+ },
140
+ mixins: [
141
+ componentsMixins, extsMixins, JfbBaseConsumpCodeMixin
142
+ ],
143
+ data() {
144
+ return {
145
+ openPath: "",
146
+ shopPath: "",
147
+ successPath: "",
148
+ cashPayPath: "",
149
+ showDialog: false,
150
+ showMask: true,
151
+ shop_id: '',
152
+ secondTimer: null,
153
+ expiration_sec: '',
154
+ code_url: '',
155
+ barcode_url: '',
156
+ barCode: '',
157
+ statusTimer: null,
158
+ validTimer: null,
159
+ payChannels: [],
160
+ channel_provider_id: "",
161
+ options: {},
162
+ canEdit: true,
163
+ settle_tag_list: [],
164
+ settle_tag_list_status: false,
165
+ tag_id: "",
166
+ price: "",
167
+ total_price: "",
168
+ num: 1,
169
+ tip: '',
170
+ shopName: '',
171
+ isFlow: false,
172
+ xnamespace: '',
173
+ plusDiscount: 0,
174
+ userInfo: {},
175
+ is_vip: 'N',
176
+ isPreview: false,
177
+ jwxSDK: null
178
+ }
179
+ },
180
+ watch: {
181
+ container(value, oldValue) {
182
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
183
+ if (this.$configProject['isPreview']) this.init(value)
184
+ },
185
+ stateLocation(n, o) {
186
+ if (JSON.stringify(n) === JSON.stringify(o)) return;
187
+ this.onJfbLoad(this.options)
188
+ }
189
+ },
190
+ computed: {
191
+ ...mapState({
192
+ stateCity: state => state.cityLocation.city,
193
+ stateLocation: state => state.cityLocation.location || {},
194
+ brandInfo: state => state.brandInfo,
195
+ jfbAuthorize: (state) => state.jfbAuthorize,
196
+ }),
197
+ expiration_sec_str() {
198
+ //秒数转 x分x秒
199
+ let second = this.expiration_sec;
200
+ if (second < 60) {
201
+ return second + "秒";
202
+ }
203
+ let min = parseInt(second / 60);
204
+ let sec = second % 60;
205
+ return `${min}分${sec}秒`;
206
+ },
207
+ curTag() {
208
+ return this.settle_tag_list.find(item => item.value === this.tag_id) || {}
209
+ },
210
+ curTagPrice() {
211
+ const curTag = this.curTag;
212
+ if (this.$xdUniHelper.isEmpty(curTag)) return 0;
213
+ if (curTag.is_static_price) {
214
+ return curTag.price_yuan;
215
+ } else {
216
+ return this.total_price;
217
+ }
218
+ },
219
+ btnDisabled() {
220
+ return this.total_price === '' || !this.tag_id;
221
+ }
222
+ },
223
+ created() {
224
+ this.isPreview = this.$configProject['isPreview']
225
+ this.is_vip = this.getTokenForKey('user_level') && this.getTokenForKey('user_level') === 'VIP' ? 'Y' : 'N'
226
+ this.init(this.container);
227
+ // #ifdef H5
228
+ if (!this.$configProject.isPreview && (isWechat() || isWechatTools())) {
229
+ this.getH5WxAuthorize()
230
+ }
231
+ // #endif
232
+ },
233
+ methods: {
234
+ async onJfbLoad(options) {
235
+ this.xnamespace = this.projectAttr.business_code
236
+ this.getUserInfo()
237
+ this.options = options
238
+ if (!this.isPreview) {
239
+ console.log(this.stateLocation, 'this.stateLocation');
240
+
241
+ if (Object.keys(this.stateLocation).length === 0) {
242
+ this.tip = '为了给您提供更好的服务需要获取您的位置信息'
243
+ this.showMask = true;
244
+ this.showDialog = false;
245
+ return
246
+ }
247
+ }
248
+ if (!this.options.shop_id) {
249
+ jfbRootExec("getConsumpShopList", {
250
+ vm: this,
251
+ data: {
252
+ city_code: this.stateCity.city_code,
253
+ consume_mode: 'SELL',
254
+ latitude: this.stateLocation.latitude + '',
255
+ longitude: this.stateLocation.longitude + '',
256
+ },
257
+ }).then(res => {
258
+ if (res && res.list.length > 0) {
259
+ this.shop_id = res.list[0].shop_id;
260
+ this.shopName = res.list[0].resource_shop_name;
261
+ this.showMask = true;
262
+ this.showDialog = true;
263
+ } else {
264
+ this.tip = '您的附近暂时没有支持的店铺'
265
+ this.showDialog = false;
266
+ }
267
+ })
268
+ } else {
269
+ this.shop_id = this.options.shop_id;
270
+ this.p_getAsyncStep();
271
+ }
272
+ },
273
+ /**
274
+ * @description 监听事件变化
275
+ * @param container {object} 业务组件对象自己
276
+ */
277
+ init(container) {
278
+ this.openPath = getContainerPropsValue(
279
+ container,
280
+ "content.openPath",
281
+ { value: "" }
282
+ ).value;
283
+ this.shopPath = getContainerPropsValue(
284
+ container,
285
+ "content.shopPath",
286
+ { value: "" }
287
+ ).value;
288
+ this.successPath = getContainerPropsValue(
289
+ container,
290
+ "content.successPath",
291
+ { value: "" }
292
+ ).value;
293
+ this.cashPayPath = getContainerPropsValue(container, 'content.cash_pay_path', { value: "" }
294
+ ).value;
295
+ },
296
+ getUserInfo() {
297
+ jfbRootExec("getConsumpBaseUserInfo", {
298
+ vm: this,
299
+ data: {},
300
+ }).then(res => {
301
+ this.userInfo = res || {};
302
+ })
303
+ },
304
+ async p_getAsyncStep() {
305
+ await this.p_getQuickPayQRCode();
306
+ if (!this.isFlow) {
307
+ this.p_getQRCodeStatus();
308
+ this.p_getListUserPayChannel();
309
+ }
310
+ },
311
+ getH5WxAuthorize() {
312
+ jfbRootExec("getH5WxAuthorize", {
313
+ vm: this,
314
+ data: { jsApiList: ["chooseWXPay"], },
315
+ })
316
+ .then((res) => {
317
+ this.jwxSDK = res.jwxSDK;
318
+ console.log('this.jwxSDK', this.jwxSDK);
319
+ })
320
+ .catch(error => {
321
+ this.$xdAlert({
322
+ content: error,
323
+ });
324
+ });
325
+ },
326
+ p_getListUserPayChannel() {
327
+ const { pay_channels } = this.projectAttr;
328
+ jfbRootExec("getConsumpListUserPayChannel", {
329
+ vm: this,
330
+ data: {
331
+ providers: pay_channels && pay_channels.join(","),
332
+ },
333
+ }).then((res) => {
334
+ console.log("p_getListUserPayChannel", res);
335
+ this.payChannels = res.list;
336
+ this.channel_provider_id = res.list[0].channel_provider_id;
337
+ });
338
+ },
339
+ p_getQuickPayQRCode() {
340
+ return new Promise((resolve, reject) => {
341
+ this.$xdShowLoading({});
342
+ jfbRootExec("getConsumpCode", {
343
+ vm: this,
344
+ data: {
345
+ shop_id: this.shop_id,
346
+ temp_order_id: this.temp_order_id,
347
+ }
348
+ }).then(res => {
349
+ this.$xdHideLoading();
350
+ this.plusDiscount = res.plus_discount
351
+ if (res.is_st_flow === 'Y') {
352
+ //水牌
353
+ this.isFlow = true
354
+ this.showMask = false;
355
+ this.shopName = res.resource_shop_name;
356
+ this.getSettleTagList()
357
+ } else {
358
+ // 消费码
359
+ this.temp_order_id = res.temp_order_id;
360
+ let code_url = this.brandInfo['api_host'] + res.code_url;
361
+ let barcode_url = this.brandInfo['api_host'] + res.barcode_url;
362
+ if (this.isPreview) {
363
+ code_url = 'https://sandbox-apis.jufubao.cn/common/v1/image/qrcode?code_content=h.161.v91654768653746&size=240'
364
+ barcode_url = 'https://sandbox-apis.jufubao.cn/common/v1/image/barcode?code_content=h.161.v91654768653746'
365
+ }
366
+ this.code_url = code_url;
367
+ this.barcode_url = barcode_url;
368
+ this.barCode = res.payment_code
369
+ this.expiration_sec = res.expiration_sec;
370
+ this.showMask = false;
371
+ this.shopName = res.resource_shop_name;
372
+ clearInterval(this.secondTimer);
373
+ this.secondTimer = setInterval(() => {
374
+ this.expiration_sec--;
375
+ if (this.expiration_sec <= 0) {
376
+ clearInterval(this.secondTimer);
377
+ this.p_getQuickPayQRCode();
378
+ }
379
+ }, 1000);
380
+ resolve();
381
+ }
382
+
383
+ }).catch(err => {
384
+ console.error(err);
385
+ reject(err);
386
+ })
387
+ })
388
+ },
389
+ p_getQRCodeStatus() {
390
+ jfbRootExec("getConsumpCodeScanStatus", {
391
+ vm: this,
392
+ data: {
393
+ temp_order_id: this.temp_order_id,
394
+ shop_id: this.shop_id
395
+ }
396
+ }).then(res => {
397
+ //P处理中 Y成功 E 失败
398
+ if (res.status === 'P') {
399
+ if (!this.isPreview) {
400
+ if (this.statusTimer) clearTimeout(this.statusTimer);
401
+ this.statusTimer = setTimeout(() => {
402
+ this.p_getQRCodeStatus();
403
+ }, 2000);
404
+ }
405
+ } else if (res.status === 'Y') {
406
+ //订单下单有效时间 秒
407
+ if (this.statusTimer) clearTimeout(this.statusTimer);
408
+ this.orderSeconds = res.seconds;
409
+ if (this.orderSeconds > 0) {
410
+ this.validTimer = setInterval(() => {
411
+ this.orderSeconds--;
412
+ if (this.orderSeconds <= 0) {
413
+ this.handlerOderFail();
414
+ }
415
+
416
+ }, 1000)
417
+ }
418
+ this.p_createOrder();
419
+ } else if (res.status === 'E') {
420
+ if (this.statusTimer) clearTimeout(this.statusTimer);
421
+ this.$xdAlert({
422
+ content: res.message,
423
+ time: 1500,
424
+ isClose: false,
425
+ zIndex: 5000
426
+ });
427
+ }
428
+ })
429
+ },
430
+ p_createOrder() {
431
+ jfbRootExec("batchConsumpUseCardCreated", {
432
+ vm: this,
433
+ data: {
434
+ temp_order_id: this.temp_order_id,
435
+ business_code: this.xnamespace,
436
+ }
437
+ }).then(res => {
438
+ this.request_order_id = res.request_order_id;
439
+ this.p_getOrderStatus();
440
+ }).catch(err => {
441
+ this.handlerOderFail();
442
+ })
443
+ },
444
+ p_getOrderStatus() {
445
+ jfbRootExec("getConsumpAsyncSubmitStatus", {
446
+ vm: this,
447
+ data: {
448
+ request_order_id: this.request_order_id
449
+ }
450
+ }).then(res => {
451
+ let { hand_status, hand_status_msg, order_id, pay_order_id, need_pay_price } = res;
452
+
453
+ if (hand_status === 'U') {
454
+ this.orderTimer = setTimeout(() => {
455
+ this.p_getOrderStatus();
456
+ }, 2000)
457
+ } else if (hand_status === 'S') { //成功
458
+ if (parseFloat(need_pay_price) > 0) {//补差
459
+ this.handleThirdPay(pay_order_id, order_id);
460
+ } else {//订单成功
461
+ this.$xdUniHelper.redirectTo({
462
+ url: this.successPath + `?order_id=${order_id}`
463
+ })
464
+ }
465
+ } else if (hand_status === 'F') {
466
+ this.handlerOderFail();
467
+ this.$xdAlert({
468
+ content: hand_status_msg || '支付失败',
469
+ time: 3000,
470
+ isClose: false,
471
+ zIndex: 5000
472
+ });
473
+ }
474
+ })
475
+ },
476
+ openTemplatePay(paySignData, cb) {
477
+ console.log('openTemplatePay', paySignData);
478
+
479
+ const { timeStamp, ...otherData } = paySignData;
480
+ otherData["timestamp"] = timeStamp;
481
+ // #ifdef H5
482
+ this.jwxSDK.chooseWXPay({
483
+ ...otherData,
484
+ success: (res) => {
485
+ this.$xdLog.setARMSInfo({ options: this.options, res }, 'pay_success');
486
+ uni.showToast({
487
+ title: "支付成功",
488
+ });
489
+ cb(res);
490
+ },
491
+ cancel: () => {
492
+ this.onRefreshPage();
493
+ this.$xdLog.setARMSInfo(this.options, 'cancel_pay');
494
+ uni.showToast({
495
+ title: "取消支付",
496
+ });
497
+ },
498
+ fail: (error) => {
499
+ this.onRefreshPage();
500
+ if (typeof error === 'string') error = { error: error }
501
+ if (window['jwxJfbSDKParams']) error = Object.assign(error, paySignData, window['jwxJfbSDKParams'])
502
+ this.$xdLog.setARMSError(error)
503
+ uni.showToast({
504
+ title: "支付失败",
505
+ });
506
+ },
507
+ });
508
+ // #endif
509
+ // #ifdef MP
510
+ wx.requestPayment({
511
+ ...paySignData,
512
+ success: (res) => {
513
+ this.$xdLog.setARMSInfo({ options: this.options, res }, 'pay_success');
514
+ uni.showToast({
515
+ title: "支付成功",
516
+ icon: "none",
517
+ });
518
+ cb(res);
519
+ },
520
+ fail: (err) => {
521
+ this.onRefreshPage();
522
+ this.$xdLog.setARMSError({
523
+ options: this.options,
524
+ error: JSON.stringify(err)
525
+ });
526
+ uni.showToast({
527
+ title: "支付失败",
528
+ icon: "none",
529
+ });
530
+ },
531
+ });
532
+ // #endif
533
+ },
534
+ onRefreshPage() {
535
+ this.temp_order_id = "";
536
+ if (this.validTimer) clearInterval(this.validTimer)
537
+ this.p_getAsyncStep();
538
+ },
539
+ getSettleTagList() {
540
+ this.$xdShowLoading({});
541
+
542
+ jfbRootExec("getConsumpSettleMainInfo", {
543
+ vm: this,
544
+ data: {
545
+ shop_id: this.shop_id,
546
+ }
547
+ }).then(res => {
548
+ this.$xdHideLoading();
549
+ const { settle_tag_list } = res;
550
+ this.settle_tag_list = settle_tag_list;
551
+ if (settle_tag_list.length > 0) {
552
+ this.handlerTagRadio(settle_tag_list[0]);
553
+ this.settle_tag_list_status = false;
554
+ }
555
+ else this.settle_tag_list_status = true;
556
+ }).catch(err => {
557
+ this.$xdHideLoading();
558
+ this.$xdLog.catch(error)
559
+ })
560
+ },
561
+ toPayOrder(options = {}) {
562
+ let { tag_id, total_price, curTag, num = 1, shop_id } = this;
563
+ let err_tip = "";
564
+ if (!curTag.is_static_price) this.price = total_price;
565
+ if (curTag.is_static_price) {
566
+ if (total_price > 10000) {
567
+ err_tip = '金额不能超过10000'
568
+ }
569
+ }
570
+ let price = this.price;
571
+ if (!price) err_tip = "请填写正确的提货金额";
572
+ if (!tag_id) err_tip = "请选择结算标签";
573
+ if (err_tip) {
574
+ uni.showToast({
575
+ title: err_tip,
576
+ icon: 'none'
577
+ });
578
+ return false;
579
+ }
580
+ if (this.total_price == 0) {
581
+ uni.showToast(
582
+ {
583
+ title: '核销金额不能为0',
584
+ icon: 'none'
585
+ }
586
+ )
587
+ return
588
+ }
589
+ jfbRootExec("addConsumpCashierTempOrderData", {
590
+ vm: this,
591
+ data: {
592
+ shop_id: this.shop_id,
593
+ settle_tag_id: this.tag_id,
594
+ num: this.num,
595
+ settle_tag_price: this.curTagPrice,
596
+ total_price: this.total_price,
597
+ ...options
598
+ }
599
+ })
600
+ .then(res => {
601
+ if (res.confirm_notice) {
602
+ return this.useCardPop(res).then(data => {
603
+ if (data == 2) {
604
+ this.toPayOrder({
605
+ is_ignore_unique_check: "Y"
606
+ })
607
+ }
608
+ })
609
+ } else {
610
+ this.price = "";
611
+ let params = {
612
+ ...this.options,
613
+ price: price,
614
+ num: num,
615
+ tag: tag_id,
616
+ shop_id: shop_id,
617
+ cart_order_id: res.cart_order_id
618
+ };
619
+ params = this.$xdUniHelper.jsonToParams(params)
620
+ this.$xdUniHelper.navigateTo({
621
+ url: this.cashPayPath + `?${params}`
622
+ })
623
+ }
624
+ })
625
+ .catch(error => {
626
+ console.error(error);
627
+ })
628
+ },
629
+ //选卡弹出项
630
+ useCardPop(data) {
631
+ return new Promise((resolve, reject) => {
632
+ uni.showModal({
633
+ title: '提示',
634
+ content: data.msg,
635
+ // confirmText: data.confirm_text,
636
+ // cancelText: data.cancel_text,
637
+ success: function (res) {
638
+ if (res.confirm) {
639
+ resolve(2);
640
+ } else if (res.cancel) {
641
+ resolve();
642
+ }
643
+ },
644
+ fail: function (res) {
645
+ reject(res);
646
+ }
647
+ });
648
+ })
649
+ },
650
+ handlerPrice(e) {
651
+ this.$nextTick(() => {
652
+ this.total_price = e.detail.value.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/, '$1');
653
+ if (this.total_price > 10000) {
654
+ this.total_price = 10000
655
+ uni.showToast(
656
+ {
657
+ title: '核销金额不能超过10000',
658
+ icon: 'none'
659
+ }
660
+ )
661
+ }
662
+ })
663
+ },
664
+ handleThirdPay(pay_order_id, main_order_id) {
665
+ let { login_providers = [] } = this.projectAttr;
666
+ let data = {
667
+ order_id: pay_order_id,
668
+ channel_provider_id: this.channel_provider_id,
669
+ login_providers: login_providers.join(","),
670
+ };
671
+ //设置支付成功页面地址
672
+ if (!this.$configProject.isPreview) {
673
+ data['pay_success_url'] = '';
674
+ // #ifdef H5
675
+ data['pay_success_url'] = `${window.location.protocol}//${window.location.host}/${this.projectAttr.deploy_dir}`;
676
+ // #endif
677
+ data['pay_success_url'] += this.successPath + `?order_id=${main_order_id}`;
678
+ }
679
+
680
+ jfbRootExec("setConsumpThirdPlace", {
681
+ vm: this,
682
+ data,
683
+ })
684
+ .then((res) => {
685
+ this.$xdHideLoading();
686
+ const { channel_data } = res;
687
+ const paySignData = JSON.parse(Base64.decode(channel_data));
688
+ this.openTemplatePay(paySignData, (ps) => {
689
+ jfbRootExec("updateConsumpPay", {
690
+ vm: this,
691
+ data: {
692
+ main_order_id: main_order_id,
693
+ },
694
+ })
695
+ .then((res) => {
696
+ this.$xdUniHelper.redirectTo({
697
+ url: this.successPath + `?order_id=${main_order_id}`
698
+ });
699
+ })
700
+ .catch(error => {
701
+ this.$xdLog.setARMSCustomError('update_loading_fail', { options: this.options, error });
702
+ });
703
+ })
704
+ });
705
+ },
706
+ //订单失效
707
+ handlerOderFail() {
708
+ console.warn("handlerOderFail");
709
+ this.temp_order_id = "";
710
+ clearInterval(this.validTimer);
711
+ clearTimeout(this.orderTimer);
712
+ clearInterval(this.secondTimer);
713
+ },
714
+ handleToShop() {
715
+ this.$xdUniHelper.navigateTo({
716
+ url: this.shopPath
717
+ });
718
+ },
719
+ handleToOpen() {
720
+ this.$xdUniHelper.navigateTo({
721
+ url: this.openPath
722
+ });
723
+ },
724
+ handleConfirm() {
725
+ this.showDialog = false;
726
+ this.p_getAsyncStep();
727
+ },
728
+ handlerTagRadio(item) {
729
+ this.tag_id = item.value;
730
+ this.canEdit = !item.is_static_price;
731
+ this.num = 1;
732
+ if (item.is_static_price) {
733
+ this.total_price = item.price_yuan
734
+ this.price = item.price_yuan
735
+ } else {
736
+ this.total_price = "";
737
+ this.price = "";
738
+ }
739
+ },
740
+ handleNumberChange(num) {
741
+ let curTag = this.curTag;
742
+ this.total_price = this.$xdUniHelper.multiplyFloatNumber(curTag.price_yuan, num);
743
+ },
744
+ onJfbUnload(options) {
745
+ console.log('event.onJfbUnload', options)
746
+ if (this.secondTimer) clearInterval(this.secondTimer);
747
+ if (this.statusTimer) clearTimeout(this.statusTimer);
748
+ if (this.orderTimer) clearTimeout(this.orderTimer);
749
+ },
750
+ onJfbBack(options) {
751
+ console.log('event.onJfbBack', options)
752
+ if (this.secondTimer) clearInterval(this.secondTimer);
753
+ if (this.statusTimer) clearTimeout(this.statusTimer);
754
+ if (this.orderTimer) clearTimeout(this.orderTimer);
755
+ },
756
+ onJfbScroll(options) {
757
+ console.log('event.onJfbScroll', options)
758
+ },
759
+ onJfbReachBottom(options) {
760
+ console.log('event.onJfbReachBottom', options)
761
+ },
762
+ onJfbShow(options) {
763
+ console.log('event.onJfbShow', options)
764
+ this.onJfbLoad(options);
765
+ },
766
+ onJfbHide(options) {
767
+ console.log('event.onJfbHide', options)
768
+ if (this.secondTimer) clearInterval(this.secondTimer);
769
+ if (this.statusTimer) clearTimeout(this.statusTimer);
770
+ if (this.orderTimer) clearTimeout(this.orderTimer);
771
+ },
772
+ onJfbUpdate(...data) {
773
+ console.log('event.onJfbUpdate', data)
774
+ },
775
+ onJfbCustomEvent(options) {
776
+ console.log('event.onJfbReachBottom', options)
777
+ },
778
+ }
779
+ }
780
+
781
+ </script>
782
+
783
+ <style scoped lang="less">
784
+ @import "./JfbBaseConsumpCodeLess.less";
785
+
786
+ .jfb-base-consump-code {
787
+ &__body {
788
+ .content-box {
789
+ margin: 0 30rpx 0 30rpx;
790
+ background-color: #fff;
791
+ padding: 81rpx 32rpx 32rpx 32rpx;
792
+ border-radius: 24rpx;
793
+ position: relative;
794
+ top: 158rpx;
795
+ display: flex;
796
+ flex-direction: column;
797
+ align-items: center;
798
+ justify-content: center;
799
+
800
+ .logo-box {
801
+ width: 154rpx;
802
+ height: 154rpx;
803
+ background-color: #fff;
804
+ position: absolute;
805
+ top: -100rpx;
806
+ left: 50%;
807
+ transform: translate(-50%, 0);
808
+ display: flex;
809
+ justify-content: center;
810
+ align-items: center;
811
+ border-radius: 50%;
812
+
813
+ .logo {
814
+ width: 144rpx;
815
+ height: 144rpx;
816
+ border-radius: 50%;
817
+ }
818
+ }
819
+
820
+ }
821
+
822
+ .shop {
823
+ border: 2rpx solid #E6E6E6;
824
+ padding: 30rpx 40rpx;
825
+ border-radius: 24rpx;
826
+ color: #fff;
827
+ font-size: 26rpx;
828
+ display: flex;
829
+ justify-content: space-between;
830
+ align-items: center;
831
+ width: 520rpx;
832
+ background: linear-gradient(135deg, #2D2824 0%, #625344 100%);
833
+ ;
834
+ }
835
+
836
+ .bar-code {
837
+ height: 120rpx;
838
+ width: 600rpx;
839
+ margin: 38rpx 0 0 0;
840
+
841
+ &-text {
842
+ color: #999999;
843
+ font-size: 24rpx;
844
+ text-align: center;
845
+ }
846
+ }
847
+
848
+ .qrcode {
849
+ width: 272rpx;
850
+ height: 272rpx;
851
+ margin: 54rpx auto 18rpx auto;
852
+ display: flex;
853
+ justify-content: center;
854
+ align-items: center;
855
+
856
+ }
857
+
858
+ .code-refresh {
859
+ color: #999;
860
+ font-size: 24rpx;
861
+ width: 95%;
862
+ text-align: center;
863
+ }
864
+
865
+ .is-vip {
866
+ font-size: 28rpx;
867
+ color: #333333;
868
+ text-align: center;
869
+ padding-top: 40rpx;
870
+ margin-top: 40rpx;
871
+ border-top: 1px dashed rgba(229, 229, 229, 1);
872
+
873
+ &>text:first-child {
874
+ font-weight: 700;
875
+ }
876
+
877
+ &>text:last-child {
878
+ color: #D10300;
879
+ }
880
+ }
881
+
882
+ .vip {
883
+ display: flex;
884
+ align-items: center;
885
+ justify-content: space-between;
886
+ width: 100%;
887
+ padding-top: 40rpx;
888
+ margin-top: 40rpx;
889
+ border-top: 1px dashed rgba(229, 229, 229, 1);
890
+
891
+ &-title {
892
+ display: flex;
893
+ align-items: center;
894
+ padding-left: 20rpx;
895
+
896
+ &-left {
897
+ background: linear-gradient(90deg, #665646 0%, #473D34 52.05%, #2B2623 100%);
898
+ color: #EFD5C3;
899
+ font-size: 22rpx;
900
+ border-radius: 74rpx 0rpx 0rpx 74rpx;
901
+ padding: 18rpx 18rpx 18rpx 22rpx;
902
+ display: flex;
903
+ align-items: center;
904
+ justify-content: center;
905
+ }
906
+
907
+ &-right {
908
+ background: linear-gradient(270deg, #FCD6B8 0%, #FCEDD7 100%);
909
+ border-radius: 0px 80rpx 80rpx 0px;
910
+ padding: 5rpx 32rpx;
911
+ font-size: 22rpx;
912
+ display: flex;
913
+ align-items: center;
914
+ justify-content: center;
915
+
916
+ &>text {
917
+ color: #D10300;
918
+ font-weight: 700;
919
+ font-size: 43rpx;
920
+ margin-right: 5rpx;
921
+ }
922
+ }
923
+ }
924
+
925
+ &-open {
926
+ display: flex;
927
+ color: #86541E;
928
+ font-size: 28rpx;
929
+ align-items: center;
930
+
931
+ &>text {
932
+ margin: 0 8rpx;
933
+ }
934
+ }
935
+ }
936
+
937
+ .mask-box {
938
+ margin: 0 auto;
939
+
940
+ .mask {
941
+ width: 660rpx;
942
+ height: 640rpx;
943
+ display: flex;
944
+ flex-direction: column;
945
+ align-items: center;
946
+ justify-content: center;
947
+ background: url('https://img1-b.jufubao.cn/uploads/20250507/1a97fda8cd8804f9bcf984da10e0a666.png?x-oss-process=style/size8') no-repeat;
948
+ background-size: 100% 100%;
949
+
950
+ &-title {
951
+ font-size: 26rpx;
952
+ color: #666666;
953
+ margin-bottom: 48rpx;
954
+ width: 300rpx;
955
+ text-align: center;
956
+ }
957
+
958
+ &-open {
959
+ font-size: 28rpx;
960
+ }
961
+ }
962
+ }
963
+
964
+ .verification {
965
+ &-item {
966
+ display: flex;
967
+ margin-top: 60rpx;
968
+ align-items: baseline;
969
+
970
+ &-label {
971
+ color: #999999;
972
+ font-size: 30rpx;
973
+ margin-right: 64rpx;
974
+ flex-shrink: 0;
975
+ }
976
+
977
+ &-tags {
978
+ display: flex;
979
+ align-items: flex-start;
980
+ flex-wrap: wrap;
981
+
982
+ &>view {
983
+ margin-right: 32rpx;
984
+ font-size: 28rpx;
985
+ border-radius: 12rpx;
986
+ padding: 16rpx 24rpx;
987
+ border: 2rpx solid #EEEEEE;
988
+ color: #CCCCCC;
989
+ margin-bottom: 18rpx;
990
+ }
991
+
992
+ &>view:last-child {
993
+ margin-bottom: 0;
994
+ }
995
+
996
+ }
997
+
998
+ &-input {
999
+ display: flex;
1000
+ flex-direction: column;
1001
+ text-align: center;
1002
+ font-size: 28rpx;
1003
+
1004
+ &>input {
1005
+ border-radius: 10rpx;
1006
+ border: 2rpx solid #EEEEEE;
1007
+ padding: 20rpx 24rpx;
1008
+ }
1009
+
1010
+ .tip {
1011
+ font-size: 18rpx;
1012
+ margin-top: 12rpx;
1013
+ }
1014
+ }
1015
+ }
1016
+ }
1017
+
1018
+ .nodata {
1019
+ color: #f00;
1020
+ line-height: unit(68, rpx);
1021
+ font-size: unit(28, rpx);
1022
+ }
1023
+ }
1024
+
1025
+ .dialog-title {
1026
+ color: #333;
1027
+ font-size: 32rpx;
1028
+ }
1029
+
1030
+ .dialog-content {
1031
+ padding-bottom: 30rpx;
1032
+ border-bottom: 2rpx dashed #E5E5E5;
1033
+ font-size: 26rpx;
1034
+ color: #999999;
1035
+
1036
+ &>view:first-child {
1037
+ margin-bottom: 10rpx;
1038
+ }
1039
+ }
1040
+
1041
+ .dialog-btns {
1042
+ width: 100%;
1043
+ display: flex;
1044
+ justify-content: space-between;
1045
+
1046
+ }
1047
+ }
1048
+ </style>