Browse Source

修改详情页面

wangxy 1 month ago
parent
commit
6a6e45fa1c

+ 20 - 9
components/goLogin/goLogin.vue

@@ -101,9 +101,14 @@
 
 	function showDl() {
 		dlRef.value.open('bottom');
+		loginData.buttonText = '获取验证码';
+		clearInterval(loginData.intervalId);
+		loginData.intervalId = null;
 	}
 
 	function closeDl() {
+		clearInterval(loginData.intervalId);
+		loginData.intervalId = null;
 		loginData.phoneNumber = null;
 		loginData.yzmNumber = null;
 		loginData.clearYzmIcon = false;
@@ -111,7 +116,7 @@
 		loginData.timeLeft = 60;
 		loginData.intervalId = null;
 		loginData.isDisabled = false;
-		loginData.buttonText = '';
+		loginData.buttonText = '获取验证码';
 		config.value = null;
 		isAgreed.value = false;
 		dlRef.value.close();
@@ -197,14 +202,13 @@
 		}
     telBind(req).then(res => {
 			if (res.code == 0 && res.data) {
-
-        const auth = cacheManager.get('auth');
-        auth.userName = loginData.phoneNumber;
+				const auth = cacheManager.get('auth');
+				auth.userName = loginData.phoneNumber;
 				// 更新用户信息
-				cacheManager.set('auth', res.data)
+				cacheManager.set('auth', auth)
 				// 返回重新支付
 				handleBack();
-        emits('success', auth)
+				emits('success', auth)
 			}
 		})
 	}
@@ -242,7 +246,7 @@
 			return;
 		}
 		loginData.isDisabled = true;
-		loginData.buttonText = `重新发送(${loginData.timeLeft}S)`;
+		loginData.buttonText = `(${loginData.timeLeft}S)`;
 
 		// 清除之前的定时器(如果有)
 		if (loginData.intervalId) {
@@ -260,7 +264,7 @@
 				loginData.isDisabled = false;
 				loginData.buttonText = '重新发送';
 			} else {
-				loginData.buttonText = `重新发送(${loginData.timeLeft}S)`;
+				loginData.buttonText = `(${loginData.timeLeft}S)`;
 			}
 		}, 1000);
 	}
@@ -273,12 +277,19 @@
 			lotNumber: sliderData.lot_number,
 			passToken: sliderData.pass_token,
 		}
-		sendCode(req).then(res => {})
+		sendCode(req).then(res => {}).catch(err => {
+			loginData.buttonText = '重新发送';
+			loginData.timeLeft = 60;
+			clearInterval(loginData.intervalId);
+			loginData.intervalId = null;
+		})
 	}
 
 	function captchaSuccess(result) {
+		loginData.buttonText = `(${loginData.timeLeft}S)`;
 		startCountdown();
 		Object.assign(sliderData, result)
+		
 		getYzmBtn();
 	}
 

+ 1 - 5
pages/chanpinMy/my.vue

@@ -125,11 +125,7 @@
 			myInfoData.nickName = res.data.nickName;
 			pageFrom.value = ''
 			appleCode.value = res.data.appleCode.toString()
-			if (res.data.nickName) {
-				myInfoData.nickName = res.data.nickName;
-			} else {
-				myInfoData.nickName = '鹅状元';
-			}
+			myInfoData.nickName = res.data.nickName;
 			if (res.data.icon) {
 				myInfoData.icon = res.data.icon;
 			} else {

+ 3 - 10
pages/chanpinMy/myInfo.vue

@@ -5,7 +5,7 @@
 			<text class="nav-bar-title">应用设置</text>
 		</view>
 		<view class="yysz-page-box">
-			<view class="yysz-row-box">
+			<view class="yysz-row-box" v-if="!isYouke">
 				<view class="yysz-item img-item" @click="headClick">
 					<text>头像</text>
 					<icon class="yysz-img-box" :style="{backgroundImage: 'url(' + myInfoData.icon + ')'}"></icon>
@@ -128,7 +128,6 @@
 		if (isYouke.value) {
 			return;
 		}
-		
 		chooseImage()
 	}
 
@@ -323,19 +322,13 @@
 	// 获取用户数据
 	function getMyInfo() {
 		myInfo({}).then(res => {
-			myInfoData.userName = res.data.userName;
+			myInfoData.userName = res.data.userName.startsWith('youke') ? '': res.data.userName;
 			myInfoData.credit = res.data.credit;
 			myInfoData.nickName = res.data.nickName;
-
-			if (res.data.nickName) {
-				myInfoData.nickName = res.data.nickName;
-			} else {
-				myInfoData.nickName = '鹅状元';
-			}
 			if (res.data.icon) {
 				myInfoData.icon = res.data.icon;
 			} else {
-				getUserImg(res.data.growthType)
+				getUserImg()
 			}
 
 		})

+ 0 - 1
pages/chanpinShop/cp1/dingdan.vue

@@ -216,7 +216,6 @@
 	}
 
 	function handlePay() {
-
 		if (getUserIsYouke()) {
 			// 游客
 			kaiRef.value.handleShow();

+ 1 - 0
utils/common.js

@@ -151,6 +151,7 @@ export function convertTimeToSeconds(timeStr) {
 // 当前用户是否是非游客
 export function getUserIsYouke() {
 	const auth = cacheManager.get('auth');
+	console.log('user', auth)
 	if (!auth) {
 		throw new Error('数据异常,未发现用户信息');
 	}