Browse Source

调整解析单词显示

wangxy 1 month ago
parent
commit
1519e2e825

+ 11 - 0
api/chanpinShuxue.js

@@ -10,3 +10,14 @@ export function getShuxueChanpinList(data = {}) {
         timeout: 20000
     })
 }
+export function getShuxueChanpinBanbenList(data = {}) {
+    return request({
+        'url': '/app/shuxue/chanpin/banben/list',
+        headers: {
+            isToken: true
+        },
+        method: 'post',
+        data,
+        timeout: 20000
+    })
+}

+ 40 - 10
pages/chanpinXuanze/banben.vue

@@ -1,20 +1,50 @@
 <template>
 	<view>
+		<view>
+			<view @click="handleBack"><</view>
+			<view>选择版本</view>
+		</view>
 		
+		<view v-for="item in data.banbenList" :key="item.id">
+			<!-- 封面 -->
+			<image :src="item.cover" mode=""></image>
+			<!-- 名称+等级 -->
+			<view>{{item.chanpinName}} {{item.dengjiName}}</view>
+			<!-- 版本名称 -->
+			<view>{{item.name}}</view>
+			
+			<view>播放按钮</view>
+		</view>
 	</view>
+	<footTabbarVue :currentTabNumber="0"></footTabbarVue>
 </template>
 
-<script>
-	export default {
-		data() {
-			return {
-				
-			}
-		},
-		methods: {
-			
-		}
+<script setup>
+	import {reactive} from "vue";
+	import {onLoad} from "@dcloudio/uni-app"
+	import * as shuxueHttp from "@/api/chanpinShuxue.js"
+	import footTabbarVue from "./components/footTabbar.vue";
+	
+	const data = reactive({
+		dengjiId: null,
+		banbenList: []
+	})
+	function getBanbenList() {
+		shuxueHttp.getShuxueChanpinBanbenList({dengjiId: data.dengjiId}).then(res => {
+			data.banbenList = res.data;
+		})
+	}
+	
+	function handleBack() {
+		uni.navigateBack()
 	}
+	
+	onLoad((options) => {
+		data.dengjiId = options.dengjiId;
+		getBanbenList();
+	})
+	
+	
 </script>
 
 <style>

+ 4 - 1
pages/chanpinXuanze/components/shuxueList.vue

@@ -11,7 +11,7 @@
 			<view>共计{{item.gongji}}节课程</view>
 			<view>
 				<view>请选择学习等级</view>
-				<view v-for="cItem in item.levelList" @click="handleSelect" :class="{active: item.active}">{{cItem.levelName}}</view>
+				<view v-for="cItem in item.levelList" @click="handleSelect(cItem)" :class="{active: item.active}">{{cItem.levelName}}</view>
 			</view>
 		</view>
 	</view>
@@ -28,6 +28,9 @@
 	// 选择产品等级
 	function handleSelect(item) {
 		console.log('item', item)
+		uni.navigateTo({
+			url: `/pages/chanpinXuanze/banben?dengjiId=${item.dengjiId}`
+		})
 	}
 </script>
 

+ 3 - 0
pages/chanpinXuanze/index.vue

@@ -18,6 +18,8 @@
 		<view class="list yuwen" v-if="data.chanpinActiveSelect == 3">
 			
 		</view>
+		
+		<footTabbarVue :currentTabNumber="0"></footTabbarVue>
 </template>
 
 <script setup>
@@ -25,6 +27,7 @@
 	import shuxueListVue from "./components/shuxueList.vue";
 	import {onLoad} from "@dcloudio/uni-app"
 	import * as shuxueHttp from "@/api/chanpinShuxue.js"
+	import footTabbarVue from "./components/footTabbar.vue";
 	
 	const data = reactive({
 		list: [