jufubao-base 1.0.237-beta18 → 1.0.237-beta3

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 (131) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbBaseBlock/Attr.js +479 -34
  3. package/src/components/JfbBaseBlock/JfbBaseBlock.vue +52 -9
  4. package/src/components/JfbBaseFastLink/Attr.js +1 -12
  5. package/src/components/JfbBaseFastLink/JfbBaseFastLink.vue +0 -66
  6. package/src/components/JfbBaseHeader/Attr.js +0 -82
  7. package/src/components/JfbBaseHeader/JfbBaseHeader.vue +1 -47
  8. package/src/components/JfbBaseHeaderColumn/Attr.js +0 -82
  9. package/src/components/JfbBaseHeaderColumn/JfbBaseHeaderColumn.vue +2 -48
  10. package/src/components/JfbBaseLogin/JfbBaseLogin.vue +0 -11
  11. package/src/components/JfbBaseNoticeDialog/Api.js +1 -1
  12. package/src/components/JfbBaseNoticeDialog/Attr.js +0 -26
  13. package/src/components/JfbBaseNoticeDialog/JfbBaseNoticeDialog.vue +8 -27
  14. package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +18 -179
  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 +1 -11
  19. package/src/components/JfbBasePoster/Attr.js +1 -1
  20. package/src/components/JfbBasePosterBigSmall/JfbBasePosterBigSmall.vue +2 -2
  21. package/src/components/JfbBaseSuccess/JfbBaseSuccess.vue +2 -12
  22. package/src/components/JfbBaseTfkSearch/ContentProduct.vue +22 -12
  23. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +1 -12
  24. package/src/components/JfbBaseTfkSearch/Mock.js +3 -51
  25. package/src/components/JfbBaseTfkSearch/listMixins.js +1 -2
  26. package/src/components/JfbBaseUserInfo/Attr.js +11 -175
  27. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +115 -337
  28. package/src/components/JfbBaseUserOrder/Attr.js +0 -16
  29. package/src/components/JfbBaseUserOrder/JfbBaseUserOrder.vue +2 -11
  30. package/src/components/JfbBaseWxAuthorize/JfbBaseWxAuthorize.vue +0 -10
  31. package/src/mixins/componentsMixins.js +117 -28
  32. package/src/components/JfbBaseBalance/Api.js +0 -46
  33. package/src/components/JfbBaseBalance/Attr.js +0 -316
  34. package/src/components/JfbBaseBalance/JfbBaseBalance.vue +0 -334
  35. package/src/components/JfbBaseBalance/JfbBaseBalanceLess.less +0 -79
  36. package/src/components/JfbBaseBalance/JfbBaseBalanceMixin.js +0 -30
  37. package/src/components/JfbBaseBalance/Mock.js +0 -9
  38. package/src/components/JfbBaseCodeOpenVip/Api.js +0 -35
  39. package/src/components/JfbBaseCodeOpenVip/Attr.js +0 -281
  40. package/src/components/JfbBaseCodeOpenVip/JfbBaseCodeOpenVip.vue +0 -251
  41. package/src/components/JfbBaseCodeOpenVip/JfbBaseCodeOpenVipLess.less +0 -79
  42. package/src/components/JfbBaseCodeOpenVip/JfbBaseCodeOpenVipMixin.js +0 -30
  43. package/src/components/JfbBaseCodeOpenVip/Mock.js +0 -13
  44. package/src/components/JfbBaseConsumpCode/Api.js +0 -133
  45. package/src/components/JfbBaseConsumpCode/Attr.js +0 -61
  46. package/src/components/JfbBaseConsumpCode/JfbBaseConsumpCode.vue +0 -1017
  47. package/src/components/JfbBaseConsumpCode/JfbBaseConsumpCodeLess.less +0 -79
  48. package/src/components/JfbBaseConsumpCode/JfbBaseConsumpCodeMixin.js +0 -30
  49. package/src/components/JfbBaseConsumpCode/Mock.js +0 -22
  50. package/src/components/JfbBaseNoticeGroup/Api.js +0 -23
  51. package/src/components/JfbBaseNoticeGroup/Attr.js +0 -237
  52. package/src/components/JfbBaseNoticeGroup/JfbBaseNoticeGroup.vue +0 -174
  53. package/src/components/JfbBaseNoticeGroup/JfbBaseNoticeGroupLess.less +0 -79
  54. package/src/components/JfbBaseNoticeGroup/JfbBaseNoticeGroupMixin.js +0 -30
  55. package/src/components/JfbBaseNoticeGroup/Mock.js +0 -13
  56. package/src/components/JfbBaseOpenVip/Api.js +0 -39
  57. package/src/components/JfbBaseOpenVip/Attr.js +0 -331
  58. package/src/components/JfbBaseOpenVip/JfbBaseOpenVip.vue +0 -457
  59. package/src/components/JfbBaseOpenVip/JfbBaseOpenVipLess.less +0 -79
  60. package/src/components/JfbBaseOpenVip/JfbBaseOpenVipMixin.js +0 -30
  61. package/src/components/JfbBaseOpenVip/Mock.js +0 -7
  62. package/src/components/JfbBaseOpenVip/XdVipList.vue +0 -131
  63. package/src/components/JfbBaseOpenVipCard/Api.js +0 -58
  64. package/src/components/JfbBaseOpenVipCard/Attr.js +0 -48
  65. package/src/components/JfbBaseOpenVipCard/JfbBaseOpenVipCard.vue +0 -111
  66. package/src/components/JfbBaseOpenVipCard/JfbBaseOpenVipCardLess.less +0 -79
  67. package/src/components/JfbBaseOpenVipCard/JfbBaseOpenVipCardMixin.js +0 -30
  68. package/src/components/JfbBaseOpenVipCard/Mock.js +0 -13
  69. package/src/components/JfbBaseOpenVipDetail/Api.js +0 -35
  70. package/src/components/JfbBaseOpenVipDetail/Attr.js +0 -37
  71. package/src/components/JfbBaseOpenVipDetail/JfbBaseOpenVipDetail.vue +0 -234
  72. package/src/components/JfbBaseOpenVipDetail/JfbBaseOpenVipDetailLess.less +0 -79
  73. package/src/components/JfbBaseOpenVipDetail/JfbBaseOpenVipDetailMixin.js +0 -30
  74. package/src/components/JfbBaseOpenVipDetail/Mock.js +0 -15
  75. package/src/components/JfbBasePersonalData/Api.js +0 -26
  76. package/src/components/JfbBasePersonalData/Attr.js +0 -13
  77. package/src/components/JfbBasePersonalData/JfbBasePersonalData.vue +0 -200
  78. package/src/components/JfbBasePersonalData/JfbBasePersonalDataLess.less +0 -79
  79. package/src/components/JfbBasePersonalData/JfbBasePersonalDataMixin.js +0 -30
  80. package/src/components/JfbBasePersonalData/Mock.js +0 -13
  81. package/src/components/JfbBasePointsCard/Api.js +0 -18
  82. package/src/components/JfbBasePointsCard/Attr.js +0 -187
  83. package/src/components/JfbBasePointsCard/JfbBasePointsCard.vue +0 -212
  84. package/src/components/JfbBasePointsCard/JfbBasePointsCardLess.less +0 -79
  85. package/src/components/JfbBasePointsCard/JfbBasePointsCardMixin.js +0 -30
  86. package/src/components/JfbBasePointsCard/Mock.js +0 -5
  87. package/src/components/JfbBasePointsDetail/Api.js +0 -48
  88. package/src/components/JfbBasePointsDetail/Attr.js +0 -305
  89. package/src/components/JfbBasePointsDetail/JfbBasePointsDetail.vue +0 -267
  90. package/src/components/JfbBasePointsDetail/JfbBasePointsDetailLess.less +0 -79
  91. package/src/components/JfbBasePointsDetail/JfbBasePointsDetailMixin.js +0 -30
  92. package/src/components/JfbBasePointsDetail/Mock.js +0 -6
  93. package/src/components/JfbBasePosterGroup/Api.js +0 -22
  94. package/src/components/JfbBasePosterGroup/Attr.js +0 -156
  95. package/src/components/JfbBasePosterGroup/JfbBasePosterGroup.vue +0 -268
  96. package/src/components/JfbBasePosterGroup/JfbBasePosterGroupLess.less +0 -79
  97. package/src/components/JfbBasePosterGroup/JfbBasePosterGroupMixin.js +0 -30
  98. package/src/components/JfbBasePosterGroup/Mock.js +0 -13
  99. package/src/components/JfbBaseSavingDetail/Api.js +0 -41
  100. package/src/components/JfbBaseSavingDetail/Attr.js +0 -70
  101. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetail.vue +0 -710
  102. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetailLess.less +0 -79
  103. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetailMixin.js +0 -30
  104. package/src/components/JfbBaseSavingDetail/Mock.js +0 -10
  105. package/src/components/JfbBaseSavingDetail/components/echarts.min.js +0 -26
  106. package/src/components/JfbBaseSavingDetail/components/echarts.vue +0 -254
  107. package/src/components/JfbBaseSavingDetail/components/wx-canvas.js +0 -105
  108. package/src/components/JfbBaseShare/Api.js +0 -20
  109. package/src/components/JfbBaseShare/Attr.js +0 -14
  110. package/src/components/JfbBaseShare/JfbBaseShare.vue +0 -273
  111. package/src/components/JfbBaseShare/JfbBaseShareLess.less +0 -79
  112. package/src/components/JfbBaseShare/JfbBaseShareMixin.js +0 -30
  113. package/src/components/JfbBaseShare/Mock.js +0 -16
  114. package/src/components/JfbBaseWithDrawAgain/Api.js +0 -41
  115. package/src/components/JfbBaseWithDrawAgain/Attr.js +0 -92
  116. package/src/components/JfbBaseWithDrawAgain/JfbBaseWithDrawAgain.vue +0 -354
  117. package/src/components/JfbBaseWithDrawAgain/JfbBaseWithDrawAgainLess.less +0 -79
  118. package/src/components/JfbBaseWithDrawAgain/JfbBaseWithDrawAgainMixin.js +0 -30
  119. package/src/components/JfbBaseWithDrawAgain/Mock.js +0 -10
  120. package/src/components/JfbBaseWithDrawRecord/Api.js +0 -19
  121. package/src/components/JfbBaseWithDrawRecord/Attr.js +0 -79
  122. package/src/components/JfbBaseWithDrawRecord/JfbBaseWithDrawRecord.vue +0 -233
  123. package/src/components/JfbBaseWithDrawRecord/JfbBaseWithDrawRecordLess.less +0 -79
  124. package/src/components/JfbBaseWithDrawRecord/JfbBaseWithDrawRecordMixin.js +0 -30
  125. package/src/components/JfbBaseWithDrawRecord/Mock.js +0 -7
  126. package/src/components/JfbBaseWithdraw/Api.js +0 -48
  127. package/src/components/JfbBaseWithdraw/Attr.js +0 -328
  128. package/src/components/JfbBaseWithdraw/JfbBaseWithdraw.vue +0 -272
  129. package/src/components/JfbBaseWithdraw/JfbBaseWithdrawLess.less +0 -79
  130. package/src/components/JfbBaseWithdraw/JfbBaseWithdrawMixin.js +0 -30
  131. package/src/components/JfbBaseWithdraw/Mock.js +0 -7
