ソースを参照

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

wangxy 3 ヶ月 前
コミット
8ce470bf9b
4 ファイル変更188 行追加111 行削除
  1. 11 0
      api/my.js
  2. 32 12
      common/styles/global/pages.scss
  3. 144 98
      pages/my/learnRecord.vue
  4. 1 1
      pages/wordList/wordList.vue

+ 11 - 0
api/my.js

@@ -55,4 +55,15 @@ export function commonCardList(data = {}) {
     data,
     timeout: 20000
   })
+}
+export function myWordList(data = {}) {
+  return request({
+    'url': '/app/user/my/word/list',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
 }

+ 32 - 12
common/styles/global/pages.scss

@@ -1912,6 +1912,32 @@
 	.clean-btn{width: 171rpx;height:58rpx;@include ezy-no-repeat-cover;margin: 24rpx auto 0;
 	background-image: url("@/static/images/study/cjdc/wordView/clean-btn.png");
 	}
+	
+	// 音标播放
+	.yb-play-box{
+		background-color: rgba(255, 255, 255, 0.6);display: inline-block;margin: 32rpx auto 0;
+		padding: 4rpx 24rpx 10rpx;border-radius: 30rpx;
+		text{font-size: 28rpx;display: inline-block;vertical-align: middle;}
+		text:nth-child(even){color: #068aea;margin: 0 10rpx;}
+		icon{width: 30rpx;height:30rpx;@include ezy-no-repeat-cover;margin-left: 24rpx;
+		display: inline-block;vertical-align: middle;}
+		.yb-play-btn{background-image: url("@/static/images/study/cjdc/wordView/yb-play-btn.png");}
+		.yb-playing-btn{background-image: url("@/static/images/study/cjdc/wordView/yb-playing-btn.gif");}
+		
+	}
+	
+	// 带点的单词展示
+	.word-circle-box{
+		width: 100%;overflow: hidden;
+		color: #015fb0;font-weight: bold;font-size: 76rpx;text-align: center;margin: 64rpx auto 0;
+		text-shadow:-1rpx -1rpx 0 #fff,1rpx -1rpx 0 #fff,-1rpx 1rpx 0 #fff,1rpx 1rpx 0 #fff;
+		text{display: inline-block;vertical-align: middle;}
+		text:nth-child(odd){color: #ff9a01;}
+		text:not(:first-child)::before{
+			content: '';width: 10rpx;height: 10rpx;background-color: #999;margin: 0 6rpx;
+			display: inline-block;vertical-align: middle;border-radius: 10rpx;
+		}
+	}
 }
 .word-view-page::before,.word-view-page::after{content: '';width: 29rpx;height: 42rpx;
 	background-image: url("@/static/images/study/jt-left-icon.png");@include ezy-no-repeat-cover;display: block;
@@ -1919,7 +1945,8 @@
 .word-view-page::before{left: 60rpx;}
 .word-view-page::after{right: 60rpx;transform: rotate(180deg);}
 	
-	
+// 单词详情- 拼
+.words-xue-box{}
 // 单词详情-拼
 .words-pin-box{
 	display: flex;flex-direction: column;padding: 10rpx;box-sizing: border-box;
@@ -1986,17 +2013,6 @@
 		color: #015fb0;font-weight: bold;font-size: 76rpx;text-align: center;margin: 64rpx auto 0;
 		text-shadow:-1rpx -1rpx 0 #fff,1rpx -1rpx 0 #fff,-1rpx 1rpx 0 #fff,1rpx 1rpx 0 #fff;
 	}
-	.yb-play-box{
-		background-color: rgba(255, 255, 255, 0.6);display: inline-block;margin: 32rpx auto 0;
-		padding: 4rpx 24rpx 10rpx;border-radius: 30rpx;
-		text{font-size: 28rpx;display: inline-block;vertical-align: middle;}
-		text:nth-child(even){color: #068aea;margin: 0 10rpx;}
-		icon{width: 30rpx;height:30rpx;@include ezy-no-repeat-cover;margin-left: 24rpx;
-		display: inline-block;vertical-align: middle;}
-		.yb-play-btn{background-image: url("@/static/images/study/cjdc/wordView/yb-play-btn.png");}
-		.yb-playing-btn{background-image: url("@/static/images/study/cjdc/wordView/yb-playing-btn.gif");}
-		
-	}
 	.select-change-box{
 		flex-shrink: 0;
 		.select-item{
@@ -2168,6 +2184,10 @@
 	.learn-record-scroll-view{
 		margin-top: 16rpx;overflow-y: auto;height: calc(100vh - 370rpx - var(--status-bar-height));
 		box-sizing: border-box;padding: 0 20rpx;
+		.word-item-box{
+			width: 100%;background-color: transparent!important;
+			.uni-list-item__container{width: 100%;display: block;}
+		}
 		.word-list-item{margin-bottom: 16rpx;}
 	}
 }

+ 144 - 98
pages/my/learnRecord.vue

@@ -6,86 +6,122 @@
 		</view>
 		<view class="ezy-tab-border">
 
-			<uni-segmented-control :current="xxjlData.current" :values="xxjlData.items" active-color="#3A7FE9"
+			<uni-segmented-control :current="xxjlData.current -1" :values="xxjlData.items" active-color="#3A7FE9"
 				@clickItem="onChangeTab" class="ezy-tab-box" />
 			<view>
-				<view v-if="xxjlData.current == 0">
+				<view v-if="xxjlData.current == 1">
 					<scroll-view scroll-y="true" refresher-enabled="true" @scrolltolower="onScrolltolower"
 						:refresher-triggered="xxjlData.weizhangwo.loading" :refresher-threshold="50"
-						refresher-background="transparent" @refresherrefresh="onRefresh" class="learn-record-scroll-view">
+						refresher-background="transparent" @refresherrefresh="onRefresh"
+						class="learn-record-scroll-view">
 						<!--数学-->
 						<uni-list>
-							<uni-list-item v-for="(item,index) in xxjlData.weizhangwo.list" :key="index"
-								class="word-list-item">
+							<uni-list-item v-for="(item,index) in xxjlData.weizhangwo.list" :key="index" class="word-item-box">
 								<template v-slot:body>
-									<view class="item-word">
-										<view class="word-text">
-											<text v-for="(word, wordIndex) in item.chaifen" 
-											:key="wordIndex" class="word-color">
-											{{ word }}
-											</text>
+									<view @click="goLearn(item)" class="word-list-item">
+										<view class="item-word">
+											<view class="word-text">
+												<text v-for="(word, wordIndex) in item.chaifen" :key="wordIndex"
+													class="word-color">
+													{{ word }}
+												</text>
+											</view>
+											<view class="phonetic-alphabet">{{item.yinbiao || ''}}</view>
 										</view>
-										<view class="phonetic-alphabet">{{item.yinbiao || ''}}</view>
-									</view>
-									<view class="item-explain">
-										<view class="item-explain-content">
-											<view class="explain-text" v-for="(meaning, meaningIndex) in item.jianyi" :key="meaningIndex">{{meaning}}</view>
+										<view class="item-explain">
+											<view class="item-explain-content">
+												<view class="explain-text"
+													v-for="(meaning, meaningIndex) in item.jianyi" :key="meaningIndex">
+													{{meaning}}</view>
+											</view>
+										</view>
+										<view class="item-arrow">
+											<icon></icon>
 										</view>
 									</view>
-									<view class="item-arrow"><icon></icon></view>
+
 								</template>
 							</uni-list-item>
-							<uni-load-more :status="xxjlData.weizhangwo.state" @click="getMore(2)"
+							<uni-load-more :status="xxjlData.weizhangwo.state" @click="getMore(1)"
 								:contentText="xxjlData.weizhangwo.contentText">
 							</uni-load-more>
 						</uni-list>
 					</scroll-view>
 				</view>
-				<view v-if="xxjlData.current == 1">
+				<view v-if="xxjlData.current == 2">
 					<scroll-view scroll-y="true" refresher-enabled="true" @scrolltolower="onScrolltolower"
 						:refresher-triggered="xxjlData.yizhangwo.loading" :refresher-threshold="50"
-						refresher-background="transparent" @refresherrefresh="onRefresh" class="learn-record-scroll-view">
+						refresher-background="transparent" @refresherrefresh="onRefresh"
+						class="learn-record-scroll-view">
 						<!--数学-->
 						<uni-list>
 							<uni-list-item v-for="(item,index) in xxjlData.yizhangwo.list" :key="index"
 								class="word-list-item">
 								<template v-slot:body>
-									
+									<view class="item-word">
+										<view @click="goLearn(item)">
+											<view class="word-text">
+												<text v-for="(word, wordIndex) in item.chaifen" :key="wordIndex"
+													class="word-color">
+													{{ word }}
+												</text>
+											</view>
+											<view class="phonetic-alphabet">{{item.yinbiao || ''}}</view>
+										</view>
+										<view class="item-explain">
+											<view class="item-explain-content">
+												<view class="explain-text"
+													v-for="(meaning, meaningIndex) in item.jianyi" :key="meaningIndex">
+													{{meaning}}</view>
+											</view>
+										</view>
+										<view class="item-arrow">
+											<icon></icon>
+										</view>
+									</view>
 								</template>
 							</uni-list-item>
-							<uni-load-more :status="xxjlData.yizhangwo.state" @click="getMore(1)"
+							<uni-load-more :status="xxjlData.yizhangwo.state" @click="getMore(2)"
 								:contentText="xxjlData.yizhangwo.contentText">
 							</uni-load-more>
 						</uni-list>
 					</scroll-view>
 				</view>
-				<view v-if="xxjlData.current == 2">
+				<view v-if="xxjlData.current == 3">
 					<scroll-view scroll-y="true" refresher-enabled="true" @scrolltolower="onScrolltolower"
 						:refresher-triggered="xxjlData.shouchang.loading" :refresher-threshold="50"
-						refresher-background="transparent" @refresherrefresh="onRefresh" class="learn-record-scroll-view">
+						refresher-background="transparent" @refresherrefresh="onRefresh"
+						class="learn-record-scroll-view">
 						<!--数学-->
 						<uni-list>
 							<uni-list-item v-for="(item,index) in xxjlData.shouchang.list" :key="index"
 								class="word-list-item">
 								<template v-slot:body>
-									<view class="item-word">
-										<view class="word-text">
-											<text v-for="(word, wordIndex) in item.chaifen" 
-											:key="wordIndex" class="word-color">
-											{{ word }}
-											</text>
+									<view @click="goLearn(item)">
+										<view class="item-word">
+											<view class="word-text">
+												<text v-for="(word, wordIndex) in item.chaifen" :key="wordIndex"
+													class="word-color">
+													{{ word }}
+												</text>
+											</view>
+											<view class="phonetic-alphabet">{{item.yinbiao || ''}}</view>
 										</view>
-										<view class="phonetic-alphabet">{{item.yinbiao || ''}}</view>
-									</view>
-									<view class="item-explain">
-										<view class="item-explain-content">
-											<view class="explain-text" v-for="(meaning, meaningIndex) in item.jianyi" :key="meaningIndex">{{meaning}}</view>
+										<view class="item-explain">
+											<view class="item-explain-content">
+												<view class="explain-text"
+												 
+													v-for="(meaning, meaningIndex) in item.jianyi" :key="meaningIndex">
+													{{meaning}}</view>
+											</view>
+										</view>
+										<view class="item-arrow">
+											<icon></icon>
 										</view>
 									</view>
-									<view class="item-arrow"><icon></icon></view>
 								</template>
 							</uni-list-item>
-							<uni-load-more :status="xxjlData.shouchang.state" @click="getMore(0)"
+							<uni-load-more :status="xxjlData.shouchang.state" @click="getMore(3)"
 								:contentText="xxjlData.shouchang.contentText">
 							</uni-load-more>
 						</uni-list>
@@ -98,13 +134,20 @@
 </template>
 
 <script setup>
-	import {reactive,ref} from "vue";
-	import {getWordList} from "@/api/word.js"
-	import {onLoad} from "@dcloudio/uni-app";
+	import {
+		reactive,
+		ref
+	} from "vue";
+	import {
+		myWordList
+	} from "@/api/my.js"
+	import {
+		onLoad
+	} from "@dcloudio/uni-app";
 	import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
 	const xxjlData = reactive({
-		items: [ '未掌握', '已掌握', '收藏'],
-		current: 0,
+		items: ['未掌握', '已掌握', '收藏'],
+		current: 1,
 		count: 0, // 总数,默认值设为 0
 		studyCount: 0, // 已学总数,默认值设为 0
 		shouchang: {
@@ -144,19 +187,22 @@
 	})
 
 
+	function goLearn() {
+		console.log('data', 123123);
+	}
 
 	function onChangeTab(e) {
-		if (xxjlData.current !== e.currentIndex) {
-			xxjlData.current = e.currentIndex;
-			if (xxjlData.current == 0) {
-				xxjlData.weizhangwo.page = 0
-			} else if (xxjlData.current == 1) {
-				xxjlData.yizhangwo.page = 0
-			} else if (xxjlData.current == 2) {
-				xxjlData.shouchang.page = 0
-			}
-			refreshData(xxjlData.current);
+		console.log('xxjlData.current', xxjlData.current);
+		console.log(' e.currentIndex', e.currentIndex);
+		xxjlData.current = e.currentIndex + 1;
+		if (xxjlData.current == 1) {
+			xxjlData.weizhangwo.page = 0
+		} else if (xxjlData.current == 2) {
+			xxjlData.yizhangwo.page = 0
+		} else if (xxjlData.current == 3) {
+			xxjlData.shouchang.page = 0
 		}
+		refreshData(xxjlData.current);
 	}
 
 	function onScrolltolower() {
@@ -165,41 +211,41 @@
 
 	function refreshData(code) {
 		const opt = {
-			jieId:"666",
+			type: code
 		}
 
-		if (code == 0) {
+		if (code == 1) {
 			xxjlData.weizhangwo.list = [];
 			// 英语
 			xxjlData.weizhangwo.state = 'loading';
 			xxjlData.weizhangwo.page++;
 			opt.page = xxjlData.weizhangwo.page;
-		} else if (code == 1) {
+		} else if (code == 2) {
 			xxjlData.yizhangwo.list = [];
 			// 英语
 			xxjlData.yizhangwo.state = 'loading';
 			xxjlData.yizhangwo.page++;
 			opt.page = xxjlData.yizhangwo.page;
-		} else if (code == 2) {
+		} else if (code == 3) {
 			xxjlData.shouchang.list = [];
 			// 数学
 			xxjlData.shouchang.state = 'loading';
 			xxjlData.shouchang.page++;
 			opt.page = xxjlData.shouchang.page;
 		}
-		getWordList(opt).then(res => {
-			if (code == 0) {
-				xxjlData.weizhangwo.list = xxjlData.weizhangwo.list.concat(res.data.data);
+		myWordList(opt).then(res => {
+			if (code == 1) {
+				xxjlData.weizhangwo.list = xxjlData.weizhangwo.list.concat(res.data);
 				xxjlData.weizhangwo.loading = false;
-				
-			} else if (code == 1) {
-				xxjlData.yizhangwo.list = xxjlData.yizhangwo.list.concat(res.data.data);
-				xxjlData.yizhangwo.loading = false;
+
 			} else if (code == 2) {
-				xxjlData.shouchang.list = xxjlData.shouchang.list.concat(res.data.data);
+				xxjlData.yizhangwo.list = xxjlData.yizhangwo.list.concat(res.data);
+				xxjlData.yizhangwo.loading = false;
+			} else if (code == 3) {
+				xxjlData.shouchang.list = xxjlData.shouchang.list.concat(res.data);
 				xxjlData.shouchang.loading = false;
 			}
-			if (code == 0) {
+			if (code == 1) {
 				if (res.data.total > xxjlData.weizhangwo.list.length) {
 					// 英语
 					xxjlData.weizhangwo.state = 'more';
@@ -209,7 +255,7 @@
 					xxjlData.weizhangwo.state = 'no-more';
 					xxjlData.weizhangwo.loading = false;
 				}
-			} else if (code == 1) {
+			} else if (code == 2) {
 				if (res.data.total > xxjlData.yizhangwo.list.length) {
 					// 英语
 					xxjlData.yizhangwo.state = 'more';
@@ -219,7 +265,7 @@
 					xxjlData.yizhangwo.state = 'no-more';
 					xxjlData.yizhangwo.loading = false;
 				}
-			} else if (code == 2) {
+			} else if (code == 3) {
 				if (res.data.total > xxjlData.shouchang.list.length) {
 					// 数学
 					xxjlData.shouchang.state = 'more';
@@ -229,16 +275,16 @@
 					xxjlData.shouchang.state = 'no-more';
 					xxjlData.shouchang.loading = false;
 				}
-				
+
 			}
 		}).catch(err => {
-			if (code == 0) {
+			if (code == 1) {
 				xxjlData.weizhangwo.state = 'more';
 				xxjlData.weizhangwo.loading = false;
-			} else if (code == 1) {
+			} else if (code == 2) {
 				xxjlData.yizhangwo.state = 'more';
 				xxjlData.yizhangwo.loading = false;
-			} else if (code == 2) {
+			} else if (code == 3) {
 				xxjlData.shouchang.state = 'more';
 				xxjlData.shouchang.loading = false;
 			}
@@ -246,16 +292,16 @@
 	}
 
 	function onRefresh() {
-		if (xxjlData.current == 0) {
+		if (xxjlData.current == 1) {
 			xxjlData.weizhangwo.page = 0;
 			xxjlData.weizhangwo.list = [];
 			xxjlData.weizhangwo.loading = true;
-			
-		} else if (xxjlData.current == 1) {
+
+		} else if (xxjlData.current == 2) {
 			xxjlData.yizhangwo.page = 0;
 			xxjlData.yizhangwo.list = [];
 			xxjlData.yizhangwo.loading = true;
-		} else if (xxjlData.current == 2) {
+		} else if (xxjlData.current == 3) {
 			xxjlData.shouchang.page = 0;
 			xxjlData.shouchang.list = [];
 			xxjlData.shouchang.loading = true;
@@ -265,25 +311,25 @@
 
 	function getMore(code) {
 		const opt = {
-			jieId:"666",
+			type: code,
 		}
 
-		if (code == 0) {
+		if (code == 1) {
 			if (xxjlData.weizhangwo.state == 'no-more') {
 				return;
 			}
 			xxjlData.weizhangwo.state = 'loading';
 			xxjlData.weizhangwo.page++;
 			opt.page = xxjlData.weizhangwo.page;
-			
-		} else if (code == 1) {
+
+		} else if (code == 2) {
 			if (xxjlData.yizhangwo.state == 'no-more') {
 				return;
 			}
 			xxjlData.yizhangwo.state = 'loading';
 			xxjlData.yizhangwo.page++;
 			opt.page = xxjlData.yizhangwo.page;
-		} else if (code == 2) {
+		} else if (code == 3) {
 			if (xxjlData.shouchang.state == 'no-more') {
 				return;
 			}
@@ -292,18 +338,18 @@
 			xxjlData.shouchang.page++;
 			opt.page = xxjlData.shouchang.page;
 		}
-		getWordList(opt).then(res => {
-			if (code == 0) {
-				xxjlData.weizhangwo.list = res.data.wordList;
+		myWordList(opt).then(res => {
+			if (code == 1) {
+				xxjlData.weizhangwo.list = xxjlData.weizhangwo.list.concat(res.data)
 				xxjlData.weizhangwo.loading = false;
-			} else if (code == 1) {
-				xxjlData.yizhangwo.list = xxjlData.yizhangwo.list.concat(res.data.data);
-				xxjlData.yizhangwo.loading = false;
 			} else if (code == 2) {
-				xxjlData.shouchang.list = xxjlData.shouchang.list.concat(res.data.data);
+				xxjlData.yizhangwo.list = xxjlData.yizhangwo.list.concat(res.data);
+				xxjlData.yizhangwo.loading = false;
+			} else if (code == 3) {
+				xxjlData.shouchang.list = xxjlData.shouchang.list.concat(res.data);
 				xxjlData.shouchang.loading = false;
 			}
-			if (code == 0) {
+			if (code == 1) {
 				if (res.data.total > xxjlData.weizhangwo.list.length) {
 					// 英语
 					xxjlData.weizhangwo.state = 'more';
@@ -313,11 +359,11 @@
 					// 英语
 					xxjlData.weizhangwo.state = 'no-more';
 					xxjlData.weizhangwo.state_text = '没有更多啦';
-				
+
 					xxjlData.weizhangwo.loading = false;
 				}
-				
-			} else if (code == 1) {
+
+			} else if (code == 2) {
 				if (res.data.total > xxjlData.yizhangwo.list.length) {
 					// 英语
 					xxjlData.yizhangwo.state = 'more';
@@ -330,7 +376,7 @@
 					xxjlData.yizhangwo.state_text = '没有更多啦';
 					xxjlData.yizhangwo.loading = false;
 				}
-			} else if (code == 2) {
+			} else if (code == 3) {
 				if (res.data.total > xxjlData.shouchang.list.length) {
 					// 数学
 					xxjlData.shouchang.state = 'more';
@@ -340,20 +386,20 @@
 					// 数学
 					xxjlData.shouchang.state = 'no-more';
 					xxjlData.shouchang.state_text = '没有更多啦';
-				
+
 					xxjlData.shouchang.loading = false;
 				}
 			}
 		}).catch(err => {
-			if (code == 0) {
+			if (code == 1) {
 				xxjlData.weizhangwo.state = 'more';
 				xxjlData.weizhangwo.state_text = '加载更多';
 				xxjlData.weizhangwo.loading = false;
-			} else if (code == 1) {
+			} else if (code == 2) {
 				xxjlData.yizhangwo.state = 'more';
 				xxjlData.yizhangwo.state_text = '加载更多';
 				xxjlData.yizhangwo.loading = false;
-			} else if (code == 2) {
+			} else if (code == 3) {
 				xxjlData.shouchang.state = 'more';
 				xxjlData.shouchang.state_text = '加载更多';
 				xxjlData.shouchang.loading = false;
@@ -366,9 +412,9 @@
 			url: '/pages/my/index'
 		})
 	}
-	
+
 	onLoad((options) => {
-		xxjlData.current = Number(options.status) || xxjlData.current
+		xxjlData.current = xxjlData.current
 		getMore(xxjlData.current);
 	})
 </script>

+ 1 - 1
pages/wordList/wordList.vue

@@ -10,7 +10,7 @@
 				<view class="word-num-box"><icon></icon><text>{{listData.studyCount || 0}}/{{listData.count || 0}}词</text></view>
 				<view class="word-list-body" v-if="listData.wordList && listData.wordList.length > 0">
 				<!-- 单词 -->
-					<view class="word-list-item" v-for="(item,index) in listData.wordList" :key="index" @click="toWord(item)" :class="{active: item.wcFlag == 0}">
+					<view class="word-list-item" v-for="(item,index) in listData.wordList" :key="index" @click="toWord(item)" :class="{active: item.wcFlag == 1}">
 						<view class="item-word">
 							<view class="word-text">
 								<text v-for="(word, wordIndex) in item.chaifen"