From 53d549839c8568f6e45fe14ae1e8c4bebe159ead Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期二, 03 九月 2024 16:48:35 +0800
Subject: [PATCH] feat(支付): 1、改为hash路由 2、页面显示错误原因

---
 pay/index.vue    |    2 +-
 manifest.json    |    4 ++--
 pages.json       |   24 +++++++++++-------------
 common/config.js |    7 +++----
 main.js          |    2 --
 pay/scanpay.vue  |    6 +++---
 6 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/common/config.js b/common/config.js
index 0e09ed4..916cf6b 100644
--- a/common/config.js
+++ b/common/config.js
@@ -17,15 +17,14 @@
 }
 // 姝e紡
 const prod = {
-    webURL: 'https://sfzf.cpbtsoft.cn',
-    // baseURL: 'https://jyy.hepost.com:20773/prod-api',
-    baseURL: 'https://sfzf.cpbtsoft.cn/pay-api/prod-api',
+    webURL: 'https://uif.hepost.com',
+    baseURL: 'https://jyy.hepost.com:20773/prod-api',
     wx_appid: 'wx4c146dba764dcb05',
     ali_appid: '2021004149689887'
 }
 
 module.exports = {
-    config: process.env.NODE_ENV === 'development' ? dev : prod,
+    config: process.env.NODE_ENV === 'development' ? dev : test,
     ACCESSTOKEN: "Authorization",
     /* 鏄惁鎵撳嵃璇锋眰鏃ュ織 */
     DEBUG: false
diff --git a/main.js b/main.js
index 16b9855..1165588 100644
--- a/main.js
+++ b/main.js
@@ -11,8 +11,6 @@
 App.mpType = 'app'
 
 uni.$u.props.text.color = '#333333'
-// import store from '@/store/index.js'
-// Vue.prototype.$store = store
 
 Vue.config.ignoredElements.push('wx-open-launch-weapp')
 
diff --git a/manifest.json b/manifest.json
index ac65925..561a446 100644
--- a/manifest.json
+++ b/manifest.json
@@ -73,8 +73,8 @@
     "h5" : {
         "title" : "浣版儬浠�",
         "router" : {
-            "base" : "/",
-            "mode" : "history"
+            "base" : "./",
+            "mode" : "hash"
         },
         "devServer" : {
             "proxy" : {
diff --git a/pages.json b/pages.json
index 90db23e..65d17ee 100644
--- a/pages.json
+++ b/pages.json
@@ -4,6 +4,17 @@
 	},
 	"pages": [
 		{
+			"path": "pay/index",
+			"style": {
+				"navigationBarTitleText": "浣版儬浠�",
+				"enablePullDownRefresh": false
+				// #ifdef H5
+				,
+				"navigationStyle": "custom"
+				// #endif
+			}
+		},
+		{
 			"path": "pay/scanpay",
 			"style": {
 				"navigationBarTitleText": "鍚戝晢瀹朵粯娆�",
@@ -24,19 +35,6 @@
 				"navigationStyle": "custom"
 				// #endif
 			}
-
-		},
-		{
-			"path": "pay/login",
-			"style": {
-				"navigationBarTitleText": "浣版儬浠�",
-				"enablePullDownRefresh": false
-				// #ifdef H5
-				,
-				"navigationStyle": "custom"
-				// #endif
-			}
-
 		}
 	],
 	"globalStyle": {
diff --git a/pay/login.vue b/pay/index.vue
similarity index 88%
rename from pay/login.vue
rename to pay/index.vue
index 0b2d5a5..f8c0935 100644
--- a/pay/login.vue
+++ b/pay/index.vue
@@ -19,7 +19,7 @@
       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||''}`
+      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
diff --git a/pay/scanpay.vue b/pay/scanpay.vue
index 25a4926..5b64e21 100644
--- a/pay/scanpay.vue
+++ b/pay/scanpay.vue
@@ -312,7 +312,7 @@
     /*鎺堟潈unionid*/
     toRegister() {
       if (this.payWay == 2) {
-        const redirect_uri = encodeURIComponent(`${config.webURL}/pay/scanpay?cid=${this.cid || ''}&shopId=${this.shopId || ''}&activityQrcodeId=${this.activityQrcodeId || ''}&smoney=${this.smoney || ''}`)
+        const redirect_uri = encodeURIComponent(`${config.webURL}/#/pay/scanpay?cid=${this.cid || ''}&shopId=${this.shopId || ''}&activityQrcodeId=${this.activityQrcodeId || ''}&smoney=${this.smoney || ''}`)
         uni.clearStorageSync()
         window.location.href =
             `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${config.wx_appid}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect`
@@ -359,10 +359,10 @@
           res.logoImage = config.baseURL + res.logoImage
         }
         this.shopInfo = res
-      }).catch(() => {
+      }).catch((err) => {
         clearTimeout(timer)
         this.shopInfo.scanFlag = 0
-        this.tips = '褰撳墠鐢ㄦ埛杩囧锛岃绋嶅悗閲嶈瘯锝瀇锝�'
+        this.tips = err.description||'褰撳墠鐢ㄦ埛杩囧锛岃绋嶅悗閲嶈瘯锝瀇锝�'
         this.loading = false
       })
 

--
Gitblit v1.9.1