From ebbb40f4f36d185e374c3579e22a1c99c3de889a Mon Sep 17 00:00:00 2001
From: Double-_-Z <2492419643@qq.com>
Date: Thu, 28 Nov 2024 10:09:55 +0800
Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E7=89=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 common/config.service.js    |  8 ++++++--
 common/http.api.js          |  2 +-
 common/routerInterceptor.js |  2 +-
 pages/home/home.vue         | 19 +++++++++++++++----
 pages/my/my.vue             | 11 +++++++----
 pages/my/mySetting.vue      | 18 +++++++++---------
 pages/my/wxLogin.vue        | 12 ++++++------
 store/index.js              |  3 ++-
 8 files changed, 47 insertions(+), 28 deletions(-)

diff --git a/common/config.service.js b/common/config.service.js
index 62b98b2..a893a49 100644
--- a/common/config.service.js
+++ b/common/config.service.js
@@ -1,6 +1,10 @@
 // 接口环境
-let BASE_URL = 'http://8.138.171.103:8081';
-let IP = 'http://8.138.171.103/';
+// 测试环境
+// let BASE_URL = 'http://8.138.171.103:8081';
+// let IP = 'http://8.138.171.103/';
+// 正式环境
+let BASE_URL = 'https://www.ymsc.org.cn/vueAdminApi';
+let IP = 'https://www.ymsc.org.cn/';
 
 const configService = {
 	apiUrl: BASE_URL,
diff --git a/common/http.api.js b/common/http.api.js
index 9e94f47..e28e757 100644
--- a/common/http.api.js
+++ b/common/http.api.js
@@ -1,7 +1,7 @@
 import configService from '@/common/config.service.js';
 
 const install = (Vue, vm) => {
-	vm.$api.wxLogin = async (params = {}) => await vm.$u.get('/wxUser/wxPhoneLogin', params);// 手机号一键登录
+	vm.$api.wxLogin = async (params = {}) => await vm.$u.get('/mbUser/wxPhoneLogin', params);// 手机号一键登录
 	vm.$api.editUserMessage = async (params = {}) => await vm.$u.put('/wxUser', params);// 修改个人资料
 	vm.$api.getBanner = async (params = {}) => await vm.$u.get('/cpBanner/all', params);// 获取轮播图
 	vm.$api.addMessage = async (params = {}) => await vm.$u.post('/cpMessage', params);// 添加留言
diff --git a/common/routerInterceptor.js b/common/routerInterceptor.js
index 42b58f5..6659c48 100644
--- a/common/routerInterceptor.js
+++ b/common/routerInterceptor.js
@@ -1,6 +1,6 @@
 // 需要登录的界面
 let needLogin = [
-	"/pages/my/mySetting"
+	"/pages/home/component/message",
 ];
 // 拦截类型
 let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
diff --git a/pages/home/home.vue b/pages/home/home.vue
index 1324162..4aa45d8 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -97,7 +97,7 @@
 				// 人才生态30条链接
 				url:'https://b.pyrc.com.cn/pyrsj/public/login.asp',
 				// 人才生态30条图片
-				webLinkImg:'http://8.138.171.103/static/webLink.png',
+				webLinkImg:configService.ip+'/static/webLink.png',
 				// 动态列表
 				dynamicsList:[{
 					top: 0,
@@ -176,9 +176,20 @@
 			
 			// 跳转网络连接-人才生态30条
 			toWeb(){
-				uni.navigateTo({
-					url: `/pages/home/component/web?url=${this.url}`
-				})
+				this.$util.tools.methods.uniCopy({content: this.url,success: (res)=>{
+					uni.showToast({
+						icon: 'none',
+						title: '复制成功,请在浏览器打开网址!'
+					})
+				},error: (res)=>{
+					uni.showToast({
+						icon: 'none',
+						title: res
+					})
+				}})
+				// uni.navigateTo({
+				// 	url: `/pages/home/component/web?url=${this.url}`
+				// })
 			},
 			
 			// 点击轮播图
diff --git a/pages/my/my.vue b/pages/my/my.vue
index 9a535a1..f5ee5d8 100644
--- a/pages/my/my.vue
+++ b/pages/my/my.vue
@@ -5,8 +5,8 @@
 		<view class="head-Bg">
 			<lwTopnav :bgColor="bgColor" lwColor="#fff" lwTitle="我的"></lwTopnav>
 			<view class="my-avatar">
-				<u-avatar size="130" :showSex="isLogin" :sexIcon="userMessage.sex===0?'man':'woman'" 
-				:src="isLogin?avatars[userMessage.sex]:''"
+				<u-avatar size="130" :showSex="isLogin" :sexIcon="userMessage.gender?'woman':'man'" 
+				:src="isLogin?avatars[userMessage.gender||0]:''"
 				@click="toShowDetail"></u-avatar>
 				<!-- :src="userMessage.avatar" -->
 				<text @click="toShowDetail">{{isLogin?userMessage.nickName:'请点击登录'}}</text>
@@ -33,7 +33,7 @@
 			return{
 				userMessage: this.$store.state.vuex_token === ''?{}:JSON.parse(this.$store.state.user_message),
 				// avatar: '',//头像
-				// sex: 'man',// 性别-man、woman
+				// gender: 'man',// 性别-man、woman
 				isLogin: this.$store.state.vuex_token !== '',// 是否登录
 				avatars:[
 					configService.ip+"upload/20241028/82f6d605d70645a0aa30c94ee51714a3.png",
@@ -67,7 +67,7 @@
 					success: (res) => {
 						if (!res.confirm) return;
 						this.isLogin = false;
-						this.userMessage = {sex:0,nickName:'',avatar:''}
+						this.userMessage = {gender:0,nickName:'',avatar:''}
 						this.$u.vuex('vuex_token', '');
 						this.$u.vuex('user_message', {});
 					}
@@ -138,6 +138,9 @@
 		justify-content: center;
 		background-color: #fff;
 		font-size: 34rpx;
+		&:active{
+			filter: opacity(0.8);
+		}
 	}
 }
 </style>
\ No newline at end of file
diff --git a/pages/my/mySetting.vue b/pages/my/mySetting.vue
index 3c7c97e..34584c1 100644
--- a/pages/my/mySetting.vue
+++ b/pages/my/mySetting.vue
@@ -4,7 +4,7 @@
 			<view class="contentAll ">
 				<view class="myhead">
 					<text>头像</text>
-					<u-avatar class="headimage" :src="isLogin?avatars[userMessage.sex]:''"></u-avatar>
+					<u-avatar class="headimage" :src="isLogin?avatars[userMessage.gender||0]:''"></u-avatar>
 					<!-- @click="changeImg"
 					:src="userMessage.avatar?userMessage.avatar:''"></u-avatar> -->
 					
@@ -16,7 +16,7 @@
 				</view>
 				<view class="myview">
 					<text>手机</text>
-					<input type="tel" v-model="userMessage.mobile" placeholder="请填写手机号"
+					<input type="tel" v-model="userMessage.phone" placeholder="请填写手机号"
 						class="mytext" disabled></input>
 				</view>
 			</view>
@@ -34,8 +34,8 @@ import configService from '@/common/config.service';
 					id: '',
 					avatar: '',
 					nickName: '',
-					mobile: '',
-					sex: ''
+					phone: '',
+					gender: ''
 				},
 				isLogin: this.$store.state.vuex_token !== '',// 是否登录
 				avatars:[
@@ -103,7 +103,7 @@ import configService from '@/common/config.service';
 				if (this.userMessage.nickName === '') {
 					this.$refs.uToast.show({type: 'warning',title: "请完善内容!"});
 					return;
-				}else if(!(/^1[345789]\d{9}$/.test(this.userMessage.mobile))){
+				}else if(!(/^1[345789]\d{9}$/.test(this.userMessage.phone))){
 					this.$refs.uToast.show({type: 'warning',title: "电话号码不符合规范!"});
 					return;
 				}
@@ -126,19 +126,19 @@ import configService from '@/common/config.service';
 					let now = JSON.parse(this.$store.state.user_message);
 					now.avatar = this.userMessage.avatar;
 					now.nickName = this.userMessage.nickName;
-					now.mobile = this.userMessage.mobile;
+					now.phone = this.userMessage.phone;
 					this.$u.vuex('user_message', JSON.stringify(now));
 				}
 			},
 		},
 		onLoad() {
-			const { id, avatar, nickName, mobile, sex } = JSON.parse(this.$store.state.user_message);
+			const { id, avatar, nickName, phone, gender } = JSON.parse(this.$store.state.user_message);
 			this.userMessage = {
 				id: id,
 				avatar: avatar,
 				nickName: nickName,
-				mobile: mobile,
-				sex: sex
+				phone: phone,
+				gender: gender
 			}
 		}
 	}
