wangguoyu il y a 3 mois
Parent
commit
1d9e0b7a53

+ 1 - 1
pages/newEnglish/components/learnContent.vue

@@ -55,7 +55,7 @@
 	// })
 	const goXiangjie = () => {
 		uni.redirectTo({
-			url: '/pages/newEnglish/components/xiangjie?jieId='+props.pageData.jieId+'&woedId='+props.pageData.activeId
+			url: '/pages/newEnglish/components/xiangjie?jieId='+props.pageData.jieId+'&wordId='+props.pageData.activeId
 		})
 	}
 	const audioInfo = ref(null)

+ 59 - 7
pages/newEnglish/components/xiangjie.vue

@@ -1,26 +1,78 @@
 <template>
+	<view class="icon-title-navBar-box">
+		<view @click="handleBack" class="nav-bar-icon"></view>
+		<text class="nav-bar-title">单词详解</text>
+	</view>
 	<view>
-	
+		<view>
+			{{pageInfo.name}}
+		</view>
+		<view>
+			<text>
+				通用释义
+			</text>
+			<text  v-for="(item,index) in pageInfo.xiangyi" :key="index">
+				<text>
+					{{item}}
+				</text>
+			</text>
+		</view>
+		<view>
+			<text>
+				实用口语
+			</text>
+			<text  v-for="(item,index) in pageInfo.kouyu" :key="index">
+				<text>
+					{{item.en}}
+					{{item.zn}}
+				</text>
+			</text>
+		</view>
 	</view>
 </template>
 
 <script setup>
-
 	import {
 		reactive,
 		ref,
 		onMounted
 	} from 'vue';
-
+	import {
+		getWordInfo
+	} from "@/api/word.js"
+	import {
+		onLoad
+	} from '@dcloudio/uni-app';
 	const goXiangjie = () => {
-		
+
 	}
-	const audioInfo = ref(null)
+	const pageInfo = ref({
+		kouyu: [],
+		xiangyi: [],
+		name: ''
+	})
+	const data = ref(null)
 
 
-	onMounted(() => {
-	
+	onLoad((options) => {
+		getInfo(options)
+		data.value = options
 	})
+	const handleBack = () => {
+		uni.redirectTo({
+			url: `/pages/newEnglish/index?jieId=${data.value.jieId}&wordId=${data.value.wordId}`
+		});
+	}
+	const getInfo = (data) => {
+		let req = {
+			jieId: data.jieId,
+			wordId: data.wordId
+		}
+		getWordInfo(req).then(res => {
+			console.log('res', res);
+			pageInfo.value = res.data
+		})
+	}
 </script>
 
 <style>