23个文件已修改
2 文件已重命名
12个文件已添加
72个文件已删除
New file |
| | |
| | | * text=auto eol=lf |
| | |
| | | .DS_Store |
| | | node_modules |
| | | /dist |
| | | |
| | | |
| | | # local env files |
| | | .env.local |
| | | .env.*.local |
| | | |
| | | # Log files |
| | | # Logs |
| | | logs |
| | | *.log |
| | | npm-debug.log* |
| | | yarn-debug.log* |
| | | yarn-error.log* |
| | | pnpm-debug.log* |
| | | lerna-debug.log* |
| | | |
| | | node_modules |
| | | .DS_Store |
| | | dist |
| | | dist-ssr |
| | | coverage |
| | | *.local |
| | | |
| | | /cypress/videos/ |
| | | /cypress/screenshots/ |
| | | |
| | | # Editor directories and files |
| | | .vscode/* |
| | | !.vscode/extensions.json |
| | | .idea |
| | | .vscode |
| | | *.suo |
| | | *.ntvs* |
| | | *.njsproj |
| | | *.sln |
| | | *.sw? |
| | | |
| | | *.tsbuildinfo |
New file |
| | |
| | | { |
| | | "$schema": "https://json.schemastore.org/prettierrc", |
| | | "semi": false, |
| | | "singleQuote": true, |
| | | "printWidth": 100 |
| | | } |
New file |
| | |
| | | { |
| | | "recommendations": ["Vue.volar", "esbenp.prettier-vscode"] |
| | | } |
| | |
| | | # website |
| | | # xiehe |
| | | |
| | | ## Project setup |
| | | ``` |
| | | yarn install |
| | | This template should help get you started developing with Vue 3 in Vite. |
| | | |
| | | ## Recommended IDE Setup |
| | | |
| | | [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). |
| | | |
| | | ## Customize configuration |
| | | |
| | | See [Vite Configuration Reference](https://vite.dev/config/). |
| | | |
| | | ## Project Setup |
| | | |
| | | ```sh |
| | | npm install |
| | | ``` |
| | | |
| | | ### Compiles and hot-reloads for development |
| | | ``` |
| | | yarn serve |
| | | ### Compile and Hot-Reload for Development |
| | | |
| | | ```sh |
| | | npm run dev |
| | | ``` |
| | | |
| | | ### Compiles and minifies for production |
| | | ``` |
| | | yarn build |
| | | ``` |
| | | ### Compile and Minify for Production |
| | | |
| | | ### Lints and fixes files |
| | | ```sh |
| | | npm run build |
| | | ``` |
| | | yarn lint |
| | | ``` |
| | | |
| | | ### Customize configuration |
| | | See [Configuration Reference](https://cli.vuejs.org/config/). |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang=""> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <link rel="icon" href="/favicon.ico"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| | | <title>Vite App</title> |
| | | </head> |
| | | <body> |
| | | <div id="app"></div> |
| | | <script type="module" src="/src/main.js"></script> |
| | | </body> |
| | | </html> |
| | |
| | | { |
| | | "compilerOptions": { |
| | | "target": "es5", |
| | | "module": "esnext", |
| | | "baseUrl": "./", |
| | | "moduleResolution": "node", |
| | | "paths": { |
| | | "@/*": [ |
| | | "src/*" |
| | | ] |
| | | }, |
| | | "lib": [ |
| | | "esnext", |
| | | "dom", |
| | | "dom.iterable", |
| | | "scripthost" |
| | | ] |
| | | } |
| | | "@/*": ["./src/*"] |
| | | } |
| | | }, |
| | | "exclude": ["node_modules", "dist"] |
| | | } |
| | |
| | | { |
| | | "name": "website", |
| | | "version": "0.1.0", |
| | | "name": "xiehe", |
| | | "version": "0.0.0", |
| | | "private": true, |
| | | "type": "module", |
| | | "engines": { |
| | | "node": "^20.19.0 || >=22.12.0" |
| | | }, |
| | | "scripts": { |
| | | "serve": "vue-cli-service serve", |
| | | "build": "vue-cli-service build", |
| | | "lint": "vue-cli-service lint" |
| | | "dev": "vite", |
| | | "build": "vite build", |
| | | "preview": "vite preview", |
| | | "format": "prettier --write src/" |
| | | }, |
| | | "dependencies": { |
| | | "@vicons/ionicons5": "^0.12.0", |
| | | "axios": "^0.27.2", |
| | | "core-js": "^3.8.3", |
| | | "element-china-area-data": "^5.0.2", |
| | | "element-ui": "^2.15.10", |
| | | "moment": "^2.29.4", |
| | | "qrcodejs2": "0.0.2", |
| | | "axios": "^1.11.0", |
| | | "element-plus": "^2.10.7", |
| | | "less": "^4.4.0", |
| | | "moment": "^2.30.1", |
| | | "pinia": "^3.0.3", |
| | | "spark-md5": "^3.0.2", |
| | | "vue": "^2.6.14", |
| | | "vue-router": "^3.5.1", |
| | | "vue-wxlogin": "^1.0.4", |
| | | "vuex": "^3.6.2" |
| | | "vue": "^3.5.18", |
| | | "vue-router": "^4.5.1" |
| | | }, |
| | | "devDependencies": { |
| | | "@babel/core": "^7.12.16", |
| | | "@babel/eslint-parser": "^7.12.16", |
| | | "@vue/cli-plugin-babel": "~5.0.0", |
| | | "@vue/cli-plugin-eslint": "~5.0.0", |
| | | "@vue/cli-plugin-router": "~5.0.0", |
| | | "@vue/cli-plugin-vuex": "~5.0.0", |
| | | "@vue/cli-service": "~5.0.0", |
| | | "eslint": "^7.32.0", |
| | | "eslint-plugin-vue": "^8.0.3", |
| | | "less": "^4.1.3", |
| | | "less-loader": "^11.0.0", |
| | | "vue-template-compiler": "^2.6.14" |
| | | }, |
| | | "eslintConfig": { |
| | | "root": true, |
| | | "env": { |
| | | "node": true |
| | | }, |
| | | "extends": [ |
| | | "plugin:vue/essential", |
| | | "eslint:recommended" |
| | | ], |
| | | "parserOptions": { |
| | | "parser": "@babel/eslint-parser" |
| | | }, |
| | | "rules": { |
| | | "vue/multi-word-component-names": 0, |
| | | "no-debugger": "off", |
| | | "no-unused-vars": "warn" |
| | | } |
| | | }, |
| | | "browserslist": [ |
| | | "> 1%", |
| | | "last 2 versions", |
| | | "not dead" |
| | | ] |
| | | "@vitejs/plugin-vue": "^6.0.1", |
| | | "prettier": "3.6.2", |
| | | "vite": "^7.0.6", |
| | | "vite-plugin-vue-devtools": "^8.0.0" |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <div id="app"> |
| | | <router-view /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { watch } from "vue"; |
| | | import { setSessionGuid, setNewView, storage } from "./assets/js/userAction"; |
| | | import tool from "./assets/js/toolClass"; |
| | | |
| | | export default { |
| | | name: "App", |
| | | data() { |
| | | return { |
| | | imgsrc: require("@/assets/images/officialAccount.jpg"), |
| | | }; |
| | | }, |
| | | created() { |
| | | // 在移动端打开Pc网站时的提示 |
| | | if ( |
| | | window.navigator.userAgent.match( |
| | | /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i |
| | | ) |
| | | ) { |
| | | this.$alert( |
| | | "<p style='text-align:left;'>请在PC端打开此网页,或扫描下方二维码关注我社公众号,单击菜单栏中的“教学服务”浏览相关信息、申请样书或下载教材配套的资源。</p><img src='" + |
| | | this.imgsrc + |
| | | "'>", |
| | | "提示", |
| | | { |
| | | dangerouslyUseHTMLString: true, |
| | | center: true, |
| | | customClass: "msgbox", |
| | | } |
| | | ); |
| | | } |
| | | |
| | | //在页面加载时读取sessionStorage里的状态信息 |
| | | if (sessionStorage.getItem("store")) { |
| | | this.$store.replaceState( |
| | | Object.assign( |
| | | {}, |
| | | this.$store.state, |
| | | JSON.parse(sessionStorage.getItem("store")) |
| | | ) |
| | | ); |
| | | sessionStorage.removeItem("store"); |
| | | } |
| | | |
| | | //在页面刷新时将vuex里的信息保存到sessionStorage里 |
| | | window.addEventListener("beforeunload", () => { |
| | | sessionStorage.setItem("store", JSON.stringify(this.$store.state)); |
| | | }); |
| | | }, |
| | | watch: { |
| | | $route(to, from) { |
| | | if (to.path.indexOf("AdminLogin") == -1 && from.path.indexOf("AdminLogin") == -1) { |
| | | const detailList = ["/bookStore/detail", "teachingServices/detail"]; |
| | | if (detailList.includes(to.path)) { |
| | | if (to.path == "/bookStore/detail") { |
| | | setNewView("productId", to.query.id); |
| | | } else { |
| | | setNewView("cmsItemId", to.query.id); |
| | | } |
| | | } |
| | | let sessionGuid = storage.get("sessionGuid"); |
| | | const token = tool.getCookie("websiteFrontToken"); |
| | | if (!sessionGuid) { |
| | | setSessionGuid(); |
| | | } |
| | | sessionStorage.setItem("fromPath", from.fullPath.substring(1)); |
| | | sessionStorage.setItem("toPath", to.fullPath.substring(1)); |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | <script setup> |
| | | import { RouterView } from 'vue-router' |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | @import "~@/assets/css/base.css"; |
| | | @import "~@/assets/css/common.css"; |
| | | <template> |
| | | <RouterView /> |
| | | </template> |
| | | |
| | | html, |
| | | body, |
| | | <style scoped> |
| | | #app { |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: #f1f8f4; |
| | | .msgbox { |
| | | width: 380px !important; |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="less"> |
| | | // 富文本容器,保留富文本默认样式,所见即所得 |
| | | .richTextBox { |
| | | line-height: 1.4; |
| | | font-size: 14px; |
| | | * { |
| | | margin: revert; |
| | | padding: revert; |
| | | border: revert; |
| | | font: revert; |
| | | vertical-align: revert; |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="less" scoped></style> |
| | |
| | | export const requestCtx = "https://www.caupress.cn"; // 请求地址 |
| | | export const requestTimeOut = 300000; // 请求超时时间 |
| | | export const tokenKey = "zgnydx-token"; |
| | | export const userInfoKey = "zgnydx-userInfo"; // 用户信息key |
| | | export const appId = 1; |
| | | export const appRefCode = "caupress"; |
| | | export const goodsStore = `defaultGoodsStore${appId}`; // 默认商品库 |
| | | export const publicStore = `defaultPublicStore${appId}`; // 默认资源开放仓储 |
| | | export const publicRepository = `defaultPublicRepository${appId}`; // 默认资源开放库 |
| | | export const requestCtx = 'http://182.92.203.7:5001' // 请求地址 |
| | | // export const appId = 1051; |
| | | |
| | | // export const requestCtx = 'http://172.31.31.145' // 请求地址 |
| | | // export const requestCtx = 'http://172.0.0.1' // 请求地址 |
| | | export const appId = 1 |
| | | |
| | | export const requestTimeOut = 300000 // 请求超时时间 |
| | | export const tokenKey = 'jilin-token' |
| | | export const userInfoKey = 'jilin-userInfo' // 用户信息key |
| | | export const appRefCode = 'jilinWebsite' |
| | | export const goodsStore = `defaultGoodsStore${appId}` // 默认商品库(书城) |
| | | export const publicStore = `defaultPublicStore${appId}` // 默认资源开放仓储 |
| | | export const publicRepository = `defaultPublicRepository${appId}` // 默认资源开放库 |
| | | |
| | | 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}$/; // 电话号正则 |
| | | /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ // 电话号正则 |
| | | |
| | | const pdfUrl = "https://www.caupress.cn/pdfRead/"; |
| | | // const pdfUrl = "http://192.168.3.196:8083/pdfRead/"; |
| | | // refcode |
| | | const refCode = { |
| | | // 收藏资源库 |
| | | FavoriteMathVideo: 'FavoriteMathVideo', |
| | | FavoriteMathPicture: 'FavoriteMathPicture', |
| | | FavoriteMathAudio: 'FavoriteMathAudio', |
| | | FavoriteMathModel: 'FavoriteMathModel', |
| | | // 轮播图 |
| | | bannerCode: 'jilin_banner\\jilin_digitalResource', |
| | | // 标准 |
| | | criterion: 'jilin_criterion', |
| | | // 资讯 |
| | | information: 'jilin_information', |
| | | // 关于我们 |
| | | aboutUs: 'jilin_aboutUs', |
| | | // 荣誉奖励 |
| | | honorAwards: 'jilin_honorAwards', |
| | | // 联系我们 |
| | | contactUs: 'jilin_contactUs', |
| | | // 仓库库 |
| | | pictureCode: 'jilin_imgResourceLibrary', |
| | | audioCode: 'jilin_audiosResourceLibrary', |
| | | videoCode: 'jilin_videosResourceLibrary', |
| | | modelCode: 'jilin_modelsResourceLibrary', |
| | | // 商品库 |
| | | imageStore: 'jilin_imgLibrary\\jilin_imageStore', |
| | | videoStore: 'jilin_videosLibrary\\jilin_videosStore', |
| | | audiosStore: 'jilin_audiosLibrary\\jilin_audiosStore', |
| | | modelStore: 'jilin_modelsLibrary\\jilin_modelsStore', |
| | | // 会员商品库 |
| | | memberImage: 'jilin_imgLibrary\\jilin_memberImage', |
| | | memberAudios: 'jilin_audiosLibrary\\jilin_memberAudios', |
| | | memberVideos: 'jilin_videosLibrary\\jilin_memberVideos', |
| | | memberModels: 'jilin_modelsLibrary\\jilin_memberModels', |
| | | // 最新资源库 |
| | | newImageStore: 'jilin_imgLibrary\\jilin_newImageStore', |
| | | newaudiosStore: 'jilin_audiosLibrary\\jilin_newaudiosStore', |
| | | newVideosStore: 'jilin_videosLibrary\\jilin_newVideosStore', |
| | | newModelsStore: 'jilin_modelsLibrary\\jilin_newModelsStore', |
| | | // 首页推荐资源 |
| | | recommendImgStore:'jilin_imgLibrary\\jilin_recommendedImage', |
| | | recommendAudioStore:'jilin_audiosLibrary\\jilin_recommendedAudio', |
| | | recommendVideoStore:'jilin_videosLibrary\\jilin_recommendedVideo', |
| | | recommendModelStore:'jilin_modelsLibrary\\jilin_recommendedModel', |
| | | } |
| | | |
| | | // 频道refCode |
| | | export const refCodes = { |
| | | index: { |
| | | banner: "caupress_banner\\caupress_homepageBanner", |
| | | information: "caupress_informationCenter\\caupress_information", |
| | | notice: "caupress_informationCenter\\caupress_notice", |
| | | column: "caupress_homepageColumn", |
| | | honor: "caupress_honor", |
| | | }, |
| | | // 意见反馈 |
| | | Feedback: "feedback", |
| | | // 投稿 |
| | | Contribution: "caupress_contributedWorks", |
| | | // 隐私政策 |
| | | Privacy:"caupress_protocol", |
| | | // 法律声明 |
| | | Statement:"caupress_protocol", |
| | | //教师认证formtypeItem |
| | | teacherCertification: "caupress_teacherCertification", |
| | | // 电子样书cmsTypeRefcode |
| | | electronicSampleApplication: "electronicSampleApplication", |
| | | // 电子样书申请 |
| | | applyBook: "applyBook", |
| | | // 纸质样书申请 |
| | | applyEntityBook: "applyEntityBook", |
| | | // 资源下载申请 |
| | | productDownLoad: "productDownLoad", |
| | | }; |
| | | |
| | | export const seriesList = { |
| | | caupress_yyxbkspkxygclzyxljc: "应用型本科食品科学与工程类专业系列教材", |
| | | caupress_ptgdyxsplzyxljc: "普通高等院校食品类专业系列教材", |
| | | caupress_ptgdjyfjylylzysswghjc: "普通高等院校风景园林/园林系列教材", |
| | | caupress_gdzyjyxmsyzyjpjc: "高等职业教育畜牧兽医专业精品教材", |
| | | caupress_gdzyjyxmsyzyqgxjhxljc: |
| | | "高等职业教育畜牧兽医专业群“工学结合”系列教材", |
| | | caupress_xczxbwnmpxxl: "乡村振兴百万农民培训系列教材", |
| | | caupress_tdzyglyyxzxfzsdzyxljc: "土地资源管理应用型转型发展试点专业系列教材", |
| | | caupress_ptgdyxtdzyglzyjpkcj: "普通高等院校土地资源管理专业精品课程建设教材", |
| | | caupress_gdzyjygklqcnygcnjxlghjc: |
| | | "高等职业教育工科类汽车、农业工程、农机系列规划教材", |
| | | }; |
| | | const wxLogin = { |
| | | appid: 'wx2b9d4a6308fd03d6', |
| | | scope: 'snsapi_login', |
| | | logInRedirectURL: encodeURIComponent(requestCtx + '/website'), |
| | | authenRedirectURL:encodeURIComponent(requestCtx + '/website/#/userInfo') |
| | | } |
| | | |
| | | const config = { |
| | | requestCtx, |
| | |
| | | userInfoKey, |
| | | appRefCode, |
| | | goodsStore, |
| | | publicStore, |
| | | publicRepository, |
| | | refCodes, |
| | | reg_tel, |
| | | seriesList, |
| | | pdfUrl |
| | | }; |
| | | export default config; |
| | | appId, |
| | | refCode, |
| | | wxLogin |
| | | } |
| | | export default config |
New file |
| | |
| | | let isSelect = false; |
| | | let move = false; |
| | | |
| | | |
| | | document.addEventListener('mousedown', () => { |
| | | isSelect = true; |
| | | }); |
| | | |
| | | document.addEventListener('mousemove', () => { |
| | | if (isSelect) { |
| | | move = true; |
| | | } |
| | | }); |
| | | |
| | | document.addEventListener('mouseup', (e) => { |
| | | isSelect = false; |
| | | if (move) { |
| | | const selection = window.getSelection(); |
| | | if (selection && selection.toString().length != 0) { |
| | | parent.window.selectChange(e) |
| | | } |
| | | } |
| | | move = false; |
| | | e.preventDefault(); |
| | | }); |
| | | parent.window.document.getElementsByClassName("epub-container")[0].addEventListener("scroll", function (e) { |
| | | parent.window.scroll(e); // 调用处理函数并传入参数 |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | |
| | | // 取消接口调用能力; |
| | | // 队列的必要性?? |
| | | |
| | | import resource from "./api/resource"; |
| | | import store from "./api/store"; |
| | | import identity from "./api/identity"; |
| | | import ugc from "./api/ugc"; |
| | | import app from "./api/app"; |
| | | import file from "./api/file"; |
| | | import job from "./api/job"; |
| | | import edu from "./api/edu"; |
| | | import resource from "./api/resource.js"; |
| | | import store from "./api/store.js"; |
| | | import identity from "./api/identity.js"; |
| | | import ugc from "./api/ugc.js"; |
| | | import app from "./api/app.js"; |
| | | import file from "./api/file.js"; |
| | | import job from "./api/job.js"; |
| | | import edu from "./api/edu.js"; |
| | | |
| | | const WebMiddleGroundApi = { |
| | | resource, |
| | |
| | | app, |
| | | file, |
| | | job, |
| | | edu |
| | | edu, |
| | | }; |
| | | |
| | | export default WebMiddleGroundApi; |
| | | export default WebMiddleGroundApi; |
| | |
| | | import request from "@/plugin/axios"; |
| | | import request from "@/plugin/axios/index.ts"; |
| | | const appApi = { |
| | | // 获取用户消息列表 |
| | | getAppMessageList(data) { |
| | |
| | | method: "post", |
| | | data |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 获取CmsItem按照Event统计 |
| | | getEventRankList(data) { |
| | | return request({ |
| | | url: "/app/api/ApiGetEventRankList", |
| | | method: "post", |
| | | data |
| | | }); |
| | | }, |
| | | |
| | | // 获取学习时长按照Event统计 |
| | | getStaticsSum(data) { |
| | | return request({ |
| | | url: "/app/api/ApiGetUserStaticsSum", |
| | | method: "post", |
| | | data |
| | | }); |
| | | }, |
| | | }; |
| | | |
| | | export default appApi; |
| | |
| | | import request from "@/plugin/axios"; |
| | | import { handleQueryResourceListData } from "../tool"; |
| | | import request from '@/plugin/axios/index.ts' |
| | | import { handleQueryResourceListData } from '../tool' |
| | | const eduApi = { |
| | | /* |
| | | **获取商品列表** |
| | | path: 数据路径 |
| | | storeInfo: 仓储 |
| | | channelInfo: 频道 |
| | | subAccess: |
| | | queryType: 检索类型 |
| | | paging: 分页 |
| | | sort: 排序 |
| | | fields: 自定义字段 |
| | | */ |
| | | getCourseProductList: ({ |
| | | courseInfo = null, |
| | | queryType, |
| | | LinkProductId = null, |
| | | paging = {}, |
| | | sort, |
| | | fields, |
| | | coverSize |
| | | }) => { |
| | | const query = { |
| | | Type: queryType || "\\", |
| | | CourseId: courseInfo + "", |
| | | LinkProductId: LinkProductId || "", |
| | | PageQuery: { |
| | | Start: paging.start || "0", |
| | | Size: paging.size || "10" |
| | | }, |
| | | SortQuery: sort |
| | | ? [sort] |
| | | : [ |
| | | { |
| | | LinkOrder: "Desc" |
| | | } |
| | | ], |
| | | CreateDate: [], |
| | | Description: [], |
| | | Name: [], |
| | | Icon: [], |
| | | RefCode: [], |
| | | TypeId: [], |
| | | SysType: [], |
| | | State: [], |
| | | Tag: [], |
| | | BeginDate: [], |
| | | EndDate: [], |
| | | ProductLinkInfo: [], |
| | | AllowDonate: [], |
| | | // DonatePriceList: [], |
| | | SubProductCount: [], |
| | | ...fields |
| | | }; |
| | | const body = { query: JSON.stringify({ Query: [{ Q1: query }] }) }; |
| | | let url = "/edu/api/ApiAppUserQueryCourseProduct"; |
| | | // 获取商品下的组卷策略 |
| | | getQuizConfigListByProduct(data) { |
| | | return request({ |
| | | url: url, |
| | | method: "post", |
| | | data: body |
| | | }).then((resp) => { |
| | | if (resp.length > 0) { |
| | | const data = resp[0]; |
| | | const datas = handleQueryResourceListData({ |
| | | datas: data.datas, |
| | | fields, |
| | | courseInfo, |
| | | coverSize |
| | | }); |
| | | return { |
| | | datas, |
| | | total: data.totalCount |
| | | }; |
| | | } |
| | | return { datas: [], total: 0 }; |
| | | }); |
| | | url: '/edu/api/ApiGetQuizConfigListByProduct', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | // 获取组卷结果 |
| | | getEduQuizConfigResult(data) { |
| | | return request({ |
| | | url: '/edu/api/ApiGetEduQuizConfigResult', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | //申请课程 |
| | | applyNewCourse(data) { |
| | | return request({ |
| | | url: "/edu/api/ApiApplyNewCourse", |
| | | method: "post", |
| | | data |
| | | }); |
| | | url: '/edu/api/ApiApplyNewCourse', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | //更新课程申请信息 |
| | | updateCourseApply(data) { |
| | | return request({ |
| | | url: "/edu/api/ApiUpdateCourseApply", |
| | | method: "post", |
| | | data |
| | | }); |
| | | url: '/edu/api/ApiUpdateCourseApply', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | //获取我的课程 |
| | | getAppCourseList(data) { |
| | | return request({ |
| | | url: "/edu/api/ApiGetAppCourseList", |
| | | method: "post", |
| | | data |
| | | }); |
| | | url: '/edu/api/ApiGetAppCourseList', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | //获取已申请的课程详情 |
| | | getCourseById(data) { |
| | | return request({ |
| | | url: "/edu/api/ApiGetCourseById", |
| | | method: "post", |
| | | data |
| | | }); |
| | | url: '/edu/api/ApiGetCourseById', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | //获取创建课程中的班级列表 |
| | | getCourseClassList(data) { |
| | | return request({ |
| | | url: "/edu/api/ApiGetCourseClassList", |
| | | method: "post", |
| | | data |
| | | }); |
| | | url: '/edu/api/ApiGetCourseClassList', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | //创建班级信息 |
| | | newCourseClass(data) { |
| | | return request({ |
| | | url: "/edu/api/ApiNewCourseClass", |
| | | method: "post", |
| | | data |
| | | }); |
| | | url: '/edu/api/ApiNewCourseClass', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | //删除班级信息 |
| | | delCourseClass(data) { |
| | | return request({ |
| | | url: "/edu/api/ApiDelCourseClass", |
| | | method: "post", |
| | | data |
| | | }); |
| | | url: '/edu/api/ApiDelCourseClass', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | // 更新班级信息 |
| | | updateCourseClass(data) { |
| | | return request({ |
| | | url: "/edu/api/ApiUpdateCourseClass", |
| | | method: "post", |
| | | data |
| | | }); |
| | | url: '/edu/api/ApiUpdateCourseClass', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | //创建课程订单 |
| | | createCourseOrder(data) { |
| | | return request({ |
| | | url: "/store/api/CreateCourseOrder", |
| | | method: "post", |
| | | data |
| | | }); |
| | | url: '/store/api/CreateCourseOrder', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | // 免费领取课程 |
| | | MakeFreeOrderPay(data) { |
| | | makeFreeOrderPay(data) { |
| | | return request({ |
| | | url: "/store/api/MakeFreeOrderPay", |
| | | method: "post", |
| | | data |
| | | }); |
| | | } |
| | | }; |
| | | url: '/store/api/MakeFreeOrderPay', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | export default eduApi; |
| | | // 获取排名结果 |
| | | getRankingList(data) { |
| | | return request({ |
| | | url: '/edu/api/ApiGetRankingList', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | //获取个人排名 |
| | | getRanking(data) { |
| | | return request({ |
| | | url: '/edu/api/ApiGetTopRanking', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | // 新建排名记录 |
| | | newRanking(data) { |
| | | return request({ |
| | | url: '/edu/api/ApiNewRanking', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | // 删除组卷规则 |
| | | delQuizConfig(data) { |
| | | return request({ |
| | | url: '/edu/admin/DelQuizConfig', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | // 更新组卷规则 |
| | | updateQuizConfig(data) { |
| | | return request({ |
| | | url: '/edu/admin/UpdateQuizConfig', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | |
| | | // 根据ID获取组卷配置 |
| | | getQuizConfig(data) { |
| | | return request({ |
| | | url: '/edu/admin/GetQuizConfig', |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | }, |
| | | } |
| | | |
| | | export default eduApi |
| | |
| | | import request from "@/plugin/axios"; |
| | | import request from "@/plugin/axios/index.ts"; |
| | | const fileApi = { |
| | | // 获取pdf总页数 |
| | | getPdfTotalPage(data) { |
| | |
| | | }); |
| | | }, |
| | | |
| | | // 获取pdf、word、ppt等转图片预览 |
| | | getPdfInfo(data) { |
| | | return request({ |
| | | url: "/file/GetPdfInfo", |
| | | method: "post", |
| | | data |
| | | }); |
| | | }, |
| | | //获取pdf目录 |
| | | GetPdfToc(data) { |
| | | return request({ |
| | | url: "/file/GetPdfToc", |
| | | method: "post", |
| | | data |
| | | }); |
| | | }, |
| | | //获取文件 |
| | | getPdfPageImage(params) { |
| | | return request({ |
| | | url: '/file/GetPdfPageImage', |
| | | method: 'get', |
| | | responseType: 'blob', |
| | | params |
| | | }); |
| | | }, |
| | | //上传文件 |
| | | upload(data) { |
| | | return request({ |
| | |
| | | data, |
| | | }); |
| | | }, |
| | | }; |
| | | |
| | | downloadForAuthorize(params) { |
| | | return request({ |
| | | url: '/file/api/ApiDownloadForAuthorize', |
| | | method: 'GET', |
| | | responseType: 'blob', |
| | | params |
| | | }); |
| | | }, |
| | | // 批量下载 |
| | | downloadFiles(data) { |
| | | return request({ |
| | | url: '/file/api/ApiDownloadFiles', |
| | | method: 'post', |
| | | responseType: 'blob', |
| | | data |
| | | }); |
| | | }, |
| | | |
| | | // 批量下载get |
| | | getDownloadFiles (params) { |
| | | return request({ |
| | | url: '/file/api/ApiGetDownloadFiles', |
| | | method: 'GET', |
| | | responseType: 'blob', |
| | | headers:{ |
| | | 'md5s':params |
| | | } |
| | | }); |
| | | }, |
| | | // 发送下载邮件 |
| | | sendFileEmail (data) { |
| | | return request({ |
| | | url:'/file/api/ApiSendFileWithEmail', |
| | | method:'post', |
| | | data |
| | | }) |
| | | } |
| | | } |
| | | |
| | | export default fileApi; |
| | |
| | | import request from "@/plugin/axios"; |
| | | import request from "@/plugin/axios/index.ts"; |
| | | const identityApi = { |
| | | // 获取图形验证码 |
| | | getImgCode() { |
| | |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 设置登录的用户名和密码,用户名和密码至少6位 |
| | | setLoginNameAndPassword(data) { |
| | | return request({ |
| | | url: "/identity/api/ApiUserSetLoginNameAndPassword", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 获取邮箱验证码 |
| | | getEmailCode(data) { |
| | | return request({ |
| | | url: "/identity/api/SendVerifyEMail", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | // 用户绑定邮箱 |
| | | bindingEmail(data) { |
| | | return request({ |
| | | url: "/identity/api/ApiBindEMail", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | }; |
| | | |
| | | export default identityApi; |
| | |
| | | import request from "@/plugin/axios"; |
| | | import request from "@/plugin/axios/index.ts"; |
| | | import { tokenKey } from "@/assets/js/config"; |
| | | import toolClass from "@/assets/js/toolClass"; |
| | | |
| | | |
| | | const jobApi = { |
| | | // 统计 |
| | | newJobWithNewView(data) { |
| | |
| | | }, |
| | | |
| | | newSession(data) { |
| | | let token = toolClass.getCookie(tokenKey); |
| | | return request({ |
| | | url: toolClass.getCookie(tokenKey) ? "/job/api/AppUserNewSession" : "/job/api/NewSession", |
| | | url: token ? "/job/api/AppUserNewSession" : "/job/api/NewSession", |
| | | method: "post", |
| | | data |
| | | }); |
| | | }, |
| | | |
| | | newJobWithApiNewEvent(data){ |
| | | return request({ |
| | | url: "/job/api/NewJobWithApiNewEvent", |
| | | method: "post", |
| | | data |
| | | }); |
| | |
| | | import request from "@/plugin/axios"; |
| | | import request from "@/plugin/axios/index.ts"; |
| | | import { publicStore, publicRepository } from "@/assets/js/config"; |
| | | import { tokenKey } from "@/assets/js/config"; |
| | | import { handleQueryResourceListData } from "../tool"; |
| | |
| | | sort, |
| | | fields, |
| | | itemId, |
| | | itemIds, |
| | | itemType, |
| | | coverSize, |
| | | filterList, |
| | | itemIdArr, |
| | | SysType, |
| | | tourism_isHighQualityResources, |
| | | }) => { |
| | | if (!path) return Promise.reject("接口请求必要参数不能为空!"); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | const query = { |
| | | AccessControl: { |
| | | Path: path, |
| | |
| | | Start: paging?.start || "0", |
| | | Size: paging?.size || "10", |
| | | }, |
| | | SortQuery: sort |
| | | ? [sort] |
| | | : [ |
| | | { |
| | | LinkOrder: "Desc", |
| | | }, |
| | | ], |
| | | SortQuery: sort ? [sort] : [{ |
| | | LinkOrder: "Desc" |
| | | }], |
| | | CreateDate: [], |
| | | Description: [], |
| | | Name: [], |
| | |
| | | ChildrenFolderCount: [], |
| | | ChildrenCount: [], |
| | | ...fields, |
| | | ...filterList, |
| | | }; |
| | | if (itemIdArr) query["Id"] = itemIdArr; |
| | | if (SysType) query["SysType="] = [`${SysType}`]; |
| | | if (tourism_isHighQualityResources) |
| | | query["tourism_isHighQualityResources="] = [ |
| | | `${tourism_isHighQualityResources}`, |
| | | ]; |
| | | if (itemId) query["Id="] = [`${itemId}`]; |
| | | if (itemIds) query["Id="] = itemIds; |
| | | if (itemType) query["Type="] = [`${itemType}`]; |
| | | const body = { query: JSON.stringify({ Query: [{ Q1: query }] }) }; |
| | | let token = toolClass.getCookie(tokenKey); |
| | | let token = localStorage.getItem(tokenKey); |
| | | return request({ |
| | | url: token ? "/resource/api/ApiAppUserQuery" : "/resource/api/ApiQuery", |
| | | method: "post", |
| | |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 获取cms收藏列表 |
| | | getCmsCollectList(data) { |
| | | const body = { query: JSON.stringify({ Query: [{ Q1: data }] }) }; |
| | | return request({ |
| | | url: "/resource/api/ApiAppUserQuery", |
| | | method: "post", |
| | | data: body, |
| | | }); |
| | | }, |
| | | }; |
| | | |
| | | export default resourceApi; |
| | |
| | | import request from "@/plugin/axios"; |
| | | import { tokenKey, goodsStore } from "@/assets/js/config"; |
| | | import toolClass from "@/assets/js/toolClass"; |
| | | import { |
| | | handleQueryResourceListData, |
| | | handleDetailQueryRequestData |
| | | } from "../tool"; |
| | | import request from '@/plugin/axios/index.ts' |
| | | import { tokenKey, goodsStore } from '@/assets/js/config' |
| | | import { handleQueryResourceListData, handleDetailQueryRequestData } from '../tool' |
| | | const storeApi = { |
| | | /* |
| | | **获取商品列表** |
| | |
| | | fields: 自定义字段 |
| | | */ |
| | | getProductList: ({ |
| | | path = "", |
| | | path = '', |
| | | storeInfo = goodsStore, |
| | | storeEventIdOrRefCode = "", |
| | | storeEventIdOrRefCode = '', |
| | | favoriteTypes = '', |
| | | queryType, |
| | | linkType, |
| | | subAccess = [], |
| | |
| | | fields, |
| | | filterList, |
| | | coverSize, |
| | | mainProductId |
| | | mainProductId, |
| | | handelEBooK |
| | | }) => { |
| | | const query = { |
| | | AccessControl: { |
| | | Path: path, |
| | | StoreRefCode: storeInfo + "", |
| | | Type: queryType || "\\", |
| | | LinkType: linkType || "" |
| | | StoreRefCode: storeInfo + '', |
| | | Type: queryType || '\\', |
| | | LinkType: linkType || '' |
| | | }, |
| | | FavoriteTypes: favoriteTypes ? [favoriteTypes] : [], |
| | | SubAccess: subAccess.length > 0 ? subAccess : [], |
| | | PageQuery: { |
| | | Start: paging.start || "0", |
| | | Size: paging.size || "10" |
| | | Start: paging.start || '0', |
| | | Size: paging.size || '10' |
| | | }, |
| | | SortQuery: |
| | | sort?.length == 0 |
| | | ? [] |
| | | : sort |
| | | ? [sort] |
| | | : [ |
| | | { |
| | | LinkOrder: "Desc" |
| | | } |
| | | ], |
| | | ? [sort] |
| | | : [ |
| | | { |
| | | LinkOrder: 'Desc' |
| | | } |
| | | ], |
| | | CreateDate: [], |
| | | Description: [], |
| | | Name: [], |
| | |
| | | StoreEventIdOrRefCode: storeEventIdOrRefCode, |
| | | ...fields, |
| | | ...filterList |
| | | }; |
| | | } |
| | | if (mainProductId) { |
| | | query.AccessControl.MainProductId = mainProductId; |
| | | query.AccessControl.MainProductId = mainProductId |
| | | } |
| | | if (handelEBooK) { |
| | | query.ProductCmsQuery = [ |
| | | { |
| | | QueryCms: { |
| | | Path: '*', |
| | | Type: '\\', |
| | | Name: [], |
| | | Icon: [], |
| | | TypeId: [], |
| | | RefCode: [], |
| | | ChildrenCount: [], |
| | | ChildrenFolderCount: [], |
| | | CreateDate: [], |
| | | SysType: [], |
| | | SaleMethod: [], |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 9999 |
| | | }, |
| | | ProductLinkInfo: [] |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | const body = { |
| | | query: JSON.stringify({ |
| | |
| | | } |
| | | ] |
| | | }) |
| | | }; |
| | | let token = toolClass.getCookie(tokenKey); |
| | | let url = token |
| | | ? "/store/api/ApiQueryProductByAppUser" |
| | | : "/store/api/ApiQueryProduct"; |
| | | } |
| | | let token = localStorage.getItem(tokenKey) |
| | | let url = token ? '/store/api/ApiQueryProductByAppUser' : '/store/api/ApiQueryProduct' |
| | | return request({ |
| | | url: url, |
| | | method: "post", |
| | | method: 'post', |
| | | data: body |
| | | }).then((resp) => { |
| | | if (resp.length > 0) { |
| | | const data = resp[0]; |
| | | const data = resp[0] |
| | | const datas = handleQueryResourceListData({ |
| | | datas: data.datas, |
| | | fields, |
| | | path, |
| | | storeInfo, |
| | | coverSize |
| | | }); |
| | | coverSize, |
| | | handelEBooK |
| | | }) |
| | | return { |
| | | datas, |
| | | total: data.totalCount, |
| | | extraInfos: data.extraInfos?.StoreEvent |
| | | }; |
| | | } |
| | | } |
| | | return { |
| | | datas: [], |
| | | total: 0 |
| | | }; |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | /* |
| | | **获取商品详情** |
| | |
| | | cmsPath:cmsPath |
| | | */ |
| | | getProductDetail: ({ |
| | | path = "", |
| | | path = '', |
| | | storeInfo = goodsStore, |
| | | channelInfo = "", |
| | | channelInfo = '', |
| | | favoriteTypes = '', |
| | | queryType, |
| | | subAccess = [], |
| | | fields, |
| | | productId, |
| | | cmsPath, |
| | | cmsType, |
| | | coverSize, |
| | | itemId, |
| | | itemIds, |
| | | itemFields, |
| | | linkTypes |
| | | linkTypes, |
| | | filterList, |
| | | handelEBooK, |
| | | sort, |
| | | cmsSort, |
| | | source |
| | | }) => { |
| | | const subQuery = {}; |
| | | const subQuery = {} |
| | | if (cmsPath) { |
| | | subQuery["QueryCms"] = { |
| | | Path: cmsPath + "", |
| | | Type: "\\", |
| | | subQuery['QueryCms'] = { |
| | | Path: cmsPath + '', |
| | | Type: cmsType || '\\', |
| | | Name: [], |
| | | Icon: [], |
| | | TypeId: [], |
| | | RefCode: [], |
| | | Description:[], |
| | | ChildrenCount: [], |
| | | ChildrenFolderCount: [], |
| | | CreateDate: [], |
| | | SysType: [], |
| | | SaleMethod: [], |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 100 |
| | | Size: 9999 |
| | | }, |
| | | SortQuery: cmsSort |
| | | ? [cmsSort] |
| | | : [ |
| | | { |
| | | ProductLinkOrder: 'Asc' |
| | | } |
| | | ], |
| | | ProductLinkInfo: [], |
| | | ...itemFields |
| | | }; |
| | | if (itemId) subQuery["QueryCms"]["Id="] = [`${itemId}`]; |
| | | } |
| | | if (itemId) subQuery['QueryCms']['Id='] = [`${itemId}`] |
| | | if (itemIds) subQuery['QueryCms']['Id='] = itemIds |
| | | } else { |
| | | subQuery['QueryCms'] = { |
| | | Path: '*', |
| | | Type: '\\', |
| | | Name: [], |
| | | Icon: [], |
| | | TypeId: [], |
| | | RefCode: [], |
| | | Description:[], |
| | | ChildrenCount: [], |
| | | ChildrenFolderCount: [], |
| | | CreateDate: [], |
| | | SysType: [], |
| | | SaleMethod: [], |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 9999 |
| | | }, |
| | | ProductLinkInfo: [] |
| | | } |
| | | } |
| | | // 获取关联资源 |
| | | let linkFields = {}; |
| | | let linkFields = {} |
| | | if (linkTypes && linkTypes.length) { |
| | | for (let i = 0; i < linkTypes.length; i++) { |
| | | const linkType = linkTypes[i]; |
| | | subQuery["QueryLink_" + linkType.linkType] = { |
| | | Path: cmsPath + "", |
| | | Type: "\\", |
| | | const linkType = linkTypes[i] |
| | | subQuery['QueryLink_' + linkType.linkType] = { |
| | | Path: cmsPath + '', |
| | | Type: '\\', |
| | | Name: [], |
| | | Icon: [], |
| | | TypeId: [], |
| | | RefCode: [], |
| | | Description:[], |
| | | LinkTypes: [linkType.linkType], |
| | | PageQuery: { |
| | | Start: 0, |
| | |
| | | }, |
| | | ProductLinkInfo: [], |
| | | ...linkType.fields |
| | | }; |
| | | } |
| | | linkFields = { |
| | | ...linkFields, |
| | | ...linkType.fields |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | const query = { |
| | | AccessControl: { |
| | | Path: path, |
| | | StoreRefCode: storeInfo + "", |
| | | ChannelRefCode: channelInfo + "", |
| | | Type: queryType || "\\" |
| | | StoreRefCode: storeInfo + '', |
| | | ChannelRefCode: channelInfo + '', |
| | | Type: queryType || '\\' |
| | | }, |
| | | FavoriteTypes: favoriteTypes ? [favoriteTypes] : [], |
| | | SubAccess: subAccess.length > 0 ? subAccess : [], |
| | | PageQuery: { |
| | | Start: "0", |
| | | Size: "1" |
| | | Start: '0', |
| | | Size: '1' |
| | | }, |
| | | "Id=": [`${productId}`], |
| | | SortQuery: [], |
| | | 'Id=': [`${productId}`], |
| | | SortQuery: sort |
| | | ? [sort] |
| | | : [ |
| | | { |
| | | LinkOrder: 'Desc' |
| | | } |
| | | ], |
| | | CreateDate: [], |
| | | Description: [], |
| | | Name: [], |
| | | Icon: [], |
| | | RefCode: [], |
| | | Description:[], |
| | | TypeId: [], |
| | | SysType: [], |
| | | State: [], |
| | |
| | | StoreEvent: [], |
| | | SaleMethod: [], |
| | | SaleMethodValid: [], |
| | | CmsItemValid: [], |
| | | ProductCmsQuery: [subQuery], |
| | | ...fields |
| | | }; |
| | | if (productId) query["Id="] = [`${productId}`]; |
| | | ...fields, |
| | | ...filterList |
| | | } |
| | | if (productId) query['Id='] = [`${productId}`] |
| | | |
| | | const body = { |
| | | query: JSON.stringify({ |
| | |
| | | } |
| | | ] |
| | | }) |
| | | }; |
| | | let token = toolClass.getCookie(tokenKey); |
| | | let url = token |
| | | ? "/store/api/ApiQueryProductByAppUser" |
| | | : "/store/api/ApiQueryProduct"; |
| | | } |
| | | let token = localStorage.getItem(tokenKey) |
| | | let url = token ? '/store/api/ApiQueryProductByAppUser' : '/store/api/ApiQueryProduct' |
| | | return request({ |
| | | url: url, |
| | | method: "post", |
| | | data: body |
| | | }).then((resp) => { |
| | | if (resp.length > 0) { |
| | | const data = resp[0]; |
| | | if (data.datas.length) { |
| | | data.datas[0].subDatas = data.datas[0].cmsDatas; |
| | | const datas = handleDetailQueryRequestData({ |
| | | item: data.datas[0], |
| | | fields, |
| | | itemFields: { |
| | | ...itemFields, |
| | | ...linkFields |
| | | }, |
| | | path, |
| | | coverSize |
| | | }); |
| | | return { |
| | | datas, |
| | | total: data.totalCount |
| | | }; |
| | | } else { |
| | | return { |
| | | datas: [], |
| | | total: 0 |
| | | }; |
| | | method: 'post', |
| | | data: body, |
| | | cancelToken: source?.token |
| | | }) |
| | | .then((resp) => { |
| | | if (resp.length > 0) { |
| | | const data = resp[0] |
| | | if (data.datas.length) { |
| | | data.datas[0].subDatas = data.datas[0].cmsDatas |
| | | const datas = handleDetailQueryRequestData({ |
| | | item: data.datas[0], |
| | | fields, |
| | | itemFields: { |
| | | ...itemFields, |
| | | ...linkFields |
| | | }, |
| | | path, |
| | | coverSize, |
| | | handelEBooK, |
| | | |
| | | }) |
| | | return { |
| | | datas, |
| | | total: data.totalCount |
| | | } |
| | | } else { |
| | | return { |
| | | datas: [], |
| | | total: 0 |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | datas: [], |
| | | total: 0 |
| | | } |
| | | }) |
| | | }, |
| | | // 获取商品详情,不返回 ChildrenCount,ChildrenFolderCount |
| | | // (此接口为了满足不返回 ChildrenCount,ChildrenFolderCount而后续添加的) 不是中台原有的 |
| | | getProductDetailNoChildren:({ |
| | | path = '', |
| | | storeInfo = goodsStore, |
| | | channelInfo = '', |
| | | favoriteTypes = '', |
| | | queryType, |
| | | subAccess = [], |
| | | fields, |
| | | productId, |
| | | cmsPath, |
| | | cmsType, |
| | | coverSize, |
| | | itemId, |
| | | itemIds, |
| | | itemFields, |
| | | linkTypes, |
| | | filterList, |
| | | handelEBooK, |
| | | sort, |
| | | cmsSort, |
| | | source |
| | | }) => { |
| | | const subQuery = {} |
| | | if (cmsPath) { |
| | | subQuery['QueryCms'] = { |
| | | Path: cmsPath + '', |
| | | Type: cmsType || '\\', |
| | | Name: [], |
| | | Icon: [], |
| | | TypeId: [], |
| | | RefCode: [], |
| | | Description:[], |
| | | // ChildrenCount: [], |
| | | // ChildrenFolderCount: [], |
| | | CreateDate: [], |
| | | SysType: [], |
| | | SaleMethod: [], |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 9999 |
| | | }, |
| | | SortQuery: cmsSort |
| | | ? [cmsSort] |
| | | : [ |
| | | { |
| | | ProductLinkOrder: 'Asc' |
| | | } |
| | | ], |
| | | ProductLinkInfo: [], |
| | | ...itemFields |
| | | } |
| | | if (itemId) subQuery['QueryCms']['Id='] = [`${itemId}`] |
| | | if (itemIds) subQuery['QueryCms']['Id='] = itemIds |
| | | } else { |
| | | subQuery['QueryCms'] = { |
| | | Path: '*', |
| | | Type: '\\', |
| | | Name: [], |
| | | Icon: [], |
| | | TypeId: [], |
| | | RefCode: [], |
| | | Description:[], |
| | | ChildrenCount: [], |
| | | ChildrenFolderCount: [], |
| | | CreateDate: [], |
| | | SysType: [], |
| | | SaleMethod: [], |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 9999 |
| | | }, |
| | | ProductLinkInfo: [] |
| | | } |
| | | } |
| | | // 获取关联资源 |
| | | let linkFields = {} |
| | | if (linkTypes && linkTypes.length) { |
| | | for (let i = 0; i < linkTypes.length; i++) { |
| | | const linkType = linkTypes[i] |
| | | subQuery['QueryLink_' + linkType.linkType] = { |
| | | Path: cmsPath + '', |
| | | Type: '\\', |
| | | Name: [], |
| | | Icon: [], |
| | | TypeId: [], |
| | | RefCode: [], |
| | | Description:[], |
| | | LinkTypes: [linkType.linkType], |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 100 |
| | | }, |
| | | ProductLinkInfo: [], |
| | | ...linkType.fields |
| | | } |
| | | linkFields = { |
| | | ...linkFields, |
| | | ...linkType.fields |
| | | } |
| | | } |
| | | return { |
| | | datas: [], |
| | | total: 0 |
| | | }; |
| | | }); |
| | | }, |
| | | } |
| | | const query = { |
| | | AccessControl: { |
| | | Path: path, |
| | | StoreRefCode: storeInfo + '', |
| | | ChannelRefCode: channelInfo + '', |
| | | Type: queryType || '\\' |
| | | }, |
| | | FavoriteTypes: favoriteTypes ? [favoriteTypes] : [], |
| | | SubAccess: subAccess.length > 0 ? subAccess : [], |
| | | PageQuery: { |
| | | Start: '0', |
| | | Size: '1' |
| | | }, |
| | | 'Id=': [`${productId}`], |
| | | SortQuery: sort |
| | | ? [sort] |
| | | : [ |
| | | { |
| | | LinkOrder: 'Desc' |
| | | } |
| | | ], |
| | | CreateDate: [], |
| | | Description: [], |
| | | Name: [], |
| | | Icon: [], |
| | | RefCode: [], |
| | | Description:[], |
| | | TypeId: [], |
| | | SysType: [], |
| | | State: [], |
| | | Tag: [], |
| | | BeginDate: [], |
| | | EndDate: [], |
| | | ProductLinkInfo: [], |
| | | AllowDonate: [], |
| | | DonatePriceList: [], |
| | | StoreEvent: [], |
| | | SaleMethod: [], |
| | | SaleMethodValid: [], |
| | | CmsItemValid: [], |
| | | ProductCmsQuery: [subQuery], |
| | | ...fields, |
| | | ...filterList |
| | | } |
| | | if (productId) query['Id='] = [`${productId}`] |
| | | |
| | | const body = { |
| | | query: JSON.stringify({ |
| | | Query: [ |
| | | { |
| | | Q1: query |
| | | } |
| | | ] |
| | | }) |
| | | } |
| | | let token = localStorage.getItem(tokenKey) |
| | | let url = token ? '/store/api/ApiQueryProductByAppUser' : '/store/api/ApiQueryProduct' |
| | | return request({ |
| | | url: url, |
| | | method: 'post', |
| | | data: body, |
| | | cancelToken: source?.token |
| | | }) |
| | | .then((resp) => { |
| | | if (resp.length > 0) { |
| | | const data = resp[0] |
| | | if (data.datas.length) { |
| | | data.datas[0].subDatas = data.datas[0].cmsDatas |
| | | const datas = handleDetailQueryRequestData({ |
| | | item: data.datas[0], |
| | | fields, |
| | | itemFields: { |
| | | ...itemFields, |
| | | ...linkFields |
| | | }, |
| | | path, |
| | | coverSize, |
| | | handelEBooK, |
| | | |
| | | }) |
| | | return { |
| | | datas, |
| | | total: data.totalCount |
| | | } |
| | | } else { |
| | | return { |
| | | datas: [], |
| | | total: 0 |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | datas: [], |
| | | total: 0 |
| | | } |
| | | }) |
| | | }, |
| | | // 获取优惠券列表 |
| | | getChannelPromoteCodeList(data) { |
| | | return request({ |
| | | url: "/store/api/ApiGetChannelPromoteCodeList", |
| | | method: "post", |
| | | url: '/store/api/ApiGetChannelPromoteCodeList', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 获取用户已领取的优惠券列表 |
| | | getPromoteCodeList(data) { |
| | | return request({ |
| | | url: "/store/api/ApiGetPromoteCodeList", |
| | | method: "post", |
| | | url: '/store/api/ApiGetPromoteCodeList', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 获取用户浏览排行 |
| | | getProductViewRank(data) { |
| | | return request({ |
| | | url: "/store/api/ApiGetProductViewRank", |
| | | method: "post", |
| | | url: '/store/api/ApiGetProductViewRank', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 获取用户销售排行 |
| | | getProductSaleRank(data) { |
| | | return request({ |
| | | url: "/store/api/ApiGetProductSaleRank", |
| | | method: "post", |
| | | url: '/store/api/ApiGetProductSaleRank', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 获取商品可用优惠券 |
| | | getProductPromoteCodeList(data) { |
| | | return request({ |
| | | url: "/store/api/ApiGetProductPromoteCodeList", |
| | | method: "post", |
| | | url: '/store/api/ApiGetProductPromoteCodeList', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 获取订单可用优惠券 |
| | | getOrderPromoteCodeList(data) { |
| | | return request({ |
| | | url: "/store/api/GetOrderPromoteCodeList", |
| | | method: "post", |
| | | url: '/store/api/GetOrderPromoteCodeList', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 获取销售方式可用优惠券 |
| | | getSaleMethodPromoteCodeList(data) { |
| | | return request({ |
| | | url: "/store/api/GetSaleMethodPromoteCodeList", |
| | | method: "post", |
| | | url: '/store/api/GetSaleMethodPromoteCodeList', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 领取优惠卷 |
| | | getPromoteCode(data) { |
| | | return request({ |
| | | url: "/store/api/ApiGetPromoteCode", |
| | | method: "post", |
| | | url: '/store/api/ApiGetPromoteCode', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 为订单使用优惠券 |
| | | updateOrderPromoteCode(data) { |
| | | return request({ |
| | | url: "/store/api/UpdateOrderPromoteCode", |
| | | method: "post", |
| | | url: '/store/api/UpdateOrderPromoteCode', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 为销售方式使用优惠券 |
| | | updateSaleMethodPromoteCode(data) { |
| | | return request({ |
| | | url: "/store/api/UpdateSaleMethodPromoteCode", |
| | | method: "post", |
| | | url: '/store/api/UpdateSaleMethodPromoteCode', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 通过订单号获取订单 |
| | | getOrderByOrderNum(data) { |
| | | return request({ |
| | | url: "/store/api/GetOrderByOrderNum", |
| | | method: "post", |
| | | url: '/store/api/GetOrderByOrderNum', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 创建订单 |
| | | initOrder(data) { |
| | | return request({ |
| | | url: "/store/api/InitOrder", |
| | | method: "post", |
| | | url: '/store/api/InitOrder', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 确认订单 |
| | | confirmOrder(data) { |
| | | return request({ |
| | | url: "/store/api/ConfirmOrder", |
| | | method: "post", |
| | | url: '/store/api/ConfirmOrder', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 取消订单 |
| | | cancelOrder(data) { |
| | | return request({ |
| | | url: "/store/api/CancelOrder", |
| | | method: "post", |
| | | url: '/store/api/CancelOrder', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 赞赏 |
| | | CreateDonateOrder(data) { |
| | | return request({ |
| | | url: "/store/api/CreateDonateOrder", |
| | | method: "post", |
| | | url: '/store/api/CreateDonateOrder', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | //获取用户订单列表 |
| | | getUserOrderList(data) { |
| | | return request({ |
| | | url: "/store/api/GetUserOrderList", |
| | | method: "post", |
| | | url: '/store/api/GetUserOrderList', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | //获取频道下的列表 |
| | | getStoreChannelList(data) { |
| | | return request({ |
| | | url: "/store/api/ApiGetStoreChannelList", |
| | | method: "post", |
| | | url: '/store/api/ApiGetStoreChannelList', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | //获取购物车 |
| | | getShoppingCartProductList(data) { |
| | | return request({ |
| | | url: "/store/api/ApiGetShoppingCartProductList", |
| | | method: "post", |
| | | url: '/store/api/ApiGetShoppingCartProductList', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | //添加到购物车 |
| | | addShoppingCart(data) { |
| | | return request({ |
| | | url: "/store/api/ApiAddShoppingCart", |
| | | method: "post", |
| | | url: '/store/api/ApiAddShoppingCart', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | //购物车删除商品 |
| | | delShoppingCart(data) { |
| | | return request({ |
| | | url: "/store/api/ApiDelShoppingCart", |
| | | method: "post", |
| | | url: '/store/api/ApiDelShoppingCart', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | //从购物车创建订单 |
| | | shoppingCartCreateOrder(data) { |
| | | return request({ |
| | | url: "/store/api/ApiShoppingCartCreateOrder", |
| | | method: "post", |
| | | url: '/store/api/ApiShoppingCartCreateOrder', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | //获取已购买的商品列表 |
| | | getPurchasedProductList(data) { |
| | | return request({ |
| | | url: "/store/api/ApiGetPurchasedProductList", |
| | | method: "post", |
| | | url: '/store/api/ApiGetPurchasedProductList', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | //调取微信支付 |
| | | makeWeChatPay(data) { |
| | | return request({ |
| | | url: "/store/api/MakeWeChatPay", |
| | | method: "post", |
| | | url: '/store/api/MakeWeChatPay', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | //调取微信二维码支付 |
| | | makeWeChatQrPay(data) { |
| | | return request({ |
| | | url: "/store/api/MakeWeChatQrPay", |
| | | method: "post", |
| | | url: '/store/api/MakeWeChatQrPay', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 获取激活码详情 |
| | | getActiveCode(data) { |
| | | return request({ |
| | | url: "/store/api/ApiGetActiveCode", |
| | | method: "post", |
| | | url: '/store/api/ApiGetActiveCode', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 使用激活码 |
| | | userActiveCode(data) { |
| | | return request({ |
| | | url: "/store/api/ApiUseActiveCode", |
| | | method: "post", |
| | | url: '/store/api/ApiUseActiveCode', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | // 使用激活码使用记录 |
| | | userActiveCodeList(data) { |
| | | return request({ |
| | | url: '/store/api/ApiGetUsedActiveCodeList', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 商品查询类型字段接口 |
| | | getProductTypeField(data) { |
| | | return request({ |
| | | url: "/store/api/ApiGetProductTypeField", |
| | | method: "post", |
| | | url: '/store/api/ApiGetProductTypeField', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | // 收藏或加入书架 |
| | | addProductLink(data) { |
| | | return request({ |
| | | url: '/store/api/ApiAddProductLink', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 取消收藏或移除书架 |
| | | delProductLink(data) { |
| | | return request({ |
| | | url: "/store/api/ApiDelProductLink", |
| | | method: "post", |
| | | url: '/store/api/ApiDelProductLink', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | //收藏商品 |
| | | productLink(data) { |
| | | //购买免费商品 |
| | | MakeFreeOrderPay(data) { |
| | | return request({ |
| | | url: "/store/api/ApiAddProductLink", |
| | | method: "post", |
| | | url: '/store/api/MakeFreeOrderPay', |
| | | method: 'post', |
| | | data |
| | | }); |
| | | } |
| | | }; |
| | | }) |
| | | }, |
| | | |
| | | export default storeApi; |
| | | // 申请订单开票 |
| | | requestOrderInvoice(data) { |
| | | return request({ |
| | | url: '/store/api/RequestOrderInvoice', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 获取用户钱包 |
| | | getUserWallet(data) { |
| | | return request({ |
| | | url: '/store/api/GetWallet', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | // 获取用户钱包记录 |
| | | getWalletHistory(data) { |
| | | return request({ |
| | | url: '/store/api/GetWalletHistory', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | // 通过钱包自动购买 |
| | | autoPayWithWallet(data) { |
| | | return request({ |
| | | url: '/store/api/AutoPayWithWallet', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | // 查询商品所在Store |
| | | getProductStore(data) { |
| | | return request({ |
| | | url: '/store/api/ApiGetProductStore', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | //根据销售方式查询商品信息 |
| | | getProductBySaleMethod(data) { |
| | | return request({ |
| | | url: '/store/api/ApiGetProductBySaleMethod', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | } |
| | | |
| | | export default storeApi |
| | |
| | | import request from "@/plugin/axios"; |
| | | import { tokenKey } from "@/assets/js/config"; |
| | | import toolClass from "@/assets/js/toolClass"; |
| | | import request from "@/plugin/axios/index.ts"; |
| | | import { tokenKey } from "@/assets/js/config.js"; |
| | | import toolClass from "@/assets/js/toolClass.js"; |
| | | const ugcApi = { |
| | | // 获取商品点赞Topic |
| | | getProductLikesTopic(data) { |
| | | return request({ |
| | | url: toolClass.getCookie(tokenKey) |
| | | url: localStorage.getItem(tokenKey) |
| | | ? "/ugc/api/ApiAppUserGetProductLikesTopic" |
| | | : "/ugc/api/ApiGetProductLikesTopic", |
| | | method: "post", |
| | |
| | | // 获取商品评论Topic |
| | | getProductCommentTopic(data) { |
| | | return request({ |
| | | url: toolClass.getCookie(tokenKey) |
| | | url: localStorage.getItem(tokenKey) |
| | | ? "/ugc/api/ApiAppUserGetProductCommentTopic" |
| | | : "/ugc/api/ApiGetProductCommentTopic", |
| | | method: "post", |
| | |
| | | // 获取MessageList |
| | | getTopicMessageList(data) { |
| | | return request({ |
| | | url: toolClass.getCookie(tokenKey) |
| | | url: localStorage.getItem(tokenKey) |
| | | ? "/ugc/api/ApiAppUserGetTopicMessageList" |
| | | : "/ugc/api/ApiGetTopicMessageList", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | // 用户根据消息类型获取列表 |
| | | getMessageList(data) { |
| | | return request({ |
| | | url: "/ugc/api/ApiGetMessageList", |
| | | method: "post", |
| | | data, |
| | | }); |
| | |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 更新message |
| | | updateTopicMessage(data) { |
| | | return request({ |
| | | url:'/ugc/api/ApiUpdateTopicMessage', |
| | | method:'post', |
| | | data |
| | | }) |
| | | }, |
| | | // 获取cms评论 |
| | | getCmsItemCommentTopic(data) { |
| | | return request({ |
| | |
| | | data, |
| | | }); |
| | | }, |
| | | //更新TOPICMESSAGE |
| | | updateTopicMessage(data) { |
| | | // 获取用户提交的教学资源 |
| | | getProductUserSubmitTopic(data) { |
| | | return request({ |
| | | url: "/ugc/api/ApiUpdateTopicMessage", |
| | | url: "/ugc/api/ApiGetProductUserSubmitTopic", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | //更新TOPICMESSAGE |
| | | // updateTopicMessage(data) { |
| | | // return request({ |
| | | // url: "/ugc/api/ApiUpdateTopicMessage", |
| | | // method: "post", |
| | | // data, |
| | | // }); |
| | | // }, |
| | | }; |
| | | |
| | | export default ugcApi; |
| | |
| | | import { requestCtx } from "@/assets/js/config"; |
| | | import moment from "moment"; |
| | | import { requestCtx, appId } from '@/assets/js/config.js' |
| | | // import defaultImg from '@/assets/images/default-book-img.png' |
| | | // import defaultBookFair from '@/assets/images/default-bookFair.png' |
| | | // import bookCover from '@/assets/images/book-cover.png' |
| | | // import defaultPub from '@/assets/images/math/default-pub.png' |
| | | // import defaultAudio from '@/assets/images/math/default-audio.png' |
| | | import moment from 'moment' |
| | | // 处理列表查询结果 |
| | | export function handleQueryResourceListData({ |
| | | datas, |
| | |
| | | storeInfo, |
| | | repositoryInfo, |
| | | coverSize, |
| | | handelEBooK |
| | | }) { |
| | | |
| | | const dataList = []; |
| | | const dataList = [] |
| | | for (let i = 0; i < datas.length; i++) { |
| | | const item = datas[i]; |
| | | const item = datas[i] |
| | | // 处理字段 |
| | | const _fields = {}; |
| | | const _fields = {} |
| | | if (fields != null) { |
| | | for (let fieldKey in fields) { |
| | | if (item.datas[fieldKey]) { |
| | | const values = JSON.parse(item.datas[fieldKey]); |
| | | const values = JSON.parse(item.datas[fieldKey]) |
| | | if (values.length > 0) { |
| | | // 用字段名处理返回的字段值 |
| | | if (values[0].Value) { |
| | | _fields[fieldKey] = values[0].Value; |
| | | _fields[fieldKey] = values[0].Value |
| | | } else if (values[0].Data) { |
| | | _fields[fieldKey] = values[0].Data.Value; |
| | | _fields[fieldKey] = values[0].Data.Value |
| | | } |
| | | item.datas[fieldKey] = values[0]; |
| | | item.datas[fieldKey] = values[0] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | const subDatas = {}; |
| | | const subDatas = {} |
| | | if (item.subDatas) { |
| | | for (let subData of item.subDatas) { |
| | | const tag = subData.queryTag.replace("Query", ""); |
| | | subDatas[tag] = subData.datas; |
| | | const tag = subData.queryTag.replace('Query', '') |
| | | subDatas[tag] = subData.datas |
| | | } |
| | | } |
| | | |
| | |
| | | ...item, |
| | | id: item.id, |
| | | name: item.datas.Name, |
| | | icon: getPublicImage( |
| | | item.datas.Icon, |
| | | coverSize?.width, |
| | | coverSize?.height |
| | | ), |
| | | icon: getPublicImage(item.datas.Icon, coverSize?.width, coverSize?.height, storeInfo), |
| | | repositoryInfo: repositoryInfo, |
| | | refCode: item.datas.RefCode === "[]" ? null : item.datas.RefCode, |
| | | refCode: item.datas.RefCode === '[]' ? null : item.datas.RefCode, |
| | | state: item.datas.State, |
| | | type: item.datas.Type, |
| | | tag: item.datas.Tag, |
| | | creator: item.datas.Creator ? JSON.parse(item.datas.Creator) : undefined, |
| | | storeInfo: storeInfo, |
| | | linkType: item.datas.LinkType, |
| | | childrenCount: parseInt(item.datas.ChildrenCount ?? "0"), |
| | | childrenFolderCount: parseInt(item.datas.ChildrenFolderCount ?? "0"), |
| | | childrenChannelCount: parseInt(item.datas.ChildrenChannelCount ?? "0"), |
| | | createDate: moment(item.datas.CreateDate).format("YYYY-MM-DD"), |
| | | beginDate: moment(item.datas.BeginDate).format("YYYY-MM-DD"), |
| | | endDate: moment(item.datas.EndDate).format("YYYY-MM-DD"), |
| | | childrenCount: parseInt(item.datas.ChildrenCount ?? '0'), |
| | | childrenFolderCount: parseInt(item.datas.ChildrenFolderCount ?? '0'), |
| | | childrenChannelCount: parseInt(item.datas.ChildrenChannelCount ?? '0'), |
| | | createDate: moment(item.datas.CreateDate).format('YYYY-MM-DD'), |
| | | beginDate: moment(item.datas.BeginDate).format('YYYY-MM-DD'), |
| | | endDate: moment(item.datas.EndDate).format('YYYY-MM-DD'), |
| | | description: item.datas.Description, |
| | | sysType: item.datas.SysType, |
| | | idPath: path + "\\" + item.id, |
| | | idPath: path + '\\' + item.id, |
| | | typeId: parseInt(item.datas.TypeId), |
| | | linkFile: JSON.parse(item.datas.LinkFile ?? "[]"), |
| | | linkFile: JSON.parse(item.datas.LinkFile ?? '[]'), |
| | | cmsItemType: item.datas.CmsItemType, |
| | | allowDonate: item.datas.AllowDonate == "True", |
| | | allowDonate: item.datas.AllowDonate == 'True', |
| | | // donatePriceList: JSON.parse(item.datas.DonatePriceList ?? "[]"), |
| | | productLinkInfo: JSON.parse(item.datas.ProductLinkInfo ?? "[]"), |
| | | storeEvent: JSON.parse(item.datas.StoreEvent ?? "[]"), |
| | | linkInfo: JSON.parse(item.datas.LinkInfo ?? "[]"), |
| | | saleMethod: JSON.parse(item.datas.SaleMethod ?? "[]"), |
| | | productLinkInfo: item.datas.ProductLinkInfo ?? '[]', |
| | | storeEvent: JSON.parse(item.datas.StoreEvent ?? '[]'), |
| | | linkInfo: JSON.parse(item.datas.LinkInfo ?? '[]'), |
| | | saleMethod: JSON.parse(item.datas.SaleMethod ?? '[]'), |
| | | subProductCount: parseInt(item.datas.SubProductCount), |
| | | ..._fields, |
| | | datas: item.datas, |
| | | subDatas, |
| | | }; |
| | | subDatas |
| | | } |
| | | |
| | | // 统一处理价格 |
| | | if (obj.defaultSaleMethod) { |
| | | if (handelEBooK) { |
| | | // 获取随书资源的销售方式 |
| | | let saleMethod = [] |
| | | try { |
| | | saleMethod = obj.cmsDatas[0].datas.find( |
| | | (item) => item.datas.RefCode == 'tourism_accompanyingResources' |
| | | ).datas.SaleMethod |
| | | saleMethod = JSON.parse(saleMethod) |
| | | } catch (error) { |
| | | saleMethod = [] |
| | | } |
| | | if (saleMethod.length) { |
| | | Object.keys(saleMethod[0]).map((key) => { |
| | | let newKey = key.replace(key[0], key[0].toLowerCase()) |
| | | saleMethod[0][newKey] = saleMethod[0][key] |
| | | delete saleMethod[0][key] |
| | | }) |
| | | obj.defaultSaleMethod = saleMethod[0] |
| | | obj.defaultSaleMethodId = saleMethod[0].id |
| | | obj.alreadyBuy = obj.purchasedSaleMethodIdList.indexOf(obj.defaultSaleMethodId) > -1 |
| | | } |
| | | } |
| | | if (obj.defaultSaleMethod.allowEvent && obj.storeEvent.length) { |
| | | // 已参加活动,获取有效活动并计算价格 |
| | | let time = new Date().getTime(); |
| | | let time = new Date().getTime() |
| | | // 过滤过期活动 |
| | | let event = obj.storeEvent.filter((item) => { |
| | | let endTime = new Date(item.EndDate).getTime(); |
| | | return endTime > time; |
| | | }); |
| | | let endTime = new Date(item.EndDate).getTime() |
| | | return endTime > time |
| | | }) |
| | | |
| | | // 只处理一条有效活动 |
| | | if (event.length) { |
| | | obj.price = (obj.defaultSaleMethod.price * event[0].Value).toFixed(2); |
| | | obj.oldPrice = obj.defaultSaleMethod.price; |
| | | obj.storeEventId = event[0].Id; |
| | | obj.price = (obj.defaultSaleMethod.price * event[0].Value).toFixed(2) |
| | | obj.oldPrice = obj.defaultSaleMethod.price |
| | | obj.storeEventId = event[0].Id |
| | | if ( |
| | | moment().format('YYYY-MM-DD') < |
| | | moment(obj.defaultSaleMethod.endDate).format('YYYY-MM-DD') |
| | | ) { |
| | | obj.defaultSaleMethodState = 'Normal' |
| | | } else { |
| | | obj.defaultSaleMethodState = 'Beyond' |
| | | } |
| | | } |
| | | } else { |
| | | obj.price = obj.defaultSaleMethod.price; |
| | | obj.oldPrice = obj.defaultSaleMethod.virtualPrice; |
| | | if ( |
| | | moment().format('YYYY-MM-DD') < moment(obj.defaultSaleMethod.endDate).format('YYYY-MM-DD') |
| | | ) { |
| | | obj.defaultSaleMethodState = 'Normal' |
| | | } else { |
| | | obj.defaultSaleMethodState = 'Beyond' |
| | | } |
| | | obj.price = obj.defaultSaleMethod.price |
| | | obj.oldPrice = obj.defaultSaleMethod.virtualPrice |
| | | } |
| | | } |
| | | dataList.push(obj); |
| | | dataList.push(obj) |
| | | } |
| | | return dataList; |
| | | return dataList |
| | | } |
| | | |
| | | // 处理详情查询结果 |
| | |
| | | path, |
| | | coverSize, |
| | | itemFields, |
| | | handelEBooK, |
| | | }) { |
| | | item.fileMap = {}; |
| | | let itemFieldsData = []; |
| | | for (const key in itemFields) { |
| | | itemFieldsData.push(key); |
| | |
| | | if (datas.length > 0) { |
| | | if (datas[0].Value) { |
| | | item[field] = datas[0].Value; |
| | | if (datas[0].Data.FileLinkList && datas[0].Data.FileLinkList.length) { |
| | | item.fileMap = { |
| | | ...item.fileMap, |
| | | ...handleLinkFileInfo( |
| | | datas[0].Data.FileLinkList.map((item) => { |
| | | return { |
| | | ...item.File, |
| | | ...item, |
| | | }; |
| | | }) |
| | | ), |
| | | }; |
| | | } |
| | | } else if (datas[0].Data) { |
| | | item[field] = datas[0].Data.Value; |
| | | if (datas[0].Data.FileLinkList && datas[0].Data.FileLinkList.length) { |
| | | item.fileMap = { |
| | | ...item.fileMap, |
| | | ...handleLinkFileInfo( |
| | | datas[0].Data.FileLinkList.map((item) => { |
| | | return { |
| | | ...item.File, |
| | | ...item, |
| | | }; |
| | | }) |
| | | ), |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | for (const sdata of subDatas) { |
| | | const tag = sdata.queryTag; |
| | | for (const subItem of sdata.datas) { |
| | | convertCmsItemBase(subItem, coverSize); |
| | | convertCmsItemBase(subItem, coverSize, handelEBooK); |
| | | subItem.fileMap = {}; |
| | | for (let i = 0; i < itemFieldsData.length; i++) { |
| | | const itemField = itemFieldsData[i]; |
| | |
| | | if (itemDatas.length > 0) { |
| | | if (itemDatas[0].Value) { |
| | | subItem[itemField] = itemDatas[0].Value; |
| | | if ( |
| | | itemDatas[0].FileList && |
| | | itemDatas[0].FileList.length |
| | | ) { |
| | | if (itemDatas[0].FileList && itemDatas[0].FileList.length) { |
| | | subItem.fileMap = { |
| | | ...subItem.fileMap, |
| | | ...handleLinkFileInfo(itemDatas[0].FileList), |
| | |
| | | } |
| | | } |
| | | } |
| | | if (subItem.productLinkInfo && subItem.productLinkInfo.length) |
| | | if (subItem.productLinkInfo && subItem.productLinkInfo.length) { |
| | | let itemProductLinkInfo = subItem.productLinkInfo.find(citem => citem.Name == item.datas.Name) |
| | | subItem.productLinkPath = |
| | | subItem.productLinkInfo[0].LinkPath + |
| | | itemProductLinkInfo.LinkPath + |
| | | "\\" + |
| | | subItem.productLinkInfo[0].CmsItemId; |
| | | itemProductLinkInfo.CmsItemId; |
| | | } |
| | | if (subItem.linkInfo && subItem.linkInfo.length) |
| | | subItem.linkPath = |
| | | subItem.linkInfo[0].LinkPath + "\\" + subItem.linkInfo[0].CmsItemId; |
| | |
| | | linkItemsMap[tag] = sdata.datas; |
| | | } |
| | | } |
| | | convertCmsItemBase(item, coverSize); |
| | | convertCmsItemBase(item, coverSize, handelEBooK); |
| | | item.idPath = path + "\\" + item.id; |
| | | item.subItems = linkItemsMap; |
| | | return item; |
| | | } |
| | | |
| | | const handleLinkFileInfo = (linkList) => { |
| | | let linkFileMap = {}; |
| | | let linkFileMap = {} |
| | | for (let z = 0; z < linkList.length; z++) { |
| | | const linkItem = linkList[z]; |
| | | const linkItem = linkList[z] |
| | | linkFileMap[linkItem.Md5] = { |
| | | linkType: linkItem.LinkType, |
| | | extension: linkItem.Extension, |
| | |
| | | md5: linkItem.Md5, |
| | | icon: linkItem.Icon, |
| | | size: linkItem.Size, |
| | | metaData: JSON.parse(linkItem.MetaData ?? "{}"), |
| | | // metaData: JSON.parse(linkItem.MetaData ?? "{}"), |
| | | order: linkItem.Order, |
| | | protectType: linkItem.ProtectType |
| | | }; |
| | | } |
| | | return linkFileMap; |
| | | }; |
| | | |
| | | const convertCmsItemBase = (item, coverSize) => { |
| | | item.name = item.datas.Name; |
| | | item.description = item.datas.Description; |
| | | item.refCode = item.datas.RefCode; |
| | | item.state = item.datas.State; |
| | | item.type = item.datas.Type; |
| | | item.tag = item.datas.Tag; |
| | | item.typeId = parseInt(item.datas.TypeId); |
| | | item.icon = getPublicImage( |
| | | item.datas.Icon, |
| | | coverSize?.width, |
| | | coverSize?.height |
| | | ); |
| | | item.sysType = item.datas.SysType; |
| | | item.linkFile = JSON.parse(item.datas.LinkFile ?? "[]"); |
| | | item.linkType = item.datas.LinkType; |
| | | item.linkAppId = parseInt(item.datas.LinkAppId); |
| | | item.linkStoreId = parseInt(item.datas.LinkStore); |
| | | item.linkRepoId = item.datas.LinkRepository; |
| | | item.childrenCount = parseInt(item.datas.ChildrenCount ?? "0"); |
| | | item.linkId = parseInt(item.datas.LinkId); |
| | | item.linkOrg = JSON.parse(item.datas.LinkOrg ?? "[]")[0]; |
| | | item.linkDepartment = JSON.parse(item.datas.LinkDepartment ?? "[]")[0]; |
| | | item.linkInfo = JSON.parse(item.datas.LinkInfo ?? "[]"); |
| | | item.productLinkInfo = JSON.parse(item.datas.ProductLinkInfo ?? "[]"); |
| | | item.saleMethod = JSON.parse(item.datas.SaleMethod ?? "[]"); |
| | | item.allowDonate = item.datas.AllowDonate == "True"; |
| | | // item.donatePriceList = JSON.parse(item.datas.DonatePriceList ?? "[]"); |
| | | item.beginDate = moment(item.datas.BeginDate).format("YYYY-MM-DD"); |
| | | item.endDate = moment(item.datas.EndDate).format("YYYY-MM-DD"); |
| | | item.storeEvent = JSON.parse(item.datas.StoreEvent ?? "[]"); |
| | | // 统一处理价格 |
| | | if (item.defaultSaleMethod) { |
| | | if (item.defaultSaleMethod.allowEvent && item.storeEvent.length) { |
| | | // 已参加活动,获取有效活动并计算价格 |
| | | let time = new Date().getTime(); |
| | | // 过滤过期活动 |
| | | let event = item.storeEvent.filter((item) => { |
| | | let endTime = new Date(item.EndDate).getTime(); |
| | | return endTime > time; |
| | | }); |
| | | // 只处理一条有效活动 |
| | | if (event.length) { |
| | | item.price = (item.defaultSaleMethod.price * event[0].Value).toFixed(2); |
| | | item.oldPrice = item.defaultSaleMethod.price; |
| | | item.storeEventId = event[0].Id; |
| | | } |
| | | } else { |
| | | item.price = item.defaultSaleMethod.price; |
| | | item.oldPrice = item.defaultSaleMethod.virtualPrice; |
| | | } |
| | | } |
| | | }; |
| | | return linkFileMap |
| | | } |
| | | |
| | | const convertCmsItemBase = (item, coverSize, handelEBooK) => { |
| | | item.name = item.datas.Name |
| | | item.description = item.datas.Description |
| | | item.refCode = item.datas.RefCode |
| | | item.state = item.datas.State |
| | | item.type = item.datas.Type |
| | | item.tag = item.datas.Tag |
| | | item.typeId = parseInt(item.datas.TypeId) |
| | | item.icon = getPublicImage(item.datas.Icon, coverSize?.width, coverSize?.height) |
| | | item.sysType = item.datas.SysType |
| | | item.linkFile = JSON.parse(item.datas.LinkFile ?? '[]') |
| | | item.linkType = item.datas.LinkType |
| | | item.linkAppId = parseInt(item.datas.LinkAppId) |
| | | item.linkStoreId = parseInt(item.datas.LinkStore) |
| | | item.linkRepoId = item.datas.LinkRepository |
| | | item.childrenCount = parseInt(item.datas.ChildrenCount ?? '0') |
| | | ;(item.childrenFolderCount = parseInt(item.datas.ChildrenFolderCount ?? '0')), |
| | | (item.childrenChannelCount = parseInt(item.datas.ChildrenChannelCount ?? '0')), |
| | | (item.linkId = parseInt(item.datas.LinkId)) |
| | | item.linkOrg = JSON.parse(item.datas.LinkOrg ?? '[]')[0] |
| | | item.linkDepartment = JSON.parse(item.datas.LinkDepartment ?? '[]')[0] |
| | | item.linkInfo = JSON.parse(item.datas.LinkInfo ?? '[]') |
| | | item.productLinkInfo = JSON.parse(item.datas.ProductLinkInfo ?? '[]') |
| | | item.saleMethod = JSON.parse(item.datas.SaleMethod ?? '[]') |
| | | item.allowDonate = item.datas.AllowDonate == 'True' |
| | | // item.donatePriceList = JSON.parse(item.datas.DonatePriceList ?? "[]"); |
| | | item.createDate = moment(item.datas.CreateDate).format('YYYY-MM-DD') |
| | | item.beginDate = moment(item.datas.BeginDate).format('YYYY-MM-DD') |
| | | item.endDate = moment(item.datas.EndDate).format('YYYY-MM-DD') |
| | | item.storeEvent = JSON.parse(item.datas.StoreEvent ?? '[]') |
| | | // 统一处理价格 |
| | | if (item.defaultSaleMethod) { |
| | | if (handelEBooK) { |
| | | // 获取随书资源的销售方式 |
| | | let saleMethod = item.cmsDatas[0].datas.find( |
| | | (item) => item.refCode == 'tourism_accompanyingResources' |
| | | ).saleMethod |
| | | if (saleMethod && saleMethod.length > 0) { |
| | | Object.keys(saleMethod[0]).map((key) => { |
| | | let newKey = key.replace(key[0], key[0].toLowerCase()) |
| | | saleMethod[0][newKey] = saleMethod[0][key] |
| | | delete saleMethod[0][key] |
| | | }) |
| | | item.defaultSaleMethod = saleMethod[0] |
| | | item.defaultSaleMethodId = saleMethod[0].id |
| | | item.alreadyBuy = item.purchasedSaleMethodIdList.indexOf(item.defaultSaleMethodId) > -1 |
| | | } |
| | | } |
| | | if (item.defaultSaleMethod.allowEvent && item.storeEvent.length) { |
| | | // 已参加活动,获取有效活动并计算价格 |
| | | let time = new Date().getTime() |
| | | // 过滤过期活动 |
| | | let event = item.storeEvent.filter((item) => { |
| | | let endTime = new Date(item.EndDate).getTime() |
| | | return endTime > time |
| | | }) |
| | | // 只处理一条有效活动 |
| | | if (event.length) { |
| | | item.price = (item.defaultSaleMethod.price * event[0].Value).toFixed(2) |
| | | item.oldPrice = item.defaultSaleMethod.price |
| | | if ( |
| | | moment().format('YYYY-MM-DD') < |
| | | moment(item.defaultSaleMethod.endDate).format('YYYY-MM-DD') |
| | | ) { |
| | | item.defaultSaleMethodState = 'Normal' |
| | | } else { |
| | | item.defaultSaleMethodState = 'Beyond' |
| | | } |
| | | item.storeEventId = event[0].Id |
| | | } |
| | | } else { |
| | | item.price = item.defaultSaleMethod.price |
| | | item.oldPrice = item.defaultSaleMethod.virtualPrice |
| | | if ( |
| | | moment().format('YYYY-MM-DD') < moment(item.defaultSaleMethod.endDate).format('YYYY-MM-DD') |
| | | ) { |
| | | item.defaultSaleMethodState = 'Normal' |
| | | } else { |
| | | item.defaultSaleMethodState = 'Beyond' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | export function getTopicMsgCmsItemFile(fileType, fileList) { |
| | | let obj = {} |
| | | fileType.forEach((item) => { |
| | | item.sequenceNum = item.config ? JSON.parse(item.config).uuid : '' |
| | | fileList.forEach((e) => { |
| | | if (item.sequenceNum == e.sequenceNum) { |
| | | try { |
| | | if (e.fileLinkList.length > 0) { |
| | | for (let i = 0; i < e.fileLinkList.length; i++) { |
| | | const ele = e.fileLinkList[i] |
| | | ele.name = ele.file.fileName |
| | | ele.md5 = ele.file.md5 |
| | | ele.status = 'success' |
| | | } |
| | | obj[item.typeField.refCode] = e.fileLinkList |
| | | } else { |
| | | const val = JSON.parse(e.value) |
| | | obj[item.typeField.refCode] = val |
| | | } |
| | | } catch (error) { |
| | | obj[item.typeField.refCode] = e.value |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | return obj |
| | | } |
| | | |
| | | // 获取不受保护的图片 |
| | | export function getPublicImage(md5, width, height) { |
| | | let src = null; |
| | | export function getPublicImage(md5, width, height, storeInfo) { |
| | | let src = null |
| | | if (md5) { |
| | | src = requestCtx + `/file/GetPreViewImage?md5=${md5}`; |
| | | src = requestCtx + `/file/GetPreViewImage?md5=${md5}` |
| | | } else { |
| | | return require("@/assets/images/default-book-img.png"); |
| | | if(storeInfo == `defaultGoodsStore${appId}`){ |
| | | return bookCover; |
| | | }else{ |
| | | return "" |
| | | } |
| | | } |
| | | if (width) src += `&width=${width}`; |
| | | if (height) src += `&height=${height}`; |
| | | return src; |
| | | if (width && src) src += `&width=${width}` |
| | | if (height && src) src += `&height=${height}` |
| | | return src |
| | | } |
| | |
| | | import SparkMD5 from "spark-md5"; |
| | | import SparkMD5 from 'spark-md5' |
| | | import { |
| | | getPublicImage |
| | | } from '@/assets/js/middleGround/tool.js' |
| | | import config from './config' |
| | | import moment from "moment"; |
| | | |
| | | |
| | | |
| | | |
| | | var tool = { |
| | | secondToTime(second) { |
| | | var minute = Math.floor(second / 60) |
| | | var sec = second % 60 |
| | | var time |
| | | if (second < 60) { |
| | | time = second + '"' |
| | | } else { |
| | | time = sec === 0 ? minute + "'" : minute + "'" + sec + '"' |
| | | } |
| | | return time |
| | | }, |
| | | setCookie: function (c_name, value, expiredays, path) { |
| | | var exdate = new Date(); |
| | | exdate.setDate(exdate.getDate() + expiredays); |
| | | var exdate = new Date() |
| | | exdate.setDate(exdate.getDate() + expiredays) |
| | | document.cookie = |
| | | c_name + |
| | | "=" + |
| | | '=' + |
| | | escape(value) + |
| | | (expiredays == null ? "" : ";expires=" + exdate.toGMTString()) + |
| | | (path ? ";path=" + path : ""); |
| | | (expiredays == null ? '' : ';expires=' + exdate.toGMTString()) + |
| | | (path ? ';path=' + path : '') |
| | | }, |
| | | getCookie: function (c_name) { |
| | | if (document.cookie.length > 0) { |
| | | var c_start = document.cookie.indexOf(c_name + "="); |
| | | var c_start = document.cookie.indexOf(c_name + '=') |
| | | if (c_start != -1) { |
| | | c_start = c_start + c_name.length + 1; |
| | | var c_end = document.cookie.indexOf(";", c_start); |
| | | if (c_end == -1) c_end = document.cookie.length; |
| | | return unescape(document.cookie.substring(c_start, c_end)); |
| | | c_start = c_start + c_name.length + 1 |
| | | var c_end = document.cookie.indexOf(';', c_start) |
| | | if (c_end == -1) c_end = document.cookie.length |
| | | return unescape(document.cookie.substring(c_start, c_end)) |
| | | } |
| | | } |
| | | return ""; |
| | | return '' |
| | | }, |
| | | delCookie: function (name) { |
| | | var exp = new Date(); |
| | | exp.setTime(exp.getTime() - 1); |
| | | var cval = tool.getCookie(name); |
| | | if (cval != null) |
| | | document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString(); |
| | | var exp = new Date() |
| | | exp.setTime(exp.getTime() - 1) |
| | | var cval = tool.getCookie(name) |
| | | if (cval != null) document.cookie = name + '=' + cval + ';expires=' + exp.toGMTString() |
| | | }, |
| | | // 强制保留2位小数,如:2,会在2后面补上00.即2.00 |
| | | toDecimal2(x) { |
| | | var f; |
| | | f = parseFloat(x); |
| | | var f |
| | | f = parseFloat(x) |
| | | if (isNaN(f)) { |
| | | return false; |
| | | return false |
| | | } |
| | | f = Math.round(x * 100) / 100; |
| | | var s = f.toString(); |
| | | var rs = s.indexOf("."); |
| | | f = Math.round(x * 100) / 100 |
| | | var s = f.toString() |
| | | var rs = s.indexOf('.') |
| | | if (rs < 0) { |
| | | rs = s.length; |
| | | s += "."; |
| | | rs = s.length |
| | | s += '.' |
| | | } |
| | | while (s.length <= rs + 2) { |
| | | s += "0"; |
| | | s += '0' |
| | | } |
| | | return s; |
| | | return s |
| | | }, |
| | | }; |
| | | formateTime(date) { |
| | | var newDate = new Date(+new Date(date) + 8 * 3600 * 1000) |
| | | .toISOString() |
| | | .replace(/T/g, ' ') |
| | | .replace(/\.[\d]{3}Z/, '') |
| | | var time = new Date(newDate) |
| | | return time.getTime() |
| | | } |
| | | } |
| | | |
| | | |
| | | //处理表单提交数据 |
| | | export function worksData(res) { |
| | | let arr = [] |
| | | for (let i = 0; i < res.length; i++) { |
| | | const item = res[i] |
| | | if (item.typeField) { |
| | | if (item.typeField.config) { |
| | | item.typeField.options = JSON.parse(item.typeField.config).option |
| | | } |
| | | arr.push(item.typeField) |
| | | } |
| | | } |
| | | return arr |
| | | } |
| | | |
| | | export function worksDataBytool(res, value, linkList) { |
| | | let arr = [] |
| | | let nrr = [] |
| | | if (linkList && linkList.length > 0) { |
| | | linkList.forEach((e) => |
| | | nrr.push({ |
| | | linkProtectType: e.linkProtectType, |
| | | linkType: e.linkType, |
| | | md5: e.md5 |
| | | }) |
| | | ) |
| | | } |
| | | res.forEach((item) => { |
| | | const obj = { |
| | | baseType: item.typeField.baseType, |
| | | order: 0, |
| | | typeFieldId: item.typeField.id, |
| | | sequenceNum: item.config ? JSON.parse(item.config).uuid : '', |
| | | newDataAndFileLinkListRequest: [] |
| | | } |
| | | for (let k in value) { |
| | | if (item.typeField.refCode === k) { |
| | | if (item.typeField.type == 'File') { |
| | | try { |
| | | obj.strValue = JSON.stringify(value[k].map((citem) => citem.md5)) |
| | | } catch (error) { |
| | | obj.strValue = '' |
| | | } |
| | | obj.newDataAndFileLinkListRequest = nrr |
| | | } else { |
| | | if (typeof value[k] == 'object') { |
| | | obj.strValue = JSON.stringify(value[k]) |
| | | } else { |
| | | if (obj.baseType === 'String') { |
| | | obj.strValue = value[k] + '' |
| | | } else if (obj.baseType === 'Text') { |
| | | obj.textValue = value[k] + '' |
| | | } else { |
| | | obj.strValue = value[k] + '' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // if (obj.strValue || obj.textValue) { |
| | | arr.push(obj) |
| | | // } |
| | | }) |
| | | return arr |
| | | } |
| | | |
| | | export function UpdateworksDataBytool(initData, res, value, linkList) { |
| | | let arr = [] |
| | | let newArr = [] |
| | | for (let i = 0; i < initData.length; i++) { |
| | | const ele = initData[i] |
| | | for (let j = 0; j < res.length; j++) { |
| | | const item = res[j] |
| | | if (item.sequenceNum == ele.sequenceNum) { |
| | | item.refCode = ele.typeField.refCode |
| | | } |
| | | } |
| | | } |
| | | initData.forEach((citem) => { |
| | | const updateOldData = res.find((f) => f.sequenceNum == citem.sequenceNum) |
| | | if (updateOldData) { |
| | | const obj = { |
| | | baseType: citem.typeField.baseType, |
| | | order: 0, |
| | | id: updateOldData.id, |
| | | typeFieldId: citem.typeField.id, |
| | | sequenceNum: citem.sequenceNum, |
| | | setDataAndFileLinkListRequest: [] |
| | | } |
| | | for (let k in value) { |
| | | if (citem.typeField.refCode === k) { |
| | | if (typeof value[k] == 'object' && k != 'region') { |
| | | obj.strValue = JSON.stringify(linkList) |
| | | obj.setDataAndFileLinkListRequest = linkList |
| | | } else if (typeof value[k] == 'object' && k == 'region') { |
| | | obj.strValue = value[k]?.join('/') |
| | | obj.setDataAndFileLinkListRequest = [{ |
| | | area: value[k] |
| | | }] |
| | | } else { |
| | | obj.strValue = value[k].toString() |
| | | } |
| | | } |
| | | } |
| | | if (obj.strValue) { |
| | | arr.push(obj) |
| | | } |
| | | } else { |
| | | const newObj = { |
| | | baseType: citem.typeField.baseType, |
| | | order: 0, |
| | | typeFieldId: citem.typeField.id, |
| | | sequenceNum: citem.sequenceNum, |
| | | setDataAndFileLinkListRequest: [] |
| | | } |
| | | for (let k in value) { |
| | | if (citem.typeField.refCode === k) { |
| | | if (typeof value[k] == 'object') { |
| | | newObj.strValue = JSON.stringify(linkList) |
| | | newObj.setDataAndFileLinkListRequest = linkList |
| | | } else { |
| | | newObj.strValue = value[k].toString() |
| | | } |
| | | } |
| | | } |
| | | if (newObj.strValue) { |
| | | newArr.push(newObj) |
| | | } |
| | | } |
| | | }) |
| | | return { |
| | | updateData: arr, |
| | | newData: newArr |
| | | } |
| | | } |
| | | |
| | | export function download(url) { |
| | | const iframe = document.createElement('iframe') |
| | | iframe.setAttribute('hidden', 'hidden') |
| | | document.body.appendChild(iframe) |
| | | iframe.onload = () => { |
| | | if (iframe) { |
| | | iframe.setAttribute('src', 'about:blank') |
| | | } |
| | | } |
| | | |
| | | iframe.setAttribute('src', url) |
| | | } |
| | | |
| | | /** |
| | | * 获取一个UUID |
| | |
| | | * @returns {string} |
| | | */ |
| | | export function uuid(len = 32, radix = 16) { |
| | | const chars = |
| | | "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""); |
| | | const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('') |
| | | let uuid = [], |
| | | i; |
| | | radix = radix || chars.length; |
| | | i |
| | | radix = radix || chars.length |
| | | |
| | | if (len) { |
| | | // Compact form |
| | | for (i = 0; i < len; i++) uuid[i] = chars[0 | (Math.random() * radix)]; |
| | | for (i = 0; i < len; i++) uuid[i] = chars[0 | (Math.random() * radix)] |
| | | } else { |
| | | // rfc4122, version 4 form |
| | | let r; |
| | | let r |
| | | |
| | | // rfc4122 requires these characters |
| | | uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-"; |
| | | uuid[14] = "4"; |
| | | uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-' |
| | | uuid[14] = '4' |
| | | |
| | | // Fill in random data. At i==19 set the high bits of clock sequence as |
| | | // per rfc4122, sec. 4.1.5 |
| | | for (i = 0; i < 36; i++) { |
| | | if (!uuid[i]) { |
| | | r = 0 | (Math.random() * 16); |
| | | uuid[i] = chars[i === 19 ? (r & 0x3) | 0x8 : r]; |
| | | r = 0 | (Math.random() * 16) |
| | | uuid[i] = chars[i === 19 ? (r & 0x3) | 0x8 : r] |
| | | } |
| | | } |
| | | } |
| | | |
| | | return uuid.join(""); |
| | | return uuid.join('') |
| | | } |
| | | |
| | | export function getFileMd5(file, chunkSize) { |
| | | return new Promise((resolve, reject) => { |
| | | let blobSlice = |
| | | File.prototype.slice || |
| | | File.prototype.mozSlice || |
| | | File.prototype.webkitSlice; |
| | | let chunks = Math.ceil(file.size / chunkSize); |
| | | let currentChunk = 0; |
| | | let spark = new SparkMD5.ArrayBuffer(); |
| | | let fileReader = new FileReader(); |
| | | let blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice |
| | | let chunks = Math.ceil(file.size / chunkSize) |
| | | let currentChunk = 0 |
| | | let spark = new SparkMD5.ArrayBuffer() |
| | | let fileReader = new FileReader() |
| | | fileReader.onload = function (e) { |
| | | spark.append(e.target.result); |
| | | currentChunk++; |
| | | spark.append(e.target.result) |
| | | currentChunk++ |
| | | if (currentChunk < chunks) { |
| | | loadNext(); |
| | | loadNext() |
| | | } else { |
| | | const md5 = spark.end(); |
| | | resolve(md5); |
| | | const md5 = spark.end() |
| | | resolve(md5) |
| | | } |
| | | }; |
| | | } |
| | | fileReader.onerror = function (e) { |
| | | reject(e); |
| | | }; |
| | | reject(e) |
| | | } |
| | | |
| | | function loadNext() { |
| | | let start = currentChunk * chunkSize; |
| | | let end = start + chunkSize; |
| | | let start = currentChunk * chunkSize |
| | | let end = start + chunkSize |
| | | if (end > file.size) { |
| | | end = file.size; |
| | | end = file.size |
| | | } |
| | | fileReader.readAsArrayBuffer(blobSlice.call(file, start, end)); |
| | | fileReader.readAsArrayBuffer(blobSlice.call(file, start, end)) |
| | | } |
| | | loadNext(); |
| | | }); |
| | | loadNext() |
| | | }) |
| | | } |
| | | |
| | | export function worksDataBytool(res, value, linkList) { |
| | | let arr = []; |
| | | res.forEach((item) => { |
| | | const obj = { |
| | | baseType: item.typeField.baseType, |
| | | order: 0, |
| | | typeFieldId: item.typeField.id, |
| | | sequenceNum: item.config ? JSON.parse(item.config).uuid : "", |
| | | newDataAndFileLinkListRequest: [], |
| | | }; |
| | | for (let k in value) { |
| | | if (item.typeField.refCode === k) { |
| | | if (typeof value[k] == "object") { |
| | | obj.strValue = JSON.stringify(value[k]); |
| | | obj.newDataAndFileLinkListRequest = linkList; |
| | | } else { |
| | | obj.strValue = value[k]; |
| | | // 获取文件 |
| | | export function getPublicFile(md5, isToken) { |
| | | const { |
| | | tokenKey, |
| | | requestCtx |
| | | } = config |
| | | let src = null |
| | | let token = localStorage.getItem(tokenKey) |
| | | if (md5) { |
| | | if (isToken) { |
| | | src = requestCtx + `/file/api/ApiDownloadForAuthorize?md5=${md5}&token=${token}` |
| | | } else { |
| | | src = requestCtx + `/file/api/ApiDownload?md5=${md5}` |
| | | } |
| | | } else { |
| | | return '' |
| | | } |
| | | return src |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | export const handleCmsItemListRequestData = (datas, fields, path, storeId, repositoryId) => { |
| | | const dataList = []; |
| | | for (let i = 0; i < datas.length; i++) { |
| | | const item = datas[i]; |
| | | const _fields = {}; |
| | | const _datas = []; |
| | | if (fields != null) { |
| | | for (let fieldKey in fields) { |
| | | // 兼容筛选条件的字段值获取,因为后台筛选和取值只能传一个,都会返回值 |
| | | fieldKey = fieldKey.replace(/[!=<>*]/g, ''); |
| | | if (item.datas[fieldKey]) { |
| | | let values = []; |
| | | if (typeof item.datas[fieldKey] == 'string') { |
| | | values = JSON.parse(item.datas[fieldKey]); |
| | | } else { |
| | | values = item.datas[fieldKey]; |
| | | } |
| | | if (values ?.length > 0) { |
| | | // 用字段名处理返回的字段值 |
| | | if (values[0].Value) { |
| | | _fields[fieldKey] = values[0].Value; |
| | | values[0].sequenceNum = values[0].SequenceNum; |
| | | } |
| | | // 兼容处理数据返回的key是CmsItemData |
| | | // if (values[0].CmsItemData) { |
| | | // _fields[fieldKey] = values[0].CmsItemData.Value; |
| | | // values[0].sequenceNum = values[0].CmsItemData.SequenceNum; |
| | | // } |
| | | |
| | | item.datas[fieldKey] = values[0]; |
| | | if (values ?.length > 1) { |
| | | const isFile = values.find((citem) => citem.FileList ?.length > 0); |
| | | const dataItems = deduplicateArray(values, 'FieldId'); |
| | | if (!isFile) { |
| | | _datas.push(dataItems[0]); |
| | | } else { |
| | | const customFile = { |
| | | customFileList: values, |
| | | name: fieldKey, |
| | | md5: _fields[fieldKey], |
| | | FieldId: values[0].FieldId, |
| | | SequenceNum: values[0].SequenceNum |
| | | }; |
| | | _datas.push(customFile); |
| | | } |
| | | } else { |
| | | _datas.push(values[0]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (obj.strValue) { |
| | | arr.push(obj); |
| | | } |
| | | }); |
| | | return arr; |
| | | } |
| | | |
| | | export function resultsBytool(res, value) { |
| | | let obj = {}; |
| | | res.forEach((item, i) => { |
| | | item.sequenceNum = item.config ? JSON.parse(item.config).uuid : ""; |
| | | value.forEach((e) => { |
| | | if (item.sequenceNum == e.sequenceNum) { |
| | | try { |
| | | const val = JSON.parse(e.value); |
| | | obj[item.typeField.refCode] = val; |
| | | } catch (error) { |
| | | obj[item.typeField.refCode] = e.value; |
| | | } |
| | | if (item.datas.LogQuery) { |
| | | item.datas.LogQuery = JSON.parse(item.datas.LogQuery); |
| | | } |
| | | |
| | | const subDatas = {}; |
| | | if (item.subDatas) { |
| | | for (let subData of item.subDatas) { |
| | | const tag = subData.queryTag.replace('Query', ''); |
| | | subDatas[tag] = subData.datas; |
| | | } |
| | | } |
| | | dataList.push({ |
| | | ...item, |
| | | id: item.id, |
| | | name: item.datas.Name ? item.datas.Name : item.name, |
| | | icon: item.datas.Icon, |
| | | storeId: storeId, |
| | | repositoryId: repositoryId, |
| | | refCode: item.datas.RefCode === '[]' ? null : item.datas.RefCode, |
| | | state: item.datas.State, |
| | | type: item.datas.Type, |
| | | tag: item.datas.Tag, |
| | | creator: item.datas.Creator ? JSON.parse(item.datas.Creator) : undefined, |
| | | linkType: item.datas.LinkType, |
| | | childrenCount: parseInt(item.datas.ChildrenCount ?? '0'), |
| | | childrenFolderCount: parseInt(item.datas.ChildrenFolderCount ?? '0'), |
| | | childrenChannelCount: parseInt(item.datas.ChildrenChannelCount ?? '0'), |
| | | childrenCmsItemCount: parseInt(item.datas.ChildrenCmsItemCount ?? '0'), |
| | | childrenFileCount: parseInt(item.datas.ChildrenFileCount ?? '0'), |
| | | createDate: moment(item.datas.CreateDate).format('YYYY-MM-DD HH:mm:ss'), |
| | | description: item.datas.Description, |
| | | sysType: item.datas.SysType, |
| | | idPath: path + '\\' + item.id, |
| | | typeId: parseInt(item.datas.TypeId), |
| | | linkAppId: item.datas.linkAppId, |
| | | linkFile: JSON.parse(item.datas.LinkFile ?? '[]'), |
| | | PublishInfo: JSON.parse(item.datas.PublishInfo ?? '[]'), |
| | | linkInfo: item.datas.LinkInfo ? JSON.parse(item.datas.LinkInfo) : [], |
| | | linkPath: item.datas.LinkPath ?? null, |
| | | linkOrg: item.datas.LinkOrg ? JSON.parse(item.datas.LinkOrg) : [], |
| | | linkDepartment: item.datas.LinkDepartment? JSON.parse(item.datas.LinkDepartment) : [], |
| | | ..._fields, |
| | | datas: item.datas, |
| | | fieldList: _datas, |
| | | subDatas |
| | | }); |
| | | }); |
| | | return obj; |
| | | } |
| | | } |
| | | return dataList; |
| | | }; |
| | | |
| | | export function UpdateworksDataBytool(initData, res, value, linkList) { |
| | | let arr = []; |
| | | for (let i = 0; i < initData.length; i++) { |
| | | const ele = initData[i]; |
| | | for (let j = 0; j < res.length; j++) { |
| | | const item = res[j]; |
| | | if (item.sequenceNum == ele.sequenceNum) { |
| | | item.refCode = ele.typeField.refCode; |
| | | // type结构处理 |
| | | export const handleTypeList = (list) => { |
| | | for (let i = 0; i < list.length; i++) { |
| | | const type = list[i]; |
| | | try { |
| | | type.cfg = JSON.parse(type.config); |
| | | } catch (error) { |
| | | type.cfg = null; |
| | | } |
| | | const fieldRefcodeMap = {}; |
| | | const tableHeaderFieldList = []; |
| | | const isSearchFieldList = []; |
| | | const isAdvSearchFieldList = []; |
| | | const isFilterFieldList = []; |
| | | handleType({ |
| | | typeFieldList: type.typeLinkList, |
| | | fieldRefcodeMap, |
| | | tableHeaderFieldList, |
| | | isSearchFieldList, |
| | | isAdvSearchFieldList, |
| | | isFilterFieldList |
| | | }); |
| | | type.fieldRefcodeMap = fieldRefcodeMap; |
| | | type.tableHeaderFieldList = tableHeaderFieldList; |
| | | type.isSearchFieldList = isSearchFieldList; |
| | | type.isAdvSearchFieldList = isAdvSearchFieldList; |
| | | type.isFilterFieldList = isFilterFieldList; |
| | | } |
| | | |
| | | return list; |
| | | }; |
| | | |
| | | const handleType = ({ |
| | | typeFieldList, |
| | | fieldRefcodeMap, |
| | | tableHeaderFieldList, |
| | | isSearchFieldList, |
| | | isAdvSearchFieldList, |
| | | isFilterFieldList |
| | | }) => { |
| | | for (let i = 0; i < typeFieldList.length; i++) { |
| | | const item = typeFieldList[i]; |
| | | try { |
| | | item.cfg = JSON.parse(item.config); |
| | | } catch (error) { |
| | | item.cfg = null; |
| | | } |
| | | if (item.typeField) { |
| | | try { |
| | | item.typeField.cfg = JSON.parse(item.typeField.config); |
| | | } catch (error) { |
| | | item.typeField.cfg = null; |
| | | } |
| | | fieldRefcodeMap[item.typeField.refCode] = item; |
| | | } |
| | | if (item.cfg && item.cfg.isColHeader) { |
| | | tableHeaderFieldList.push(item); |
| | | } |
| | | if (item.cfg && item.cfg.isSearch) { |
| | | isSearchFieldList.push(item); |
| | | } |
| | | if (item.cfg && item.cfg.isAdvSearch) { |
| | | isAdvSearchFieldList.push(item); |
| | | } |
| | | if (item.cfg && item.cfg.isFilter) { |
| | | isFilterFieldList.push(item); |
| | | } |
| | | if (item.children && item.children.length) { |
| | | handleType({ |
| | | typeFieldList: item.children, |
| | | fieldRefcodeMap, |
| | | tableHeaderFieldList, |
| | | isSearchFieldList, |
| | | isAdvSearchFieldList, |
| | | isFilterFieldList |
| | | }); |
| | | } |
| | | } |
| | | res.forEach((item) => { |
| | | }; |
| | | |
| | | |
| | | //处理树形结构 |
| | | const handleTreeData = (datas, parent, noTriggerSelect = false) => { |
| | | let parentData = {}; |
| | | if (parent) { |
| | | parentData = { ...parent, parent: null }; |
| | | } else { |
| | | parentData = null; |
| | | } |
| | | const list = []; |
| | | for (let i = 0; i < datas.length; i++) { |
| | | const data = datas[i]; |
| | | const obj = { |
| | | baseType: item.baseType, |
| | | order: 0, |
| | | id: item.id, |
| | | typeFieldId: item.fieldId, |
| | | sequenceNum: item.sequenceNum, |
| | | setDataAndFileLinkListRequest: [], |
| | | label: data.name, |
| | | key: parentData ? parentData.key + "_" + i : i + "", |
| | | namePath: parentData ? parentData.namePath + "\\" + data.name : data.name, |
| | | icon: data.icon, |
| | | data: data, |
| | | parent: parentData, |
| | | leaf: false, |
| | | children: [], |
| | | }; |
| | | for (let k in value) { |
| | | if (item.refCode === k) { |
| | | if (typeof value[k] == "object") { |
| | | obj.strValue = JSON.stringify(value[k]); |
| | | obj.setDataAndFileLinkListRequest = linkList; |
| | | } else { |
| | | obj.strValue = value[k].toString(); |
| | | } |
| | | } |
| | | if (data["children"] && data["children"].length) { |
| | | obj.leaf = false; |
| | | obj.children = handleTreeData( |
| | | data["children"], |
| | | { |
| | | ...data, |
| | | key: obj.key, |
| | | namePath: obj.namePath, |
| | | }, |
| | | i == 0 ? false : true // 如果有子数据处理,只有第一条数据需要展开和回调 |
| | | ); |
| | | } else { |
| | | obj.leaf = |
| | | !data["childrenChannelCount"] || data["childrenChannelCount"] == 0; |
| | | } |
| | | if (obj.strValue) { |
| | | arr.push(obj); |
| | | } |
| | | }); |
| | | return arr; |
| | | } |
| | | list.push(obj); |
| | | } |
| | | console.log(list, "list"); |
| | | return list; |
| | | }; |
| | | |
| | | |
| | | //获取资源 |
| | | |
| | | |
| | | |
| | | export default { |
| | | ...tool, |
| | |
| | | getFileMd5, |
| | | worksDataBytool, |
| | | UpdateworksDataBytool, |
| | | resultsBytool, |
| | | }; |
| | | getPublicImage, |
| | | worksData, |
| | | getPublicFile, |
| | | handleTypeList, |
| | | handleTreeData, |
| | | // parseHtml, |
| | | } |
| | |
| | | import config from "@/assets/js/config.js"; |
| | | import toolClass from "@/assets/js/toolClass"; |
| | | |
| | | |
| | | import jobApi |
| | | // newSession, |
| | | // newJobWithNewView |
| | | from "./middleGround/api/job" |
| | | import jobApi from "./middleGround/api/job"; // newJobWithNewView // newSession, |
| | | |
| | | export function setSessionGuid(type, id) { |
| | | var cityCode = null; |
| | |
| | | } else { |
| | | cityCode = { |
| | | cip: "0.0.0.0", |
| | | cname: "未知" |
| | | cname: "未知", |
| | | }; |
| | | } |
| | | const _city = cityCode.cname.substring(3); |
| | |
| | | city: _city ? _city : _province, |
| | | }; |
| | | |
| | | jobApi.newSession(params).then((res) => { |
| | | jobApi.newSession(params).then(res => { |
| | | storage.set("sessionGuid", res, 30); |
| | | setNewView(type, id) |
| | | setNewView(type, id); |
| | | }); |
| | | } |
| | | |
| | |
| | | try { |
| | | val = JSON.parse(val); |
| | | } catch (e) { |
| | | return e |
| | | return e; |
| | | } |
| | | return val; |
| | | } |
| | | }, |
| | | }; |
| | | |
| | | function myBrowser() { |
| | |
| | | |
| | | export function setNewView(type, id) { |
| | | if (!sessionStorage.getItem("sessionGuid")) { |
| | | setSessionGuid(type, id) |
| | | setSessionGuid(type, id); |
| | | } |
| | | |
| | | const sessionGuid = sessionStorage.getItem("sessionGuid"); |
| | |
| | | appRefCode: config.appRefCode, |
| | | type: "View", |
| | | url: toPath == null ? "/" : toPath, |
| | | ref: fromPath == null ? "/" : fromPath |
| | | ref: fromPath == null ? "/" : fromPath, |
| | | }; |
| | | if (id) { |
| | | params[type] = id; |
| | | } |
| | | jobApi.newJobWithNewView(params).then((res) => {}); |
| | | jobApi.newJobWithNewView(params).then(res => {}); |
| | | } |
| | | } |
New file |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg> |
File was renamed from src/assets/css/common.css |
| | |
| | | @import './base.css'; |
| | | |
| | | /* 居中布局 */ |
| | | .contentBox{ |
| | | width: 1200px; |
New file |
| | |
| | | <template> |
| | | <div class="layoutBox"> |
| | | <Header class="header"></Header> |
| | | <div class="layoutContentBox" id="layout"> |
| | | <RouterView /> |
| | | <Footer class="footer"></Footer> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import Header from './components/headerPage.vue' |
| | | import Footer from './components/footerPage.vue' |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .layoutBox { |
| | | width: 100%; |
| | | height: 100vh; |
| | | display: flex; |
| | | flex-direction: column; |
| | | background-color: #fff; |
| | | |
| | | .layoutContentBox { |
| | | flex: 1; |
| | | height: auto; |
| | | } |
| | | |
| | | .header { |
| | | flex-shrink: 0; |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1200px) { |
| | | .layoutContentBox { |
| | | flex: 1; |
| | | overflow: auto; |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="pageFooter"> |
| | | <div class="footerContent contentBox flex"> |
| | | <div class="infoBox flex1"> |
| | | <ul class="linkBox"> |
| | | <li class="link" @click="toAboutus(index)" v-for="(item, index) in linkList" :key="index"> |
| | | {{ item.name }} |
| | | </li> |
| | | </ul> |
| | | <ul class="linkBox"> |
| | | <li class="link" @click="toAboutus(index)" v-for="(item, index) in newList" :key="index"> |
| | | {{ item.name }} |
| | | </li> |
| | | </ul> |
| | | <ul class="linkBox"> |
| | | <li |
| | | class="link" |
| | | @click="toAboutus(index)" |
| | | v-for="(item, index) in serviceList" |
| | | :key="index" |
| | | > |
| | | {{ item.name }} |
| | | </li> |
| | | </ul> |
| | | <ul class="linkBox"> |
| | | <li class="link" @click="toAboutus(index)">天猫旗舰店</li> |
| | | <li class="link" style="opacity: 1; font-size: 20px" @click="toAboutus(index)"> |
| | | 京东旗舰店 |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | <div class="QRCodeBox"> |
| | | <div class="codeItem"> |
| | | <img src="@/assets/images/pageFooter/wechatCode.png" /> |
| | | </div> |
| | | <div class="codeItem"> |
| | | <img src="@/assets/images/pageFooter/weiboCode.png" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="copyrightBox"> |
| | | <span |
| | | >中国协和医科大学出版社有限公司 丨 备案序号:<span class="beian" @click="toLink" |
| | | >京ICP备 05029104号-4互联网出版许可证 新出网证 (京 )</span |
| | | > |
| | | 丨 增值电信业务经营许可证:京B2-20224426</span |
| | | > |
| | | <span style="display: block">Copyright©2013 中国协和医科大学出版社有限公司 版权所有!</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { reactive } from 'vue' |
| | | |
| | | const toAboutus = () => {} |
| | | |
| | | const linkList = reactive([ |
| | | { |
| | | name: '关于我们', |
| | | url: '', |
| | | }, |
| | | { |
| | | name: '关于我们', |
| | | url: '', |
| | | }, |
| | | { |
| | | name: '联系我们', |
| | | url: '', |
| | | }, |
| | | { |
| | | name: '意见反馈', |
| | | url: '', |
| | | }, |
| | | ]) |
| | | const newList = reactive([ |
| | | { |
| | | name: '新手上路', |
| | | url: '', |
| | | }, |
| | | { |
| | | name: '操作指南', |
| | | url: '', |
| | | }, |
| | | { |
| | | name: '教师认证', |
| | | url: '', |
| | | }, |
| | | ]) |
| | | const serviceList = reactive([ |
| | | { |
| | | name: '友情链接', |
| | | url: '', |
| | | }, |
| | | { |
| | | name: '国家科学技术部', |
| | | url: '', |
| | | }, |
| | | { |
| | | name: '国家卫生健康委', |
| | | url: '', |
| | | }, |
| | | { |
| | | name: '国家教育部', |
| | | url: '', |
| | | }, |
| | | { |
| | | name: '北京市卫健委', |
| | | url: '', |
| | | }, |
| | | ]) |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .pageFooter { |
| | | background: #444444; |
| | | background-image: url('@/assets/images/xiehe/home/footer-bg.png'); |
| | | .footerContent { |
| | | padding: 30px 0; |
| | | .infoBox { |
| | | display: flex; |
| | | .linkBox { |
| | | font-size: 16px; |
| | | margin-left: 50px; |
| | | .link { |
| | | padding-right: 15px; |
| | | cursor: pointer; |
| | | color: #fff; |
| | | margin-top: 20px; |
| | | opacity: 0.7; |
| | | &::after { |
| | | margin-left: 15px; |
| | | } |
| | | &:last-child::after { |
| | | display: none; |
| | | } |
| | | &:first-child { |
| | | color: #fff; |
| | | opacity: 1; |
| | | font-size: 20px; |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | } |
| | | .address { |
| | | margin-top: 30px; |
| | | font-size: 14px; |
| | | color: #ccc; |
| | | span { |
| | | margin-right: 30px; |
| | | } |
| | | } |
| | | .logo { |
| | | height: 50px; |
| | | margin-top: 30px; |
| | | img { |
| | | height: 100%; |
| | | } |
| | | } |
| | | } |
| | | .QRCodeBox { |
| | | .codeItem { |
| | | display: inline-block; |
| | | text-align: center; |
| | | margin-left: 40px; |
| | | p { |
| | | font-size: 16px; |
| | | } |
| | | img { |
| | | width: 100px; |
| | | height: 100px; |
| | | margin-top: 20px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .copyrightBox { |
| | | text-align: center; |
| | | color: #fff; |
| | | |
| | | height: 80px; |
| | | line-height: 40px; |
| | | font-size: 12px; |
| | | border-top: 1px solid #e6e6e6; |
| | | .beian { |
| | | cursor: pointer; |
| | | } |
| | | .beian:hover { |
| | | color: blue; |
| | | } |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="pageHeader"> |
| | | <div class="contentBox logoBox"> |
| | | <div class="logo"> |
| | | <img |
| | | @click=" |
| | | () => { |
| | | $router.push({ |
| | | path: '/home', |
| | | }) |
| | | } |
| | | " |
| | | src="@/assets/images/xiehe/home/Group_303.png" |
| | | /> |
| | | </div> |
| | | <div class="searchBox" v-show="!hideSerch"> |
| | | <el-input |
| | | style="width: 500px; height: 50px" |
| | | placeholder="请输入内容" |
| | | @change="gotoSearch" |
| | | v-model="searchKey" |
| | | :suffix-icon="Search" |
| | | > |
| | | </el-input> |
| | | <div class="loginInfoBox"> |
| | | <div v-if="!userInfo" class="loginBtnBox"> |
| | | <a |
| | | @click=" |
| | | () => { |
| | | $router.push({ |
| | | path: '/register', |
| | | }) |
| | | } |
| | | " |
| | | >注册</a |
| | | > |
| | | | |
| | | <a |
| | | @click=" |
| | | () => { |
| | | $router.push({ |
| | | path: '/login', |
| | | query: { |
| | | redirectPath: $route.fullPath, |
| | | }, |
| | | }) |
| | | } |
| | | " |
| | | >登录</a |
| | | > |
| | | </div> |
| | | <div v-else class="userInfoBox"> |
| | | <el-dropdown @command="handleCommand"> |
| | | <span style="cursor: pointer">欢迎您,{{ userInfo.name }}!</span> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item icon="el-icon-user" command="gotoPersonalCenter" |
| | | >个人中心</el-dropdown-item |
| | | > |
| | | <el-dropdown-item icon="el-icon-switch-button" command="logout" |
| | | >退出登录</el-dropdown-item |
| | | > |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="contentBox navBox" v-show="!hideNav"> |
| | | <div |
| | | :class="{ |
| | | navItem: true, |
| | | active: $route.fullPath.indexOf(item.path) > -1, |
| | | }" |
| | | v-for="(item, index) in navData" |
| | | :key="index" |
| | | @click="gotoPage(item)" |
| | | > |
| | | {{ item.name }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { Search } from '@element-plus/icons-vue' |
| | | const props = defineProps({ |
| | | hideSerch: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | hideNav: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | }) |
| | | |
| | | let searchKey = ref('') |
| | | let userInfo = ref('') |
| | | const navData = ref([ |
| | | { |
| | | name: '首页', |
| | | path: '/home', |
| | | }, |
| | | { |
| | | name: '教育出版', |
| | | path: '/bookStore', |
| | | }, |
| | | { |
| | | name: '读者服务', |
| | | path: '/teachingServices', |
| | | }, |
| | | { |
| | | name: '关于我们', |
| | | path: '/aboutUs', |
| | | }, |
| | | ]) |
| | | |
| | | const gotoSearch = () => {} |
| | | const handleCommand = () => {} |
| | | const gotoPage = () => {} |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .pageHeader { |
| | | width: 100%; |
| | | background-color: #fff; |
| | | border-bottom: 1px solid #e6e6e6; |
| | | .topBar { |
| | | background: #e6e6e6; |
| | | color: #808080; |
| | | overflow: hidden; |
| | | padding: 14px 0; |
| | | p { |
| | | float: left; |
| | | } |
| | | .loginInfoBox { |
| | | float: right; |
| | | .loginBtnBox { |
| | | a { |
| | | cursor: pointer; |
| | | text-decoration: none; |
| | | color: inherit; |
| | | margin: 0 4px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .logoBox { |
| | | padding: 25px 0; |
| | | overflow: hidden; |
| | | max-width: 1200px !important; |
| | | .logo { |
| | | float: left; |
| | | height: 66px; |
| | | img { |
| | | height: 100%; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | .searchBox { |
| | | width: 670px; |
| | | float: right; |
| | | padding-right: 10px; |
| | | line-height: 66px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | .searchItem { |
| | | width: 120px; |
| | | vertical-align: initial; |
| | | } |
| | | .searchBtn { |
| | | width: auto; |
| | | background: #144941; |
| | | color: #fff; |
| | | padding: 0 20px; |
| | | height: 40px; |
| | | } |
| | | } |
| | | } |
| | | .navBox { |
| | | .navItem { |
| | | display: inline-block; |
| | | width: 120px; |
| | | height: 50px; |
| | | text-align: center; |
| | | line-height: 50px; |
| | | font-size: 16px; |
| | | cursor: pointer; |
| | | &.active { |
| | | background: #144941; |
| | | color: #fff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | <style> |
| | | .pageHeader .searchBox .el-input-group__prepend { |
| | | background: #fff; |
| | | color: #444; |
| | | } |
| | | </style> |
| | |
| | | import Vue from "vue"; |
| | | import App from "./App.vue"; |
| | | import router from "./router"; |
| | | import store from "./store"; |
| | | import './assets/main.css' |
| | | |
| | | // 自定义配置 |
| | | import { createApp } from 'vue' |
| | | import { createPinia } from 'pinia' |
| | | |
| | | import "@/assets/iconfont/iconfont.css"; |
| | | import config from "@/assets/js/config"; |
| | | Vue.prototype.config = config; |
| | | import App from './App.vue' |
| | | // 完整引入 Element Plus |
| | | import ElementPlus from 'element-plus' |
| | | import 'element-plus/dist/index.css' |
| | | import * as ElementPlusIconsVue from '@element-plus/icons-vue' |
| | | import router from './router' |
| | | import MG from '@/assets/js/middleGround/WebMiddleGroundApi.js' |
| | | import toolClass from '@/assets/js/toolClass.js' |
| | | import config from '@/assets/js/config.js' |
| | | |
| | | // axios |
| | | import service from "@/plugin/axios"; |
| | | Vue.prototype.request = service; |
| | | const app = createApp(App) |
| | | |
| | | import { |
| | | setNewView |
| | | } from "@/assets/js/userAction" |
| | | Vue.prototype.setNewView = setNewView; |
| | | // ElementUI |
| | | import ElementUI from "element-ui"; |
| | | import "@/assets/theme/index.css"; |
| | | Vue.use(ElementUI); |
| | | app.provide('config', config) |
| | | app.provide('MG', MG) |
| | | app.provide('toolClass', toolClass) |
| | | |
| | | import { |
| | | tokenKey |
| | | } from "@/assets/js/config"; |
| | | //工具类 |
| | | import tool from "@/assets/js/toolClass"; |
| | | Vue.prototype.tool = tool; |
| | | // 注册所有图标 |
| | | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
| | | app.component(key, component) |
| | | } |
| | | app.use(ElementPlus) |
| | | app.use(createPinia()) |
| | | app.use(router) |
| | | |
| | | // 路由判断登录 根据路由配置文件的参数 |
| | | router.beforeEach((to, from, next) => { |
| | | if (to.matched.some((record) => record.meta.authentication)) { |
| | | // 判断该路由是否需要登录权限 |
| | | if (tool.getCookie(tokenKey)) { |
| | | // 判断当前的token是否存在 ; 登录存入的token |
| | | if (to.path === "/login") { |
| | | tool.delCookie(tokenKey); |
| | | // removeToken(); |
| | | window.location.reload(); |
| | | } else { |
| | | next(); |
| | | } |
| | | } else { |
| | | next({ |
| | | path: "/login", |
| | | query: { |
| | | redirect: to.fullPath |
| | | }, // 将跳转的路由path作为参数,登录成功后跳转到该路由 |
| | | }); |
| | | } |
| | | } else { |
| | | next(); |
| | | } |
| | | }); |
| | | // 请求处理 |
| | | import MG from "@/assets/js/middleGround/WebMiddleGroundApi"; |
| | | Vue.prototype.MG = MG; |
| | | |
| | | // 时间处理 |
| | | import moment from "moment"; |
| | | Vue.prototype.moment = moment; |
| | | |
| | | Vue.config.productionTip = false; |
| | | |
| | | new Vue({ |
| | | router, |
| | | store, |
| | | render: (h) => h(App), |
| | | }).$mount("#app"); |
| | | app.mount('#app') |
New file |
| | |
| | | import axios from "axios"; |
| | | import myConfig from "@/assets/js/config.js"; |
| | | import toolClass from "@/assets/js/toolClass.js"; |
| | | import router from "@/router"; |
| | | // 创建 axios 实例 |
| | | const service = axios.create({ |
| | | baseURL: myConfig.requestCtx, |
| | | timeout: myConfig.requestTimeOut, // 请求超时时间 |
| | | }); |
| | | |
| | | // 请求拦截器 |
| | | service.interceptors.request.use( |
| | | (config) => { |
| | | let token = localStorage.getItem(myConfig.tokenKey); |
| | | if (token) config.headers["Authorization"] = `bearer ${token}`; |
| | | return config; |
| | | }, |
| | | (error) => { |
| | | // 发送失败 |
| | | Promise.reject(error); |
| | | } |
| | | ); |
| | | |
| | | // 响应拦截器 |
| | | service.interceptors.response.use( |
| | | (response) => { |
| | | // dataAxios 是 axios 返回数据中的 data |
| | | const dataAxios = response.data; |
| | | if (typeof dataAxios.data === "boolean") { |
| | | return dataAxios.data; |
| | | } |
| | | if (response.config.responseType == "blob") { |
| | | return dataAxios; |
| | | } |
| | | const { success } = dataAxios; |
| | | if (dataAxios.currentDate) { |
| | | sessionStorage.currentDate = new Date(dataAxios.currentDate).getTime(); |
| | | } |
| | | // 根据 code 进行判断 |
| | | if (response.status == 200 && response.statusText == "OK") { |
| | | return dataAxios.data ? dataAxios.data : dataAxios; |
| | | } else { |
| | | // 提示错误 |
| | | } |
| | | }, |
| | | (error) => { |
| | | if ( |
| | | (error.response && error.response.status == 401) || |
| | | error.code == "ERR_NETWORK" |
| | | ) { |
| | | console.log(router, "router"); |
| | | |
| | | localStorage.removeItem(myConfig.tokenKey); |
| | | localStorage.removeItem("jesk-userInfo"); |
| | | router.push({ |
| | | name: "login", |
| | | }); |
| | | } else { |
| | | if (error.response && error.response.data && error.response.data.error) { |
| | | console.error(error.response.data.error.msg); |
| | | } else { |
| | | console.error("请求发生错误"); |
| | | } |
| | | } |
| | | return Promise.reject(error); |
| | | } |
| | | ); |
| | | |
| | | export default service; |
| | |
| | | import Vue from "vue"; |
| | | import VueRouter from "vue-router"; |
| | | import HomeLayout from "@/layout"; |
| | | import Home from "@/views/home"; |
| | | import Search from "@/views/home/search"; |
| | | |
| | | import bookStore from "./modules/bookStore"; |
| | | import teachingServices from "./modules/teachingServices"; |
| | | import informationCenterRouter from "./modules/informationCenter"; |
| | | import aboutUs from "./modules/aboutUs"; |
| | | import preview from "./modules/preview" |
| | | import baseLayout from "@/layout/base"; |
| | | const originalPush = VueRouter.prototype.push |
| | | VueRouter.prototype.push = function push(location) { |
| | | return originalPush.call(this, location).catch(err => err) |
| | | } |
| | | |
| | | Vue.use(VueRouter); |
| | | |
| | | const routes = [{ |
| | | path: "/", |
| | | name: "HomeLayout", |
| | | component: HomeLayout, |
| | | redirect: { |
| | | name: "home" |
| | | }, |
| | | children: [ |
| | | // 在主框架内 |
| | | import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router' |
| | | import HomeView from '../views/home/index.vue' |
| | | import PageLayout from '../layout/baseLayout.vue' |
| | | const router = createRouter({ |
| | | history: createWebHashHistory(import.meta.env.BASE_URL), |
| | | routes: [ |
| | | { |
| | | path: "home", |
| | | name: "home", |
| | | meta: { |
| | | name: "首页", |
| | | authentication: false, // 是否需要登录验证 |
| | | keepAlive: false, // 是否需要缓存 |
| | | }, |
| | | component: baseLayout, |
| | | redirect: { |
| | | name: "index" |
| | | }, |
| | | children: [{ |
| | | path: "index", |
| | | name: "index", |
| | | meta: { |
| | | name: "首页", |
| | | authentication: false, // 是否需要登录验证 |
| | | keepAlive: false, // 是否需要缓存 |
| | | path: '/', |
| | | name: 'layout', |
| | | component: PageLayout, |
| | | redirect: { name: 'home' }, |
| | | children: [ |
| | | { |
| | | path: '/home', |
| | | name: 'home', |
| | | component: HomeView, |
| | | }, |
| | | component: Home, |
| | | }, |
| | | { |
| | | path: "search", |
| | | name: "search", |
| | | meta: { |
| | | name: "首页搜索", |
| | | authentication: false, // 是否需要登录验证 |
| | | keepAlive: true, // 是否需要缓存 |
| | | }, |
| | | component: Search, |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | path: "/login", |
| | | name: "login", |
| | | meta: { |
| | | name: "登录", |
| | | authentication: false, |
| | | }, |
| | | component: () => import("@/views/login/login"), |
| | | }, |
| | | { |
| | | path: "/register", |
| | | name: "register", |
| | | meta: { |
| | | name: "注册", |
| | | authentication: false, |
| | | }, |
| | | component: () => import("@/views/login/register"), |
| | | }, |
| | | { |
| | | path: "/personalCenter", |
| | | name: "personalCenter", |
| | | meta: { |
| | | name: "个人中心", |
| | | authentication: true, |
| | | }, |
| | | component: () => import("@/views/personalCenter"), |
| | | }, |
| | | { |
| | | path: "/authorServices", |
| | | name: "authorServices", |
| | | meta: { |
| | | name: "作者服务", |
| | | authentication: false, |
| | | }, |
| | | component: () => import("@/views/authorServices"), |
| | | }, |
| | | { |
| | | path: "/bindWeChat", |
| | | name: "bindWeChat", |
| | | meta: { |
| | | name: "绑定微信", |
| | | authentication: true, |
| | | }, |
| | | component: () => import("@/views/bindWeChat"), |
| | | }, |
| | | { |
| | | path: "/bindWeChatBack", |
| | | name: "bindWeChatBack", |
| | | meta: { |
| | | name: "绑定微信", |
| | | authentication: true, |
| | | }, |
| | | component: () => import("@/views/bindWeChat/success"), |
| | | }, |
| | | { |
| | | path: "/AdminLogin", |
| | | name: "AdminLogin", |
| | | meta: { |
| | | name: "管理登录", |
| | | noWrapHeadFooter: true, |
| | | }, |
| | | component: () => import("@/views/login/adminLogin"), |
| | | }, |
| | | ...bookStore, |
| | | ...teachingServices, |
| | | ...informationCenterRouter, |
| | | ...aboutUs, |
| | | ...preview |
| | | ], |
| | | }, |
| | | // 不在主框架内 |
| | | }) |
| | | |
| | | { |
| | | path: "/findPassword", |
| | | name: "findPassword", |
| | | meta: { |
| | | name: "登录", |
| | | }, |
| | | component: () => import("@/views/login/findPassword"), |
| | | }, |
| | | ]; |
| | | |
| | | const router = new VueRouter({ |
| | | routes, |
| | | }); |
| | | |
| | | export default router; |
| | | export default router |
New file |
| | |
| | | import { ref, computed } from 'vue' |
| | | import { defineStore } from 'pinia' |
| | | |
| | | export const useCounterStore = defineStore('counter', () => { |
| | | const count = ref(0) |
| | | const doubleCount = computed(() => count.value * 2) |
| | | function increment() { |
| | | count.value++ |
| | | } |
| | | |
| | | return { count, doubleCount, increment } |
| | | }) |
| | |
| | | <template> |
| | | <div class="indexPage"> |
| | | <el-carousel :height="screenheight + 'px'"> |
| | | <el-carousel-item v-for="item in bannerList" :key="item.id"> |
| | | <div |
| | | class="bannerBox imgBox" |
| | | :style="item.caupress_link ? 'cursor: pointer' : ''" |
| | | > |
| | | <img |
| | | id="autoHeight" |
| | | class="bannerImg" |
| | | :src="item.icon" |
| | | @click="bannerLink(item)" |
| | | /> |
| | | </div> |
| | | <div class="homePage"> |
| | | <el-carousel :height="screenheight"> |
| | | <el-carousel-item v-for="item in 4" :key="item"> |
| | | <h3 class="small justify-center" text="2xl">{{ item }}</h3> |
| | | </el-carousel-item> |
| | | </el-carousel> |
| | | <div class="bookListBox"> |
| | | <div class="contentBox"> |
| | | <div class="bookListTitle"> |
| | | <div class="title">推荐教材</div> |
| | | <div class="more">更多></div> |
| | | </div> |
| | | <div class="recommendList"> |
| | | <div |
| | | class="recommendItem" |
| | | v-for="item in bookListData" |
| | | :key="item.id" |
| | | > |
| | | <div class="recommendItemImg"> |
| | | <img class="autoImg" :src="item.icon" /> |
| | | </div> |
| | | <div class="infoBox"> |
| | | <div class="bookName">{{ item.name }}</div> |
| | | <div class="author"> |
| | | 作者:{{ |
| | | item.authorcaupress_author ? item.caupress_author : "-" |
| | | }} |
| | | </div> |
| | | <div class="priceBox"> |
| | | <span class="oldPrice" v-if="item.oldPrice" |
| | | >原价:¥{{ tool.toDecimal2(item.oldPrice) }}</span |
| | | > |
| | | <span class="price" v-if="item.price && item.price > 0"> |
| | | 定价:¥ |
| | | <span>{{ tool.toDecimal2(item.price) }}</span> |
| | | </span> |
| | | <span class="price" v-else> |
| | | 定价:<span class="freePrice">免费</span> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="funBox"> |
| | | <div class="authentication"></div> |
| | | <div class="manual"></div> |
| | | </div> |
| | | <div class="bookListTitle"> |
| | | <div class="title">推荐教材</div> |
| | | <div class="more">更多></div> |
| | | </div> |
| | | <div class="recommendList"> |
| | | <div |
| | | class="recommendItem" |
| | | v-for="item in bookListData" |
| | | :key="item.id" |
| | | > |
| | | <div class="recommendItemImg"> |
| | | <img class="autoImg" :src="item.icon" /> |
| | | </div> |
| | | <div class="infoBox"> |
| | | <div class="bookName">{{ item.name }}</div> |
| | | <div class="author"> |
| | | 作者:{{ |
| | | item.authorcaupress_author ? item.caupress_author : "-" |
| | | }} |
| | | </div> |
| | | <div class="priceBox"> |
| | | <span class="oldPrice" v-if="item.oldPrice" |
| | | >原价:¥{{ tool.toDecimal2(item.oldPrice) }}</span |
| | | > |
| | | <span class="price" v-if="item.price && item.price > 0"> |
| | | 定价:¥ |
| | | <span>{{ tool.toDecimal2(item.price) }}</span> |
| | | </span> |
| | | <span class="price" v-else> |
| | | 定价:<span class="freePrice">免费</span> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "home", |
| | | data() { |
| | | return { |
| | | bannerList: [], |
| | | informationData: [], |
| | | noticeData: [], |
| | | honorData: [], |
| | | menuData: [], |
| | | bookListData: [], |
| | | bookListTotal: 0, |
| | | bookListLoading: true, |
| | | showMenuIndex: 0, |
| | | screenheight: document.documentElement.clientWidth / 4, |
| | | }; |
| | | }, |
| | | created() { |
| | | window.onresize = () => { |
| | | let c = 2.628; |
| | | if (document.documentElement.clientWidth >= 1220) { |
| | | this.screenheight = document.documentElement.clientWidth / c; |
| | | } |
| | | }; |
| | | var url = window.location.href; |
| | | if (url.indexOf("WeChatScanningCodeLogin") > -1) { |
| | | var querys = url.substring(url.indexOf("?") + 1).split("&"); |
| | | var result = {}; |
| | | for (var i = 0; i < querys.length; i++) { |
| | | var temp = querys[i].split("="); |
| | | if (temp.length < 2) { |
| | | result[temp[0]] = ""; |
| | | } else { |
| | | result[temp[0]] = temp[1]; |
| | | } |
| | | } |
| | | if (result && result.code) { |
| | | this.MG.identity |
| | | .loginByWeChatOpenCode({ |
| | | code: result.code, |
| | | appRefCode: this.config.appRefCode, |
| | | platform: "PCWeb", |
| | | }) |
| | | .then((res) => { |
| | | if (res && res.status == "Ok") { |
| | | this.$store.dispatch("setToken", res.token); |
| | | this.getUserInfo(() => { |
| | | window.location.href = this.config.requestCtx; |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | this.getBanner(); |
| | | this.getHonor(); |
| | | this.getBookMenu(); |
| | | } |
| | | } else { |
| | | this.getBanner(); |
| | | this.getHonor(); |
| | | this.getBookMenu(); |
| | | } |
| | | }, |
| | | methods: { |
| | | //点击轮播图跳转 |
| | | |
| | | bannerLink(val) { |
| | | if (val.caupress_link) { |
| | | window.open(val.caupress_link); |
| | | } |
| | | }, |
| | | getUserInfo(callback) { |
| | | this.MG.identity.getCurrentAppUser().then((res) => { |
| | | // 用户信息优先级:教师认证 > 微信 > 学生(注册时默认) |
| | | if (res) { |
| | | let teacherRole = res.roleLinks.find( |
| | | (item) => item.role.refCode == "teacher" |
| | | ); |
| | | let teacherInfo = res.infoList.find( |
| | | (item) => item.type == "teacherInfo" |
| | | ); |
| | | let wechatInfo = res.infoList.find((item) => item.type == "WeChat"); |
| | | let studentInfo = res.infoList.find((item) => item.type == "Default"); |
| | | let phoneInfo = res.secretList.find( |
| | | (item) => item.type == "MobilePhone" |
| | | ); |
| | | if (teacherRole && teacherInfo) { |
| | | let data = {}; |
| | | try { |
| | | data = JSON.parse(teacherInfo.data); |
| | | } catch (error) { |
| | | data = {}; |
| | | } |
| | | this.$store.dispatch("setUserInfo", { |
| | | ...data, |
| | | name: data.fullName, |
| | | phoneNumber: phoneInfo?.credential, |
| | | role: "Teacher", |
| | | roleId: teacherRole.role.id, |
| | | }); |
| | | } else if (wechatInfo) { |
| | | this.$store.dispatch("setUserInfo", { |
| | | ...wechatInfo, |
| | | phoneNumber: phoneInfo?.credential, |
| | | role: "Student", |
| | | }); |
| | | } else if (studentInfo) { |
| | | this.$store.dispatch("setUserInfo", { |
| | | ...studentInfo, |
| | | phoneNumber: phoneInfo?.credential, |
| | | role: "Student", |
| | | }); |
| | | } |
| | | } |
| | | // 清空本地储存的申请样书清单 |
| | | this.$store.commit("emptyBookList"); |
| | | callback(); |
| | | }); |
| | | }, |
| | | getBanner() { |
| | | this.MG.resource |
| | | .getItem({ |
| | | path: this.config.refCodes.index.banner, |
| | | fields: { |
| | | caupress_link: [], |
| | | }, |
| | | coverSize: { |
| | | height: 750, |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 999, |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | this.bannerList = res.datas; |
| | | }); |
| | | }, |
| | | |
| | | getHonor() { |
| | | this.MG.resource |
| | | .getItem({ |
| | | path: this.config.refCodes.index.honor, |
| | | coverSize: { |
| | | height: 200, |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 999, |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | this.honorData = res.datas; |
| | | }); |
| | | }, |
| | | getBookMenu() { |
| | | this.MG.store |
| | | .getStoreChannelList({ |
| | | storeRefCode: this.config.goodsStore, |
| | | path: this.config.refCodes.index.column, |
| | | start: 0, |
| | | size: 999, |
| | | }) |
| | | .then((res) => { |
| | | if (res.datas && res.datas.length) { |
| | | this.menuData = res.datas; |
| | | this.getBookList(); |
| | | } |
| | | }); |
| | | }, |
| | | getBookList() { |
| | | this.bookListLoading = true; |
| | | this.MG.store |
| | | .getProductList({ |
| | | path: |
| | | this.config.refCodes.index.column + |
| | | "\\" + |
| | | this.menuData[this.showMenuIndex].refCode, |
| | | paging: { |
| | | start: 0, |
| | | size: 5, |
| | | }, |
| | | fields: { |
| | | caupress_author: [], |
| | | caupress_recommendationReason: [], |
| | | }, |
| | | coverSize: { |
| | | width: 150, |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | this.bookListData = res.datas; |
| | | this.bookListTotal = res.total; |
| | | this.bookListLoading = false; |
| | | }); |
| | | }, |
| | | toInformation(selected) { |
| | | this.$router.push({ |
| | | name: "informationCenter-index", |
| | | query: { |
| | | tabsSelected: selected, |
| | | }, |
| | | }); |
| | | }, |
| | | toDetails(tabsSelected, linkInfo) { |
| | | this.$router.push({ |
| | | name: "informationCenter-detail", |
| | | query: { |
| | | tabsSelected: tabsSelected, |
| | | path: linkInfo[0].LinkPath, |
| | | id: linkInfo[0].ChildrenId, |
| | | }, |
| | | }); |
| | | }, |
| | | toDetail(row) { |
| | | this.$router.push({ |
| | | name: "teachingServices-detail", |
| | | query: { id: row.id, cmsPath: row.rootCmsItemId }, |
| | | }); |
| | | }, |
| | | // 跳转至列表页 |
| | | toList() { |
| | | this.$router.push({ |
| | | path: "/teachingServices", |
| | | query: { |
| | | searchOptionHidden: true, |
| | | searchPath: |
| | | this.config.refCodes.index.column + |
| | | "\\" + |
| | | this.menuData[this.showMenuIndex].refCode, |
| | | }, |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | <script setup> |
| | | import { ref } from 'vue' |
| | | let screenheight = ref(document.documentElement.clientHeight / 4) |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | @import "@/assets/css/theme.less"; |
| | | .indexPage { |
| | | .homePage { |
| | | min-width: 1220px; |
| | | min-height: calc(100vh - 61.8%); |
| | | background-color: #fff; |
| | | .bannerBox { |
| | | background: #f3f3f3; |
| | | } |
| | | .imgBox { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | // 本社资讯 |
| | | .informationBox { |
| | | padding-right: 30px; |
| | | border-right: 1px dashed #b3b3b3; |
| | | .informationList { |
| | | .informationItem { |
| | | margin-bottom: 50px; |
| | | cursor: pointer; |
| | | .imgBox { |
| | | position: relative; |
| | | width: 150px; |
| | | height: 90px; |
| | | margin-right: 30px; |
| | | background: #f2f2f2; |
| | | .date { |
| | | color: #999999; |
| | | text-align: center; |
| | | font-size: 30px; |
| | | padding-top: 20px; |
| | | .year { |
| | | font-size: 17px; |
| | | margin-top: 5px; |
| | | } |
| | | } |
| | | } |
| | | .infoBox { |
| | | .title { |
| | | font-size: 16px; |
| | | color: #444444; |
| | | margin-bottom: 20px; |
| | | font-weight: bold; |
| | | line-height: 1.5; |
| | | cursor: pointer; |
| | | } |
| | | .detail { |
| | | font-size: 12px; |
| | | color: #444444; |
| | | line-height: 2; |
| | | display: -webkit-box; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 本社通知 |
| | | .noticeBox { |
| | | width: 400px; |
| | | padding-left: 30px; |
| | | .noticeList { |
| | | .noticeItem { |
| | | margin-bottom: 40px; |
| | | cursor: pointer; |
| | | .indexBox { |
| | | width: 60px; |
| | | height: 60px; |
| | | text-align: center; |
| | | line-height: 60px; |
| | | font-size: 36px; |
| | | color: #b3b3b3; |
| | | background: #f2f2f2; |
| | | margin-right: 30px; |
| | | } |
| | | .infoBox { |
| | | .title { |
| | | font-size: 16px; |
| | | color: #444444; |
| | | height: 40px; |
| | | line-height: 20px; |
| | | margin-bottom: 8px; |
| | | cursor: pointer; |
| | | display: -webkit-box; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | } |
| | | .date { |
| | | font-size: 12px; |
| | | color: #bcbcbc; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 书籍列表 |
| | | .bookListBox { |
| | | width: 100%; |
| | | padding: 80px 0; |
| | | margin-top: 60px; |
| | | background-repeat: no-repeat; |
| | | background-size: 100% 100%; |
| | | background-image: url("@/assets/images/tuijian-bg.png"); |
| | | background-repeat: no-repeat; |
| | | background-size: 100% 42%; |
| | | .contentBox { |
| | | min-height: 776px; |
| | | } |
| | | .menuBox { |
| | | width: 180px; |
| | | border-right: 1px solid #d9d9d9; |
| | | padding: 30px 0 30px; |
| | | .menuItem { |
| | | padding-left: 30px; |
| | | border-right: 3px solid #fff; |
| | | font-size: 16px; |
| | | height: 40px; |
| | | line-height: 40px; |
| | | cursor: pointer; |
| | | margin-bottom: 20px; |
| | | &:hover { |
| | | background: #f2f2f2; |
| | | } |
| | | &.active { |
| | | color: @color; |
| | | border-color: @color; |
| | | } |
| | | } |
| | | } |
| | | .bookList { |
| | | padding: 40px; |
| | | min-height: 826px; |
| | | box-sizing: border-box; |
| | | |
| | | .bookItem { |
| | | margin-bottom: 30px; |
| | | cursor: pointer; |
| | | .imgBox { |
| | | width: 150px; |
| | | height: 200px; |
| | | border: 1px solid #e6e6e6; |
| | | } |
| | | .infoBox { |
| | | margin-left: 30px; |
| | | .title { |
| | | color: #333333; |
| | | font-size: 20px; |
| | | margin-top: 14px; |
| | | margin-bottom: 12px; |
| | | font-weight: bold; |
| | | cursor: pointer; |
| | | } |
| | | .author { |
| | | color: #808080; |
| | | margin-bottom: 20px; |
| | | } |
| | | .reasonBox { |
| | | display: flex; |
| | | line-height: 24px; |
| | | font-size: 14px; |
| | | color: #333333; |
| | | margin-bottom: 20px; |
| | | min-height: 72px; |
| | | .reasonTxt { |
| | | flex: 1; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | display: -webkit-box; |
| | | -webkit-line-clamp: 3; |
| | | -webkit-box-orient: vertical; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .allList { |
| | | width: 160px; |
| | | height: 40px; |
| | | line-height: 40px; |
| | | font-size: 16px; |
| | | background: #e5f3eb; |
| | | color: @color; |
| | | text-align: center; |
| | | border-radius: 50px; |
| | | margin: 10px auto; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | .boxTitle { |
| | | font-size: 18px; |
| | | color: #333333; |
| | | margin-bottom: 30px; |
| | | font-weight: bold; |
| | | span { |
| | | float: right; |
| | | font-size: 12px; |
| | | color: #999999; |
| | | line-height: 18px; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | .honorBox { |
| | | margin-bottom: 60px; |
| | | } |
| | | } |
| | | // 模块标题 |
| | | .blockTitle { |
| | | .el-carousel__item h3 { |
| | | color: #475669; |
| | | opacity: 0.75; |
| | | line-height: 150px; |
| | | margin: 0; |
| | | text-align: center; |
| | | font-size: 24px; |
| | | font-weight: bold; |
| | | margin-top: 60px; |
| | | margin-bottom: 30px; |
| | | span { |
| | | display: inline-block; |
| | | width: 60px; |
| | | height: 6px; |
| | | margin-top: 10px; |
| | | background: @color; |
| | | } |
| | | } |
| | | |
| | | .bookListTitle { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | |
| | | .title { |
| | | font-size: 20px; |
| | | color: #333333; |
| | | font-weight: bold; |
| | | } |
| | | .more { |
| | | font-size: 14px; |
| | | color: #999999; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | .recommendList { |
| | | display: flex; |
| | | padding-top: 20px; |
| | | |
| | | .recommendItem { |
| | | flex: 1; |
| | | margin-right: 20px; |
| | | height: 300px; |
| | | background-repeat: no-repeat; |
| | | background-size: 100% 100%; |
| | | cursor: pointer; |
| | | border: 1px solid #dedede; |
| | | background-color: #fff; |
| | | padding-top: 10px; |
| | | &:last-child { |
| | | margin-right: 0; |
| | | } |
| | | } |
| | | .el-carousel__item:nth-child(2n) { |
| | | background-color: #99a9bf; |
| | | } |
| | | |
| | | .recommendItemImg { |
| | | width: 150px; |
| | | height: 200px; |
| | | position: relative; |
| | | margin: 0 auto; |
| | | } |
| | | .infoBox { |
| | | text-align: center; |
| | | margin-top: 10px; |
| | | } |
| | | .author { |
| | | margin-top: 10px; |
| | | } |
| | | .priceBox { |
| | | margin-top: 10px; |
| | | .oldPrice { |
| | | font-size: 16px; |
| | | color: #444444; |
| | | text-decoration: line-through; |
| | | margin-right: 20px; |
| | | } |
| | | .price { |
| | | span { |
| | | font-weight: bold; |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .funBox { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-top: 60px; |
| | | margin-bottom: 60px; |
| | | .authentication { |
| | | width: 40%; |
| | | height: 80px; |
| | | background-repeat: no-repeat; |
| | | background-size: 100% 100%; |
| | | background-image: url("@/assets/images/xiehe/home/jiaoshirenzheng.png"); |
| | | } |
| | | .manual { |
| | | width: 40%; |
| | | height: 80px; |
| | | background-repeat: no-repeat; |
| | | background-size: 100% 100%; |
| | | background-image: url("@/assets/images/xiehe/home/jiaoshirenzheng.png"); |
| | | } |
| | | .el-carousel__item:nth-child(2n + 1) { |
| | | background-color: #d3dce6; |
| | | } |
| | | </style> |
New file |
| | |
| | | import { fileURLToPath, URL } from 'node:url' |
| | | |
| | | import { defineConfig } from 'vite' |
| | | import vue from '@vitejs/plugin-vue' |
| | | |
| | | // https://vite.dev/config/ |
| | | export default defineConfig({ |
| | | plugins: [vue()], |
| | | base: './', |
| | | server: { |
| | | host: '0.0.0.0', |
| | | }, |
| | | resolve: { |
| | | alias: { |
| | | '@': fileURLToPath(new URL('./src', import.meta.url)), |
| | | }, |
| | | }, |
| | | }) |