@@ -1,1017 +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 v-if="!showMask" class="jfb-base-consump-code__body" :style="{
9
- minHeight: layoutInfo.bodyMinHeightRpx + 'rpx',
10
- background: 'url(https://img.js.design/assets/img/678f560988986af5661c2876.png#a3be067970d2c78a56d08024581a9ca0)',
11
- backgroundSize: '100% 100%'
12
- }">
13
- <view class="content-box">
14
- <view class="logo-box">
15
- <image :src="userInfo['head_url']" class="logo"></image>
16
- </view>
17
- <view v-if="isFlow">
18
- <view @click="handleToShop" class="shop">
19
- <view>{{shopName}}</view>
20
- <XdFontIcon size="20" icon="iconxiangyou_xian"></XdFontIcon>
21
- </view>
22
- <view class="verification-item">
23
- <view class="verification-item-label">提货标签</view>
24
- <view class="verification-item-tags">
25
- <view :style="{color:tag_id===item.value?mainColor:'',borderColor: tag_id===item.value?mainColor:''}"
26
- v-for="(item,index) in settle_tag_list" :key="index" @click="handlerTagRadio(item)">{{item.label}}
27
- </view>
28
- </view>
29
- <view class="nodata" v-if="settle_tag_list_status">结算标签为空,请联系店员设置后重试</view>
30
- </view>
31
- <view class="verification-item">
32
- <view class="verification-item-label">提货点数</view>
33
- <view class="verification-item-input">
34
- <input v-model="total_price" @input="(value)=>handlerPrice(value)" type="text">
35
- <xd-number v-if="curTag.is_static_price" class="xd-number" :min="1" :max="999" v-model="num"
36
- @change="handleNumberChange"></xd-number>
37
- <view :style="{color:mainColor}" class="tip">*提货点数请咨询店员,提货成功后无法退换</view>
38
- </view>
39
- </view>
40
- <XdButton v-if="btnDisabled" style="margin-top: 200rpx;display:block" width="260rpx" type="primary" disabled>下一步</XdButton>
41
- <XdButton v-else style="margin-top: 200rpx;display:block" 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
- this.onJfbLoad(options);
734
- },
735
- onJfbHide(options) {
736
- console.log('event.onJfbHide', options)
737
- if (this.secondTimer) clearInterval(this.secondTimer);
738
- if (this.statusTimer) clearTimeout(this.statusTimer);
739
- if (this.orderTimer) clearTimeout(this.orderTimer);
740
- },
741
- onJfbUpdate(...data) {
742
- console.log('event.onJfbUpdate', data)
743
- },
744
- onJfbCustomEvent(options) {
745
- console.log('event.onJfbReachBottom', options)
746
- },
747
- }
748
- }
749
-
750
- </script>
751
-
752
- <style scoped lang="less">
753
- @import "./JfbBaseConsumpCodeLess.less";
754
-
755
- .jfb-base-consump-code {
756
- &__body {
757
- .content-box {
758
- margin: 0 30rpx 0 30rpx;
759
- background-color: #fff;
760
- padding: 81rpx 32rpx 32rpx 32rpx;
761
- border-radius: 24rpx;
762
- position: relative;
763
- top: 158rpx;
764
- display: flex;
765
- flex-direction: column;
766
- align-items: center;
767
- justify-content: center;
768
-
769
- .logo-box {
770
- width: 154rpx;
771
- height: 154rpx;
772
- background-color: #fff;
773
- position: absolute;
774
- top: -100rpx;
775
- left: 50%;
776
- transform: translate(-50%, 0);
777
- display: flex;
778
- justify-content: center;
779
- align-items: center;
780
- border-radius: 50%;
781
-
782
- .logo {
783
- width: 144rpx;
784
- height: 144rpx;
785
- border-radius: 50%;
786
- }
787
- }
788
-
789
- }
790
-
791
- .shop {
792
- border: 2rpx solid #E6E6E6;
793
- padding: 30rpx 40rpx;
794
- border-radius: 24rpx;
795
- color: #fff;
796
- font-size: 26rpx;
797
- display: flex;
798
- justify-content: space-between;
799
- align-items: center;
800
- width: 520rpx;
801
- background: linear-gradient(135deg, #2D2824 0%, #625344 100%);
802
- ;
803
- }
804
-
805
- .bar-code {
806
- height: 120rpx;
807
- width: 600rpx;
808
- margin: 38rpx 0 0 0;
809
-
810
- &-text {
811
- color: #999999;
812
- font-size: 24rpx;
813
- text-align: center;
814
- }
815
- }
816
-
817
- .qrcode {
818
- width: 272rpx;
819
- height: 272rpx;
820
- margin: 54rpx auto 18rpx auto;
821
- display: flex;
822
- justify-content: center;
823
- align-items: center;
824
-
825
- }
826
-
827
- .code-refresh {
828
- color: #999;
829
- font-size: 24rpx;
830
- width: 95%;
831
- text-align: center;
832
- }
833
-
834
- .is-vip {
835
- font-size: 28rpx;
836
- color: #333333;
837
- text-align: center;
838
- padding-top: 40rpx;
839
- margin-top: 40rpx;
840
- border-top: 1px dashed rgba(229, 229, 229, 1);
841
-
842
- &>text:first-child {
843
- font-weight: 700;
844
- }
845
-
846
- &>text:last-child {
847
- color: #D10300;
848
- }
849
- }
850
-
851
- .vip {
852
- display: flex;
853
- align-items: center;
854
- justify-content: space-between;
855
- width: 100%;
856
- padding-top: 40rpx;
857
- margin-top: 40rpx;
858
- border-top: 1px dashed rgba(229, 229, 229, 1);
859
-
860
- &-title {
861
- display: flex;
862
- align-items: center;
863
- padding-left: 20rpx;
864
-
865
- &-left {
866
- background: linear-gradient(90deg, #665646 0%, #473D34 52.05%, #2B2623 100%);
867
- color: #EFD5C3;
868
- font-size: 22rpx;
869
- border-radius: 74rpx 0rpx 0rpx 74rpx;
870
- padding: 18rpx 18rpx 18rpx 22rpx;
871
- display: flex;
872
- align-items: center;
873
- justify-content: center;
874
- }
875
-
876
- &-right {
877
- background: linear-gradient(270deg, #FCD6B8 0%, #FCEDD7 100%);
878
- border-radius: 0px 80rpx 80rpx 0px;
879
- padding: 5rpx 32rpx;
880
- font-size: 22rpx;
881
- display: flex;
882
- align-items: center;
883
- justify-content: center;
884
-
885
- &>text {
886
- color: #D10300;
887
- font-weight: 700;
888
- font-size: 43rpx;
889
- margin-right: 5rpx;
890
- }
891
- }
892
- }
893
-
894
- &-open {
895
- display: flex;
896
- color: #86541E;
897
- font-size: 28rpx;
898
- align-items: center;
899
-
900
- &>text {
901
- margin: 0 8rpx;
902
- }
903
- }
904
- }
905
-
906
- .mask-box {
907
- margin: 0 auto;
908
-
909
- .mask {
910
- width: 660rpx;
911
- height: 640rpx;
912
- display: flex;
913
- flex-direction: column;
914
- align-items: center;
915
- justify-content: center;
916
- background: url('https://img1-b.jufubao.cn/uploads/20250507/1a97fda8cd8804f9bcf984da10e0a666.png?x-oss-process=style/size8') no-repeat;
917
- background-size: 100% 100%;
918
-
919
- &-title {
920
- font-size: 26rpx;
921
- color: #666666;
922
- margin-bottom: 48rpx;
923
- width: 300rpx;
924
- text-align: center;
925
- }
926
-
927
- &-open {
928
- font-size: 28rpx;
929
- }
930
- }
931
- }
932
-
933
- .verification {
934
- &-item {
935
- display: flex;
936
- margin-top: 60rpx;
937
- align-items: baseline;
938
-
939
- &-label {
940
- color: #999999;
941
- font-size: 30rpx;
942
- margin-right: 64rpx;
943
- flex-shrink: 0;
944
- }
945
-
946
- &-tags {
947
- display: flex;
948
- align-items: flex-start;
949
- flex-wrap: wrap;
950
-
951
- &>view {
952
- margin-right: 32rpx;
953
- font-size: 28rpx;
954
- border-radius: 12rpx;
955
- padding: 16rpx 24rpx;
956
- border: 2rpx solid #EEEEEE;
957
- color: #CCCCCC;
958
- margin-bottom: 18rpx;
959
- }
960
-
961
- &>view:last-child {
962
- margin-bottom: 0;
963
- }
964
-
965
- }
966
-
967
- &-input {
968
- display: flex;
969
- flex-direction: column;
970
- text-align: center;
971
- font-size: 28rpx;
972
-
973
- &>input {
974
- border-radius: 10rpx;
975
- border: 2rpx solid #EEEEEE;
976
- padding: 20rpx 24rpx;
977
- }
978
-
979
- .tip {
980
- font-size: 18rpx;
981
- margin-top: 12rpx;
982
- }
983
- }
984
- }
985
- }
986
-
987
- .nodata {
988
- color: #f00;
989
- line-height: unit(68, rpx);
990
- font-size: unit(28, rpx);
991
- }
992
- }
993
-
994
- .dialog-title {
995
- color: #333;
996
- font-size: 32rpx;
997
- }
998
-
999
- .dialog-content {
1000
- padding-bottom: 30rpx;
1001
- border-bottom: 2rpx dashed #E5E5E5;
1002
- font-size: 26rpx;
1003
- color: #999999;
1004
-
1005
- &>view:first-child {
1006
- margin-bottom: 10rpx;
1007
- }
1008
- }
1009
-
1010
- .dialog-btns {
1011
- width: 100%;
1012
- display: flex;
1013
- justify-content: space-between;
1014
-
1015
- }
1016
- }
1017
- </style>