Jelajahi Sumber

Merge remote-tracking branch 'origin/2025鹅状元数学' into 2025鹅状元数学

# Conflicts:
#	pages/chanpinneirong/chanpin1.vue
tanxue 1 bulan lalu
induk
melakukan
813afd59c2

+ 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();

+ 24 - 13
pages/chanpinneirong/chanpin1.vue

@@ -33,7 +33,8 @@
 
 				<view v-for="(danyuanItem, index) in danyuanList" :key="danyuanItem.danyuanId">
 					<!-- 单元标题(带唯一ID,用于位置查询) -->
-					<ezyActiveVue class="ezy-list-item-active item-dy-box" @aclick="handleClickDanyuan(danyuanItem.danyuanId)" :id="`unit-title-${danyuanItem.danyuanId}`">
+					<ezyActiveVue class="ezy-list-item-active item-dy-box"
+						@aclick="handleClickDanyuan(danyuanItem.danyuanId)" :id="`unit-title-${danyuanItem.danyuanId}`">
 						<view class="dy-left-box">L{{banbenInfo.dengjiId}}</view>
 						<view class="dy-right-box">
 							<view class="right-content">
@@ -52,7 +53,7 @@
 							<view>{{ jieItem.jieName }}</view>
 							<view>{{ jieItem.jieIntro }}</view>
 						</view>
-						<view v-if="jieItem.lock" class="xx-item-lock-btn"></view>
+						<view v-if="jieItem.lock" class="xx-item-lock-btn"></view>
 						<view v-else class="xx-item-btn"></view>
 					</ezyActiveVue>
 				</view>
@@ -128,7 +129,7 @@
 			danyuanInfoVue,
 			ezyActiveVue
 		},
-	
+
 		onHide() {
 			console.log('学习页面隐藏')
 		},
@@ -139,13 +140,11 @@
 			initData(banbenId) {
 				console.log('123111');
 				const cacheData = cacheManager.get('contentInfo');
-			
 				if (cacheData) {
 					console.log('使用缓存数据');
 					this.updateFromCache();
 				} else {
 					console.log('重新请求数据');
-					const cacheDataAuth = cacheManager.get('auth');
 					this.initFromOptions(banbenId);
 				}
 			},
@@ -165,11 +164,12 @@
 			},
 
 			initFromOptions(banbenId) {
-			
+
 				this.loadDataFromApi(banbenId);
 			},
 			// 从缓存更新数据方法
 			updateFromCache() {
+				console.log('12311');
 				updateChanpin1Process()
 				const cacheData = cacheManager.get('contentInfo');
 				console.log('cacheData 从缓存更新数据方法', cacheData);
@@ -180,6 +180,11 @@
 					this.curProcess = cacheData.curProcess;
 					this.danyuanList = [...(cacheData.danyuanList || [])];
 					this.banbenId = cacheData.banbenId
+					if (this.danyuanList.length == 0) {
+						this.existData = false
+					} else {
+						this.existData = true
+					}
 					// this.$nextTick(() => {
 					// 	this.updateTitlePositions();
 					// });
@@ -187,6 +192,10 @@
 			},
 
 			loadDataFromApi(banbenId) {
+				uni.showLoading({
+					title: '加载中'
+				});
+
 				this.banbenInfo = {}
 				this.curProcess = ''
 				this.danyuanList = []
@@ -209,10 +218,12 @@
 							banbenId: banbenId,
 						};
 						cacheManager.set('contentInfo', cacheData);
+						uni.hideLoading();
 					}
 				}).catch(res => {
 					cacheManager.remove("contentInfo");
 					toast("加载失败,请重试");
+					uni.hideLoading();
 				});
 			},
 
@@ -291,13 +302,13 @@
 			},
 			handlePlay(da, code) {
 
-        if (da.lock && code == 'play') {
-          // 加锁视频需要购买
-          uni.navigateTo({
-            url: "/pages/chanpinShop/cp1/dingdan"
-          })
-          return;
-        }
+				if (da.lock && code == 'play') {
+					// 加锁视频需要购买
+					uni.navigateTo({
+						url: "/pages/chanpinShop/cp1/dingdan"
+					})
+					return;
+				}
 				let jieId = code === 'jixu' ? da.curJieId : da.jieId;
 				if (!jieId) {
 					toast("无课程ID");

+ 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('数据异常,未发现用户信息');
 	}