潘超林 2 月之前
父節點
當前提交
4f2476df3d
共有 5 個文件被更改,包括 23 次插入21 次删除
  1. 1 1
      app.config.js
  2. 4 1
      pages/index/index.vue
  3. 7 4
      pages/index/pay-zfb.vue
  4. 11 15
      pages/index/pay.vue
  5. 二進制
      static/images/error.jpeg

+ 1 - 1
app.config.js

@@ -36,6 +36,6 @@ export const requestConfig = {
 	// zfb_redirect_uri: "http://192.168.3.183:80/#/pages/index/pay-zfb",
 	zfb_redirect_uri: "https://ne.sxdirectpurchase.com/#/pages/index/pay-zfb",
 
-
+	// farming-ne
 
 }

+ 4 - 1
pages/index/index.vue

@@ -32,11 +32,13 @@
 				ap: ap,
 				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")
 			console.log(wechatuserinfo);
@@ -72,13 +74,14 @@
 					&redirect_uri=${encodeURIComponent(requestConfig.zfb_redirect_uri)}
 					&state=STATE
 					&shopId=${this.shopId}
+					&uid=${this.uid}
 					&type=zfb`
 				window.location = url;
 
 			},
 			wxLink() {
 				/*微信授权登录*/
-				let redirect_uri = encodeURIComponent(requestConfig.wx_redirect_uri + '?shopId=' + this.shopId)
+				let redirect_uri = encodeURIComponent(requestConfig.wx_redirect_uri + '?shopId=' + this.shopId+'&uid='+this.uid)
 				let url = `https://open.weixin.qq.com/connect/oauth2/authorize?
 							appid=${requestConfig.wx_appid}
 							&redirect_uri=${redirect_uri}

+ 7 - 4
pages/index/pay-zfb.vue

@@ -2,7 +2,8 @@
 	<view class="login-main">
 		<view style="width: 100%; height: 220px">
 			<view class="login-main-content">
-				<image class="img" :src="shopInfo?shopInfo.store_logo_url:''" mode=""></image>
+				<image class="img" :src="shopInfo.store_logo_url?shopInfo.store_logo_url:'/static/images/error.jpeg'">
+				</image>
 				<h4 class="shopName">{{shopInfo?shopInfo.store_name:""}}</h4>
 			</view>
 		</view>
@@ -81,12 +82,14 @@
 				shopInfo: {},
 				zfbInfo: {},
 				shopId: "",
-				localUserInfo: {}
+				localUserInfo: {},
+				uid: ""
 
 			};
 		},
 		onLoad(options) {
 			this.zfbInfo = options
+			this.uid = options.uid
 			this.shopId = options.shopId
 			let info = localStorage.getItem('aliPayUserInfo');
 			this.localUserInfo = JSON.parse(info)
@@ -147,7 +150,7 @@
 					uni.$u.toast('请输入支付金额!');
 				}
 				let res = await axios.get(`${requestConfig.BaseUrl}order/app/v1/buyer/order/createOfflineOrder
-						?shopId=${this.zfbInfo.shopId}&price=${this.price}`, {
+						?shopId=${this.zfbInfo.shopId}&price=${this.price}&uid=${this.uid}`, {
 					headers: {
 						'token': `${this.userInfo.token}`
 					}
@@ -199,7 +202,7 @@
 
 			async getShopInfo() {
 				let res = await axios.get(
-					`${requestConfig.BaseUrl}user/app/v1/store/getStoreInfoByScan?shopId=${this.zfbInfo.shopId}`, {
+					`${requestConfig.BaseUrl}user/app/v1/store/getStoreInfoByScan?shopId=${this.zfbInfo.shopId}&uid=${this.uid}`, {
 						headers: {
 							'token': `${this.userInfo.token}`
 						}

+ 11 - 15
pages/index/pay.vue

@@ -2,7 +2,8 @@
 	<view class="login-main">
 		<view style="width: 100%; height: 220px">
 			<view class="login-main-content">
-				<image class="img" :src="shopInfo?shopInfo.store_logo_url:''" mode=""></image>
+				<image class="img" :src="shopInfo.store_logo_url?shopInfo.store_logo_url:'/static/images/error.jpeg'"
+					mode=""></image>
 				<h4 class="shopName">{{shopInfo?shopInfo.store_name:""}}</h4>
 			</view>
 		</view>
@@ -19,12 +20,6 @@
 				<button class="btn" @click="Pay">立即支付</button>
 				<view style="margin-top: 20rpx; font-size: 26rpx">
 					支付成功后,次日有奖励红包,农商直采小程序领取
-					<!-- 	支付成功立返
-				<span
-						style="color: red">
-						
-						{{ requestConfig.pay }}元</span>红包,可进入农商网小程序查看
-						 -->
 				</view>
 			</view>
 		</view>
@@ -84,13 +79,16 @@
 				price: null,
 				shopId: "",
 				shopInfo: {},
-				localUserInfo: {}
+				localUserInfo: {},
+				uid: ""
 
 			};
 		},
 		onLoad(options) {
 			this.shopId = options.shopId
-			let info = localStorage.getItem('weChatUserInfo');
+			this.uid = options.uid
+			console.log(this.uid);
+			let info = localStorage.getItem('wechatuserInfo');
 			this.localUserInfo = JSON.parse(info)
 			if (this.localUserInfo) {
 				this.vidTokenExist()
@@ -112,7 +110,7 @@
 					this.getShopInfo();
 				} else {
 					uni.$u.toast('登录已过期,请重新登录!');
-					localStorage.removeItem('weChatUserInfo');
+					localStorage.removeItem('wechatuserInfo');
 					setTimeout(() => {
 						uni.redirectTo({
 							url: '/pages/index/index?shopId=' + this.shopId
@@ -135,7 +133,7 @@
 
 			async getShopInfo() {
 				let res = await axios.get(
-					`${requestConfig.BaseUrl}user/app/v1/store/getStoreInfoByScan?shopId=${this.shopId}`, {
+					`${requestConfig.BaseUrl}user/app/v1/store/getStoreInfoByScan?shopId=${this.shopId}&uid=${this.uid}`, {
 						headers: {
 							'token': `${this.userInfo.token}`
 						}
@@ -198,7 +196,7 @@
 					uni.$u.toast('请输入支付金额!');
 				}
 				let res = await axios.get(`${requestConfig.BaseUrl}order/app/v1/buyer/order/createOfflineOrder
-					?shopId=${this.shopId}&price=${this.price}`, {
+					?shopId=${this.shopId}&price=${this.price}&uid=${this.uid}`, {
 					headers: {
 						'token': `${this.userInfo.token}`
 					}
@@ -254,7 +252,7 @@
 					}
 				} else if (res.data.code == 403) {
 					uni.$u.toast('登录已过期,请重新登录!');
-					localStorage.removeItem('weChatUserInfo');
+					localStorage.removeItem('wechatuserInfo');
 					setTimeout(() => {
 						uni.redirectTo({
 							url: '/pages/index/index'
@@ -273,9 +271,7 @@
 				);
 				if (res.data.code == 200) {
 					this.userInfo = res.data.data;
-					
 					localStorage.setItem('weChatUserInfo', JSON.stringify(this.userInfo))
-					
 					if (this.userInfo.bindPhoneStatus == 0) {
 						this.showPhone = true
 					} else {

二進制
static/images/error.jpeg