From e649747b2c454f0d2cb18edc9c8e1b41363e0d65 Mon Sep 17 00:00:00 2001
From: lin <1005713861@163.com>
Date: Mon, 27 Apr 2026 15:26:58 +0800
Subject: [PATCH] fix: 澜品优选iosShopUnionLogin接口对接

---
 pages/quanyi/add.vue      |    2 
 pages/quanshou/index.vue  |    8 +-
 pages/login/login.vue     |  198 +++++++++++++++++++++++++++++++++++++------------
 pages/my/my_bak.vue       |    2 
 pages/quanyi/index.vue    |    6 
 pages/my/my.vue           |    5 
 pages/profile/profile.vue |    4 
 main.js                   |    4 +
 pages/idcard/idcard.vue   |    2 
 pages/regist/regist.vue   |    2 
 10 files changed, 169 insertions(+), 64 deletions(-)

diff --git a/main.js b/main.js
index 0ca1935..6f1bcf1 100644
--- a/main.js
+++ b/main.js
@@ -11,6 +11,10 @@
 Vue.prototype.$webHost = 'https://rbb98765.zrgy-bbg.com'
 Vue.prototype.$util = util
 Vue.prototype.$baseUrl = 'https://lp1994.lpyx.top'
+console.log('NODE_ENV',process.env.NODE_ENV)
+if(process.env.NODE_ENV === 'development') {
+    Vue.prototype.$webHost = 'https://test-skfq.zrgy-bbg.com'
+}
 Vue.prototype.$bank = [
 	'中国工商银行',
 	'中国建设银行',
diff --git a/pages/idcard/idcard.vue b/pages/idcard/idcard.vue
index fb01d49..01cbef6 100644
--- a/pages/idcard/idcard.vue
+++ b/pages/idcard/idcard.vue
@@ -228,7 +228,7 @@
 					success: (chooseImageRes) => {
 						t.is_choose = true
 						let tempFilePaths = chooseImageRes.tempFilePaths
-						let token = uni.getStorageSync('lzsc-token')
+						let token = uni.getStorageSync('pig-token')
 						let header = {
 							'Accept': 'application/json',
 							'authorization': token,
diff --git a/pages/login/login.vue b/pages/login/login.vue
index cb4068e..1ea4db6 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -77,61 +77,161 @@
 			agreeClick () {
 				this.loginAct = !this.loginAct
 			},
-			loginUser () {
+			// loginUser () {
+			// 	let t = this
+			// 	if(!t.loginAct) {
+			// 		return uni.showToast({
+			// 			title: '请阅读并同意协议政策',
+			// 			icon: 'error'
+			// 		})
+			// 	}
+			// 	if(t.formData.phone == '' || !t.phoneReg.test(t.formData.phone)){
+			// 		return uni.showToast({
+			// 			title: '手机号错误!',
+			// 			icon: 'error',
+			// 		})
+			// 	}
+			// 	if(t.formData.pass == '' && t.formData.loginType == 1){
+			// 		return uni.showToast({
+			// 			title: '请输入密码!',
+			// 			icon: 'error',
+			// 		})
+			// 	}
+			// 	if(t.formData.code == '' && t.formData.loginType == 2){
+			// 		return uni.showToast({
+			// 			title: '请输入验证码!',
+			// 			icon: 'error',
+			// 		})
+			// 	}
+			// 	t.$util.post('User/Login', this.formData).then(res => {
+			// 		if(res.code == 1) {
+			// 			uni.setStorageSync('pig-token', res.data.userToken)
+			// 			uni.setStorageSync('user-info', JSON.stringify(res.data))
+			// 			let isSwitch = 0
+			// 			let goUrl = ''
+			// 			if(this.backUrl == ''){
+			// 				isSwitch = 1
+			// 				goUrl = '/pages/index/index'
+			// 			} else {
+			// 				goUrl = this.backUrl
+			// 			}
+			// 			uni.showToast({
+			// 				title: res.msg || '登录成功'
+			// 			})
+			// 			setTimeout(() => {
+			// 				if(isSwitch == 1) {
+			// 					t.$util.goSwitch(goUrl)
+			// 				} else {
+			// 					t.$util.goPages(goUrl)
+			// 				}
+			// 			}, 1500)
+			// 		} else {
+			// 			uni.showToast({
+			// 				title: res.msg || '登录失败',
+			// 				icon: 'error'
+			// 			})
+			// 		}
+			// 	})
+			// },
+			async loginUser() {
 				let t = this
-				if(!t.loginAct) {
-					return uni.showToast({
-						title: '请阅读并同意协议政策',
-						icon: 'error'
-					})
+
+				if (!t.loginAct) {
+				  return uni.showToast({
+					title: '请阅读并同意协议政策',
+					icon: 'error'
+				  })
 				}
-				if(t.formData.phone == '' || !t.phoneReg.test(t.formData.phone)){
-					return uni.showToast({
-						title: '手机号错误!',
-						icon: 'error',
-					})
+
+				if (t.formData.phone == '' || !t.phoneReg.test(t.formData.phone)) {
+				  return uni.showToast({
+					title: '手机号错误!',
+					icon: 'error'
+				  })
 				}
-				if(t.formData.pass == '' && t.formData.loginType == 1){
-					return uni.showToast({
-						title: '请输入密码!',
-						icon: 'error',
-					})
+
+				if (t.formData.pass == '' && t.formData.loginType == 1) {
+				  return uni.showToast({
+					title: '请输入密码!',
+					icon: 'error'
+				  })
 				}
-				if(t.formData.code == '' && t.formData.loginType == 2){
-					return uni.showToast({
-						title: '请输入验证码!',
-						icon: 'error',
-					})
+
+				if (t.formData.code == '' && t.formData.loginType == 2) {
+				  return uni.showToast({
+					title: '请输入验证码!',
+					icon: 'error'
+				  })
 				}
-				t.$util.post('User/Login', this.formData).then(res => {
-					if(res.code == 1) {
-						uni.setStorageSync('pig-token', res.data.userToken)
-						uni.setStorageSync('user-info', JSON.stringify(res.data))
-						let isSwitch = 0
-						let goUrl = ''
-						if(this.backUrl == ''){
-							isSwitch = 1
-							goUrl = '/pages/index/index'
-						} else {
-							goUrl = this.backUrl
-						}
-						uni.showToast({
-							title: res.msg || '登录成功'
-						})
-						setTimeout(() => {
-							if(isSwitch == 1) {
-								t.$util.goSwitch(goUrl)
-							} else {
-								t.$util.goPages(goUrl)
-							}
-						}, 1500)
-					} else {
-						uni.showToast({
-							title: res.msg || '登录失败',
-							icon: 'error'
-						})
+
+				try {
+
+				  // 登录接口
+				  const res = await t.$util.post('User/Login', this.formData)
+
+				  if (res.code == 1) {
+
+					uni.setStorageSync('pig-token', res.data.userToken)
+					uni.setStorageSync('user-info', JSON.stringify(res.data))
+
+					let isSwitch = 0
+					let goUrl = ''
+
+					// qxgLogin接口
+					const ygxRes = await new Promise((resolve, reject) => {
+					  uni.request({
+						url: t.$webHost + '/api/v2/auth/iosShopUnionLogin?phone=' + t.$util.getUserInfo().phone+'&configureToDomain=10',
+						success: resolve,
+						fail: reject
+					  })
+					})
+					console.log(ygxRes);
+					if(!ygxRes.data.data.boughtEquity){
+					  goUrl = '/pages/quanyi/index'
+					  // t.$util.goPages(goUrl)
+					  uni.navigateTo({
+						url: '/pages/quanyi/index'
+					  })
+					  return
 					}
-				})
+
+					t.ygxLogin = ygxRes.data.data
+					uni.setStorageSync('ygxLogin', t.ygxLogin)
+
+					if (this.backUrl == '') {
+					  isSwitch = 1
+					  goUrl = '/pages/index/index'
+					} else {
+					  goUrl = this.backUrl
+					}
+
+					uni.showToast({
+					  title: res.msg || '登录成功'
+					})
+
+					setTimeout(() => {
+					  if (isSwitch == 1) {
+						t.$util.goSwitch(goUrl)
+					  } else {
+						t.$util.goPages(goUrl)
+					  }
+					}, 1500)
+
+				  } else {
+					uni.showToast({
+					  title: res.msg || '登录失败',
+					  icon: 'error'
+					})
+				  }
+
+				} catch (err) {
+				  console.error(err)
+
+				  uni.showToast({
+					title: '请求失败',
+					icon: 'error'
+				  })
+				}
 			},
 			sendCode () {
 				let t = this
diff --git a/pages/my/my.vue b/pages/my/my.vue
index 6b103d7..ce6de84 100644
--- a/pages/my/my.vue
+++ b/pages/my/my.vue
@@ -158,6 +158,7 @@
 					{index: 6, text: '联系客服'},
 				],
 				errState: '',
+				isShop: false,
 			}
 		},
 		onLoad() {
@@ -168,7 +169,7 @@
 			  const _this = this;
 			  if(_this.$util.getUserInfo()?.phone){
 				uni.request({
-				  url: _this.$webHost+'/api/v2/auth/qxgIosUnionLogin?phone='+_this.$util.getUserInfo().phone,
+				  url: _this.$webHost+'/api/v2/auth/iosShopUnionLogin?phone='+_this.$util.getUserInfo().phone + '&configureToDomain=10',
 				  data:{
 					customerId: uni.getStorageSync('ygxLogin').customerId,
 					appId: uni.getStorageSync('ygxLogin').appId
@@ -250,7 +251,7 @@
 					sizeType: ['original', 'compressed'],
 					success: (chooseImageRes) => {
 						let tempFilePaths = chooseImageRes.tempFilePaths
-						let token = uni.getStorageSync('lzsc-token')
+						let token = uni.getStorageSync('pig-token')
 						let header = {
 							'Accept': 'application/json',
 							'authorization': token,
diff --git a/pages/my/my_bak.vue b/pages/my/my_bak.vue
index 8e6ba07..9a39d1e 100644
--- a/pages/my/my_bak.vue
+++ b/pages/my/my_bak.vue
@@ -160,7 +160,7 @@
 					sizeType: ['original', 'compressed'],
 					success: (chooseImageRes) => {
 						let tempFilePaths = chooseImageRes.tempFilePaths
-						let token = uni.getStorageSync('lzsc-token')
+						let token = uni.getStorageSync('pig-token')
 						let header = {
 							'Accept': 'application/json',
 							'authorization': token,
diff --git a/pages/profile/profile.vue b/pages/profile/profile.vue
index aad7aef..ccccedc 100644
--- a/pages/profile/profile.vue
+++ b/pages/profile/profile.vue
@@ -137,7 +137,7 @@
 										title: res.msg || ''
 									})
 									setTimeout(() => {
-										uni.setStorageSync('lzsc-token', null)
+										uni.setStorageSync('pig-token', null)
 										uni.setStorageSync('user-info', null)
 										uni.navigateTo({
 											url: '/pages/login/login'
@@ -190,7 +190,7 @@
 					sizeType: ['original', 'compressed'],
 					success: (chooseImageRes) => {
 						let tempFilePaths = chooseImageRes.tempFilePaths
-						let token = uni.getStorageSync('lzsc-token')
+						let token = uni.getStorageSync('pig-token')
 						let header = {
 							'Accept': 'application/json',
 							'authorization': token,
diff --git a/pages/quanshou/index.vue b/pages/quanshou/index.vue
index d2b0e55..5732151 100644
--- a/pages/quanshou/index.vue
+++ b/pages/quanshou/index.vue
@@ -66,7 +66,7 @@
     const _this = this;
     this.isAgree = uni.getStorageSync('boughtEquity')
     uni.request({
-      url: _this.$webHost+'/api/v2/customer/getRyxBenefitsRecordList?phone='+uni.getStorageSync('phone')+'&appId='+'47be9559-6b1b-42dd-84ed-25d028065013',
+      url: _this.$webHost+'/api/v2/customer/getRyxBenefitsRecordList?phone='+_this.$util.getUserInfo().phone+'&appId='+'47be9559-6b1b-42dd-84ed-25d028065013',
       success: function (res) {
         if(res.data.code==200){
           _this.lst = res.data.data;
@@ -109,11 +109,11 @@
     toHuiyuan(){
       const _this = this;
       uni.request({
-        url: _this.$webHost+'/api/v2/memberEquity/getUrlByShop/'+uni.getStorageSync('phone'),
+        url: _this.$webHost+'/api/v2/memberEquity/getUrlByShop/'+_this.$util.getUserInfo().phone,
         success: function (res) {
           if(res.data.code==200){
             uni.request( {
-              url: _this.$webHost+'/api/v2/memberEquity/clickUrlByShop/'+uni.getStorageSync('phone'),
+              url: _this.$webHost+'/api/v2/memberEquity/clickUrlByShop/'+_this.$util.getUserInfo().phone,
             })
             uni.navigateTo( {
               url: '/pages/users/web_page/index?webUel=' + encodeURIComponent(res.data.data.url)
@@ -134,7 +134,7 @@
     getTips(){
       const _this = this;
       uni.request({
-        url: _this.$webHost+'/api/v2/shop/findExpressNo?phone='+uni.getStorageSync('phone'),
+        url: _this.$webHost+'/api/v2/shop/findExpressNo?phone='+_this.$util.getUserInfo().phone,
         success: function (res) {
           if(res.data.code==200){
             _this.tips = res.data.data;
diff --git a/pages/quanyi/add.vue b/pages/quanyi/add.vue
index b67f32c..c04f888 100644
--- a/pages/quanyi/add.vue
+++ b/pages/quanyi/add.vue
@@ -171,7 +171,7 @@
 
   },
   mounted(){
-	  this.$refs.codeUi.open()
+	  // this.$refs.codeUi.open()
     this.windowHeight = uni.getSystemInfoSync().windowHeight;
     this.interval = setInterval(() => {
       let newHeight = window.innerHeight;
diff --git a/pages/quanyi/index.vue b/pages/quanyi/index.vue
index ed40443..61f8340 100644
--- a/pages/quanyi/index.vue
+++ b/pages/quanyi/index.vue
@@ -11,7 +11,7 @@
     const _this = this;
     await uni.request({
       // url: _this.$webHost+'/api/v2/auth/ygxLogin?phone='+_this.$util.getUserInfo().phone+'&appId='+'47be9559-6b1b-42dd-84ed-25d028065013',
-		url: _this.$webHost + '/api/v2/auth/qxgIosUnionLogin?phone=' + _this.$util.getUserInfo().phone,
+		url: _this.$webHost + '/api/v2/auth/iosShopUnionLogin?phone=' + _this.$util.getUserInfo().phone + '&configureToDomain=10',
       success: function (res) {
         _this.ygxLogin = res.data.data;
         uni.setStorageSync('ygxLogin',_this.ygxLogin)
@@ -182,7 +182,7 @@
 			  <text style="color: #20110E;">我已阅读并同意</text>
 		  </uv-checkbox>
 	    </uv-checkbox-group>
-	    <text style="display: inline;font-size: 24rpx;color: #4766FE" @click="link(`/pages/web/xieyi?code=${memberPeriodConfigInfo.protocolCode}&title=${memberPeriodConfigInfo.protocolName}`)">《会员权益服务协议-星享购》</text>
+	    <text style="display: inline;font-size: 24rpx;color: #4766FE" @click="link(`/pages/web/xieyi?code=${memberPeriodConfigInfo.protocolCode}&title=${memberPeriodConfigInfo.protocolName}`)">{{memberPeriodConfigInfo.protocolName}}</text>
 	  </view>
 	</view>
 
@@ -303,7 +303,7 @@
 
       <!--      <view style="text-align: center;display: flex;flex-direction: row;justify-content: center"><text @click="submit(false)" style="color: #666666;margin-bottom: 20rpx;font-size: 28rpx">不同意</text></view>-->
     </view>
-    <textBox v-if="showTextBox" ref="textBox" :code="memberPeriodConfigInfo.protocolCode" :title="memberPeriodConfigInfo.protocolName"></textBox>
+    <!-- <textBox v-if="showTextBox" ref="textBox" :code="memberPeriodConfigInfo.protocolCode" :title="memberPeriodConfigInfo.protocolName"></textBox> -->
   </view>
   </view>
 </template>
diff --git a/pages/regist/regist.vue b/pages/regist/regist.vue
index e2b81a3..2ba568c 100644
--- a/pages/regist/regist.vue
+++ b/pages/regist/regist.vue
@@ -109,7 +109,7 @@
 				}
 				t.$util.post('User/register', this.formData).then(res => {
 					if(res.code == 1) {
-						uni.setStorageSync('user-token', res.data.userToken)
+						uni.setStorageSync('pig-token', res.data.userToken)
 						uni.setStorageSync('user-info', JSON.stringify(res.data))
 
 						uni.showToast({

--
Gitblit v1.9.3