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