From 183714a83070c7d3e68dfa5686a749f3bafc75a8 Mon Sep 17 00:00:00 2001 From: "liu.xiaofeng@ebiz-digits.com" Date: Mon, 17 Jul 2023 11:33:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=8E=88=E6=9D=83=E7=9A=84code=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ebiz/sale/PayMent.vue | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/views/ebiz/sale/PayMent.vue b/src/views/ebiz/sale/PayMent.vue index 324658613..61a3912d5 100644 --- a/src/views/ebiz/sale/PayMent.vue +++ b/src/views/ebiz/sale/PayMent.vue @@ -98,6 +98,7 @@ import { Cell, CellGroup, RadioGroup, Radio, Dialog } from 'vant' import { acceptInsurance, getBankCardSignState,payFlag, underWrite, getOrderDetail,signConfirm} from '@/api/ebiz/sale/sale' import Loading from '@/components/ebiz/Loading' import config from '@/config' +import { wxShare } from '@/api/ebiz/common/common.js' export default { data() { let isWeixin = this.$utils.device().isWeixin //判断环境 @@ -202,6 +203,25 @@ export default { } }, methods: { + getOpenid(){ + wxShare({ url: location.href }).then(response => { + if (response.result == '0') { + let orderNo = this.$route.query.orderNo + let code = this.getUrlParam('code') + if(!code){ + window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + response.content.appid + '&redirect_uri=' + encodeURIComponent(location.href + '?orderNo=' + orderNo) + '&response_type=code&scope=snsapi_base&state=1#wechat_redirect' + }else{ + + } + } + }) + }, + // 获取地址上的参数 + getUrlParam(name) { + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); + var r = window.location.search.substr(1).match(reg); + if (r != null) return unescape(r[2]); return null; + }, async payMentWx(orderNo){ const res = await payFlag({ orderNo: orderNo }) console.dir(res)