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