Browse Source

Merge branch '2025鹅状元数学' of https://gogs.mtavip.com/wangguoyu/uniProject into 2025鹅状元数学

tanxue 1 month ago
parent
commit
236e21244c

+ 23 - 0
api/chanpinShuxue.js

@@ -0,0 +1,23 @@
+import request from '@/utils/request'
+export function getShuxueChanpinList(data = {}) {
+    return request({
+        'url': '/app/shuxue/chanpin/list',
+        headers: {
+            isToken: true
+        },
+        method: 'post',
+        data,
+        timeout: 20000
+    })
+}
+export function getShuxueChanpinBanbenList(data = {}) {
+    return request({
+        'url': '/app/shuxue/chanpin/banben/list',
+        headers: {
+            isToken: true
+        },
+        method: 'post',
+        data,
+        timeout: 20000
+    })
+}

+ 14 - 0
pages.json

@@ -146,6 +146,20 @@
 			"style": {
 				"navigationStyle": "custom"
 			}
+		},
+		{
+			"path" : "pages/chanpinXuanze/index",
+			"style" : 
+			{
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path" : "pages/chanpinXuanze/banben",
+			"style" : 
+			{
+				"navigationStyle": "custom"
+			}
 		}
 	],
 	"tabBar": {

+ 52 - 0
pages/chanpinXuanze/banben.vue

@@ -0,0 +1,52 @@
+<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 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>
+
+</style>

+ 60 - 0
pages/chanpinXuanze/components/footTabbar.vue

@@ -0,0 +1,60 @@
+<template>
+	<view class="ezy-custom-tabbar">
+		<view class="tabbar-item-box">
+
+			<view class="tabbar-item" v-for="(item, index) in tabList" :key="index" @click="switchTab(item.path,index)" :class="{active: index == currentTabNumber}"
+				:style="{ backgroundImage: 'url(' + (currentTab == index ? item.activePath : item.iconPath) + ')' }">
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		nextTick,
+	} from "vue";
+	export default {
+		data() {
+			return {
+				tabList: [{
+						iconPath: 'static/images/tabbar/unselect/plan-sj.png',
+						activePath: 'static/images/tabbar/select/plan-sj.png',
+						path: `/pages/study/index`
+					},
+					{
+						iconPath: 'static/images/tabbar/unselect/xinqing-sj.png',
+						activePath: 'static/images/tabbar/select/xinqing-sj.png',
+						path: `/pages/zhuanti/index`
+					},
+					{
+						iconPath: 'static/images/tabbar/unselect/partner-sj.png',
+						activePath: 'static/images/tabbar/select/partner-sj.png',
+						path: '/pages/game/index'
+					},
+					{
+						iconPath: 'static/images/tabbar/unselect/my-sj.png',
+						activePath: 'static/images/tabbar/select/my-sj.png',
+						path: `/pages/my/index`
+					},
+				],
+				currentTab: 0,
+			};
+		},
+		props: {
+			currentTabNumber: {
+				type: Number,
+			},
+		},
+		methods: {
+			switchTab(path, index) {
+
+		
+
+			},
+		},
+		created() {
+
+			this.currentTab = this.currentTabNumber
+		}
+	}
+</script>

+ 41 - 0
pages/chanpinXuanze/components/shuxueList.vue

@@ -0,0 +1,41 @@
+<template>
+	<view>
+		<view v-for="item in list" :key="item.chanpinId">
+			<!-- 封面 -->
+			<image :src="item.cover"></image>
+			<!-- 名称 -->
+			<view>{{item.name}}</view>
+			<!-- 简介 -->
+			<view>{{item.intro}}</view>
+			<!-- 共计 -->
+			<view>共计{{item.gongji}}节课程</view>
+			<view>
+				<view>请选择学习等级</view>
+				<view v-for="cItem in item.levelList" @click="handleSelect(cItem)" :class="{active: item.active}">{{cItem.levelName}}</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	
+	const props = defineProps({
+		list: {
+			type: Array
+		}
+	})
+	
+	// 选择产品等级
+	function handleSelect(item) {
+		console.log('item', item)
+		uni.navigateTo({
+			url: `/pages/chanpinXuanze/banben?dengjiId=${item.dengjiId}`
+		})
+	}
+</script>
+
+<style scoped lang="scss">
+.active {
+	color: red
+}
+</style>

+ 73 - 0
pages/chanpinXuanze/index.vue

@@ -0,0 +1,73 @@
+<template>
+	<!-- 返回区域 -->
+		<view>
+			<!-- <view @click="handleBack"></view> -->
+			<view>选课</view>
+		</view>
+		<!-- 头部区域 -->
+		<view>
+			<view v-for="item in data.list" :key="item.value" :class="{active: item.value == data.chanpinActiveSelect}" @click="handleSelectChanpin">{{item.name}}</view>
+		</view>
+		<!-- 英语列表 -->
+		<view class="list yingyu" v-if="data.chanpinActiveSelect == 1">
+			
+		</view>
+		<!-- 数学列表 -->
+		<shuxueListVue class="list shuxue" v-if="data.chanpinActiveSelect == 2" :list="data.shuxueList"></shuxueListVue>
+		<!-- 语文列表 -->
+		<view class="list yuwen" v-if="data.chanpinActiveSelect == 3">
+			
+		</view>
+		
+		<footTabbarVue :currentTabNumber="0"></footTabbarVue>
+</template>
+
+<script setup>
+	import {reactive} from "vue";
+	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: [
+			{
+				name: '英语',
+				value: 1
+			},
+			{
+				name: '数学',
+				value: 2
+			},
+			{
+				name: '语文',
+				value: 3
+			},
+		],
+		chanpinActiveSelect: 2,
+		
+		shuxueList: [],
+	})
+	
+	function handleBack() {}
+	
+	function getShuxueList() {
+		shuxueHttp.getShuxueChanpinList().then(res => {
+			data.shuxueList = res.data;
+		})
+	}
+	
+	function handleSelectChanpin(item) {
+		data.chanpinActiveSelect = item.value
+	}
+	
+	onLoad(() => {
+		getShuxueList()
+	})
+</script>
+
+<style scoped lang="scss">
+.active {
+	color: red
+}
+</style>