From cabc1ce19c57a7c7388502952eaaafd558363145 Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期五, 22 八月 2025 18:18:51 +0800 Subject: [PATCH] 数字教材相关 --- src/assets/images/digitalTextbooks/img.png | 0 src/assets/images/digitalTextbooks/Frame.png | 0 src/assets/js/config.js | 1 package-lock.json | 63 +++ src/assets/images/digitalTextbooks/shixun.png | 0 src/assets/images/digitalTextbooks/tuozhan.png | 0 src/assets/images/digitalTextbooks/shijuan.png | 0 src/assets/images/digitalTextbooks/3D.png | 0 src/views/bookStore/detail.vue | 357 ++++++++++++++++++++ src/assets/images/digitalTextbooks/video.png | 0 src/assets/images/digitalTextbooks/PPT.png | 0 src/assets/images/digitalTextbooks/VR.png | 0 src/assets/images/digitalTextbooks/jcfl.png | 0 src/views/bookStore/textBookApply.vue | 277 ++++++++++++++++ src/assets/images/digitalTextbooks/carousel.png | 0 src/assets/images/digitalTextbooks/ziliao.png | 0 src/layout/components/headerPage.vue | 74 ++-- src/router/index.js | 5 src/assets/images/digitalTextbooks/jiaocai.png | 0 src/assets/images/digitalTextbooks/Audio.png | 0 src/views/home/index.vue | 165 +++++++++ src/main.js | 5 src/views/bookStore/index.vue | 60 +++ package.json | 3 src/assets/images/digitalTextbooks/hezuoyuanxiao.png | 0 src/assets/images/digitalTextbooks/caozuo_bg.png | 0 26 files changed, 945 insertions(+), 65 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4c86e51..669b4b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "axios": "^1.11.0", + "echarts": "^5.6.0", "element-plus": "^2.10.7", "less": "^4.4.0", "moment": "^2.30.1", @@ -1940,6 +1941,22 @@ "node": ">= 0.4" } }, + "node_modules/echarts": { + "version": "5.6.0", + "resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.6.0.tgz", + "integrity": "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "2.3.0", + "zrender": "5.6.1" + } + }, + "node_modules/echarts/node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", + "license": "0BSD" + }, "node_modules/electron-to-chromium": { "version": "1.5.201", "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.201.tgz", @@ -3567,6 +3584,21 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zrender": { + "version": "5.6.1", + "resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.1.tgz", + "integrity": "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==", + "license": "BSD-3-Clause", + "dependencies": { + "tslib": "2.3.0" + } + }, + "node_modules/zrender/node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", + "license": "0BSD" } }, "dependencies": { @@ -4778,6 +4810,22 @@ "gopd": "^1.2.0" } }, + "echarts": { + "version": "5.6.0", + "resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.6.0.tgz", + "integrity": "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==", + "requires": { + "tslib": "2.3.0", + "zrender": "5.6.1" + }, + "dependencies": { + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + } + } + }, "electron-to-chromium": { "version": "1.5.201", "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.201.tgz", @@ -5809,6 +5857,21 @@ "resolved": "https://registry.npmmirror.com/yoctocolors/-/yoctocolors-2.1.1.tgz", "integrity": "sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==", "dev": true + }, + "zrender": { + "version": "5.6.1", + "resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.1.tgz", + "integrity": "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==", + "requires": { + "tslib": "2.3.0" + }, + "dependencies": { + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + } + } } } } diff --git a/package.json b/package.json index b431e55..2a08319 100644 --- a/package.json +++ b/package.json @@ -15,14 +15,15 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "axios": "^1.11.0", + "echarts": "^5.6.0", "element-plus": "^2.10.7", "less": "^4.4.0", "moment": "^2.30.1", "pinia": "^3.0.3", "spark-md5": "^3.0.2", "vue": "^3.5.18", - "vue-clipboard3": "^2.0.0", "vue-baidu-map-3x": "^1.0.40", + "vue-clipboard3": "^2.0.0", "vue-router": "^4.5.1" }, "devDependencies": { diff --git a/src/assets/images/digitalTextbooks/3D.png b/src/assets/images/digitalTextbooks/3D.png new file mode 100644 index 0000000..b0b274b --- /dev/null +++ b/src/assets/images/digitalTextbooks/3D.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/Audio.png b/src/assets/images/digitalTextbooks/Audio.png new file mode 100644 index 0000000..a9100f3 --- /dev/null +++ b/src/assets/images/digitalTextbooks/Audio.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/Frame.png b/src/assets/images/digitalTextbooks/Frame.png new file mode 100644 index 0000000..6044a4f --- /dev/null +++ b/src/assets/images/digitalTextbooks/Frame.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/PPT.png b/src/assets/images/digitalTextbooks/PPT.png new file mode 100644 index 0000000..750a31c --- /dev/null +++ b/src/assets/images/digitalTextbooks/PPT.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/VR.png b/src/assets/images/digitalTextbooks/VR.png new file mode 100644 index 0000000..b903523 --- /dev/null +++ b/src/assets/images/digitalTextbooks/VR.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/caozuo_bg.png b/src/assets/images/digitalTextbooks/caozuo_bg.png new file mode 100644 index 0000000..171223e --- /dev/null +++ b/src/assets/images/digitalTextbooks/caozuo_bg.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/carousel.png b/src/assets/images/digitalTextbooks/carousel.png new file mode 100644 index 0000000..6bfaac2 --- /dev/null +++ b/src/assets/images/digitalTextbooks/carousel.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/hezuoyuanxiao.png b/src/assets/images/digitalTextbooks/hezuoyuanxiao.png new file mode 100644 index 0000000..cec887c --- /dev/null +++ b/src/assets/images/digitalTextbooks/hezuoyuanxiao.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/img.png b/src/assets/images/digitalTextbooks/img.png new file mode 100644 index 0000000..3502a50 --- /dev/null +++ b/src/assets/images/digitalTextbooks/img.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/jcfl.png b/src/assets/images/digitalTextbooks/jcfl.png new file mode 100644 index 0000000..825b91a --- /dev/null +++ b/src/assets/images/digitalTextbooks/jcfl.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/jiaocai.png b/src/assets/images/digitalTextbooks/jiaocai.png new file mode 100644 index 0000000..7b1af5d --- /dev/null +++ b/src/assets/images/digitalTextbooks/jiaocai.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/shijuan.png b/src/assets/images/digitalTextbooks/shijuan.png new file mode 100644 index 0000000..dfe225f --- /dev/null +++ b/src/assets/images/digitalTextbooks/shijuan.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/shixun.png b/src/assets/images/digitalTextbooks/shixun.png new file mode 100644 index 0000000..a824f00 --- /dev/null +++ b/src/assets/images/digitalTextbooks/shixun.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/tuozhan.png b/src/assets/images/digitalTextbooks/tuozhan.png new file mode 100644 index 0000000..7b80f8a --- /dev/null +++ b/src/assets/images/digitalTextbooks/tuozhan.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/video.png b/src/assets/images/digitalTextbooks/video.png new file mode 100644 index 0000000..34498dc --- /dev/null +++ b/src/assets/images/digitalTextbooks/video.png Binary files differ diff --git a/src/assets/images/digitalTextbooks/ziliao.png b/src/assets/images/digitalTextbooks/ziliao.png new file mode 100644 index 0000000..a1b3249 --- /dev/null +++ b/src/assets/images/digitalTextbooks/ziliao.png Binary files differ diff --git a/src/assets/js/config.js b/src/assets/js/config.js index 6565a7c..9891912 100644 --- a/src/assets/js/config.js +++ b/src/assets/js/config.js @@ -12,6 +12,7 @@ export const goodsStore = `defaultGoodsStore${appId}` // 榛樿鍟嗗搧搴�(涔﹀煄) export const publicStore = `defaultPublicStore${appId}` // 榛樿璧勬簮寮�鏀句粨鍌� export const publicRepository = `defaultPublicRepository${appId}` // 榛樿璧勬簮寮�鏀惧簱 +export const textBookResourceUrl = 'https://yxjy.pumcp.com/books/resource/' export const reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ // 鐢佃瘽鍙锋鍒� diff --git a/src/layout/components/headerPage.vue b/src/layout/components/headerPage.vue index 9aa7fcd..1a793ca 100644 --- a/src/layout/components/headerPage.vue +++ b/src/layout/components/headerPage.vue @@ -7,7 +7,7 @@ () => { $router.push({ path: '/home', - }); + }) } " src="@/assets/images/xiehe/home/Group_303.png" @@ -27,8 +27,8 @@ <a @click=" () => { - console.log(loginRef.value); - loginRef.logIn(); + console.log(loginRef.value) + loginRef.logIn() } " >娉ㄥ唽/鐧诲綍</a @@ -75,15 +75,15 @@ </template> <script setup lang="ts"> -import login from "./login.vue"; -import { onMounted, ref } from "vue"; -import { Search } from "@element-plus/icons-vue"; -import { useUserStore } from "@/store"; -import { useRouter } from "vue-router"; -const userStore = useUserStore(); -const router = useRouter(); +import login from './login.vue' +import { onMounted, ref } from 'vue' +import { Search } from '@element-plus/icons-vue' +import { useUserStore } from '@/store' +import { useRouter } from 'vue-router' +const userStore = useUserStore() +const router = useRouter() -const loginRef = ref(); +const loginRef = ref() const props = defineProps({ hideSerch: { type: Boolean, @@ -93,51 +93,51 @@ type: Boolean, default: false, }, -}); +}) -let searchKey = ref(""); -let userInfo = ref(""); +let searchKey = ref('') +let userInfo = ref('') const navData = ref([ { - name: "棣栭〉", - path: "/home", + name: '棣栭〉', + path: '/home', }, { - name: "鏁欒偛鍑虹増", - path: "/bookStore", + name: '鏁欒偛鍑虹増', + path: '/bookStore', }, { - name: "璇昏�呮湇鍔�", - path: "/teachingServices", + name: '璇昏�呮湇鍔�', + path: '/teachingServices', }, { - name: "鍏充簬鎴戜滑", - path: "/aboutUs", + name: '鍏充簬鎴戜滑', + path: '/aboutUs', }, -]); +]) onMounted(() => { - userInfo.value = userStore.userInfo; - console.log(userInfo.value, "userInfo"); -}); + userInfo.value = userStore.userInfo + console.log(userInfo.value, 'userInfo') +}) -const gotoSearch = () => {}; +const gotoSearch = () => {} const handleCommand = (item) => { - if (item === "gotoPersonalCenter") { + if (item === 'gotoPersonalCenter') { router.push({ - path: "/personalCenter", - }); + path: '/personalCenter', + }) } - if (item === "logout") { - localStorage.clear(); + if (item === 'logout') { + localStorage.clear() router.push({ - path: "/home", - }); + path: '/home', + }) } -}; +} const gotoPage = (item) => { - router.push(item.path); -}; + router.push(item.path) +} </script> <style lang="less" scoped> diff --git a/src/main.js b/src/main.js index 4ffb08e..d8c10a0 100644 --- a/src/main.js +++ b/src/main.js @@ -12,6 +12,7 @@ import MG from '@/assets/js/middleGround/WebMiddleGroundApi.js' import toolClass from '@/assets/js/toolClass.js' import config from '@/assets/js/config.js' +import zhCn from 'element-plus/dist/locale/zh-cn.mjs' const app = createApp(App) @@ -26,5 +27,7 @@ app.use(ElementPlus) app.use(createPinia()) app.use(router) - +app.use(ElementPlus, { + locale: zhCn, +}) app.mount('#app') diff --git a/src/router/index.js b/src/router/index.js index 9e6270a..46d21a3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -33,6 +33,11 @@ name: 'bookStore', component: bookStore, }, + { + path: '/textBookApply', + name: 'textBookApply', + component: () => import('@/views/bookStore/textBookApply.vue'), + }, //涓汉涓績 { path: '/personalCenter', diff --git a/src/views/bookStore/detail.vue b/src/views/bookStore/detail.vue index abef0e0..0e37559 100644 --- a/src/views/bookStore/detail.vue +++ b/src/views/bookStore/detail.vue @@ -167,6 +167,7 @@ <el-button v-if="currentRoute == 'teachingServices'" plain @click="addPaperBook" >绾歌川鏍蜂功</el-button > + <el-button plain @click="applyTextBook">鐢宠浣跨敤</el-button> </div> </div> </div> @@ -244,31 +245,105 @@ <div v-if="editableTabsValue == '1'" class="textbookInfo"> <div class="textbookInfoItem"> <div class="titleBorderBox">鍥句功绠�浠�</div> - <div class="textbookContent"></div> + <div class="textbookContent" v-if="bookInfo.content" v-html="bookInfo.content"></div> + <div v-else> + <el-empty description="鏆傛棤鏁版嵁" /> + </div> </div> <div class="textbookInfoItem"> <div class="titleBorderBox">浣滆�呯畝浠�</div> - <div class="authorInfo"></div> + <div + class="authorInfo" + v-if="bookInfo.authorIntroduction" + v-html="bookInfo.authorIntroduction" + ></div> + <div v-else> + <el-empty description="鏆傛棤鏁版嵁" /> + </div> </div> </div> <div v-else-if="editableTabsValue == '2'" class="catalogue">bbbb</div> + <div v-else-if="editableTabsValue == '6'" class="supportingResources"> + <div class="resourcesBox"> + <el-empty v-if="!resourceHave" :image-size="150" description="鏆傛棤鍐呭"></el-empty> + <div class="distribution" v-if="resourceHave"> + <div class="title">璧勬簮鍒嗗竷</div> + <div class="echartsBox"> + <div class="left"> + <div id="chartsContent" style="width: 600px; height: 400px"></div> + </div> + <div class="right"> + <div> + <p>璧勬簮绉嶇被</p> + <p> + <span class="num">{{ resourceData.length }}</span + >绉� + </p> + </div> + </div> + </div> + </div> + </div> + </div> </div> - <div class="recommendBox"></div> + <div class="recommendBox"> + <div class="recommendTitle">鎺ㄨ崘鏁欐潗</div> + <div class="newRecommendList"> + <div class="recommendItem" v-for="item in recommendBookListData" :key="item.id"> + <div class="recommendItemImg"> + <img class="autoImg" :src="item.icon" /> + </div> + <div class="infoBox2"> + <div class="bookName2">{{ item.name }}</div> + <div class="author2"> + 浣滆�咃細{{ item.authorcaupress_author ? item.caupress_author : '-' }} + </div> + <div class="priceBox2"> + <span class="oldPrice" v-if="item.oldPrice">鍘熶环锛毬{ item.oldPrice }}</span> + <span class="price" v-if="item.price && item.price > 0"> + 瀹氫环锛毬� + <span>{{ item.price }}</span> + </span> + <span class="price" v-else> 瀹氫环锛�<span class="freePrice">鍏嶈垂</span> </span> + </div> + </div> + </div> + </div> + </div> </div> </div> </template> <script setup> import moment from 'moment' -import { ref, onBeforeMount, inject, reactive, onMounted } from 'vue' +import axios from 'axios' +import * as echarts from 'echarts' +import imgIcon from '@/assets/images/digitalTextbooks/img.png' +import AudioIcon from '@/assets/images/digitalTextbooks/Audio.png' +import DIcon from '@/assets/images/digitalTextbooks/3D.png' +import PPTIcon from '@/assets/images/digitalTextbooks/PPT.png' +import shijuanIcon from '@/assets/images/digitalTextbooks/shijuan.png' +import shixunIcon from '@/assets/images/digitalTextbooks/shixun.png' +import tuozhanIcon from '@/assets/images/digitalTextbooks/tuozhan.png' +import videoIcon from '@/assets/images/digitalTextbooks/video.png' +import VRIcon from '@/assets/images/digitalTextbooks/VR.png' +import ziliaoIcon from '@/assets/images/digitalTextbooks/ziliao.png' +import { ref, onBeforeMount, inject, reactive, onMounted, watchEffect } from 'vue' const MG = inject('MG') +const config = inject('config') import { useRouter, useRoute } from 'vue-router' +import { applyBookStore } from '@/store' const route = useRoute() const router = useRouter() let bookInfo = ref({}) let digitalTextId = ref('') +let resourceData = ref([]) +let recommendBookListData = ref([]) let editableTabsValue = ref('1') - +let resourceHave = ref(true) +var chartDom = null +var myChart = {} +var option = null const editableTabs = reactive([ { title: '鏁欐潗淇℃伅', @@ -299,7 +374,153 @@ onMounted(() => { digitalTextId.value = route.query.bookId getBookDetail(digitalTextId.value) + getRecommendBookList() }) + +watchEffect(() => { + if (editableTabsValue.value == '6') { + getBookResource() + } +}) + +//鐢宠璇曠敤 +const applyTextBook = () => { + localStorage.setItem('applyBookInfo', JSON.stringify(bookInfo.value)) + router.push({ + path: '/textBookApply', + }) +} + +const getRecommendBookList = () => { + MG.store + .getProductList({ + path: 'recommendedTextbooks', + paging: { + start: 0, + size: 5, + }, + fields: { + author: [], + }, + }) + .then((res) => { + console.log(res, '鎺ㄨ崘鏁欐潗') + recommendBookListData.value = res.datas + }) +} + +const getBookResource = () => { + try { + axios + .get('https://yxjy.pumcp.com/books/resource/' + bookInfo.value.refCode + '/resource.json') + .then(async (res) => { + console.log(res, 'resource') + if (res.data.length > 0) { + res.data.forEach((item) => { + if (item.resourceTypeShow == '鍥剧墖') { + item.icon = imgIcon + } else if (item.resourceTypeShow == '瑙嗛') { + item.icon = videoIcon + } else if (item.resourceTypeShow == '闊抽') { + item.icon = AudioIcon + } else if (item.resourceTypeShow == 'PPT') { + item.icon = PPTIcon + } else if (item.resourceTypeShow == '鎷撳睍') { + item.icon = tuozhanIcon + } else if (item.resourceTypeShow == '璧勬枡') { + item.icon = ziliaoIcon + } else if (item.resourceTypeShow == '璇曞嵎') { + item.icon = shijuanIcon + } else if (item.resourceTypeShow == '3D') { + item.icon = DIcon + } else if (item.resourceTypeShow == '瀹炶') { + item.icon = shixunIcon + } else if (item.resourceTypeShow == 'VR') { + item.icon = VRIcon + } else { + item.icon = ziliaoIcon + } + }) + resourceData.value = await groupByResourceTypeShow(res.data) + resourceHave.value = true + console.log(resourceData.value, 'resourceData') + initChart(resourceData.value) + } else { + resourceHave.value = false + } + }) + .catch((error) => { + console.log(error, 'error1') + + resourceData = [] + resourceHave = false + }) + } catch (error) { + console.log(error, 'error') + resourceData = [] + resourceHave = false + } +} + +const groupByResourceTypeShow = (resources) => { + const grouped = resources.reduce((acc, item) => { + const key = item.resourceTypeShow + if (!acc[key]) { + acc[key] = { + resourceTypeShow: key, + list: [], + } + } + acc[key].list.push(item) + return acc + }, {}) + return Object.values(grouped) +} + +const initChart = (data) => { + let dataList = [] + let num = [] + data.forEach((item) => { + dataList.push(item.resourceTypeShow) + num.push(item.list.length) + }) + chartDom = document.getElementById('chartsContent') + console.log(chartDom, 'chartDom') + + myChart = echarts.init(chartDom) + myChart.setOption({ + tooltip: {}, + xAxis: { + data: dataList, + }, + yAxis: {}, + series: [ + { + name: '鏁伴噺', + type: 'bar', + data: num, + itemStyle: { + color: function (params) { + // params.dataIndex鏄暟鎹」鐨勭储寮曪紝浣犲彲浠ユ牴鎹繖涓储寮曟潵璁剧疆涓嶅悓鐨勯鑹� + const colors = [ + '#5EA1FF', + '#FF5A85', + '#7E7AFF', + '#3CB768', + '#FF8F54', + '#FF574B', + '#3DB0BF', + '#FBBB3B', + '#3B5EFB', + '#B1FB3B', + ] + return colors[params.dataIndex % colors.length] + }, + }, + }, + ], + }) +} const getBookDetail = (id) => { const query = { @@ -572,8 +793,10 @@ .detailContent { margin-top: 30px; + display: flex; + justify-content: space-between; .resourceBox { - width: 80%; + width: 76%; } .textbookInfo { padding: 20px 0; @@ -590,4 +813,126 @@ .textbookInfoItem { margin-top: 20px; } + +.distribution { + .title { + margin: 10px 0; + font-weight: bold; + } + .echartsBox { + height: 400px; + border-radius: 7px 7px 7px 7px; + border: 1px solid #e4e7ed; + display: flex; + justify-content: space-between; + margin-bottom: 20px; + } + .left { + } + .right { + background: rgba(64, 158, 255, 0.09); + display: flex; + align-items: center; + justify-content: center; + text-align: center; + width: 200px; + p { + line-height: 30px; + } + .num { + font-size: 18px; + font-weight: bold; + } + } + .list { + display: flex; + margin-bottom: 40px; + .listItem { + width: 100px; + display: block; + box-sizing: border-box; + .imgBox { + margin: 0 auto; + position: relative; + width: 80px; + height: 80px; + } + .bookInfo { + margin: 0; + overflow: hidden; + text-align: center; + .title { + color: #333; + margin: 10px 0; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } + } + } + } +} + +.recommendBox { + width: 23%; + border: 1px solid #e4e7ed; + border-radius: 10px; + .recommendTitle { + height: 50px; + line-height: 50px; + padding-left: 20px; + border-bottom: 1px solid #e4e7ed; + color: #333333; + font-weight: 700; + } +} + +.newRecommendList { + padding-top: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + .recommendItem { + margin-right: 20px; + height: 300px; + background-repeat: no-repeat; + background-size: 100% 100%; + cursor: pointer; + background-color: #fff; + padding-top: 10px; + margin-top: 10px; + &:last-child { + margin-right: 0; + } + } + .recommendItemImg { + width: 150px; + height: 200px; + position: relative; + margin: 0 auto; + } + .infoBox2 { + text-align: center; + margin-top: 10px; + } + .author2 { + margin-top: 10px; + } + .priceBox2 { + margin-top: 10px; + .oldPrice { + font-size: 16px; + color: #444444; + text-decoration: line-through; + margin-right: 20px; + } + .price { + span { + font-weight: bold; + font-size: 14px; + } + } + } +} </style> diff --git a/src/views/bookStore/index.vue b/src/views/bookStore/index.vue index 0c89bff..1bdca0d 100644 --- a/src/views/bookStore/index.vue +++ b/src/views/bookStore/index.vue @@ -14,7 +14,13 @@ <div class="classificationBox"> <div style="width: 100px">鍒嗙被锛�</div> <div class="classificaListBox"> - <div class="classificaItem" v-for="(item, index) in classfeild" :key="index"> + <div + class="classificaItem" + :class="{ active: currentLevel == item.value }" + v-for="(item, index) in classfeild" + :key="index" + @click="changeLevel(item)" + > {{ item.name }} </div> </div> @@ -23,7 +29,7 @@ <div class="bookList"> <div class="bookfilterList"> <div class="listTitle"> - <div>缁撴灉锛氬叡璁�***鏉�</div> + <div>缁撴灉锛氬叡璁{ total }}鏉�</div> <div style="width: 300px"> <el-input v-model="input3" @@ -31,7 +37,7 @@ class="input-with-select" > <template #append> - <el-button :icon="Search" /> + <el-button :icon="Search" @click="getBookList" /> </template> </el-input> </div> @@ -83,7 +89,7 @@ <div class="recommendBox"> <div class="recommendTitle">鎺ㄨ崘鏁欐潗</div> <div class="newRecommendList"> - <div class="recommendItem" v-for="item in bookListData" :key="item.id"> + <div class="recommendItem" v-for="item in recommendBookListData" :key="item.id"> <div class="recommendItemImg"> <img class="autoImg" :src="item.icon" /> </div> @@ -121,9 +127,11 @@ import { Search } from '@element-plus/icons-vue' const input3 = ref('') let bookListData = ref([]) -const total = ref(50) +let recommendBookListData = ref([]) +const total = ref(0) const currentPage1 = ref(1) const router = useRouter() +let currentLevel = ref('all') const toDetail = (item) => { router.push({ @@ -134,12 +142,17 @@ }) } +const changeLevel = (item) => { + currentLevel.value = item.value + getBookList() +} + const getBanner = () => { MG.resource .getItem({ path: 'banner\\educationPublishing', fields: { link: [] }, - paging: { start: 0, size: 9 }, + paging: { start: 0, size: 20 }, }) .then((res) => { banner.push(...res.datas) @@ -152,7 +165,7 @@ getBookList() } -const getBookList = () => { +const getRecommendBookList = () => { MG.store .getProductList({ path: 'recommendedTextbooks', @@ -166,8 +179,32 @@ }) .then((res) => { console.log(res, '鎺ㄨ崘鏁欐潗') - bookListData.value = res.datas + recommendBookListData.value = res.datas }) +} + +const getBookList = () => { + const query = { + path: '*', + queryType: '*', + storeInfo: 'defaultGoodsStore1', + paging: { + start: (currentPage1.value - 1) * 20, + size: 20, + }, + fields: {}, + } + if (currentLevel.value !== 'all') { + query.fields['teachingLevel='] = currentLevel.value + } + if (input3.value) { + query.fields['Name*'] = input3.value + } + MG.store.getProductList(query).then((res) => { + console.log(res, '11111111111') + bookListData.value = res.datas + total.value = res.total + }) } const classifList = () => { @@ -190,6 +227,7 @@ getBanner() classifList() getBookList() + getRecommendBookList() }) </script> @@ -380,4 +418,10 @@ margin: 20px 0; padding-bottom: 30px; } + +.active { + background-color: #ebf8f8; + border: 1px solid #144941; + color: #144941; +} </style> diff --git a/src/views/bookStore/textBookApply.vue b/src/views/bookStore/textBookApply.vue new file mode 100644 index 0000000..8a4bb49 --- /dev/null +++ b/src/views/bookStore/textBookApply.vue @@ -0,0 +1,277 @@ +<template> + <div class="contentBox"> + <div class="generateEorder"> + <div class="crumbBox"> + <el-breadcrumb separator-class="el-icon-arrow-right"> + <span style="float: left">褰撳墠浣嶇疆锛�</span> + <el-breadcrumb-item :to="{ path: '/textbooks' }">鏁板瓧鏁欐潗</el-breadcrumb-item> + <el-breadcrumb-item>鐢宠璇曠敤</el-breadcrumb-item> + </el-breadcrumb> + </div> + </div> + <div class="content"> + <div class="title">鍗忓拰浜戣鍫傛暟瀛楁暀鏉愯瘯鐢ㄧ敵璇疯〃</div> + <div class="center"> + <div class="headline">鏁欐潗鐢宠</div> + <div class="book-list"> + <div class="book-example"> + <div class="imgBox"> + <img :src="textBookInfo.icon" alt /> + </div> + <div class="bookname">{{ textBookInfo.name }}</div> + </div> + </div> + <div class="headline">鎺堣鎯呭喌</div> + <el-form + label-width="200px" + label-position="right" + :model="formData" + class="teachingSituationForm" + :rules="rules" + ref="teachingSituationForm" + > + <el-form-item label="璇剧▼鍚嶇О锛�" prop="courseName"> + <el-input v-model="formData.courseName"></el-input> + </el-form-item> + <el-form-item label="瀛︾敓灞傛锛�" prop="studentLevel"> + <el-input v-model="formData.studentLevel"></el-input> + </el-form-item> + <el-form-item label="瀛︾敓浜烘暟/骞达細" prop="studentsNumber"> + <el-input v-model="formData.studentsNumber"></el-input> + </el-form-item> + <el-form-item label="鐜板湪浣跨敤鏁欐潗鎵�灞炲嚭鐗堢ぞ锛�" prop="teachingMaterialPress"> + <el-input v-model="formData.teachingMaterialPress"></el-input> + </el-form-item> + <el-form-item label="鎵�鐢ㄦ暀鏉愶細" prop="teachingMaterials"> + <el-input v-model="formData.teachingMaterials"></el-input> + </el-form-item> + </el-form> + <div class="btn"> + <el-button :loading="loading" @click="submit(teachingSituationForm)">鎻愪氦</el-button> + <el-button @click="toSelectBook()">杩斿洖</el-button> + </div> + </div> + </div> + </div> +</template> + +<script setup> +import { ref, reactive, inject, onMounted } from 'vue' +import { useRoute } from 'vue-router' +const MG = inject('MG') +import { useUserStore } from '@/store' +import { ElMessage, ElMessageBox } from 'element-plus' + +import { useRouter } from 'vue-router' +const toolClass = inject('toolClass') +const userStore = useUserStore() +onMounted(() => { + getType() +}) + +let textBookInfo = ref(JSON.parse(localStorage.getItem('applyBookInfo'))) +let loading = ref(false) +let formData = ref({ + courseName: '', + studentLevel: '', + studentsNumber: '', + teachingMaterialPress: '', + teachingMaterials: '', +}) + +let workInfo = ref([]) +const teachingSituationForm = ref() + +const rules = { + courseName: [{ required: true, message: '璇峰~鍐欒绋嬪悕绉�' }], + studentLevel: [{ required: true, message: '璇峰~鍐欏鐢熷眰娆�' }], + studentsNumber: [{ required: true, message: '璇峰~鍐欏鐢熶汉鏁�/骞�' }], + teachingMaterialPress: [{ required: true, message: '璇峰~鍐欑幇鍦ㄤ娇鐢ㄦ暀鏉愭墍灞炲嚭鐗堢ぞ' }], + teachingMaterials: [{ required: true, message: '璇峰~鍐欐墍鐢ㄦ暀鏉�' }], +} + +const getType = () => { + const data = { + refCodes: ['sampleBook'], + } + MG.resource.getCmsTypeByRefCode(data).then((res) => { + console.log(res, 'sampleBook') + workInfo.value = res[0].cmsTypeLinks[0].children + }) +} + +const submit = async (formEl) => { + if (!formEl) return + formEl.validate((valid) => { + if (valid) { + loading.value = true + const contentData = { + id: textBookInfo.value.id, + title: textBookInfo.value.name, + icon: textBookInfo.value.icon, + isbn: textBookInfo.value.tourism_ISBN, + author: textBookInfo.value.tourism_author, + price: textBookInfo.value.price, + } + const data = { + topicIdOrRefCode: 'applyDigitalBook', + name: userStore.userInfo?.name || '-', + cmsTypeRefCode: 'sampleBook ', + content: JSON.stringify([contentData]), + state: 'WaitAudit', + type: 'applyDigitalBook', + newDataListRequest: toolClass.worksDataBytool(workInfo.value, formData.value), + } + MG.ugc.newTopicMessage(data).then((res) => { + loading.value = false + if (res) { + ElMessageBox.confirm('鎮ㄧ殑璇曠敤鐢宠宸叉彁浜わ紝绠$悊鍛樺鏍镐腑锛�', 'success', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'success', + }) + .then(() => { + this.$router.go(-1) + formEl.resetFields() + }) + .catch(() => { + this.$router.go(-1) + formEl.resetFields() + }) + } + }) + } + }) +} +const toSelectBook = () => {} +</script> + +<style scoped> +.imgBox { + display: inline-block; + position: relative; + width: 100px; + height: 140px; + background: #fff; +} +.imgBox img { + width: auto; + height: auto; + max-width: 100%; + max-height: 100%; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; +} +.contentBox { + display: flex; + flex-direction: column; +} +.generateEorder { + width: 1200px; + margin: 0 auto; + padding: 20px 0; +} +.xian { + width: 100%; + height: 5px; +} +/* content */ +.content { + border: 1px solid #dcdcdc; + margin: 11px auto 111px; +} +.content .title { + margin: 0 auto; + width: 1160px; + border-bottom: 2px dashed #dcdcdc; + font-size: 24px; + color: #333; + text-align: center; + line-height: 70px; + font-weight: bold; +} +.content .center { + width: 1100px; + margin: 0 auto; +} +.headline { + font-size: 16px; + color: #333; + font-weight: bold; + padding-top: 40px; +} +.list { + background-color: #f1f8fe; + border-radius: 2px; + font-size: 14px; + line-height: 28px; + margin-top: 20px; + color: #333; + padding: 10px 0 15px 20px; +} +.personal { + font-weight: bold; +} +.checkBox { + position: absolute; + top: 86px; + left: 30px; +} +.book-example { + position: relative; + display: inline-block; + overflow: hidden; + padding: 20px 40px; + text-align: center; +} +.book-example img { + border: 1px solid #dcdcdc; +} +.bookname { + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 15px; + color: #333; + line-height: 29px; +} +.book-list { + margin-top: 10px; + border: 1px solid #dcdcdc; + overflow: hidden; + margin-bottom: 10px; +} +.btn { + margin: 50px 0; + text-align: center; +} +.teachingSituationForm { + margin-top: 20px; +} +</style> +<style> +.generateEorder .el-button { + width: 120px; + height: 40px; + background-color: #2b68cd; + color: #fff; +} +.generateEorder .el-button:last-child { + border: solid 1px #2b68cd; + color: #2b68cd; + background-color: #fff; +} + +.generateEorder .el-input__inner { + border-radius: 0; + border: none; + border-bottom: 1px solid #eee; + width: 315px; + height: 30px; +} +</style> diff --git a/src/views/home/index.vue b/src/views/home/index.vue index ace2d24..974cb22 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -56,18 +56,33 @@ </div> <div class="contentBox"> <div class="funBox"> - <div class="authentication"></div> - <div class="manual"></div> + <div class="authentication"> + <div class="cardNav" @click="toAuthentication(true)"> + <div class="cardTitle">鏁欏笀璁よ瘉</div> + <div class="cardText"> + 瀛︽牎浠昏鑰佸笀涓婁紶鏁欏笀璇佹槑鏂囦欢锛岄�氳繃璁よ瘉鍚庯紝鍙繘琛屾牱涔︿笌鏁欏璧勬簮涓嬭浇鐢宠 + </div> + </div> + </div> + <div class="manual"> + <div class="cardNav" @click="toAuthentication(false)"> + <div class="cardTitle">鎿嶄綔鎵嬪唽</div> + <div class="cardText">蹇�熶簡瑙d娇鐢ㄦ楠わ紝杞绘澗寮�鍚暀瀛︽敮鎸佷箣鏃呫��</div> + </div> + </div> </div> <div class="bookListTitle"> <div class="title" style="display: flex; line-height: 50px"> - <div>鏂伴椈璧勮</div> - <div class="titleTabs"> - <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> - <el-tab-pane label="楂樼瓑鑱屼笟鏁欐潗" name="first"> </el-tab-pane> - <el-tab-pane label="涓撳崌鏈暀鏉�" name="second"></el-tab-pane> - <el-tab-pane label="鍗忓拰鍖诲闄㈡暀鏉�" name="third"></el-tab-pane> + <div>鏁欏瀵艰埅</div> + <div class="titleTabs" v-if="classfeild.length > 0"> + <el-tabs v-model="activeName" @tab-change="handleClick"> + <el-tab-pane + v-for="item in classfeild" + :key="item.value" + :label="item.name" + :name="item.value" + /> </el-tabs> </div> </div> @@ -75,7 +90,7 @@ <div class="more">鏇村></div> </div> <div class="recommendList"> - <div class="recommendItem" v-for="item in bookListData" :key="item.id"> + <div class="recommendItem" v-for="item in navBookList" :key="item.id"> <div class="recommendItemImg"> <img class="autoImg" :src="item.icon" /> </div> @@ -96,22 +111,30 @@ </div> </div> </div> + <teacherCertification :isShow="teacherDialog" @dialog-Change="dialogChange" /> </div> </template> <script setup> import moment from 'moment' +import { ElMessage } from 'element-plus' +import teacherCertification from '@/views/personalCenter/teacherCertification.vue' import { ref, onBeforeMount, inject, reactive, onMounted } from 'vue' let screenheight = ref(document.documentElement.clientHeight / 2) const MG = inject('MG') const config = inject('config') const tool = inject('tool') +const toolClass = inject('toolClass') const banner = reactive([]) const informationList = reactive([]) +let classfeild = ref([]) +let activeName = ref('A1') + let bookListData = ref([]) +let navBookList = ref([]) +let teacherDialog = ref(false) onBeforeMount(() => { console.log(document.documentElement.clientWidth / 2.628) - window.onresize = () => { let c = 2.628 if (document.documentElement.clientWidth >= 1220) { @@ -123,9 +146,111 @@ onMounted(() => { getBanner() + classifList() getInformationList() getBookList() + getNavBookList() }) + +const handleClick = (tab, event) => { + console.log(tab) + + activeName.value = tab + getNavBookList() +} + +const classifList = () => { + const query = { + refCodes: ['digitalTextbooks'], + } + MG.resource.getCmsTypeByRefCode(query).then((res) => { + const types = toolClass.handleTypeList(res) + const typeData = types[0].cmsTypeLinks[0].children + const temp_classfeild = typeData.find((item) => item.typeField.refCode === 'teachingLevel') + ?.typeField.cfg.option + + const noCheck = temp_classfeild.map((item) => { + return { + name: item.name, + value: item.value, + } + }) + console.log(noCheck, 'noCheck') + + classfeild.value = noCheck + console.log(classfeild, 'classfeild') + }) +} + +const getNavBookList = () => { + MG.store + .getProductList({ + path: '*', + queryType: '*', + storeInfo: 'defaultGoodsStore1', + paging: { + start: 0, + size: 5, + }, + fields: { + 'teachingLevel=': activeName.value, + }, + }) + .then((res) => { + console.log(res, '11111111111') + navBookList.value = res.datas + }) +} + +const dialogChange = (val) => { + getTeacherInfo() + if (val == false) { + teacherDialog.value = false + } else { + teacherDialog.value = true + } +} + +//鏁欏笀淇℃伅 +function getTeacherInfo() { + const data = { + start: 0, + size: 10, + topicIdOrRefCode: 'teacherRoleApproval', + appRefCode: config.appRefCode, + sort: { + type: 'Desc', + field: 'CreateDate', + }, + } + MG.ugc.getTopicMessageList(data).then((res) => { + try { + const resData = res.datas.find((i) => i.appUserCreator.userId == userId.value) + if (resData) { + teacherState.value = resData.state + if (resData.feedBack != null) { + reasonTxt.value = JSON.parse(resData.feedBack).reason + } + } else { + teacherState.value = '' + } + loading.value = false + } catch (error) { + loading.value = false + } + }) +} + +const toAuthentication = (type) => { + if (type) { + teacherDialog.value = true + } else { + ElMessage({ + message: '寤鸿涓�...', + type: 'warning', + }) + } +} const getBookList = () => { MG.store @@ -315,14 +440,14 @@ margin-bottom: 60px; .authentication { width: 40%; - height: 80px; + height: 100px; background-repeat: no-repeat; background-size: 100% 100%; background-image: url('@/assets/images/xiehe/home/jiaoshirenzheng.png'); } .manual { width: 40%; - height: 80px; + height: 100px; background-repeat: no-repeat; background-size: 100% 100%; background-image: url('@/assets/images/xiehe/home/jiaoshirenzheng.png'); @@ -331,6 +456,7 @@ .titleTabs { margin-left: 50px; + width: 70%; } .bookListTitle { display: flex; @@ -351,4 +477,19 @@ cursor: pointer; } } +.cardNav { + margin-left: 30%; + margin-top: 20px; + padding-right: 20px; + cursor: pointer; + .cardTitle { + font-size: 28px; + color: #ffffff; + } + .cardText { + font-size: 14px; + color: #ccc; + margin-top: 10px; + } +} </style> -- Gitblit v1.9.1