jufubao-base 1.0.239-beta1 → 1.0.239

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