jufubao-base 1.0.297-beta21 → 1.0.297-beta23

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.
@@ -1,22 +1,220 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
3
  module.exports = {
4
+ getConsumpCode: {
5
+ payment_code: "h.161.v80313631074495",
6
+ expiration_time: 1763083163,
7
+ expiration_sec: 60,
8
+ temp_order_id: "quickpay-5000433-XhWJn-MdO8Iheuu6lgSAX",
9
+ confirm_notice: true,
10
+ notice: "请询问店员核销金额",
11
+ cash_order_id: "",
12
+ code_url:
13
+ "/common/v1/image/qrcode?code_content=h.161.v80313631074495&size=240",
14
+ plus_discount: 8100,
15
+ is_st_flow: "Y",
16
+ barcode_url: "/common/v1/image/barcode?code_content=h.161.v80313631074495",
17
+ shop_name: "分账测试门店-固定标签",
18
+ resource_shop_name: "分账测试门店-固定标签",
19
+ qrcode_icon:
20
+ "https://img1.jufubao.cn/uploads/20230802/7a4f98f153282ef1cb089393c5b7f64e.png?x-oss-process=style/size8&ver=1735028642567",
21
+ shop_icon: "/uploads/20230710/44f645b06fe4da358f7b0ee06259afcd.jpg",
22
+ consume_options: [
23
+ {
24
+ consume_mode: "WB",
25
+ desc: "到店扫码消费任意金额可用",
26
+ icon: "iconduihuan",
27
+ show_price: ""
28
+ },
29
+ {
30
+ consume_mode: "JHD",
31
+ desc: "到店消费任意金额可用",
32
+ icon: "iconduihuan",
33
+ show_price: ""
34
+ },
35
+ {
36
+ consume_mode: "QP",
37
+ desc: "到店展码消费任意金额可用",
38
+ icon: "iconduihuan",
39
+ show_price: ""
40
+ }
41
+ ],
42
+ default_consume_type: "QP",
43
+ request_id: "3346ee37f1347085"
44
+ },
4
45
 
5
- getConsumpCode: { "payment_code": "h.161.v71913434717194", "expiration_time": 1744971193, "expiration_sec": 60, "temp_order_id": "quickpay-5000358-DBeMnvrvInuINYeTqbCXw", "confirm_notice": false, "notice": "", "cash_order_id": "", "code_url": "\/common\/v1\/image\/qrcode?code_content=h.161.v71913434717194&size=240", "plus_discount": 0, "is_st_flow": "张三", "barcode_url": "\/common\/v1\/image\/barcode?code_content=h.161.v71913434717194", "shop_name": "六九豆浆饺子(石门市场店)", "request_id": "52ebf80c255ebcb5" },
46
+ getConsumpCodeScanStatus: {
47
+ status: "P",
48
+ message: "",
49
+ order_data:
50
+ '{"total_amount":"0","pay_expire_time":"0","message":"","status":"P","cash_order_id":"","user_id":"5000358","channel_order_id":"","cart_order_id":""}',
51
+ seconds: 0,
52
+ request_id: "a54ac53ad31312d6"
53
+ },
6
54
 
7
- getConsumpCodeScanStatus: { "status": "P", "message": "", "order_data": "{\"total_amount\":\"0\",\"pay_expire_time\":\"0\",\"message\":\"\",\"status\":\"P\",\"cash_order_id\":\"\",\"user_id\":\"5000358\",\"channel_order_id\":\"\",\"cart_order_id\":\"\"}", "seconds": 0, "request_id": "a54ac53ad31312d6" },
55
+ getConsumpListUserPayChannel: {
56
+ list: [
57
+ {
58
+ channel_provider_id: "1rRq74ACKJj5nIx5CgLpb",
59
+ channel_provider_name: "微信",
60
+ channel_code: "wxpay",
61
+ channel_logo:
62
+ "https://jfb-public-images.oss-cn-qingdao.aliyuncs.com/system-paychannel-logo-wxpay.png?x-oss-process=style/200_200"
63
+ }
64
+ ],
65
+ request_id: "e142d26c3d24c060"
66
+ },
8
67
 
9
- getConsumpListUserPayChannel: { "list": [{ "channel_provider_id": "1rRq74ACKJj5nIx5CgLpb", "channel_provider_name": "微信", "channel_code": "wxpay", "channel_logo": "https:\/\/jfb-public-images.oss-cn-qingdao.aliyuncs.com\/system-paychannel-logo-wxpay.png?x-oss-process=style\/200_200" }], "request_id": "e142d26c3d24c060" },
68
+ batchConsumpUseCardCreated: {
69
+ request_order_id: "quickpay-5000358-DBeMnvrvInuINYeTqbCXw",
70
+ request_id: "e17499843ece44b1"
71
+ },
10
72
 
11
- batchConsumpUseCardCreated: { "request_order_id": "quickpay-5000358-DBeMnvrvInuINYeTqbCXw", "request_id": "e17499843ece44b1" },
73
+ getConsumpAsyncSubmitStatus: {
74
+ hand_status: "U",
75
+ hand_status_msg: "异步下单中",
76
+ order_id: "",
77
+ pay_order_id: "",
78
+ need_pay_price: "0",
79
+ request_id: "fddff0af4216825d"
80
+ },
12
81
 
13
- getConsumpAsyncSubmitStatus: { "hand_status": "U", "hand_status_msg": "异步下单中", "order_id": "", "pay_order_id": "", "need_pay_price": "0", "request_id": "fddff0af4216825d" },
14
-
15
- getConsumpShopList: {"categories":[{"label":"商超","value":100518},{"label":"蛋糕店","value":100519}],"namespaces":[{"label":"蛋糕(勿改)","value":"cake"}],"brands":[{"label":"测试1111","value":14,"icon":"\/uploads\/20230324\/3265afeb6a1f2a94f25c968a09275574.png"},{"label":"好利来","value":3,"icon":"\/uploads\/20230524\/b18190a6d80ae31a84a1ed53fc0dc8aa.jpg"}],"list":[{"brand_id":14,"brand_name":"测试1111","brand_type":"MA","business_status":"OPEN_BUSINESS","consume_mode":["SELL"],"consume_mode_name":"","distance":"37km","distance_conversion":"36.8km","default_consume_type":"CV","consume_type":["CV"],"is_support_jhd":false,"address":"通州区马驹桥镇北京通州区","province_name":"","city_name":"","area_name":"","street_name":"","phone":"13152565898","resource_shop_id":8003538,"exts_params":"eyJyZXNvdXJjZV9zaG9wX2lkIjo4MDAzNTM4LCJzaG9wX2lkIjoxMDUwMzQyLCJ2ZXJzaW9uIjoyfQ","resource_shop_name":"新建559","shop_icon":"https://sandbox-img2.jufubao.cn\/uploads\/20230324\/3265afeb6a1f2a94f25c968a09275574.png","shop_id":1050342,"shop_tags":[],"stars":0,"time_slot_name":"-","business_code":"","longitude":"116.6634126629373","latitude":"39.91601857510662","discount_ratio":7200},{"brand_id":14,"brand_name":"测试1111","brand_type":"MA","business_status":"CLOSED","consume_mode":["SELL"],"consume_mode_name":"","distance":"38km","distance_conversion":"37.9km","default_consume_type":"CV","consume_type":["CV"],"is_support_jhd":true,"address":"顺义区东六环与顺于路交叉口东150米","province_name":"","city_name":"","area_name":"","street_name":"","phone":"(010)89430806","resource_shop_id":8003489,"exts_params":"eyJyZXNvdXJjZV9zaG9wX2lkIjo4MDAzNDg5LCJzaG9wX2lkIjoxMTUzNTIwLCJ2ZXJzaW9uIjoyfQ","resource_shop_name":"六九豆浆饺子(石门市场店)","shop_icon":"https://sandbox-img2.jufubao.cn\/uploads\/20230324\/3265afeb6a1f2a94f25c968a09275574.png","shop_id":1153520,"shop_tags":[],"stars":0,"time_slot_name":"-","business_code":"","longitude":"116.65307505295904","latitude":"40.07088305940431","discount_ratio":7200}],"total_size":6,"next_page_token":"2","request_id":"d7071936733ed3f5"},
82
+ getConsumpShopList: {
83
+ categories: [
84
+ { label: "商超", value: 100518 },
85
+ { label: "蛋糕店", value: 100519 }
86
+ ],
87
+ namespaces: [{ label: "蛋糕(勿改)", value: "cake" }],
88
+ brands: [
89
+ {
90
+ label: "测试1111",
91
+ value: 14,
92
+ icon: "/uploads/20230324/3265afeb6a1f2a94f25c968a09275574.png"
93
+ },
94
+ {
95
+ label: "好利来",
96
+ value: 3,
97
+ icon: "/uploads/20230524/b18190a6d80ae31a84a1ed53fc0dc8aa.jpg"
98
+ }
99
+ ],
100
+ list: [
101
+ {
102
+ brand_id: 14,
103
+ brand_name: "测试1111",
104
+ brand_type: "MA",
105
+ business_status: "OPEN_BUSINESS",
106
+ consume_mode: ["SELL"],
107
+ consume_mode_name: "",
108
+ distance: "37km",
109
+ distance_conversion: "36.8km",
110
+ default_consume_type: "CV",
111
+ consume_type: ["CV"],
112
+ is_support_jhd: false,
113
+ address: "通州区马驹桥镇北京通州区",
114
+ province_name: "",
115
+ city_name: "",
116
+ area_name: "",
117
+ street_name: "",
118
+ phone: "13152565898",
119
+ resource_shop_id: 8003538,
120
+ exts_params:
121
+ "eyJyZXNvdXJjZV9zaG9wX2lkIjo4MDAzNTM4LCJzaG9wX2lkIjoxMDUwMzQyLCJ2ZXJzaW9uIjoyfQ",
122
+ resource_shop_name: "新建559",
123
+ shop_icon:
124
+ "https://sandbox-img2.jufubao.cn/uploads/20230324/3265afeb6a1f2a94f25c968a09275574.png",
125
+ shop_id: 1050342,
126
+ shop_tags: [],
127
+ stars: 0,
128
+ time_slot_name: "-",
129
+ business_code: "",
130
+ longitude: "116.6634126629373",
131
+ latitude: "39.91601857510662",
132
+ discount_ratio: 7200
133
+ },
134
+ {
135
+ brand_id: 14,
136
+ brand_name: "测试1111",
137
+ brand_type: "MA",
138
+ business_status: "CLOSED",
139
+ consume_mode: ["SELL"],
140
+ consume_mode_name: "",
141
+ distance: "38km",
142
+ distance_conversion: "37.9km",
143
+ default_consume_type: "CV",
144
+ consume_type: ["CV"],
145
+ is_support_jhd: true,
146
+ address: "顺义区东六环与顺于路交叉口东150米",
147
+ province_name: "",
148
+ city_name: "",
149
+ area_name: "",
150
+ street_name: "",
151
+ phone: "(010)89430806",
152
+ resource_shop_id: 8003489,
153
+ exts_params:
154
+ "eyJyZXNvdXJjZV9zaG9wX2lkIjo4MDAzNDg5LCJzaG9wX2lkIjoxMTUzNTIwLCJ2ZXJzaW9uIjoyfQ",
155
+ resource_shop_name: "六九豆浆饺子(石门市场店)",
156
+ shop_icon:
157
+ "https://sandbox-img2.jufubao.cn/uploads/20230324/3265afeb6a1f2a94f25c968a09275574.png",
158
+ shop_id: 1153520,
159
+ shop_tags: [],
160
+ stars: 0,
161
+ time_slot_name: "-",
162
+ business_code: "",
163
+ longitude: "116.65307505295904",
164
+ latitude: "40.07088305940431",
165
+ discount_ratio: 7200
166
+ }
167
+ ],
168
+ total_size: 6,
169
+ next_page_token: "2",
170
+ request_id: "d7071936733ed3f5"
171
+ },
16
172
 
17
- getConsumpSettleMainInfo: { "shop_id": 1037266, "shop_logo": "\/uploads\/20230710\/44f645b06fe4da358f7b0ee06259afcd.jpg", "shop_name": "a加盟商-185", "shop_brand": 100003, "shop_partner_name": "A加盟商-余额测试", "settle_tag_list": [{ "label": "幸福西饼、goodlike品牌", "value": 262, "price": 0, "price_yuan": "0.00", "is_static_price": false, "icon_url": "https:\/\/sandbox-img.jufubao.cn\/uploads\/20230728\/70f4dd90cdf2681e71ccf41d332d71a0.jpeg" }], "request_id": "a4a6cfe9db905597" },
173
+ getConsumpSettleMainInfo: {
174
+ shop_id: 1037266,
175
+ shop_logo: "/uploads/20230710/44f645b06fe4da358f7b0ee06259afcd.jpg",
176
+ shop_name: "a加盟商-185",
177
+ shop_brand: 100003,
178
+ shop_partner_name: "A加盟商-余额测试",
179
+ settle_tag_list: [
180
+ {
181
+ label: "幸福西饼、goodlike品牌",
182
+ value: 262,
183
+ price: 0,
184
+ price_yuan: "0.00",
185
+ is_static_price: false,
186
+ icon_url:
187
+ "https://sandbox-img.jufubao.cn/uploads/20230728/70f4dd90cdf2681e71ccf41d332d71a0.jpeg"
188
+ }
189
+ ],
190
+ request_id: "a4a6cfe9db905597"
191
+ },
18
192
 
19
- getConsumpBaseUserInfo: { "user_name": "", "user_code": "WuE5Wotf08", "nickname": "张三", "real_name": "", "head_url": "https:\/\/thirdwx.qlogo.cn\/mmopen\/vi_32\/AOqEDeiaxss8GR4jD1GicIgyqWSOZV8xN23Iw3DOzFjVBzTFbdv21X7u9ZASQJYsTNm07XSq6ebzp4K4qu1JT26qGZ0qYFMe1nHdQjFZib83Fg\/132", "province_code": "", "city_code": "", "province_name": "", "city_name": "", "sex": "1", "sex_name": "男", "birthday_date": "2025-04-16", "phone_number": "177****7945", "show_user_name": "张三", "user_level": "VIP", "vip_expire_time": 1776157293, "request_id": "f1dbb1c0bb8da893" },
193
+ getConsumpBaseUserInfo: {
194
+ user_name: "",
195
+ user_code: "WuE5Wotf08",
196
+ nickname: "张三",
197
+ real_name: "",
198
+ head_url:
199
+ "https://thirdwx.qlogo.cn/mmopen/vi_32/AOqEDeiaxss8GR4jD1GicIgyqWSOZV8xN23Iw3DOzFjVBzTFbdv21X7u9ZASQJYsTNm07XSq6ebzp4K4qu1JT26qGZ0qYFMe1nHdQjFZib83Fg/132",
200
+ province_code: "",
201
+ city_code: "",
202
+ province_name: "",
203
+ city_name: "",
204
+ sex: "1",
205
+ sex_name: "男",
206
+ birthday_date: "2025-04-16",
207
+ phone_number: "177****7945",
208
+ show_user_name: "张三",
209
+ user_level: "VIP",
210
+ vip_expire_time: 1776157293,
211
+ request_id: "f1dbb1c0bb8da893"
212
+ },
20
213
 
21
- addConsumpCashierTempOrderData: { "cart_order_id": "c08f38347ec8bc5b", "request_id": "779bf62e988587ce" }
22
- }
214
+ addConsumpCashierTempOrderData: {
215
+ cart_order_id: "c08f38347ec8bc5b",
216
+ request_id: "779bf62e988587ce"
217
+ },
218
+
219
+ getMyPayOrderConfig: {"configs":[{"pay_method":"card","pay_method_name":"会享卡","priority_rules":["end_time","bind_time"],"options":[{"label":"优先使用即将到期","value":"end_time","wallet_amount":0},{"label":"按绑定时间","value":"bind_time","wallet_amount":0}],"wallet_amount":0},{"pay_method":"wallet","pay_method_name":"余额","priority_rules":[],"options":[{"label":"综合元宝","value":"fVun9HAuF47_waUq8F0RA","wallet_amount":0}],"wallet_amount":0}],"request_id":"5365d0f0e73f8c69"}
220
+ };
@@ -0,0 +1,327 @@
1
+ 'use strict';
2
+ import { jfbRootExec } from "@/utils/xd.event";
3
+ export default {
4
+ data() {
5
+ return {
6
+ payChannels: [],
7
+ channel_provider_id: "",
8
+ jwxSDK: null,
9
+ validTimer: null,
10
+ temp_order_id: "",
11
+ expiration_sec: '',
12
+ secondTimer: null,
13
+ statusTimer: null,
14
+
15
+ code_url: '',
16
+ barcode_url: '',
17
+ qrcode_icon: '',
18
+ barCode: '',
19
+ paySortList: [],
20
+ tempList: [],
21
+ deductDialog: false,
22
+ }
23
+ },
24
+ computed: {
25
+ curPaySelectShow(){
26
+ if(this.paySortList.length === 0) return ''
27
+ let curPay = this.paySortList[0];
28
+ return curPay.pay_method_name + (curPay.pay_method !== 'card' ? `: ${this.$xdUniHelper.divisionFloatNumber(curPay.wallet_amount, 100)}` : '')
29
+ },
30
+ expiration_sec_str() {
31
+ //秒数转 x分x秒
32
+ let second = this.expiration_sec;
33
+ if (second < 60) {
34
+ return second + "秒";
35
+ }
36
+ let min = parseInt(second / 60);
37
+ let sec = second % 60;
38
+ return `${min}分${sec}秒`;
39
+ },
40
+ },
41
+ methods: {
42
+ //获取jwxSDK实例,用于发起微信支付请求
43
+ getH5WxAuthorize() {
44
+ jfbRootExec("getH5WxAuthorize", {
45
+ vm: this,
46
+ data: { jsApiList: ["chooseWXPay"], },
47
+ })
48
+ .then((res) => {
49
+ this.jwxSDK = res.jwxSDK;
50
+ console.log('this.jwxSDK', this.jwxSDK);
51
+ })
52
+ .catch(error => {
53
+ this.$xdAlert({
54
+ content: error,
55
+ });
56
+ });
57
+ },
58
+ // 发起微信支付请求 (支付签名数据)
59
+ openTemplatePay(paySignData, cb) {
60
+ console.log('openTemplatePay', paySignData);
61
+
62
+ const { timeStamp, ...otherData } = paySignData;
63
+ otherData["timestamp"] = timeStamp;
64
+ // #ifdef H5
65
+ this.jwxSDK.chooseWXPay({
66
+ ...otherData,
67
+ success: (res) => {
68
+ this.refresh = false;
69
+ this.$xdLog.setARMSInfo({ options: this.options, res }, 'pay_success');
70
+ uni.showToast({
71
+ title: "支付成功",
72
+ });
73
+ cb(res);
74
+ },
75
+ cancel: () => {
76
+ this.onRefreshPage();
77
+ this.$xdLog.setARMSInfo(this.options, 'cancel_pay');
78
+ uni.showToast({
79
+ title: "取消支付",
80
+ });
81
+ },
82
+ fail: (error) => {
83
+ this.onRefreshPage();
84
+ if (typeof error === 'string') error = { error: error }
85
+ if (window['jwxJfbSDKParams']) error = Object.assign(error, paySignData, window['jwxJfbSDKParams'])
86
+ this.$xdLog.setARMSError(error)
87
+ uni.showToast({
88
+ title: "支付失败",
89
+ });
90
+ },
91
+ });
92
+ // #endif
93
+ // #ifdef MP
94
+ wx.requestPayment({
95
+ ...paySignData,
96
+ success: (res) => {
97
+ this.refresh = false;
98
+ this.$xdLog.setARMSInfo({ options: this.options, res }, 'pay_success');
99
+ uni.showToast({
100
+ title: "支付成功",
101
+ icon: "none",
102
+ });
103
+ cb(res);
104
+ },
105
+ fail: (err) => {
106
+ this.onRefreshPage();
107
+ this.$xdLog.setARMSError({
108
+ options: this.options,
109
+ error: JSON.stringify(err)
110
+ });
111
+ uni.showToast({
112
+ title: "支付失败",
113
+ icon: "none",
114
+ });
115
+ },
116
+ });
117
+ // #endif
118
+ },
119
+ //三方支付 - 微信补差支付
120
+ handleThirdPay(pay_order_id, main_order_id) {
121
+ let { login_providers = [] } = this.projectAttr;
122
+ let data = {
123
+ order_id: pay_order_id,
124
+ channel_provider_id: this.channel_provider_id,
125
+ login_providers: login_providers.join(","),
126
+ };
127
+ //设置支付成功页面地址
128
+ if (!this.$configProject.isPreview) {
129
+ data['pay_success_url'] = '';
130
+ // #ifdef H5
131
+ data['pay_success_url'] = `${window.location.protocol}//${window.location.host}/${this.projectAttr.deploy_dir}`;
132
+ // #endif
133
+ data['pay_success_url'] += this.successPath + `?order_id=${main_order_id}`;
134
+ }
135
+
136
+ jfbRootExec("setConsumpThirdPlace", {
137
+ vm: this,
138
+ data,
139
+ })
140
+ .then((res) => {
141
+ this.$xdHideLoading();
142
+ const { channel_data } = res;
143
+ const paySignData = JSON.parse(Base64.decode(channel_data));
144
+ this.openTemplatePay(paySignData, (ps) => {
145
+ jfbRootExec("updateConsumpPay", {
146
+ vm: this,
147
+ data: {
148
+ main_order_id: main_order_id,
149
+ },
150
+ })
151
+ .then((res) => {
152
+ this.$xdUniHelper.redirectTo({
153
+ url: this.successPath + `?order_id=${main_order_id}`
154
+ });
155
+ })
156
+ .catch(error => {
157
+ this.$xdLog.setARMSCustomError('update_loading_fail', { options: this.options, error });
158
+ });
159
+ })
160
+ });
161
+ },
162
+ onRefreshPage() {
163
+ this.temp_order_id = "";
164
+ if (this.validTimer) clearInterval(this.validTimer)
165
+ this.p_getAsyncStep();
166
+ },
167
+ //订单失效
168
+ handlerOderFail() {
169
+ console.warn("handlerOderFail");
170
+ this.temp_order_id = "";
171
+ clearInterval(this.validTimer);
172
+ clearTimeout(this.orderTimer);
173
+ clearInterval(this.secondTimer);
174
+ },
175
+ //获取订单状态 - 轮询订单状态
176
+ p_getOrderStatus() {
177
+ jfbRootExec("getConsumpAsyncSubmitStatus", {
178
+ vm: this,
179
+ data: {
180
+ request_order_id: this.request_order_id
181
+ }
182
+ }).then(res => {
183
+ let { hand_status, hand_status_msg, order_id, pay_order_id, need_pay_price } = res;
184
+
185
+ if (hand_status === 'U') {
186
+ this.orderTimer = setTimeout(() => {
187
+ this.p_getOrderStatus();
188
+ }, 2000)
189
+ } else if (hand_status === 'S') { //成功
190
+ if (parseFloat(need_pay_price) > 0) {//补差
191
+ this.handleThirdPay(pay_order_id, order_id);
192
+ } else {//订单成功
193
+ this.refresh = false
194
+ this.$xdUniHelper.redirectTo({
195
+ url: this.successPath + `?order_id=${order_id}`
196
+ })
197
+ }
198
+ } else if (hand_status === 'F') {
199
+ this.handlerOderFail();
200
+ this.$xdAlert({
201
+ content: hand_status_msg || '支付失败',
202
+ time: 3000,
203
+ isClose: false,
204
+ zIndex: 5000
205
+ });
206
+ }
207
+ })
208
+ },
209
+ //创建订单
210
+ p_createOrder() {
211
+ jfbRootExec("batchConsumpUseCardCreated", {
212
+ vm: this,
213
+ data: {
214
+ temp_order_id: this.temp_order_id,
215
+ business_code: this.xnamespace,
216
+ }
217
+ }).then(res => {
218
+ this.request_order_id = res.request_order_id;
219
+ this.p_getOrderStatus();
220
+ }).catch(err => {
221
+ this.handlerOderFail();
222
+ })
223
+ },
224
+ //获取支付码扫码状态 - 轮询支付状态
225
+ p_getQRCodeStatus() {
226
+ jfbRootExec("getConsumpCodeScanStatus", {
227
+ vm: this,
228
+ data: {
229
+ temp_order_id: this.temp_order_id,
230
+ shop_id: this.shop_id
231
+ }
232
+ }).then(res => {
233
+ //P处理中 Y成功 E 失败
234
+ if (res.status === 'P') {
235
+ if (!this.isPreview) {
236
+ if (this.statusTimer) clearTimeout(this.statusTimer);
237
+ this.statusTimer = setTimeout(() => {
238
+ this.p_getQRCodeStatus();
239
+ }, 2000);
240
+ }
241
+ } else if (res.status === 'Y') {
242
+ //订单下单有效时间 秒
243
+ if (this.statusTimer) clearTimeout(this.statusTimer);
244
+ this.orderSeconds = res.seconds;
245
+ if (this.orderSeconds > 0) {
246
+ this.validTimer = setInterval(() => {
247
+ this.orderSeconds--;
248
+ if (this.orderSeconds <= 0) {
249
+ this.handlerOderFail();
250
+ }
251
+
252
+ }, 1000)
253
+ }
254
+ this.p_createOrder();
255
+ } else if (res.status === 'E') {
256
+ if (this.statusTimer) clearTimeout(this.statusTimer);
257
+ this.$xdAlert({
258
+ content: res.message,
259
+ time: 1500,
260
+ isClose: false,
261
+ zIndex: 5000
262
+ });
263
+ }
264
+ })
265
+ },
266
+
267
+ //获取用户可用支付渠道
268
+ p_getListUserPayChannel() {
269
+ const { pay_channels } = this.projectAttr;
270
+ jfbRootExec("getConsumpListUserPayChannel", {
271
+ vm: this,
272
+ data: {
273
+ providers: pay_channels && pay_channels.join(","),
274
+ },
275
+ }).then((res) => {
276
+ console.log("p_getListUserPayChannel", res);
277
+ this.payChannels = res.list;
278
+ this.channel_provider_id = res.list[0].channel_provider_id;
279
+ });
280
+ },
281
+ //关闭支付方式排序弹窗
282
+ handleSortClose(){
283
+ this.deductDialog = false;
284
+ },
285
+ //显示支付方式排序弹窗
286
+ showSortDialog(){
287
+ this.deductDialog = true;
288
+ },
289
+ //支付方式排序
290
+ handleDeductSort(list){
291
+ console.log("handleDeductSort",list);
292
+ this.tempList = list;
293
+ },
294
+ //获取我的支付顺序配置
295
+ p_getMyPayOrderConfig(){
296
+ jfbRootExec("getMyPayOrderConfig", {
297
+ vm: this,
298
+ data: {},
299
+ }).then(res => {
300
+ this.paySortList = res.configs;
301
+ })
302
+ },
303
+ //提交支付方式的排序
304
+ doConfirmSortPay(){
305
+ if(this.tempList.length === 0){
306
+ this.deductDialog = false;
307
+ return false;
308
+ }
309
+ let configs = this.tempList.map(item => {
310
+ return {
311
+ pay_method: item.pay_method,
312
+ priority_rules: item.options.map(ii => ii.value)
313
+ }
314
+ })
315
+ console.log('configs',configs);
316
+ jfbRootExec("saveMyPayOrderConfig", {
317
+ vm: this,
318
+ data: {
319
+ configs: configs
320
+ }
321
+ }).then(res => {
322
+ this.deductDialog = false;
323
+ this.paySortList = this.tempList;
324
+ })
325
+ },
326
+ }
327
+ }
@@ -0,0 +1,94 @@
1
+ 'use strict';
2
+
3
+ export default (data)=>{
4
+ return [
5
+ {
6
+ label: '开通会员',
7
+ ele: 'xd-select-pages-path',
8
+ valueKey: 'openPath',
9
+ placeholder: '请选择开通会员跳转页面',
10
+ value: data.openPath || null,
11
+ labelInline: true,
12
+ setting: {
13
+ router: XdBus.getParentApi('getPagesTree'),
14
+ },
15
+ groupKey:'advanced',
16
+ className: 'input100',
17
+ },
18
+ {
19
+ label: '切换门店',
20
+ ele: 'xd-select-pages-path',
21
+ valueKey: 'shopPath',
22
+ placeholder: '请选择切换门店跳转页面',
23
+ value: data.shopPath || null,
24
+ labelInline: true,
25
+ setting: {
26
+ router: XdBus.getParentApi('getPagesTree'),
27
+ },
28
+ groupKey:'advanced',
29
+ className: 'input100',
30
+ },
31
+ {
32
+ label: '支付成功',
33
+ ele: 'xd-select-pages-path',
34
+ valueKey: 'successPath',
35
+ placeholder: '请选择支付成功跳转页面',
36
+ value: data.successPath || null,
37
+ labelInline: true,
38
+ setting: {
39
+ router: XdBus.getParentApi('getPagesTree'),
40
+ },
41
+ groupKey:'advanced',
42
+ className: 'input100',
43
+ },
44
+ {
45
+ label: '核销支付',
46
+ ele: 'xd-select-pages-path',
47
+ valueKey: 'cash_pay_path',
48
+ placeholder: '请选择核销支付跳转页面',
49
+ value: data.cash_pay_path || null,
50
+ labelInline: true,
51
+ setting: {
52
+ router: XdBus.getParentApi('getPagesTree'),
53
+ },
54
+ groupKey:'advanced',
55
+ className: 'input100',
56
+ },
57
+ {
58
+ label: '扫码提货',
59
+ ele: 'xd-select-pages-path',
60
+ valueKey: 'scanPath',
61
+ placeholder: '请选择扫码提货跳转页面',
62
+ value: data.scanPath || null,
63
+ labelInline: true,
64
+ setting: {
65
+ router: XdBus.getParentApi('getPagesTree'),
66
+ },
67
+ groupKey:'advanced',
68
+ className: 'input100',
69
+ },
70
+ {
71
+ label: '选取城市:',
72
+ ele: 'xd-select-pages-path',
73
+ valueKey: 'cityPath',
74
+ placeholder: '请选择选取城市跳转页面',
75
+ value: data.cityPath || null,
76
+ className: 'input100',
77
+ labelInline: true,
78
+ groupKey:'advanced',
79
+ setting: {
80
+ router: XdBus.getParentApi('getPagesTree')
81
+ },
82
+ inline: false,
83
+ },
84
+ {
85
+ label: '版本号:',
86
+ ele: 'el-input',
87
+ type: 'text',
88
+ groupKey: 'advanced',
89
+ valueKey: 'version',
90
+ value: 'v2.0',
91
+ hidden: true,
92
+ },
93
+ ]
94
+ }