jufubao-third 1.0.9-beta1 → 1.0.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-third",
3
- "version": "1.0.9-beta1",
3
+ "version": "1.0.9",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件第三方购物平台包",
6
6
  "main": "index.js",
@@ -1,4 +1,9 @@
1
1
  import { jfbRootExec } from "@/utils/xd.event";
2
+ // #ifdef H5
3
+ import cookie from "@/common/cookie";
4
+ //#endif
5
+ import {Base64} from "js-base64";
6
+
2
7
  export default {
3
8
  data(){
4
9
  return {
@@ -219,6 +224,29 @@ export default {
219
224
  }, 'create_order');
220
225
  })
221
226
  },
227
+
228
+
229
+ handleToPay(res){
230
+ let payPath = '';
231
+ let isMp = false;
232
+ // #ifdef H5
233
+ payPath = cookie.get(`jfb-pay-path-${this.brandInfo.site_id}`);
234
+ if(navigator.userAgent.match(/miniprogram/i)) isMp = true;
235
+ //#endif
236
+ if(payPath && isMp) {
237
+ payPath = Base64.encodeURI(`${this.thirdPayPath}?order_id=${res['pay_order_id']}&main_order_id=${res['order_id']}`);
238
+ this['$xdUniHelper'].redirectTo({
239
+ url: `/pages/jumptomp/jumptomp?callback=${payPath}`
240
+ });
241
+ }
242
+ else {
243
+ this.$xdUniHelper.redirectTo({
244
+ url: this.thirdPayPath + `?order_id=${res['pay_order_id']}&main_order_id=${res['order_id']}`
245
+ }, false, true)
246
+ }
247
+ },
248
+
249
+
222
250
  createSettleOrder(options, successCb){
223
251
  let postData = {
224
252
  ...options,
@@ -241,9 +269,7 @@ export default {
241
269
  }else{
242
270
  //支持补差, 跳转补差页
243
271
  if(this.payThird){
244
- this.$xdUniHelper.redirectTo({
245
- url: this.thirdPayPath + `?order_id=${res.pay_order_id}&main_order_id=${res.order_id}`
246
- })
272
+ this.handleToPay(res);
247
273
  }else{
248
274
  this.$xdAlert({
249
275
  content: '余额不足,请选择其他票券',
@@ -256,4 +282,4 @@ export default {
256
282
  })
257
283
  }
258
284
  }
259
- }
285
+ }