jufubao-base 1.0.237-beta1 → 1.0.237-beta11

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