jufubao-base 1.0.237-beta1 → 1.0.237-beta4

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