diff --git a/pages/my/wxLogin.vue b/pages/my/wxLogin.vue
index f9f332a..307f3a0 100644
--- a/pages/my/wxLogin.vue
+++ b/pages/my/wxLogin.vue
@@ -11,10 +11,10 @@
 		</view>
 		<view style="text-align: center;margin-top: 160rpx;">
 			<u-checkbox style="margin-right: -10rpx;" active-color="#0f2b8d" v-model="isChecked"></u-checkbox>
-			<text style="font-size: 24rpx;margin-right: 10rpx;">登录注册代表同意智汇谷</text>
-			<text style="font-size: 24rpx;color:#0f2b8d;" @click="toShowAgreement('userAgreement')">《用户使用协议》</text>
+			<text style="font-size: 24rpx;margin-right: 10rpx;">登录注册代表同意智汇谷协议</text>
+			<!-- <text style="font-size: 24rpx;color:#0f2b8d;" @click="toShowAgreement('userAgreement')">《用户使用协议》</text>
 			<text style="font-size: 24rpx;margin-left: 10rpx;margin-right: 10rpx;">和</text>
-			<text style="font-size: 24rpx;color:#0f2b8d;" @click="toShowAgreement('privacyAgreement')">《隐私政策》</text>
+			<text style="font-size: 24rpx;color:#0f2b8d;" @click="toShowAgreement('privacyAgreement')">《隐私政策》</text> -->
 		</view>
 		<view
 			style="height: 80rpx;width: 100%; text-align: center;margin-top: 40rpx;display: flex;flex-direction: column;justify-content: center;">
