yangg 2 сар өмнө
parent
commit
63db7ce75b

+ 1 - 1
pages/camera/camera.vue

@@ -521,7 +521,7 @@
 					}
 					
 					const submitData = {
-						application_id: 1, // 或者使用其他合适的ID
+						application_id: uni.getStorageSync('appId'), // 或者使用其他合适的ID
 						question_id: this.currentAnswer.questionId,
 						answer_content: answerContent,
 						answer_duration: this.currentAnswer.answerDuration || 0,

+ 1 - 1
pages/face-photo/face-photo.vue

@@ -288,7 +288,7 @@ export default {
       
       // 使用fillUserInfo方法进行上传
       fillUserInfo({
-        application_id: JSON.parse(uni.getStorageSync('selectedJob')).id,
+        application_id: uni.getStorageSync('appId'),
         openid: openid,
         tenant_id: tenant_id,
         avatar: this.photoUrl,

+ 3 - 3
pages/identity-verify/identity-verify.vue

@@ -1127,7 +1127,7 @@ export default {
         formData.append('file', fileOrPath);
         formData.append('openid', openid);
         formData.append('tenant_id', tenant_id);
-        formData.append('application_id', 1);
+        formData.append('application_id', uni.getStorageSync('appId'));
         formData.append('question_id', questionId);
         formData.append('video_duration', 0);
         formData.append('has_audio', 'true'); // 明确标记视频包含音频
@@ -1203,7 +1203,7 @@ export default {
         formData: {
           openid: openid,
           tenant_id: tenant_id,
-          application_id: 1,
+          application_id: uni.getStorageSync('appId'),
           question_id: questionId,
           video_duration: 0,
           has_audio: 'true'  // 明确标记视频包含音频
@@ -1282,7 +1282,7 @@ export default {
       
       // 准备请求参数,使用映射后的问题ID
       const requestData = {
-        application_id: 1,
+        application_id: uni.getStorageSync('appId'),
         question_id: questionId,
         video_url: videoUrl,
         tenant_id: uni.getStorageSync('tenant_id') || '1'

+ 41 - 39
pages/index/index.vue

@@ -221,13 +221,10 @@
 					getUserInfo(userInfo.id)
 						.then(res => {
 							uni.hideLoading();
-
-							if (res.code === 200 && res.data) {
-								const userData = res.data;
-
-								if (userData.name && userData.phone) {
+							console.log('res:', res);
+								const userData = res;
+								if (userData.name==null && userData.phone==null) {
 									this.userInfoFilled = true;
-
 									this.formData.name = userData.name || '';
 									this.formData.gender = userData.gender || '';
 									this.formData.phone = userData.phone || '';
@@ -235,19 +232,17 @@
 									this.formData.emergencyContact = userData.emergency_contact || '';
 									this.formData.emergencyPhone = userData.emergency_phone || '';
 									this.formData.relation = userData.relation || '';
-
 									if (userData.relation) {
 										const index = this.relationOptions.findIndex(item => item === userData.relation);
 										if (index !== -1) {
 											this.relationIndex = index;
 										}
 									}
-
-									uni.navigateTo({
-										url: '/pages/success/success'
-									});
+									// uni.navigateTo({
+									// 	url: '/pages/success/success'
+									// });
 								}
-							}
+						
 						})
 						.catch(err => {
 							uni.hideLoading();
@@ -314,22 +309,38 @@
 					tenant_id: 1,
 					openid: JSON.parse(uni.getStorageSync('userInfo')).openid
 				}).then(res => {
+					// 保存返回的应用ID到本地存储
+					if (res && res.id) {
+						// 将应用ID保存到本地
+						uni.setStorageSync('appId', res.id);
+						
+						// 也可以更新已有的userInfo对象
+						try {
+							const userInfo = JSON.parse(uni.getStorageSync('userInfo') || '{}');
+							userInfo.appId = res.id;
+							uni.setStorageSync('userInfo', JSON.stringify(userInfo));
+						} catch (e) {
+							console.error('更新用户信息失败:', e);
+						}
+					}
+					
 					uni.navigateTo({
-				  url: '/pages/interview-notice/interview-notice',
-				  fail: (err) => {
-				    console.error('页面跳转失败:', err);
-				    uni.showToast({
-				      title: '页面跳转失败',
-				      icon: 'none'
-				    });
-				  }
-				});
+						url: '/pages/interview-notice/interview-notice',
+						fail: (err) => {
+							console.error('页面跳转失败:', err);
+							uni.showToast({
+								title: '页面跳转失败',
+								icon: 'none'
+							});
+						}
+					});
 				}).catch(err => {
 					console.error('申请职位失败:', err);
+					uni.showToast({
+						title: '申请职位失败,请重试',
+						icon: 'none'
+					});
 				});
-				
-				// 显示填写个人信息表单
-				// this.userInfoFilled = true;
 			},
 			submitForm() {
 				if (!this.checkLogin()) {
@@ -456,25 +467,16 @@
 				fillUserInfo(submitData)
 					.then(res => {
 						uni.hideLoading();
-							this.updateLocalUserInfo();
+							this.updateLocalUserInfo(res.id);
 
 							uni.showToast({
 								title: '提交成功',
 								icon: 'success',
 								duration: 1500,
 								success: () => {
-									setTimeout(() => {
-										uni.navigateTo({
-											url: '/pages/success/success',
-											fail: (err) => {
-												console.error('页面跳转失败:', err);
-												uni.showToast({
-													title: '页面跳转失败',
-													icon: 'none'
-												});
-											}
-										});
-									}, 1500);
+									this.userInfoFilled = false;
+									// setTimeout(() => {
+									// }, 1500);
 								}
 							});
 						// } else {
@@ -493,8 +495,8 @@
 						});
 					});
 			},
-			updateLocalUserInfo() {
-				getUserInfo()
+			updateLocalUserInfo(data) {
+					getUserInfo(data)
 					.then(res => {
 						if (res.code === 200 && res.data) {
 							let userInfo = {};

+ 4 - 4
pages/interview/interview.vue

@@ -225,12 +225,12 @@ import { apiBaseUrl } from '@/common/config.js'; // Import the base URL from a c
 					const formData = new FormData();
 					// 确保文件参数名称正确
 					formData.append('photo_file', blob, `${type}.jpg`);
-					formData.append('application_id', '1');
+					formData.append('application_id', uni.getStorageSync('appId'));
 					formData.append('tenant_id', tenant_id);
 					formData.append('description', `手部照片-${type}`);
 					
 					console.log('H5上传参数:', {
-						application_id: '1',
+						application_id: uni.getStorageSync('appId'),
 						tenant_id: tenant_id,
 						description: `手部照片-${type}`
 					});
@@ -269,7 +269,7 @@ import { apiBaseUrl } from '@/common/config.js'; // Import the base URL from a c
 					// 小程序环境的上传逻辑
 					console.log(`小程序环境上传文件路径:`, filePathOrData);
 					console.log('小程序上传参数:', {
-						application_id: '1',
+						application_id: uni.getStorageSync('appId'),
 						tenant_id: tenant_id,
 						description: `手部照片-${type}`
 					});
@@ -279,7 +279,7 @@ import { apiBaseUrl } from '@/common/config.js'; // Import the base URL from a c
 						filePath: filePathOrData,
 						name: 'photo_file',  // 确保文件参数名称正确
 						formData: {  // 使用formData替代data以确保参数正确传递
-							'application_id': '1',
+							'application_id': uni.getStorageSync('appId'),
 							'tenant_id': tenant_id,
 							'description': `手部照片-${type}`
 						},

+ 40 - 10
pages/my/my.vue

@@ -42,13 +42,14 @@
 		</view>
 		
 		<!-- 添加获取手机号按钮 -->
-		<button 
+		<!-- <button 
 			v-if="isLogin && !userInfo.phone" 
 			open-type="getPhoneNumber" 
 			@getphonenumber="getPhoneNumber" 
 			class="get-phone-btn">
 			绑定手机号
-		</button>
+		</button> -->
+		<!-- <button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">获取手机号</button> -->
 	</view>
 </template>
 
@@ -161,7 +162,7 @@ export default {
 		getWxLoginCode() {
 			uni.showLoading({ title: '登录中...' });
 			
-			// 每次都重新获取 code
+			// 调用uni.login获取临时code
 			uni.login({
 				provider: 'weixin',
 				success: (loginRes) => {
@@ -464,7 +465,20 @@ export default {
 		 * 获取用户手机号
 		 * @param {Object} e - 事件对象
 		 */
-		async getPhoneNumber(e) {
+		 getPhoneNumber(e) {
+  if (e.detail.code) {
+    // 立即发送到后端,不缓存,不复用
+    wx.request({
+      url: 'http:192.168.66.187:8083/wechat/getUserPhoneNumber',
+      method: 'POST',
+      data: {
+        code: e.detail.code,  // 刚获取的新code
+        openid: this.data.openid
+      }
+    })
+  }
+},
+		/* async getPhoneNumber(e) {
 			console.log('获取手机号事件:', e);
 			
 			// 检查是否成功获取
@@ -480,23 +494,39 @@ export default {
 			try {
 				uni.showLoading({ title: '获取手机号中...' });
 				
-				// 需要重新获取登录code
+				// 每次都重新获取最新的登录code
 				const loginResult = await new Promise((resolve, reject) => {
 					uni.login({
 						provider: 'weixin',
-						success: resolve,
-						fail: reject
+						success: (res) => resolve(res),
+						fail: (err) => reject(err)
 					});
 				});
 				
+				if (!loginResult || !loginResult.code) {
+					throw new Error('获取微信登录凭证失败');
+				}
+				
+				console.log('成功获取新的登录code:', loginResult.code);
+				
+				// 获取存储的用户信息
+				const userInfoStr = uni.getStorageSync('userInfo');
+				if (!userInfoStr) {
+					throw new Error('用户信息不存在,请重新登录');
+				}
+				
+				const userInfo = JSON.parse(userInfoStr);
+				
 				// 准备请求参数
 				const params = {
 					code: loginResult.code,
 					encryptedData: e.detail.encryptedData,
 					iv: e.detail.iv,
-					openid: JSON.parse(uni.getStorageSync('userInfo')).openid
+					openid: userInfo.openid
 				};
-				console.log('获取手机号请求参数:', JSON.parse(uni.getStorageSync('userInfo')).openid);
+				
+				console.log('获取手机号请求参数:', params);
+				
 				// 调用获取手机号API
 				const phoneData = await getUserPhoneNumber(params);
 				console.log('获取手机号成功:', phoneData);
@@ -528,7 +558,7 @@ export default {
 			} finally {
 				uni.hideLoading();
 			}
-		},
+		}, */
 		
 		// 添加刷新 CSRF token 的方法
 		refreshCSRFToken() {

+ 0 - 4
unpackage/dist/dev/mp-weixin/api/user.js

@@ -31,9 +31,6 @@ const getUserInfo = (userId) => {
   const url = userId ? `/wechat/getUserDetail?id=${userId}` : "/wechat/getUserDetail";
   return utils_request.http.get(url);
 };
-const getUserPhoneNumber = (params) => {
-  return utils_request.http.post("/wechat/getUserPhoneNumber", params);
-};
 const logout = () => {
   return utils_request.http.post("/api/user/logout");
 };
@@ -62,6 +59,5 @@ exports.fillUserInfo = fillUserInfo;
 exports.getInterviewList = getInterviewList;
 exports.getJobList = getJobList;
 exports.getUserInfo = getUserInfo;
-exports.getUserPhoneNumber = getUserPhoneNumber;
 exports.logout = logout;
 exports.wxLogin = wxLogin;

+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/camera/camera.js

@@ -306,7 +306,7 @@ const _sfc_main = {
           answerContent = selectedOptionIds.join(",");
         }
         const submitData = {
-          application_id: 1,
+          application_id: common_vendor.index.getStorageSync("appId"),
           // 或者使用其他合适的ID
           question_id: this.currentAnswer.questionId,
           answer_content: answerContent,

+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/face-photo/face-photo.js

@@ -216,7 +216,7 @@ const _sfc_main = {
         return;
       }
       api_user.fillUserInfo({
-        application_id: JSON.parse(common_vendor.index.getStorageSync("selectedJob")).id,
+        application_id: common_vendor.index.getStorageSync("appId"),
         openid,
         tenant_id,
         avatar: this.photoUrl

+ 3 - 3
unpackage/dist/dev/mp-weixin/pages/identity-verify/identity-verify.js

@@ -804,7 +804,7 @@ const _sfc_main = {
         formData.append("file", fileOrPath);
         formData.append("openid", openid);
         formData.append("tenant_id", tenant_id);
-        formData.append("application_id", 1);
+        formData.append("application_id", common_vendor.index.getStorageSync("appId"));
         formData.append("question_id", questionId);
         formData.append("video_duration", 0);
         formData.append("has_audio", "true");
@@ -870,7 +870,7 @@ const _sfc_main = {
         formData: {
           openid,
           tenant_id,
-          application_id: 1,
+          application_id: common_vendor.index.getStorageSync("appId"),
           question_id: questionId,
           video_duration: 0,
           has_audio: "true"
@@ -941,7 +941,7 @@ const _sfc_main = {
           questionId = 10;
       }
       const requestData = {
-        application_id: 1,
+        application_id: common_vendor.index.getStorageSync("appId"),
         question_id: questionId,
         video_url: videoUrl,
         tenant_id: common_vendor.index.getStorageSync("tenant_id") || "1"

+ 33 - 34
unpackage/dist/dev/mp-weixin/pages/index/index.js

@@ -94,26 +94,22 @@ const _sfc_main = {
         console.log("id:", userInfo.id);
         api_user.getUserInfo(userInfo.id).then((res) => {
           common_vendor.index.hideLoading();
-          if (res.code === 200 && res.data) {
-            const userData = res.data;
-            if (userData.name && userData.phone) {
-              this.userInfoFilled = true;
-              this.formData.name = userData.name || "";
-              this.formData.gender = userData.gender || "";
-              this.formData.phone = userData.phone || "";
-              this.formData.idCard = userData.id_card || "";
-              this.formData.emergencyContact = userData.emergency_contact || "";
-              this.formData.emergencyPhone = userData.emergency_phone || "";
-              this.formData.relation = userData.relation || "";
-              if (userData.relation) {
-                const index = this.relationOptions.findIndex((item) => item === userData.relation);
-                if (index !== -1) {
-                  this.relationIndex = index;
-                }
+          console.log("res:", res);
+          const userData = res;
+          if (userData.name == null && userData.phone == null) {
+            this.userInfoFilled = true;
+            this.formData.name = userData.name || "";
+            this.formData.gender = userData.gender || "";
+            this.formData.phone = userData.phone || "";
+            this.formData.idCard = userData.id_card || "";
+            this.formData.emergencyContact = userData.emergency_contact || "";
+            this.formData.emergencyPhone = userData.emergency_phone || "";
+            this.formData.relation = userData.relation || "";
+            if (userData.relation) {
+              const index = this.relationOptions.findIndex((item) => item === userData.relation);
+              if (index !== -1) {
+                this.relationIndex = index;
               }
-              common_vendor.index.navigateTo({
-                url: "/pages/success/success"
-              });
             }
           }
         }).catch((err) => {
@@ -174,6 +170,16 @@ const _sfc_main = {
         tenant_id: 1,
         openid: JSON.parse(common_vendor.index.getStorageSync("userInfo")).openid
       }).then((res) => {
+        if (res && res.id) {
+          common_vendor.index.setStorageSync("appId", res.id);
+          try {
+            const userInfo = JSON.parse(common_vendor.index.getStorageSync("userInfo") || "{}");
+            userInfo.appId = res.id;
+            common_vendor.index.setStorageSync("userInfo", JSON.stringify(userInfo));
+          } catch (e) {
+            console.error("更新用户信息失败:", e);
+          }
+        }
         common_vendor.index.navigateTo({
           url: "/pages/interview-notice/interview-notice",
           fail: (err) => {
@@ -186,6 +192,10 @@ const _sfc_main = {
         });
       }).catch((err) => {
         console.error("申请职位失败:", err);
+        common_vendor.index.showToast({
+          title: "申请职位失败,请重试",
+          icon: "none"
+        });
       });
     },
     submitForm() {
@@ -297,24 +307,13 @@ const _sfc_main = {
       });
       api_user.fillUserInfo(submitData).then((res) => {
         common_vendor.index.hideLoading();
-        this.updateLocalUserInfo();
+        this.updateLocalUserInfo(res.id);
         common_vendor.index.showToast({
           title: "提交成功",
           icon: "success",
           duration: 1500,
           success: () => {
-            setTimeout(() => {
-              common_vendor.index.navigateTo({
-                url: "/pages/success/success",
-                fail: (err) => {
-                  console.error("页面跳转失败:", err);
-                  common_vendor.index.showToast({
-                    title: "页面跳转失败",
-                    icon: "none"
-                  });
-                }
-              });
-            }, 1500);
+            this.userInfoFilled = false;
           }
         });
       }).catch((err) => {
@@ -326,8 +325,8 @@ const _sfc_main = {
         });
       });
     },
-    updateLocalUserInfo() {
-      api_user.getUserInfo().then((res) => {
+    updateLocalUserInfo(data) {
+      api_user.getUserInfo(data).then((res) => {
         if (res.code === 200 && res.data) {
           let userInfo = {};
           try {

+ 4 - 4
unpackage/dist/dev/mp-weixin/pages/interview/interview.js

@@ -116,11 +116,11 @@ const _sfc_main = {
         const blob = this.base64ToBlob(base64Data, "image/jpeg");
         const formData = new FormData();
         formData.append("photo_file", blob, `${type}.jpg`);
-        formData.append("application_id", "1");
+        formData.append("application_id", common_vendor.index.getStorageSync("appId"));
         formData.append("tenant_id", tenant_id);
         formData.append("description", `手部照片-${type}`);
         console.log("H5上传参数:", {
-          application_id: "1",
+          application_id: common_vendor.index.getStorageSync("appId"),
           tenant_id,
           description: `手部照片-${type}`
         });
@@ -150,7 +150,7 @@ const _sfc_main = {
       } else {
         console.log(`小程序环境上传文件路径:`, filePathOrData);
         console.log("小程序上传参数:", {
-          application_id: "1",
+          application_id: common_vendor.index.getStorageSync("appId"),
           tenant_id,
           description: `手部照片-${type}`
         });
@@ -161,7 +161,7 @@ const _sfc_main = {
           // 确保文件参数名称正确
           formData: {
             // 使用formData替代data以确保参数正确传递
-            "application_id": "1",
+            "application_id": common_vendor.index.getStorageSync("appId"),
             "tenant_id": tenant_id,
             "description": `手部照片-${type}`
           },

+ 91 - 53
unpackage/dist/dev/mp-weixin/pages/my/my.js

@@ -313,58 +313,100 @@ const _sfc_main = {
      * 获取用户手机号
      * @param {Object} e - 事件对象
      */
-    async getPhoneNumber(e) {
-      console.log("获取手机号事件:", e);
-      if (e.detail.errMsg !== "getPhoneNumber:ok") {
-        console.error("用户拒绝授权手机号");
-        common_vendor.index.showToast({
-          title: "获取手机号失败",
-          icon: "none"
-        });
-        return;
-      }
-      try {
-        common_vendor.index.showLoading({ title: "获取手机号中..." });
-        const loginResult = await new Promise((resolve, reject) => {
-          common_vendor.index.login({
-            provider: "weixin",
-            success: resolve,
-            fail: reject
-          });
-        });
-        const params = {
-          code: loginResult.code,
-          encryptedData: e.detail.encryptedData,
-          iv: e.detail.iv,
-          openid: JSON.parse(common_vendor.index.getStorageSync("userInfo")).openid
-        };
-        console.log("获取手机号请求参数:", JSON.parse(common_vendor.index.getStorageSync("userInfo")).openid);
-        const phoneData = await api_user.getUserPhoneNumber(params);
-        console.log("获取手机号成功:", phoneData);
-        if (phoneData && phoneData.phoneNumber) {
-          const updatedUserInfo = {
-            ...this.userInfo,
-            phone: phoneData.phoneNumber
-          };
-          this.userInfo = updatedUserInfo;
-          common_vendor.index.setStorageSync("userInfo", JSON.stringify(updatedUserInfo));
-          common_vendor.index.showToast({
-            title: "手机号绑定成功",
-            icon: "success"
-          });
-        } else {
-          throw new Error("未能获取到手机号");
-        }
-      } catch (error) {
-        console.error("获取手机号失败:", error);
-        common_vendor.index.showToast({
-          title: error.message || "获取手机号失败",
-          icon: "none"
+    getPhoneNumber(e) {
+      if (e.detail.code) {
+        common_vendor.wx$1.request({
+          url: "http:192.168.66.187:8083/wechat/getUserPhoneNumber",
+          method: "POST",
+          data: {
+            code: e.detail.code,
+            // 刚获取的新code
+            openid: this.data.openid
+          }
         });
-      } finally {
-        common_vendor.index.hideLoading();
       }
     },
+    /* async getPhoneNumber(e) {
+    	console.log('获取手机号事件:', e);
+    	
+    	// 检查是否成功获取
+    	if (e.detail.errMsg !== 'getPhoneNumber:ok') {
+    		console.error('用户拒绝授权手机号');
+    		uni.showToast({
+    			title: '获取手机号失败',
+    			icon: 'none'
+    		});
+    		return;
+    	}
+    	
+    	try {
+    		uni.showLoading({ title: '获取手机号中...' });
+    		
+    		// 每次都重新获取最新的登录code
+    		const loginResult = await new Promise((resolve, reject) => {
+    			uni.login({
+    				provider: 'weixin',
+    				success: (res) => resolve(res),
+    				fail: (err) => reject(err)
+    			});
+    		});
+    		
+    		if (!loginResult || !loginResult.code) {
+    			throw new Error('获取微信登录凭证失败');
+    		}
+    		
+    		console.log('成功获取新的登录code:', loginResult.code);
+    		
+    		// 获取存储的用户信息
+    		const userInfoStr = uni.getStorageSync('userInfo');
+    		if (!userInfoStr) {
+    			throw new Error('用户信息不存在,请重新登录');
+    		}
+    		
+    		const userInfo = JSON.parse(userInfoStr);
+    		
+    		// 准备请求参数
+    		const params = {
+    			code: loginResult.code,
+    			encryptedData: e.detail.encryptedData,
+    			iv: e.detail.iv,
+    			openid: userInfo.openid
+    		};
+    		
+    		console.log('获取手机号请求参数:', params);
+    		
+    		// 调用获取手机号API
+    		const phoneData = await getUserPhoneNumber(params);
+    		console.log('获取手机号成功:', phoneData);
+    		
+    		// 更新用户信息
+    		if (phoneData && phoneData.phoneNumber) {
+    			const updatedUserInfo = {
+    				...this.userInfo,
+    				phone: phoneData.phoneNumber
+    			};
+    			
+    			// 更新状态和存储
+    			this.userInfo = updatedUserInfo;
+    			uni.setStorageSync('userInfo', JSON.stringify(updatedUserInfo));
+    			
+    			uni.showToast({
+    				title: '手机号绑定成功',
+    				icon: 'success'
+    			});
+    		} else {
+    			throw new Error('未能获取到手机号');
+    		}
+    	} catch (error) {
+    		console.error('获取手机号失败:', error);
+    		uni.showToast({
+    			title: error.message || '获取手机号失败',
+    			icon: 'none'
+    		});
+    	} finally {
+    		uni.hideLoading();
+    	}
+    }, */
     // 添加刷新 CSRF token 的方法
     refreshCSRFToken() {
       common_vendor.index.request({
@@ -510,10 +552,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
   }, $data.showAuthModal ? {
     l: common_vendor.o((...args) => $options.getUserProfile && $options.getUserProfile(...args)),
     m: common_vendor.o((...args) => $options.cancelAuth && $options.cancelAuth(...args))
-  } : {}, {
-    n: $data.isLogin && !$data.userInfo.phone
-  }, $data.isLogin && !$data.userInfo.phone ? {
-    o: common_vendor.o((...args) => $options.getPhoneNumber && $options.getPhoneNumber(...args))
   } : {});
 }
 const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);

+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/my/my.wxml

@@ -1 +1 @@
-<view class="my-container"><view wx:if="{{a}}" class="user-info"><image class="avatar" src="{{b}}"></image><view class="user-details"><text class="username">{{c}}</text><text wx:if="{{d}}" class="user-phone">手机: {{e}}</text></view></view><view wx:else class="user-info" bindtap="{{g}}"><image class="avatar" src="{{f}}"></image><view class="user-details"><text class="username">点击登录</text><text class="user-id">登录后查看更多信息</text></view></view><view class="menu-list"><view wx:for="{{h}}" wx:for-item="item" wx:key="c" class="menu-item" bindtap="{{item.d}}"><view class="menu-item-left"><text class="{{['iconfont', item.a]}}"></text><text class="menu-text">{{item.b}}</text></view><text class="iconfont icon-right"></text></view></view><view wx:if="{{i}}" class="logout-btn" bindtap="{{j}}"><text>退出登录</text></view><view wx:if="{{k}}" class="auth-modal"><view class="auth-content"><text class="auth-title">微信授权登录</text><text class="auth-desc">请授权获取您的微信头像和昵称</text><button class="auth-btn" bindtap="{{l}}">确认授权</button><button class="auth-cancel" bindtap="{{m}}">取消</button></view></view><button wx:if="{{n}}" open-type="getPhoneNumber" bindgetphonenumber="{{o}}" class="get-phone-btn"> 绑定手机号 </button></view>
+<view class="my-container"><view wx:if="{{a}}" class="user-info"><image class="avatar" src="{{b}}"></image><view class="user-details"><text class="username">{{c}}</text><text wx:if="{{d}}" class="user-phone">手机: {{e}}</text></view></view><view wx:else class="user-info" bindtap="{{g}}"><image class="avatar" src="{{f}}"></image><view class="user-details"><text class="username">点击登录</text><text class="user-id">登录后查看更多信息</text></view></view><view class="menu-list"><view wx:for="{{h}}" wx:for-item="item" wx:key="c" class="menu-item" bindtap="{{item.d}}"><view class="menu-item-left"><text class="{{['iconfont', item.a]}}"></text><text class="menu-text">{{item.b}}</text></view><text class="iconfont icon-right"></text></view></view><view wx:if="{{i}}" class="logout-btn" bindtap="{{j}}"><text>退出登录</text></view><view wx:if="{{k}}" class="auth-modal"><view class="auth-content"><text class="auth-title">微信授权登录</text><text class="auth-desc">请授权获取您的微信头像和昵称</text><button class="auth-btn" bindtap="{{l}}">确认授权</button><button class="auth-cancel" bindtap="{{m}}">取消</button></view></view></view>

+ 1 - 1
unpackage/dist/dev/mp-weixin/project.config.json

@@ -8,7 +8,7 @@
     "urlCheck": false,
     "es6": true,
     "postcss": false,
-    "minified": false,
+    "minified": true,
     "newFeature": true,
     "bigPackageSizeSupport": true,
     "babelSetting": {