| | |
| | | this.opt = opt |
| | | }, |
| | | onShow() { |
| | | let redirect_uri = `${config.webURL}/pay/scanpay?cid=${this.opt.cid||''}&shopId=${this.opt.shopId||''}&smoney=${this.opt.smoney||''}` |
| | | if(uni.getStorageSync('OPENID'+this.platform)){ |
| | | let redirect_uri = `${config.webURL}/pay/scanpay?cid=${this.opt.cid||''}&shopId=${this.opt.shopId||''}&activityQrcodeId=${this.opt.activityQrcodeId||''}&smoney=${this.opt.smoney||''}` |
| | | if(this.platform==2&&uni.getStorageSync('OPENID'+this.platform)){ |
| | | window.location.href = redirect_uri |
| | | return |
| | | } |
| | | if(this.platform==5&&uni.getStorageSync('ALIUSERID'+this.platform)){ |
| | | window.location.href = redirect_uri |
| | | return |
| | | } |
| | | redirect_uri = encodeURIComponent(redirect_uri) |
| | | uni.clearStorage() |
| | | if (this.platform == 2) { |
| | | window.location.href = |
| | | `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${config.wx_appid}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect` |
| | | `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${config.wx_appid}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base&state=0#wechat_redirect` |
| | | } else if (this.platform == 5) { |
| | | window.location.href = |
| | | `https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=${config.ali_appid}&scope=auth_base&redirect_uri=${redirect_uri}&state=STATE` |
| | | } else if (this.platform == 15) { |
| | | window.location.href = |
| | | `https://qr.95516.com/qrcGtwWeb-web/api/userAuth?version=1.0.0&redirectUrl=${redirect_uri}` |
| | | } else { |
| | | uni.reLaunch({ |
| | | url: `/pay/scanpay?cid=${this.opt.cid}` |