潘超林 11 月之前
父节点
当前提交
9cc10a0645
共有 7 个文件被更改,包括 66 次插入31 次删除
  1. 1 1
      app.config.js
  2. 14 9
      pages.json
  3. 35 0
      pages/index/close.vue
  4. 2 3
      pages/index/index.vue
  5. 2 2
      pages/index/pay-zfb.vue
  6. 11 15
      pages/index/pay.vue
  7. 1 1
      unpackage/dist/build/web/index.html

+ 1 - 1
app.config.js

@@ -10,7 +10,7 @@ export const requestConfig = {
 	// 授权后重定向的回调链接地址, 请使用 urlEncode 对链接进行处理
 	wx_redirect_uri: "https://ne.sxdirectpurchase.com/#/pages/index/pay",
 	// wx_redirect_uri: "http://192.168.3.183:80/#/pages/index/pay",
-	wx_redirectOpen: "https://ne.sxdirectpurchase.com/#/pages/index/paySuccess",
+	// wx_redirectOpen: "https://ne.sxdirectpurchase.com/#/pages/index/paySuccess",
 	/**公众号信息 */
 	wx_appid: "wxad190b75af42ac7e",
 	wx_appsecret: "934a264458f4de42c5ccbe611d212587",

+ 14 - 9
pages.json

@@ -1,34 +1,39 @@
 {
-    "easycom": {
-        "^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue"
-    },
+	"easycom": {
+		"^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue"
+	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
 			"path": "pages/index/index",
 			"style": {
-					"navigationStyle": "custom"
+				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path": "pages/index/pay",
 			"style": {
-					"navigationStyle": "custom"
+				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path": "pages/index/pay-zfb",
 			"style": {
-					"navigationStyle": "custom"
+				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path": "pages/index/paySuccess",
 			"style": {
-					"navigationStyle": "custom"
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path": "pages/index/close",
+			"style": {
+				"navigationStyle": "custom"
 			}
 		}
 	],
-	"globalStyle": {
-	},
+	"globalStyle": {},
 	"uniIdRouter": {}
 }

+ 35 - 0
pages/index/close.vue

@@ -0,0 +1,35 @@
+<template>
+</template>
+
+<script>
+	import {
+		requestConfig
+	} from "@/app.config.js";
+	export default {
+		data() {
+			return {
+				radiovalue: 0,
+				shopId: "",
+				uid: "",
+				userInfo: {}
+			};
+		},
+		onLoad(options) {
+			this.shopId = options.shopId;
+			this.uid = options.uid || '';
+			let alipayuserinfo = localStorage.getItem("aliPayUserInfo")
+			let wechatuserinfo = localStorage.getItem("weChatUserInfo")
+			if (wechatuserinfo) {
+				alert('微信缓存')
+				localStorage.removeItem('weChatUserInfo');
+			}
+			if (alipayuserinfo) {
+				alert('支付宝缓存')
+				localStorage.removeItem('aliPayUserInfo');
+			}
+
+		},
+		methods: {
+		},
+	};
+</script>

+ 2 - 3
pages/index/index.vue

@@ -41,7 +41,6 @@
 			this.uid = options.uid || '';
 			let alipayuserinfo = localStorage.getItem("aliPayUserInfo")
 			let wechatuserinfo = localStorage.getItem("weChatUserInfo")
-			this.radiovalue = 1
 			if (alipayuserinfo) {
 				this.zfbLink()
 			} else if (wechatuserinfo) {
@@ -51,6 +50,7 @@
 		},
 		methods: {
 			login() {
+				console.log(this.radiovalue);
 				var userAgent = window.navigator.userAgent.toUpperCase();
 				console.log(this.radiovalue);
 				if (this.radiovalue == 1) {
@@ -60,7 +60,6 @@
 					if (userAgent.indexOf('ALIPAYCLIENT') > 0) {
 						this.zfbLink()
 					}
-
 				} else {
 					uni.$u.toast('请先同意用户授权!');
 				}
@@ -75,7 +74,7 @@
 					&shopId=${this.shopId}
 					${this.uid?'&uid='+this.uid:''}
 					&type=zfb`
-					console.log(url);
+				console.log(url);
 				window.location = url;
 
 			},

+ 2 - 2
pages/index/pay-zfb.vue

@@ -88,7 +88,7 @@
 			};
 		},
 		onLoad(options) {
-			console.log('options',options);
+			console.log('options', options);
 			this.zfbInfo = options
 			this.uid = options.uid || ""
 			this.shopId = options.shopId
@@ -117,7 +117,7 @@
 					localStorage.removeItem('aliPayUserInfo');
 					setTimeout(() => {
 						uni.redirectTo({
-							url: '/pages/index/index?shopId=' + this.shopId
+							url: '/pages/index/index?shopId=' + this.shopId + '&uid=' + this.uid
 						})
 					}, 1000)
 				}

+ 11 - 15
pages/index/pay.vue

@@ -88,7 +88,8 @@
 			this.shopId = options.shopId
 			this.uid = options.uid || ''
 			console.log(this.uid);
-			let info = localStorage.getItem('wechatuserInfo');
+			let info = localStorage.getItem('weChatUserInfo');
+			console.log(info);
 			this.localUserInfo = JSON.parse(info)
 			if (this.localUserInfo) {
 				this.vidTokenExist()
@@ -110,10 +111,10 @@
 					this.getShopInfo();
 				} else {
 					uni.$u.toast('登录已过期,请重新登录!');
-					localStorage.removeItem('wechatuserInfo');
+					localStorage.removeItem('weChatUserInfo');
 					setTimeout(() => {
 						uni.redirectTo({
-							url: '/pages/index/index?shopId=' + this.shopId
+							url: '/pages/index/index?shopId=' + this.shopId + '&uid=' + this.uid
 						})
 					}, 1000)
 				}
@@ -250,16 +251,6 @@
 						uni.hideLoading();
 						uni.$u.toast('支付失败!');
 					}
-				} else if (res.data.code == 403) {
-					uni.$u.toast('登录已过期,请重新登录!');
-					localStorage.removeItem('wechatuserInfo');
-					setTimeout(() => {
-						uni.redirectTo({
-							url: '/pages/index/index'
-						})
-					}, 1000)
-
-					return;
 				} else {
 					uni.$u.toast('线下订单创建失败!');
 				}
@@ -278,9 +269,14 @@
 						this.showPhone = false
 						this.getShopInfo()
 					}
-
 				} else {
-					uni.$u.toast('获取微信登录信息失败!');
+					uni.$u.toast('获取微信登录信息失败,请重新登录!');
+					// localStorage.removeItem('weChatUserInfo');
+					// setTimeout(() => {
+					// 	uni.redirectTo({
+					// 		url: '/pages/index/index?shopId=' + this.shopId + '&uid=' + this.uid
+					// 	})
+					// }, 1000)
 				}
 			},
 			GetQueryString(name) {

文件差异内容过多而无法显示
+ 1 - 1
unpackage/dist/build/web/index.html