jufubao-base 1.0.67 → 1.0.69-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.
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ getCouponList: {
5
+ "list": [
6
+ {
7
+ "prize_id": 25,
8
+ "prize_name": "满100减1",
9
+ "prize_num": 23
10
+ }
11
+ ],
12
+ "background": "//sandbox-img.jufubao.cn/uploads/20231123/4767f11be07185af4d31c657812dd96f.jpg",
13
+ "app_coupon_url": "//sandbox-img.jufubao.cn/uploads/20231123/9709c60e75753585d7bab94699ce1d96.jpg",
14
+ "request_id": "60417690eab2c156"
15
+ },
16
+ getAllCoupon: {
17
+ "request_id": "5987aa28c709d4ef"
18
+ }
19
+ }
@@ -179,6 +179,8 @@ import XdFormInput from "@/components/XdFormInput/XdFormInput";
179
179
  import XdRadio from "@/components/XdRadio/XdRadio";
180
180
  import XdUnit from "@/components/XdUnit/XdUnit";
181
181
  import StyleForm from "@/utils/StyleForm";
182
+ import {isWechat,isWechatTools} from "@/utils/xd.base";
183
+
182
184
  let styleForm = new StyleForm({bgColor: '#fafafa'}, getContainerPropsValue, 'pay');
183
185
 
184
186
  export default {
@@ -240,8 +242,9 @@ export default {
240
242
  },
241
243
  created() {
242
244
  this.init(this.container);
245
+
243
246
  // #ifdef H5
244
- if (!this.$configProject.isPreview){
247
+ if (!this.$configProject.isPreview && (isWechat() || isWechatTools())){
245
248
  this.p_getH5WxAuthorize()
246
249
  }
247
250
  // #endif
@@ -356,9 +359,10 @@ export default {
356
359
  },
357
360
  //第三方支付
358
361
  doThirdPay() {
359
- if(this.$configProject.isPreview) return ;
360
- const { channel_provider_id, order_id, payInfo } = this;
361
- let { login_providers = [] } = this.projectAttr;
362
+ if (this.$configProject.isPreview) return;
363
+ const {channel_provider_id, order_id, payInfo} = this;
364
+ let {login_providers = []} = this.projectAttr;
365
+ console.log(this.projectAttr)
362
366
  if (+payInfo.channel_amount > 0 && !this.channel_provider_id) {
363
367
  uni.showToast({
364
368
  title: "请选择支付方式",
@@ -367,17 +371,32 @@ export default {
367
371
  return false;
368
372
  }
369
373
  this.$xdShowLoading({});
374
+
375
+ let data = {
376
+ order_id,
377
+ channel_provider_id,
378
+ login_providers: login_providers.join(","),
379
+ };
380
+ // #ifdef H5
381
+ if (!(!this.$configProject.isPreview && (isWechat() || isWechatTools()))){
382
+ data['pay_success_url'] = `${window.location.protocol}//${window.location.host}/${this.projectAttr.deploy_dir}`;
383
+ data['pay_success_url'] += this.getSuccessUrl + `?order_id=${this.main_order_id}`;
384
+ }
385
+ // #endif
386
+
387
+
370
388
  jfbRootExec("setThirdPlace", {
371
389
  vm: this,
372
- data: {
373
- order_id,
374
- channel_provider_id,
375
- login_providers: login_providers.join(",")
376
- },
390
+ data,
377
391
  })
378
392
  .then((res) => {
379
393
  this.$xdHideLoading();
380
- console.log("thirdPay", res);
394
+ // #ifdef H5
395
+ if(res && res.payment_type === 'url') {
396
+ window.location.replace(res.payment_url);
397
+ return
398
+ }
399
+ // #endif
381
400
  const { channel_data } = res;
382
401
  const paySignData = JSON.parse(Base64.decode(channel_data));
383
402
  this.openTemplatePay(paySignData, (ps) => {
@@ -400,6 +400,11 @@ export default {
400
400
  this.isPreview = this.$configProject.isPreview;
401
401
  this.init(this.container);
402
402
  },
403
+ destroyed() {
404
+ if (this.timeer) {
405
+ clearTimeout(this.timeer);
406
+ }
407
+ },
403
408
  methods: {
404
409
 
405
410
  onJfbLoad(options) {
@@ -638,12 +643,6 @@ export default {
638
643
  }
639
644
  },
640
645
 
641
- destroyed() {
642
- if (this.timeer) {
643
- clearTimeout(this.timeer);
644
- }
645
- },
646
-
647
646
  /**
648
647
  * @description 页面返回按钮
649
648
  * @param options