From 7e081cadeda2d7b5d3cc3f6055b4ee2799d19c00 Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期四, 08 八月 2024 15:11:54 +0800
Subject: [PATCH] feat(支付): 云闪付
---
pay/login.vue | 46 ++++++++++++++++++++++++++++++----------------
1 files changed, 30 insertions(+), 16 deletions(-)
diff --git a/pay/login.vue b/pay/login.vue
index 9204bd8..0b2d5a5 100644
--- a/pay/login.vue
+++ b/pay/login.vue
@@ -11,29 +11,43 @@
export default {
data() {
return {
+ opt: {},
platform: this.$utils.getPlat()
};
},
onLoad(opt) {
- const redirect_uri = encodeURIComponent(`${config.webURL}/pay/scanpay?cid=${opt.cid}`)
- if(uni.getStorageSync('UNIONID'+this.platform)){
+ this.opt = opt
+ },
+ onShow() {
+ 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')){
window.location.href = redirect_uri
return
}
- 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`
- } 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 {
- uni.reLaunch({
- url: `/pay/scanpay?cid=${opt.cid}`
- })
- }
-
- }
+ if(this.platform==5&&uni.getStorageSync('ALIUSERID')){
+ window.location.href = redirect_uri
+ return
+ }
+ if(this.platform==15&&uni.getStorageSync('UNIONPAYID')){
+ window.location.href = redirect_uri
+ return
+ }
+ redirect_uri = encodeURIComponent(redirect_uri)
+ 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=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}`
+ })
+ }
+ },
}
</script>
--
Gitblit v1.9.1