jufubao-base 1.0.68 → 1.0.70

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-base",
3
- "version": "1.0.68",
3
+ "version": "1.0.70",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -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) => {