@@ -69,9 +69,9 @@
 								});
 								return;
 							}
-							// that.$u.vuex('vuex_token', resp.data.token);
-							that.$u.vuex('vuex_token','fbc545a91cc94fe89296828a25a7e08e@9085553879028596738');
-							that.$u.vuex('user_message', JSON.stringify(resp.data.wxUser));
+							that.$u.vuex('vuex_token', resp.data.token);
+							// that.$u.vuex('vuex_token','fbc545a91cc94fe89296828a25a7e08e@9085553879028596738');
+							that.$u.vuex('user_message', JSON.stringify(resp.data.mbUser));
 							if(that.nextUrl===''){
 								uni.navigateBack({
 									complete() {
diff --git a/store/index.js b/store/index.js
index d69ce60..1bd76da 100644
--- a/store/index.js
+++ b/store/index.js
@@ -31,7 +31,8 @@ const store = new Vuex.Store({
 	state: {
 		// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
 		// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
-		vuex_token: lifeData.vuex_token ? lifeData.vuex_token : 'fbc545a91cc94fe89296828a25a7e08e@9085553879028596738',
+		// fbc545a91cc94fe89296828a25a7e08e@9085553879028596738
+		vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
 		user_message:lifeData.user_message ? lifeData.user_message : {},
 	},
 	mutations: {