wangguoyu vor 3 Monaten
Ursprung
Commit
0f6644f3cc
2 geänderte Dateien mit 34 neuen und 35 gelöschten Zeilen
  1. 26 14
      pages/newEnglish/components/xiangjie.vue
  2. 8 21
      pages/newEnglish/index.vue

+ 26 - 14
pages/newEnglish/components/xiangjie.vue

@@ -13,11 +13,11 @@
 				</view>
 				<view class="details-content-box">
 					<text class="details-title">实用口语</text>
-					<view  v-for="(item,index) in pageInfo.kouyu" :key="index" class="syky-content">
+					<view v-for="(item,index) in pageInfo.kouyu" :key="index" class="syky-content">
 						<view class="details-en-content">
-							
+
 							<rich-text :nodes="highlightWord(item.en)"></rich-text>
-						<!-- 	<text>{{item.en}}</text> -->
+							<!-- 	<text>{{item.en}}</text> -->
 							<!-- 变色  word-color-->
 							<!-- <text class="word-color">{{item.en}}</text>
 							<text>{{item.en}}</text> -->
@@ -43,14 +43,14 @@
 	import {
 		onLoad
 	} from '@dcloudio/uni-app';
-	
+
 	import {
 		getUserIdentity,
 	} from "@/utils/common.js"
 	const goXiangjie = () => {
 
 	}
-	
+
 	const pageInfo = ref({
 		kouyu: [],
 		xiangyi: [],
@@ -61,26 +61,38 @@
 
 	onLoad((options) => {
 		if (userCode !== 'Visitor') {
-		getInfo(options)
-		data.value = options
+			getInfo(options)
+			data.value = options
 		} else {
-		getCommonInfo(options)
-		data.value = options
+			getCommonInfo(options)
+			data.value = options
 		}
 	})
 	const highlightWord = (text) => {
-		if (!text || !pageInfo.value.name){return text} 
+		if (!text || !pageInfo.value.name) {
+			return text
+		}
 		const word = pageInfo.value.name;
 		const regex = new RegExp(word, 'gi');
-		console.log('pageInfo.value.name',pageInfo.value.name);
+		console.log('pageInfo.value.name', pageInfo.value.name);
 		return text.replace(regex, (match) => {
 			return `<span style="color: #3a7fe9;">${match}</span>`;
 		});
 	}
 	const handleBack = () => {
-		uni.redirectTo({
-			url: `/pages/newEnglish/index?jieId=${data.value.jieId}&wordId=${data.value.wordId}`
-		});
+
+
+		if (userCode !== 'Visitor') {
+			uni.redirectTo({
+				url: `/pages/newEnglish/index?jieId=${data.value.jieId}&wordId=${data.value.wordId}`
+			});
+		} else {
+			
+			console.log('data123',data);
+			uni.redirectTo({
+				url: `/pages/newEnglish/index?jieId=${data.value.jieId}&wordId=${data.value.wordId}&levelId=${data.value.levelId}&typeId=${data.value.typeId}&subjectId=${data.value.subjectId}&tipFlag=${data.value.tipFlag}&youkeZhangId=${data.value.youkeZhangId}`
+			});
+		}
 	}
 	const getInfo = (data) => {
 		let req = {

+ 8 - 21
pages/newEnglish/index.vue

@@ -134,32 +134,18 @@
 	function nextWord() {
 		const index = data.wordList.findIndex(item => item.id == data.activeId);
 		if (index < data.wordList.length - 1) {
-				if (userCode !== 'Visitor') {
-					uni.redirectTo({
-						url: `/pages/newEnglish/index?jieId=${data.jieId}&wordId=${data.wordList[index + 1].id }`
-					})
-				} else {
-					uni.redirectTo({
-						url: `/pages/newEnglish/index?jieId=${data.jieId}&wordId=${data.wordList[index + 1].id }&levelId=${data.levelId}&typeId=${data.typeId}&subjectId=${data.subjectId}&tipFlag=${data.tipFlag}&youkeZhangId=${data.youkeZhangId}`
-					})
-				}
-		
+			uni.redirectTo({
+				url: `/pages/newEnglish/index?jieId=${data.jieId}&wordId=${data.wordList[index + 1].id }`
+			})
 		}
 	}
 
 	function prevWord() {
 		const index = data.wordList.findIndex(item => item.id == data.activeId);
 		if (index > 0) {
-			if (userCode !== 'Visitor') {
-				uni.redirectTo({
-					url: `/pages/newEnglish/index?jieId=${data.jieId}&wordId=${data.wordList[index - 1].id }`
-				})
-			} else {
-				uni.redirectTo({
-					url: `/pages/newEnglish/index?jieId=${data.jieId}&wordId=${data.wordList[index - 1].id }&levelId=${data.levelId}&typeId=${data.typeId}&subjectId=${data.subjectId}&tipFlag=${data.tipFlag}&youkeZhangId=${data.youkeZhangId}`
-				})
-			}
-		
+			uni.redirectTo({
+				url: `/pages/newEnglish/index?jieId=${data.jieId}&wordId=${data.wordList[index - 1].id }`
+			})
 		}
 	}
 
@@ -168,7 +154,7 @@
 		if (userCode !== 'Visitor') {
 			if (data.jieId == 0) {
 				uni.redirectTo({
-					url: `/pages/my/learnRecord?jieId=${data.jieId}&isLearnStatus=${data.isLearnStatus}&levelId=${data.levelId}&typeId=${data.typeId}&subjectId=${data.subjectId}&tipFlag=${data.tipFlag}&youkeZhangId=${data.youkeZhangId}`
+					url: `/pages/my/learnRecord?jieId=${data.jieId}&isLearnStatus=${data.isLearnStatus}`
 				})
 			} else {
 				uni.redirectTo({
@@ -256,6 +242,7 @@
 	}
 
 	function goXiangjie() {
+	
 		uni.redirectTo({
 			url: `/pages/newEnglish/components/xiangjie?levelId=${data.levelId}&typeId=${data.typeId}&subjectId=${data.subjectId}&tipFlag=${data.tipFlag}&wordId=${data.activeId}&youkeZhangId=${data.youkeZhangId}&jieId=${data.jieId}`
 		})