3 次代码提交 b94588175b ... 810adfd2f5

作者 SHA1 备注 提交日期
  tanxue 810adfd2f5 merge 5 天之前
  tanxue 8be5e75dcb 数学计算特训 5 天之前
  tanxue 1cf28e631e 内容修改 5 天之前

+ 5 - 0
common/styles/global/pages.scss

@@ -914,4 +914,9 @@
 // 资料
 .ezy-ziliao-page{
 	width: 100%;height: 100vh;display: flex;flex-direction: column;
+}
+
+// 资料---数学--计算特训题库下载
+.ezy-jstx-ziliao-page{
+	width: 100%;height: 100vh;display: flex;flex-direction: column;
 }

+ 15 - 8
pages.json

@@ -19,9 +19,16 @@
 				"navigationStyle": "custom"
 			}
 		},
+      {
+        "path" : "pages/chanpinZiliao/shuxue/jstxInfo",
+        "style" :
+        {
+          "navigationStyle": "custom"
+        }
+      },
 		{
 			"path" : "pages/chanpinMy/order",
-			"style" : 
+			"style" :
 			{
 				"navigationStyle": "custom"
 			}
@@ -35,7 +42,7 @@
 		},
 		{
 			"path" : "pages/chanpinZiliao/ziliaoInfo",
-			"style" : 
+			"style" :
 			{
 				"navigationStyle": "custom"
 			}
@@ -95,28 +102,28 @@
 		},
 		{
 			"path" : "pages/chanpinMy/yinsizhengce",
-			"style" : 
+			"style" :
 			{
 				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path" : "pages/chanpinShop/cp1/intro",
-			"style" : 
+			"style" :
 			{
 				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path" : "pages/chanpinShop/cp1/dingdan",
-			"style" : 
+			"style" :
 			{
 				"navigationStyle": "custom"
 			}
 		},
 		{
 			"path" : "pages/chanpinShop/orderHistory",
-			"style" : 
+			"style" :
 			{
 				"navigationStyle": "custom"
 			}
@@ -125,9 +132,9 @@
 	"tabBar": {
 		"custom": true,
 		"list": [{
-				"pagePath": "pages/chanpinXuanze/index"
+			"pagePath": "pages/chanpinXuanze/index"
 
-			},
+		},
 			{
 				"pagePath": "pages/chanpinneirong/index"
 			},

+ 1 - 1
pages/chanpinMy/order.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="ezy-ziliao-page">
+	<view class="ezy-order-page">
 		<view class="icon-title-navBar-box">
 			<view @click="handleBack" class="nav-bar-icon"></view>
 			<text class="nav-bar-title">订单</text>

+ 51 - 21
pages/chanpinZiliao/index.vue

@@ -14,25 +14,13 @@
 			<!-- 资源卡片列表 -->
 			
 			<!-- 数学 -->
-			<ShuXueList
-			  v-if="data.chanpinActiveSelect === 'shuxue'"
-			  :list="data.shuxue"
-			  @select="goDetail"
-			/>
+			<ShuXueList v-if="data.chanpinActiveSelect === 'shuxue'" :list="data.shuxueList" />
 			
 			<!-- 英语 -->
-			<YingYuList
-			  v-else-if="data.chanpinActiveSelect === 'yingyu'"
-			  :list="data.yingyu"
-			  @select="goDetail"
-			/>
+			<YingYuList v-if="data.chanpinActiveSelect === 'yingyu'" :list="data.yingyuList" />
 			
 			<!-- 语文 -->
-			<YuWenList
-			  v-else-if="data.chanpinActiveSelect === 'yuwen'"
-			  :list="data.yuwen"
-			  @select="goDetail"
-			/>
+			<YuWenList v-if="data.chanpinActiveSelect === 'yuwen'" :list="data.yuwenList" />
 			
 		</view>
 	</view>
@@ -42,11 +30,12 @@
 <script setup>
 import {reactive, ref} from "vue";
 import {onLoad,onShow} from "@dcloudio/uni-app"
+import {ziliaoIndex} from '@/api/ziliao.js'
 import CustomTabBar from "@/components/custom-tabbar/index.vue";
 import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
-import shuxueList  from "./shuxue/sxList.vue"
-import yingyuList  from "./yingyu/yyList.vue"
-import yuwenList  from "./yuwen/ywList.vue"
+import ShuXueList  from "./shuxue/sxList.vue"
+import YingYuList  from "./yingyu/yyList.vue"
+import YuWenList  from "./yuwen/ywList.vue"
 let currentTabIndex = ref(2);
 const data = reactive({
 	list:[
@@ -55,18 +44,59 @@ const data = reactive({
 	  { key: 'yuwen', label: '语文' }
 	],
 	chanpinActiveSelect: 'shuxue',
-	shuxue: {},
-	yingyu: {},
-	yuwen: {}
+	shuxueList: {},
+	yingyuList: {},
+	yuwenList: {}
 })
 
 // tab click
 function handleSelectChanpin(item) {
 	data.chanpinActiveSelect = item.key
 }
+
+// ziliao list
+function getZiliaoList() {
+  ziliaoIndex({}).then(res => {
+    const result = getFormatData(res.data);
+    data.shuxueList = result.shuxue;
+    data.yingyuList = result.yingyu;
+    data.yuwenList = result.yuwen;
+  })
+}
+
+// Format
+function getFormatData(data) {
+  const shuxue = data.shuxue || {};
+  const yingyu = data.yingyu || {};
+  const yuwen = data.yuwen || {};
+
+  return {
+    shuxue: Object.entries(shuxue).map(([chanpin, content]) => {
+      return { chanpin, content };
+    }),
+    yingyu:Object.entries(yingyu).map(([chanpin, content]) => {
+      return { chanpin, content };
+    }),
+    yuwen:Object.entries(yuwen).map(([chanpin, content]) => {
+      return { chanpin, content };
+    }),
+  }
+}
+
+onShow(() => {
+  currentTabIndex.value = 2;
+  data.chanpinActiveSelect = 'shuxue'
+  // 缺少功能 每日刷新
+  /* if (getFullTimer() !== `2026-01-28`) {
+    //每日刷新
+    getZiliaoList();
+  } */
+})
+
 onLoad(() => {
 	// 隐藏默认系统导航栏显示自定义导航栏
 	uni.hideTabBar()
+	getZiliaoList()
 })
 </script>
 

+ 17 - 4
pages/chanpinZiliao/shuxue/jstxCard.vue

@@ -1,12 +1,25 @@
 <template>
 	<!-- 数学-计算特训card -->
-	<view class="card" @click="handleClick">
-	  <image :src="data.cover" mode="aspectFill" class="cover" />
-	  <text class="name">{{ data.name }}</text>
+	<view class="card" @click="handleClick(item)">
+	  <image :src="item.cover" mode="aspectFill" class="cover" />
+	  <view class="name">{{ item.name }}</view>
 	</view>
 </template>
 
-<script>
+<script setup>
+import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
+const porps = defineProps({
+  item: {
+    type: Object
+  }
+})
+// 跳转详情页面
+function handleClick(item) {
+	console.log('item',item.ziliaoId);
+	uni.navigateTo({
+		url: `/pages/chanpinZiliao/shuxue/jstxInfo?ziliaoId=${item.ziliaoId}`
+	})
+}
 </script>
 
 <style>

+ 74 - 4
pages/chanpinZiliao/shuxue/jstxInfo.vue

@@ -1,8 +1,78 @@
 <template>
+	<view class="ezy-jstx-ziliao-page">
+		<view class="icon-title-navBar-box">
+			<text class="nav-bar-title">{{data.ziliaoName}}</text>
+		</view>
+		<view class="ezy-page-body">
+			<scroll-view scroll-y="true" class="level-list-container">
+				<view v-for="(item, index) in data.dengjiList" :key="item.dengjiId" class="level-item">
+					<view class="level-item-content">
+						<!-- 图标 -->
+						<view @click="selectDjBtn(item)"
+						:class="{active: item.dengjiId == data.dengjiActiveSelect}">{{ item.dengjiName }}</view>
+						
+						<view>
+							<view class="ziliao-card-box">
+								<!-- <img/> -->
+								<!-- 内容区 -->
+								<view class="content-box">
+									<text class="title">{{ ziliaoName }}</text>
+									<text class="version">{{ getFirstVersion(item.banbenList) }}</text>
+								</view>
+										
+								<!-- PDF 按钮 -->
+								<view class="pdf-btn">
+									<icon>PDF</icon>
+								</view>
+							</view>
+							
+						</view>
+						
+					</view>
+				</view>
+			</scroll-view>
+		</view>
+		<jstxDownDialog ref="jiaocaiRef" @confirm-btn="jcConfirm" :content="jcContent"></jstxDownDialog>
+	</view>
 </template>
 
-<script>
-</script>
+<script setup>
+import {reactive, ref} from "vue";
+import {onLoad,onShow} from "@dcloudio/uni-app"
+import {jisuanInfo,jisuanPdf} from '@/api/ziliao.js'
+import jstxDownDialog from './jstxDownDialog.vue';
+const data = reactive({
+	id: '',
+	ziliaoName: '',
+	dengjiList: [],
+	dengjiActiveSelect: '',
+})
+
+// jisuantexun Info data
+function getJisuanInfo() {
+  jisuanInfo({ziliaoId:data.id}).then(res => {
+	  data.ziliaoName = res.data.ziliaoName;
+	  data.dengjiList = res.data.dengjiList;
+	  // 默认为等级list中第一个
+	  data.dengjiActiveSelect = res.data.dengjiList[0].dengjiId;
+  })
+}
+
+// 获取第一个版本名称
+function getFirstVersion(banbenList) {
+	if (banbenList && banbenList.length > 0) {
+		return banbenList[0].banbenName;
+	}
+	return '未知版本';
+}
 
-<style>
-</style>
+function selectDjBtn(item){
+	data.dengjiActiveSelect = item.dengjiId
+}
+
+onLoad((options) => {
+	data.id = options.ziliaoId;
+	console.log('options',options);
+	getJisuanInfo()
+})
+</script>

+ 18 - 1
pages/chanpinZiliao/shuxue/sxList.vue

@@ -1,7 +1,24 @@
 <template>
+	<view class="sx-card-list" v-if="list.length">
+	    <template  v-for="{chanpin,content:item} in list">
+			{{list}}
+			<jstxCard v-if="chanpin == 'jisuantexun'" :item="item" :key="item.ziliaoId"></jstxCard>
+	    </template>
+	
+		</view>
+		<view class="ezy-no-sj" v-else>
+			<icon></icon>
+			<text>暂无数据</text>
+		</view>
 </template>
 
-<script>
+<script setup>
+import jstxCard from './jstxCard.vue';
+const props = defineProps({
+	list: {
+		type: Object
+	}
+})
 </script>
 
 <style>

+ 0 - 26
pages/chanpinZiliao/ziliaoInfo.vue

@@ -1,26 +0,0 @@
-<template>
-	<view class="ezy-ziliao-page">
-		<view class="icon-title-navBar-box">
-			<view @click="handleBack" class="nav-bar-icon"></view>
-			<text class="nav-bar-title">资料详情</text>
-		</view>
-		<view class="ezy-page-body">
-			
-		</view>
-	</view>
-</template>
-
-<script setup>
-import {reactive, ref} from "vue";
-import {onLoad,onShow} from "@dcloudio/uni-app"
-function handleBack() {
-		uni.switchTab({
-			url: '/pages/chanpinZiliao/index'
-		})
-	}
-onLoad(() => {
-})
-</script>
-
-<style>
-</style>

+ 11 - 11
unpackage/dist/cache/.vite/deps/_metadata.json

@@ -1,20 +1,20 @@
 {
-  "hash": "122c3a9d",
-  "configHash": "d5858f9f",
-  "lockfileHash": "e3b0c442",
-  "browserHash": "d8bf20c4",
+  "hash": "78e2cbc4",
+  "configHash": "cf70751b",
+  "lockfileHash": "7b43968b",
+  "browserHash": "4a933061",
   "optimized": {
-    "uview-plus": {
-      "src": "../../../../../node_modules/uview-plus/index.js",
-      "file": "uview-plus.js",
-      "fileHash": "5da21bbe",
-      "needsInterop": false
-    },
     "ts-md5/dist/md5": {
       "src": "../../../../../node_modules/ts-md5/dist/md5.js",
       "file": "ts-md5_dist_md5.js",
-      "fileHash": "674d644d",
+      "fileHash": "f1457326",
       "needsInterop": true
+    },
+    "uview-plus": {
+      "src": "../../../../../node_modules/uview-plus/index.js",
+      "file": "uview-plus.js",
+      "fileHash": "73c5cf2b",
+      "needsInterop": false
     }
   },
   "chunks": {