4个文件已删除
10个文件已修改
23个文件已添加
| | |
| | | } |
| | | if (taskInfo) { |
| | | router.replace({ |
| | | path: '/transmission' |
| | | path: '/home' |
| | | }) |
| | | window.electronAPI.newDownloadTask(taskInfo) |
| | | } |
New file |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-list-search"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 15m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /><path d="M18.5 18.5l2.5 2.5" /><path d="M4 6h16" /><path d="M4 12h4" /><path d="M4 18h4" /></svg> |
New file |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-bookmark-plus" style="color:#fff"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 17l-6 4v-14a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v5" /><path d="M16 19h6" /><path d="M19 16v6" /></svg> |
New file |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-brush" style="color:#fff"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 21v-4a4 4 0 1 1 4 4h-4" /><path d="M21 3a16 16 0 0 0 -12.8 10.2" /><path d="M21 3a16 16 0 0 1 -10.2 12.8" /><path d="M10.6 9a9 9 0 0 1 4.4 4.4" /></svg> |
New file |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-chalkboard" style="color:#fff"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M8 19h-3a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v11a1 1 0 0 1 -1 1" /><path d="M11 16m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v1a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z" /></svg> |
New file |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-crop" style="color:#fff"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M8 5v10a1 1 0 0 0 1 1h10" /><path d="M5 8h10a1 1 0 0 1 1 1v10" /></svg> |
New file |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-pencil-minus" style="color:#fff"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" /><path d="M13.5 6.5l4 4" /><path d="M16 19h6" /></svg> |
New file |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-pencil"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" /><path d="M13.5 6.5l4 4" /></svg> |
New file |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-trash" style="color:707070"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 7l16 0" /><path d="M10 11l0 6" /><path d="M14 11l0 6" /><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" /><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" /></svg> |
| | |
| | | // 测试 |
| | | export const ctx = "http://182.92.203.7:3001"; |
| | | export const downloaderFileCtx = "http://182.92.203.7:3007/DigitalTextbookReader"; |
| | | export const ctxUrl = "http://182.92.203.7:3007/books/book"; //服务器地址 |
| | | export const resourceUrl = "http://182.92.203.7:3007/books/resource"; //资源地址 |
| | | export const requestCtx = "https://jsek.bnuic.com"; //jsek |
| | | export const appId = 3; |
| | | export const requestTimeOut = 300000; // 请求超时时间 |
| | | export const tokenKey = "token"; |
| | | export const userInfoKey = "website-front-userInfo"; // 用户信息key |
| | | export const appRefCode = "jingshieke"; |
| | | export const goodsStore = `defaultGoodsStore${appId}`; // 默认商品库(书城) |
| | | export const digitalTextbooks = "jsek_digitalTextbooks";//数字教材 |
| | | |
New file |
| | |
| | | // 取消接口调用能力; |
| | | // 队列的必要性?? |
| | | |
| | | import store from "./api/store.js"; |
| | | import identity from "./api/identity.js"; |
| | | import app from "./api/app.js"; |
| | | |
| | | const WebMiddleGroundApi = { |
| | | store, |
| | | identity, |
| | | app, |
| | | }; |
| | | |
| | | export default WebMiddleGroundApi; |
New file |
| | |
| | | import request from "@/plugin/axios/index.ts"; |
| | | const appApi = { |
| | | // 获取用户消息列表 |
| | | getAppMessageList(data) { |
| | | return request({ |
| | | url: "/app/api/ApiGetAppMessageList", |
| | | method: "post", |
| | | data |
| | | }); |
| | | }, |
| | | // 获取用户消息详情 |
| | | getMessage(data) { |
| | | return request({ |
| | | url: "/app/api/ApiGetMessage", |
| | | method: "post", |
| | | data |
| | | }); |
| | | }, |
| | | |
| | | }; |
| | | |
| | | export default appApi; |
New file |
| | |
| | | import request from "@/plugin/axios/index.ts"; |
| | | const identityApi = { |
| | | // 获取图形验证码 |
| | | getImgCode() { |
| | | return request({ |
| | | url: "/identity/NewCaptcha", |
| | | method: "post", |
| | | }); |
| | | }, |
| | | |
| | | // 验证图形验证码 |
| | | verificationImgCode(data) { |
| | | return request({ |
| | | url: "/identity/ValidCaptcha", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 获取短信验证码 |
| | | getPhoneCode(data) { |
| | | return request({ |
| | | url: "/identity/NewSms", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | // 验证短信验证码 |
| | | verificationPhoneCode(data) { |
| | | return request({ |
| | | url: "/identity/api/ApiValidMobilePhone", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 通过手机号注册用户 |
| | | registerAppUserWithPhone(data) { |
| | | return request({ |
| | | url: "/identity/api/RegisterAppUserWithPhone", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 账号密码登录 |
| | | loginByPassword(data) { |
| | | return request({ |
| | | url: "/identity/api/LoginByPassword", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 短信验证码登录 |
| | | loginByMobilePhone(data) { |
| | | return request({ |
| | | url: "/identity/api/LoginByMobilePhone", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 设置用户key |
| | | setUserKey(data) { |
| | | return request({ |
| | | url: "/identity/api/ApiAppUserSetKey", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 获取用户key |
| | | getUserKey(data) { |
| | | return request({ |
| | | url: "/identity/api/ApiGetAppUserKey", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 删除用户key |
| | | delUserKey(data) { |
| | | return request({ |
| | | url: "/identity/api/ApiDelAppUserKey", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 获取去当前用户信息 |
| | | getCurrentAppUser() { |
| | | return request({ |
| | | url: "/identity/api/GetCurrentAppUser", |
| | | method: "post", |
| | | }); |
| | | }, |
| | | |
| | | // 添加用户信息 |
| | | setAppUserInfo(data) { |
| | | return request({ |
| | | url: "/identity/api/SetAppUserInfoRequest", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 用户更换绑定手机号,如没有绑定手机则自动创建 |
| | | userSetPhoneNumber(data) { |
| | | return request({ |
| | | url: "/identity/api/ApiUserSetPhoneNumber", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 检测用户是否绑定微信 |
| | | checkBuildingWeChat(data) { |
| | | return request({ |
| | | url: "/identity/api/ApiCheckBuildingWeChat", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | |
| | | // 通过手机号重置密码 |
| | | changePasswordByMobilePhone(data) { |
| | | return request({ |
| | | url: "/identity/api/ChangePasswordByMobilePhone", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 微信开放平台扫码登录 |
| | | loginByWeChatOpenCode(data) { |
| | | return request({ |
| | | url: "/identity/api/LoginByWeChatOpenCode", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | }, |
| | | |
| | | // 用户绑定微信号 |
| | | bindingWeChat(data) { |
| | | return request({ |
| | | url: "/identity/api/ApiBindingWeChat", |
| | | method: "post", |
| | | 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; |
New file |
| | |
| | | import request from '@/plugin/axios/index.ts' |
| | | import { tokenKey, goodsStore } from '@/assets/js/config.ts' |
| | | import { handleQueryResourceListData, handleDetailQueryRequestData } from '../tool' |
| | | const storeApi = { |
| | | /* |
| | | **获取商品列表** |
| | | path: 数据路径 |
| | | storeInfo: 仓储 |
| | | channelInfo: 频道 |
| | | subAccess: |
| | | queryType: 检索类型 |
| | | paging: 分页 |
| | | sort: 排序 |
| | | fields: 自定义字段 |
| | | */ |
| | | getProductList: ({ |
| | | path = '', |
| | | storeInfo = goodsStore, |
| | | storeEventIdOrRefCode = '', |
| | | favoriteTypes = '', |
| | | queryType, |
| | | linkType, |
| | | subAccess = [], |
| | | paging = {}, |
| | | sort, |
| | | fields, |
| | | filterList, |
| | | coverSize, |
| | | mainProductId, |
| | | handelEBooK |
| | | }) => { |
| | | const query = { |
| | | AccessControl: { |
| | | Path: path, |
| | | StoreRefCode: storeInfo + '', |
| | | Type: queryType || '\\', |
| | | LinkType: linkType || '' |
| | | }, |
| | | FavoriteTypes: favoriteTypes ? [favoriteTypes] : [], |
| | | SubAccess: subAccess.length > 0 ? subAccess : [], |
| | | PageQuery: { |
| | | Start: paging.start || '0', |
| | | Size: paging.size || '10' |
| | | }, |
| | | SortQuery: |
| | | sort?.length == 0 |
| | | ? [] |
| | | : sort |
| | | ? [sort] |
| | | : [ |
| | | { |
| | | LinkOrder: 'Desc' |
| | | } |
| | | ], |
| | | CreateDate: [], |
| | | Description: [], |
| | | Name: [], |
| | | Icon: [], |
| | | RefCode: [], |
| | | TypeId: [], |
| | | SysType: [], |
| | | State: [], |
| | | Tag: [], |
| | | BeginDate: [], |
| | | EndDate: [], |
| | | ProductLinkInfo: [], |
| | | AllowDonate: [], |
| | | // DonatePriceList: [], |
| | | StoreEvent: [], |
| | | SubProductCount: [], |
| | | SaleMethod: [], |
| | | SaleMethodValid: [], |
| | | StoreEventIdOrRefCode: storeEventIdOrRefCode, |
| | | ...fields, |
| | | ...filterList |
| | | } |
| | | if (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({ |
| | | 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 |
| | | }).then((resp) => { |
| | | if (resp.length > 0) { |
| | | const data = resp[0] |
| | | const datas = handleQueryResourceListData({ |
| | | datas: data.datas, |
| | | fields, |
| | | path, |
| | | storeInfo, |
| | | coverSize, |
| | | handelEBooK |
| | | }) |
| | | return { |
| | | datas, |
| | | total: data.totalCount, |
| | | extraInfos: data.extraInfos?.StoreEvent |
| | | } |
| | | } |
| | | return { |
| | | datas: [], |
| | | total: 0 |
| | | } |
| | | }) |
| | | }, |
| | | /* |
| | | **获取商品详情** |
| | | path: 数据路径 |
| | | storeInfo: 仓储 |
| | | channelInfo: 频道 |
| | | subAccess: |
| | | fields: 自定义字段 |
| | | productId: 商品ID |
| | | cmsPath:cmsPath |
| | | */ |
| | | getProductDetail: ({ |
| | | 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: [], |
| | | 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: [], |
| | | 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: [], |
| | | LinkTypes: [linkType.linkType], |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 100 |
| | | }, |
| | | ProductLinkInfo: [], |
| | | ...linkType.fields |
| | | } |
| | | linkFields = { |
| | | ...linkFields, |
| | | ...linkType.fields |
| | | } |
| | | } |
| | | } |
| | | 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: [], |
| | | 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', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 获取用户已领取的优惠券列表 |
| | | getPromoteCodeList(data) { |
| | | return request({ |
| | | url: '/store/api/ApiGetPromoteCodeList', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 获取用户浏览排行 |
| | | getProductViewRank(data) { |
| | | return request({ |
| | | url: '/store/api/ApiGetProductViewRank', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 获取用户销售排行 |
| | | getProductSaleRank(data) { |
| | | return request({ |
| | | url: '/store/api/ApiGetProductSaleRank', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 获取商品可用优惠券 |
| | | getProductPromoteCodeList(data) { |
| | | return request({ |
| | | url: '/store/api/ApiGetProductPromoteCodeList', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 获取订单可用优惠券 |
| | | getOrderPromoteCodeList(data) { |
| | | return request({ |
| | | url: '/store/api/GetOrderPromoteCodeList', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 获取销售方式可用优惠券 |
| | | getSaleMethodPromoteCodeList(data) { |
| | | return request({ |
| | | url: '/store/api/GetSaleMethodPromoteCodeList', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 领取优惠卷 |
| | | getPromoteCode(data) { |
| | | return request({ |
| | | url: '/store/api/ApiGetPromoteCode', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 为订单使用优惠券 |
| | | updateOrderPromoteCode(data) { |
| | | return request({ |
| | | url: '/store/api/UpdateOrderPromoteCode', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 为销售方式使用优惠券 |
| | | updateSaleMethodPromoteCode(data) { |
| | | return request({ |
| | | url: '/store/api/UpdateSaleMethodPromoteCode', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 通过订单号获取订单 |
| | | getOrderByOrderNum(data) { |
| | | return request({ |
| | | url: '/store/api/GetOrderByOrderNum', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 创建订单 |
| | | initOrder(data) { |
| | | return request({ |
| | | url: '/store/api/InitOrder', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 确认订单 |
| | | confirmOrder(data) { |
| | | return request({ |
| | | url: '/store/api/ConfirmOrder', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 取消订单 |
| | | cancelOrder(data) { |
| | | return request({ |
| | | url: '/store/api/CancelOrder', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 赞赏 |
| | | CreateDonateOrder(data) { |
| | | return request({ |
| | | url: '/store/api/CreateDonateOrder', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | //获取用户订单列表 |
| | | getUserOrderList(data) { |
| | | return request({ |
| | | url: '/store/api/GetUserOrderList', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | //获取频道下的列表 |
| | | getStoreChannelList(data) { |
| | | return request({ |
| | | url: '/store/api/ApiGetStoreChannelList', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | //获取购物车 |
| | | getShoppingCartProductList(data) { |
| | | return request({ |
| | | url: '/store/api/ApiGetShoppingCartProductList', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | //添加到购物车 |
| | | addShoppingCart(data) { |
| | | return request({ |
| | | url: '/store/api/ApiAddShoppingCart', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | //购物车删除商品 |
| | | delShoppingCart(data) { |
| | | return request({ |
| | | url: '/store/api/ApiDelShoppingCart', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | //从购物车创建订单 |
| | | shoppingCartCreateOrder(data) { |
| | | return request({ |
| | | url: '/store/api/ApiShoppingCartCreateOrder', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | //获取已购买的商品列表 |
| | | getPurchasedProductList(data) { |
| | | return request({ |
| | | url: '/store/api/ApiGetPurchasedProductList', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | //调取微信支付 |
| | | makeWeChatPay(data) { |
| | | return request({ |
| | | url: '/store/api/MakeWeChatPay', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | //调取微信二维码支付 |
| | | makeWeChatQrPay(data) { |
| | | return request({ |
| | | url: '/store/api/MakeWeChatQrPay', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 获取激活码详情 |
| | | getActiveCode(data) { |
| | | return request({ |
| | | url: '/store/api/ApiGetActiveCode', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 使用激活码 |
| | | userActiveCode(data) { |
| | | return request({ |
| | | 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', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 收藏或加入书架 |
| | | addProductLink(data) { |
| | | return request({ |
| | | url: '/store/api/ApiAddProductLink', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 取消收藏或移除书架 |
| | | delProductLink(data) { |
| | | return request({ |
| | | url: '/store/api/ApiDelProductLink', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | //购买免费商品 |
| | | MakeFreeOrderPay(data) { |
| | | return request({ |
| | | url: '/store/api/MakeFreeOrderPay', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | // 申请订单开票 |
| | | 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 |
New file |
| | |
| | | import { requestCtx, appId } from "@/assets/js/config.ts"; |
| | | import defaultImg from "@/assets/images/default-book-img.png"; |
| | | import bookCover from "@/assets/images/book-cover.png"; |
| | | import moment from "moment"; |
| | | // 处理列表查询结果 |
| | | export function handleQueryResourceListData({ |
| | | datas, |
| | | fields, |
| | | path, |
| | | storeInfo, |
| | | repositoryInfo, |
| | | coverSize, |
| | | handelEBooK, |
| | | }) { |
| | | const dataList = []; |
| | | for (let i = 0; i < datas.length; i++) { |
| | | const item = datas[i]; |
| | | // 处理字段 |
| | | const _fields = {}; |
| | | if (fields != null) { |
| | | for (let fieldKey in fields) { |
| | | if (item.datas[fieldKey]) { |
| | | const values = JSON.parse(item.datas[fieldKey]); |
| | | if (values.length > 0) { |
| | | // 用字段名处理返回的字段值 |
| | | if (values[0].Value) { |
| | | _fields[fieldKey] = values[0].Value; |
| | | } else if (values[0].Data) { |
| | | _fields[fieldKey] = values[0].Data.Value; |
| | | } |
| | | item.datas[fieldKey] = values[0]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | const subDatas = {}; |
| | | if (item.subDatas) { |
| | | for (let subData of item.subDatas) { |
| | | const tag = subData.queryTag.replace("Query", ""); |
| | | subDatas[tag] = subData.datas; |
| | | } |
| | | } |
| | | |
| | | let obj = { |
| | | ...item, |
| | | id: item.id, |
| | | name: item.datas.Name, |
| | | icon: getPublicImage( |
| | | item.datas.Icon, |
| | | coverSize?.width, |
| | | coverSize?.height, |
| | | storeInfo |
| | | ), |
| | | repositoryInfo: repositoryInfo, |
| | | 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"), |
| | | description: item.datas.Description, |
| | | sysType: item.datas.SysType, |
| | | idPath: path + "\\" + item.id, |
| | | typeId: parseInt(item.datas.TypeId), |
| | | linkFile: JSON.parse(item.datas.LinkFile ?? "[]"), |
| | | cmsItemType: item.datas.CmsItemType, |
| | | allowDonate: item.datas.AllowDonate == "True", |
| | | // donatePriceList: JSON.parse(item.datas.DonatePriceList ?? "[]"), |
| | | 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, |
| | | }; |
| | | |
| | | // 统一处理价格 |
| | | 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 event = obj.storeEvent.filter((item) => { |
| | | 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; |
| | | if ( |
| | | moment().format("YYYY-MM-DD") < |
| | | moment(obj.defaultSaleMethod.endDate).format("YYYY-MM-DD") |
| | | ) { |
| | | obj.defaultSaleMethodState = "Normal"; |
| | | } else { |
| | | obj.defaultSaleMethodState = "Beyond"; |
| | | } |
| | | } |
| | | } else { |
| | | 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); |
| | | } |
| | | return dataList; |
| | | } |
| | | |
| | | // 处理详情查询结果 |
| | | export function handleDetailQueryRequestData({ |
| | | item, |
| | | fields, |
| | | path, |
| | | coverSize, |
| | | itemFields, |
| | | handelEBooK, |
| | | }) { |
| | | item.fileMap = {}; |
| | | let itemFieldsData = []; |
| | | for (const key in itemFields) { |
| | | itemFieldsData.push(key); |
| | | } |
| | | let fieldsData = []; |
| | | for (const key in fields) { |
| | | fieldsData.push(key); |
| | | } |
| | | for (let i = 0; i < fieldsData.length; i++) { |
| | | const field = fieldsData[i]; |
| | | item.datas[field] = JSON.parse(item.datas[field]); |
| | | const datas = item.datas[field]; |
| | | 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, |
| | | }; |
| | | }) |
| | | ), |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 处理cms资源 |
| | | const subDatas = item.subDatas; |
| | | const linkItemsMap = {}; |
| | | if (subDatas) { |
| | | for (const sdata of subDatas) { |
| | | const tag = sdata.queryTag; |
| | | for (const subItem of sdata.datas) { |
| | | convertCmsItemBase(subItem, coverSize, handelEBooK); |
| | | subItem.fileMap = {}; |
| | | for (let i = 0; i < itemFieldsData.length; i++) { |
| | | const itemField = itemFieldsData[i]; |
| | | try { |
| | | subItem.datas[itemField] = JSON.parse(subItem.datas[itemField]); |
| | | } catch (error) { |
| | | subItem.datas[itemField] = []; |
| | | } |
| | | const itemDatas = subItem.datas[itemField]; |
| | | if (itemDatas.length > 0) { |
| | | if (itemDatas[0].Value) { |
| | | subItem[itemField] = itemDatas[0].Value; |
| | | if (itemDatas[0].FileList && itemDatas[0].FileList.length) { |
| | | subItem.fileMap = { |
| | | ...subItem.fileMap, |
| | | ...handleLinkFileInfo(itemDatas[0].FileList), |
| | | }; |
| | | } |
| | | } else if (itemDatas[0].Data) { |
| | | subItem[itemField] = itemDatas[0].Data.Value; |
| | | if ( |
| | | itemDatas[0].Data.FileList && |
| | | itemDatas[0].Data.FileList.length |
| | | ) { |
| | | subItem.fileMap = { |
| | | ...subItem.fileMap, |
| | | ...handleLinkFileInfo(itemDatas[0].Data.FileList), |
| | | }; |
| | | } |
| | | } else if (itemDatas[0].CmsItemData) { |
| | | subItem[itemField] = itemDatas[0].CmsItemData.Value; |
| | | if ( |
| | | itemDatas[0].CmsItemData.FileList && |
| | | itemDatas[0].CmsItemData.FileList.length |
| | | ) { |
| | | subItem.fileMap = { |
| | | ...subItem.fileMap, |
| | | ...handleLinkFileInfo(itemDatas[0].CmsItemData.FileList), |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (subItem.productLinkInfo && subItem.productLinkInfo.length) |
| | | subItem.productLinkPath = |
| | | subItem.productLinkInfo[0].LinkPath + |
| | | "\\" + |
| | | subItem.productLinkInfo[0].CmsItemId; |
| | | if (subItem.linkInfo && subItem.linkInfo.length) |
| | | subItem.linkPath = |
| | | subItem.linkInfo[0].LinkPath + "\\" + subItem.linkInfo[0].CmsItemId; |
| | | } |
| | | linkItemsMap[tag] = sdata.datas; |
| | | } |
| | | } |
| | | convertCmsItemBase(item, coverSize, handelEBooK); |
| | | item.idPath = path + "\\" + item.id; |
| | | item.subItems = linkItemsMap; |
| | | return item; |
| | | } |
| | | |
| | | const handleLinkFileInfo = (linkList) => { |
| | | let linkFileMap = {}; |
| | | for (let z = 0; z < linkList.length; z++) { |
| | | const linkItem = linkList[z]; |
| | | linkFileMap[linkItem.Md5] = { |
| | | linkType: linkItem.LinkType, |
| | | extension: linkItem.Extension, |
| | | fileName: linkItem.FileName, |
| | | fileType: linkItem.Type, |
| | | md5: linkItem.Md5, |
| | | icon: linkItem.Icon, |
| | | size: linkItem.Size, |
| | | metaData: JSON.parse(linkItem.MetaData ?? "{}"), |
| | | order: linkItem.Order, |
| | | protectType: linkItem.ProtectType, |
| | | }; |
| | | } |
| | | 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,storeInfo) { |
| | | let src = null; |
| | | if (md5) { |
| | | src = requestCtx + `/file/GetPreViewImage?md5=${md5}`; |
| | | } else { |
| | | if(storeInfo == 'jsek_bookFair') { |
| | | // return defaultBookFair; |
| | | return |
| | | }else if(storeInfo == `defaultGoodsStore${appId}`){ |
| | | return bookCover; |
| | | }else |
| | | { |
| | | return defaultImg; |
| | | } |
| | | |
| | | } |
| | | if (width) src += `&width=${width}`; |
| | | if (height) src += `&height=${height}`; |
| | | return src; |
| | | } |
| | |
| | | float: right; |
| | | color:#707070; |
| | | padding-right:5px; |
| | | } |
| | | |
| | | .icon-tabler-arrow-bar-to-left,.icon-tabler-arrow-bar-to-right{ |
| | | color:#707070 !important; |
| | | } |
| | |
| | | <div class="layoutBox"> |
| | | <RouterView /> |
| | | </div> |
| | | </template> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref, reactive, watch } from 'vue' |
| | |
| | | import router from './router' |
| | | import * as ElementPlusIconsVue from '@element-plus/icons-vue' |
| | | import toolClass from '@/assets/js/toolClass' |
| | | import request from '@/plugin/axios/index.ts' |
| | | import MG from "@/assets/js/middleGround/WebMiddleGroundApi.js" |
| | | import './child.ts' |
| | | |
| | | const handleGetToken = () => { |
| | | return localStorage.getItem('token') |
| | | } |
| | | |
| | | const getUrlParam =(paraName)=>{ |
| | | var url = window.location.toString(); |
| | | var arrObj = url.split("?"); |
| | | if (arrObj.length > 1) { |
| | | var arrPara = arrObj[1].split("&"); |
| | | var arr; |
| | | for (var i = 0; i < arrPara.length; i++) { |
| | | arr = arrPara[i].split("="); |
| | | if (arr != null && arr[0] == paraName) { |
| | | return arr[1]; |
| | | } |
| | | } |
| | | return ""; |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | // 路由执行之前的一些操作 |
| | | router.beforeEach((to, from, next) => { |
| | | // 如果有token |
| | | if (handleGetToken()) { |
| | | let token = getUrlParam('token'); |
| | | let bookId = getUrlParam('bookId'); |
| | | if(bookId){ |
| | | localStorage.setItem('bookId', bookId) |
| | | } |
| | | |
| | | if (token) { |
| | | localStorage.setItem('token', token) |
| | | |
| | | if (to.path === '/login') { |
| | | next({ path: '/home' }) |
| | | } else { |
| | | // 如果不是登录页面,跳转到目标的页面 |
| | | next() |
| | | } |
| | | }else if (handleGetToken()) { |
| | | // 是否是登录页面,直接到首页 |
| | | if (to.path === '/login') { |
| | | next({ path: '/transmission' }) |
| | | next({ path: '/home' }) |
| | | } else { |
| | | // 如果不是登录页面,跳转到目标的页面 |
| | | next() |
| | |
| | | } |
| | | } |
| | | }) |
| | | |
| | | |
| | | // qiankun主应用与微应用通讯 |
| | | // import { initGlobalState, type MicroAppStateActions } from 'qiankun' |
| | |
| | | const app = createApp(App) |
| | | |
| | | app.provide('toolClass', toolClass) |
| | | app.provide('request', request) |
| | | app.provide('MG', MG) |
| | | app.use(router) |
| | | app.use(ElementPlus) |
| | | app.use(pinia) |
| | |
| | | } |
| | | |
| | | app.mount('#parentApp') |
| | | |
| | |
| | | const state = { |
| | | state: 0, |
| | | bookName:"", |
| | | bookId:0, |
| | | getBookConfig: null, |
| | | windowSelection: null, |
| | |
| | | import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router' |
| | | import Layout from '@/layout/layout.vue' |
| | | const Home = () => import('@/views/home.vue') |
| | | const Reader = () => import('@/views/home.vue') |
| | | const Login = () => import('@/views/login.vue') |
| | | |
| | | const router = createRouter({ |
| | |
| | | component: Layout, |
| | | children: [ |
| | | { |
| | | path: '/index', |
| | | name: 'index', |
| | | meta: { auth: true }, |
| | | component: () => import('@/views/index.vue'), |
| | | children: [ |
| | | { |
| | | path: '/bookshelfList', |
| | | name: 'bookshelfList', |
| | | meta: { auth: true, name: '书架' }, |
| | | component: () => import('@/views/bookshelfList/list.vue') |
| | | }, |
| | | { |
| | | path: '/classeManagement', |
| | | name: 'classeManagement', |
| | | meta: { auth: true, name: '班级' }, |
| | | component: () => import('@/views/classeManagement/list.vue') |
| | | }, |
| | | { |
| | | path: '/jobManagement', |
| | | name: 'jobManagement', |
| | | meta: { auth: true, name: '作业' }, |
| | | component: () => import('@/views/jobManagement/list.vue') |
| | | }, |
| | | { |
| | | path: '/personalCenter', |
| | | name: 'personalCenter', |
| | | meta: { auth: true, name: '个人中心' }, |
| | | component: () => import('@/views/personalCenter/index.vue') |
| | | }, |
| | | { |
| | | path: '/messageList', |
| | | name: 'messageList', |
| | | meta: { auth: true, name: '消息' }, |
| | | component: () => import('@/views/messageList/list.vue') |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: '/home', |
| | | name: 'home', |
| | | meta: { auth: true }, |
| | | component: Home |
| | | meta: { auth: true, name: '阅读器' }, |
| | | component: Reader |
| | | }, |
| | | |
| | | { |
| | | path: '/dictionary', |
| | | name: 'dictionary', |
| | | meta: { auth: true }, |
| | | meta: { auth: true, name: '词典' }, |
| | | component: () => import('@/views/components/dictionary.vue') |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | { |
| | | path: '/login', |
| | | name: 'login', |
New file |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="topBox"> |
| | | <div class="searchBox"> |
| | | <el-input |
| | | class="custom-input" |
| | | placeholder="请输入内容" |
| | | v-model="searchText" |
| | | @keyup.enter="searchBook" |
| | | > |
| | | <template #suffix> |
| | | <el-icon @click="searchBook"><Search /></el-icon> |
| | | </template> |
| | | </el-input> |
| | | </div> |
| | | <div class="manageBox"> |
| | | <div class="manageItem"><img :src="jihe" /><div class="label">激活</div></div> |
| | | <div class="manageItem"><img :src="jihe" /><div class="label">管理</div></div> |
| | | <div class="manageItem"><img :src="jihe" /><div class="label">更多教材</div></div> |
| | | </div> |
| | | </div> |
| | | <div class="contentBox"></div> |
| | | </div> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { useRouter, onBeforeRouteUpdate } from 'vue-router' |
| | | import { ref, onMounted,inject } from 'vue' |
| | | const router = useRouter() |
| | | const MG: any = inject('MG') |
| | | |
| | | import jihe from '@/assets/images/menu/jihe.png' |
| | | |
| | | const searchText = ref('') |
| | | onMounted(() => {}) |
| | | |
| | | const searchBook = () => {} |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | .page { |
| | | width: 100%; |
| | | height: 100%; |
| | | padding: 20px; |
| | | .topBox { |
| | | display: flex; |
| | | .searchBox { |
| | | padding: 0 20px; |
| | | .el-input .el-input__wrapper{ |
| | | border-radius:20px !important; |
| | | height:34px; |
| | | background: #FFFFFF; |
| | | |
| | | } |
| | | } |
| | | .manageBox { |
| | | display: flex; |
| | | .manageItem { |
| | | margin: 0 15px; |
| | | display:flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | img{ |
| | | width:24px; |
| | | height:24px; |
| | | } |
| | | .label{ |
| | | padding-left:10px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="contentPage"> |
| | | 班级 |
| | | </div> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { useRouter, onBeforeRouteUpdate } from "vue-router"; |
| | | import { ref, onMounted } from "vue"; |
| | | const router = useRouter(); |
| | | |
| | | |
| | | onMounted(() => { |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | |
| | | |
| | | </style> |
| | |
| | | import { ref, reactive, watch, onMounted, inject } from 'vue' |
| | | const request = inject('request') |
| | | const props = defineProps({ |
| | | searchCon: Boolean |
| | | searchCon: String |
| | | }) |
| | | const searchContent = ref('') |
| | | const isFull = ref(false) |
| | | watch(props, (newValue) => { |
| | | // 统监听props的值变化,动态修改isShow的值 |
| | | searchContent.value = newValue.searchCon |
| | | getSearchResult() |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | if(props){ |
| | | searchContent.value = props.searchCon |
| | | getSearchResult() |
| | | } |
| | | }) |
| | | |
| | | const searchResult = ref([]) |
| | | |
| | | |
| | | const getSearchResult = () => { |
| | | if (searchContent.value) { |
| | |
| | | isFull: isFull.value |
| | | } |
| | | }).then((res) => { |
| | | console.log(JSON.parse(res[0].sentence)[0].sCn) |
| | | // encodeURIComponent(res[0].syno[0].tran) |
| | | if (res.length > 0) { |
| | | res.map((item) => { |
| | | item.phrase = JSON.parse(item.phrase) |
New file |
| | |
| | | <template> |
| | | <div class="menuList"> |
| | | <ul class="menu-top"> |
| | | <li |
| | | v-for="item in menuList.menu" |
| | | :key="item.key" |
| | | @click="goRouter(item)" |
| | | :class="`/${item.path}` === path ? 'activeItem hover' : 'menuItem hover'" |
| | | > |
| | | <img :src="item.icon" alt="" /> |
| | | <div>{{ item.label }}</div> |
| | | </li> |
| | | </ul> |
| | | <ul class="menu-bottom"> |
| | | <li |
| | | v-for="item in menuList.user" |
| | | :key="item.key" |
| | | @click="goRouter(item)" |
| | | :class="`/${item.path}` === path ? 'activeItem hover' : 'menuItem hover'" |
| | | > |
| | | <img :src="item.icon" alt="" /> |
| | | <div>{{ item.label }}</div> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { useRouter, onBeforeRouteUpdate } from 'vue-router' |
| | | import { ref, reactive, onMounted } from 'vue' |
| | | const router = useRouter() |
| | | const routerVal = router.currentRoute.value |
| | | const path = ref(routerVal.path) |
| | | import ziyuan from '@/assets/images/menu/ziyuan.png' |
| | | |
| | | const menuList = reactive({ |
| | | menu: [ |
| | | { |
| | | label: '书架', |
| | | key: '1', |
| | | path: 'bookshelfList', |
| | | icon: ziyuan |
| | | }, |
| | | { |
| | | label: '班级', |
| | | key: '2', |
| | | path: 'classeManagement', |
| | | icon: ziyuan |
| | | }, |
| | | { |
| | | label: '作业', |
| | | key: '3', |
| | | path: 'jobManagement', |
| | | icon: ziyuan |
| | | } |
| | | ], |
| | | user: [ |
| | | { |
| | | label: '个人中心', |
| | | key: '4', |
| | | path: 'personalCenter', |
| | | icon: ziyuan |
| | | }, |
| | | { |
| | | label: '消息', |
| | | key: '5', |
| | | path: 'messageList', |
| | | icon: ziyuan |
| | | }, |
| | | { |
| | | label: '设置', |
| | | key: '6', |
| | | path: 'setting', |
| | | icon: ziyuan |
| | | } |
| | | ] |
| | | }) |
| | | onBeforeRouteUpdate(async (to, from) => { |
| | | path.value = to.fullPath |
| | | }) |
| | | onMounted(() => {}) |
| | | const goRouter = (item) => { |
| | | if (!localStorage.getItem('token')) { |
| | | return router.push({ |
| | | path: '/home' |
| | | }) |
| | | } |
| | | router.push({ path: item.path }) |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | .menuList { |
| | | height: 100%; |
| | | padding: 10px; |
| | | text-align: center; |
| | | position: relative; |
| | | font-size: 14px; |
| | | color: #b3b3b3; |
| | | li { |
| | | margin-bottom: 10px; |
| | | img { |
| | | width: 24px; |
| | | height: 24px; |
| | | } |
| | | } |
| | | .menuItem { |
| | | color: #b3b3b3; |
| | | } |
| | | |
| | | .menu-bottom { |
| | | position: absolute; |
| | | bottom: 20px; |
| | | margin: 0 auto; |
| | | } |
| | | .activeItem { |
| | | color: #4d4d4d; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="homeBox"> |
| | | <div class="headerBox"> |
| | | <!-- <span class="logoTxt">北京师范大学出版集团</span> --> |
| | | <img :src="logo" /> |
| | | |
| | | <img :src="logo" v-if="bookConfig.textbookOwnership == '北京师范大学出版集团'" /> |
| | | <!-- <span class="logoTxt" v-else>铁道出版社</span> --> |
| | | <span></span> |
| | | <div class="userInfoBox"> |
| | | <div></div> |
| | | <div></div> |
| | | <div class="userName" v-if="userInfo.name">{{userInfo.name}}</div> |
| | | <div><div class="layout hover" @click="layoutBtn">退出</div></div> |
| | | </div> |
| | | </div> |
| | | <div class="contentBox"> |
| | | <!-- 菜单 --> |
| | | <div class="menuBox"> |
| | | <div |
| | | v-for="(item, index) in menuData" |
| | | :key="index" |
| | | @click="menuItemClick(item.name)" |
| | | > |
| | | <div :class="['menuItem', activeMenu == item.name ? 'active' : '']" v-if="item.isShow"> |
| | | <div class="menuIcon imgBox"> |
| | | <img :src="item.icon" /> |
| | | <div v-for="(item, index) in menuData" :key="index" @click="menuItemClick(item.name)"> |
| | | <div :class="['menuItem', activeMenu == item.name ? 'active' : '']" v-if="item.isShow"> |
| | | <div class="menuIcon imgBox"> |
| | | <img :src="item.icon" /> |
| | | </div> |
| | | <div class="name">{{ item.name }}</div> |
| | | </div> |
| | | <div class="name">{{ item.name }}</div> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="reload hover" @click="reload()">刷新</div> --> |
| | | <!-- 设置 --> |
| | |
| | | @keyup.enter="searchBook" |
| | | > |
| | | <template #prefix> |
| | | <el-icon class="hover"><Search /></el-icon> |
| | | <el-icon><Search /></el-icon> |
| | | </template> |
| | | <template #suffix> |
| | | <svg @click="searchBook" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-list-search hover"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 15m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /><path d="M18.5 18.5l2.5 2.5" /><path d="M4 6h16" /><path d="M4 12h4" /><path d="M4 18h4" /></svg> |
| | | </template> |
| | | </el-input> |
| | | </div> |
| | |
| | | <el-tree |
| | | ref="catalogTree" |
| | | default-expand-all="true" |
| | | expand-on-click-node="false" |
| | | :expand-on-click-node="false" |
| | | :data="catalogueData" |
| | | :props="defaultProps" |
| | | v-if="catalogueData.length > 0" |
| | |
| | | </div> |
| | | </template> |
| | | </el-tree> |
| | | <div v-if="catalogueData.length == 0"> |
| | | <div v-else> |
| | | <el-empty :image-size="60" description="暂无数据" /> |
| | | </div> |
| | | </div> |
| | |
| | | <template #prefix> |
| | | <el-icon><Search /></el-icon> |
| | | </template> |
| | | <template #suffix> |
| | | <svg @click="searchBook" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-list-search hover"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 15m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /><path d="M18.5 18.5l2.5 2.5" /><path d="M4 6h16" /><path d="M4 12h4" /><path d="M4 18h4" /></svg> |
| | | </template> |
| | | </el-input> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 菜单内容收起 --> |
| | | <div class="menuStateBox" v-if="menuState.open"> |
| | | <svg @click="menuState.open = false" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-bar-to-left"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12l10 0" /><path d="M10 12l4 4" /><path d="M10 12l4 -4" /><path d="M4 4l0 16" /></svg> |
| | | <!-- <img :src="shouqiL" @click="menuState.open = false" /> --> |
| | | </div> |
| | | </div> |
| | | <!-- 菜单内容收起 --> |
| | | <div class="menuStateBox" v-if="menuState.open"> |
| | | <img :src="shouqiL" @click="menuState.open = false" /> |
| | | </div> |
| | | |
| | | <!-- 中间内容 --> |
| | | <div class="pageBox"> |
| | | <!-- 头部显示 --> |
| | |
| | | </div> |
| | | <div class="rightBox"> |
| | | <div class="pageSizeBox"> |
| | | <div><img :src="zoomIn" @click="changePageSize('add')" /></div> |
| | | <div>{{ headerData.pageSize }}%</div> |
| | | <div><img :src="zoomOut" @click="changePageSize('reduce')" /></div> |
| | | <div>{{ headerData.pageSize }}%</div> |
| | | <div><img :src="zoomIn" @click="changePageSize('add')" /></div> |
| | | </div> |
| | | <!-- <div class="brushImgBox"> |
| | | <div @click="jumpContent('note' + index)"> |
| | |
| | | <div class="pageBox-content"> |
| | | <div class="content-box"> |
| | | <div |
| | | id="container" |
| | | @mousedown="handleMouseDown" |
| | | @mousemove="handleMousemove" |
| | | :style="{ background: settingForm.bgColorActive }" |
| | | id="container" :style="{ background: settingForm.bgColorActive }" |
| | | ></div> |
| | | <!-- 画笔画布 --> |
| | | <div class="canvas-box" v-show="canvasShow"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 教学组件 --> |
| | | <div class="toolBox"> |
| | | <div class="toolTitle"> |
| | | <span>{{ toolState.open ? '学习组件' : '组件' }}</span> |
| | | <div class="text"></div> |
| | | </div> |
| | | <div class="menuList"> |
| | | <ul class="menu"> |
| | | <li v-for="item in teachToolsMenuData" :key="item.key"> |
| | | <div :class="item.name === activeTool ? 'activeItem hover' : 'menuItem hover'" :style="!toolState.open ? 'padding:10px 15px' : ''" v-if="item.isShow" @click="selectTeachTools(item)"> |
| | | <img :src="item.icon" alt="" /> |
| | | <span v-if="toolState.open">{{ item.name }}</span> |
| | | </div> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | <div :class="['openBox', toolState.open ? 'right' : '']"> |
| | | <img :src="shouqiR" v-if="toolState.open" @click="toolState.open = false" /> |
| | | <img :src="shouqiL" v-if="!toolState.open" @click="toolState.open = true" /> |
| | | </div> |
| | | <div class="classRoomBox" v-if="false"> |
| | | <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> |
| | | <el-tab-pane label="备课组件" name="first"> |
| | | <div class="tabBox"> |
| | | <div class="insertSelect"> |
| | | <div |
| | | :class="selectType == 'resource' ? 'typeActive' : 'selectItem hover'" |
| | | @click="selectTypeClick('resource')" |
| | | > |
| | | <img :src="selectType == 'resource' ? charuziyuan_blue : charuziyuan" /> |
| | | <div>插入资源</div> |
| | | </div> |
| | | <div |
| | | :class="selectType == 'answer' ? 'typeActive' : 'selectItem hover'" |
| | | @click="selectTypeClick('answer')" |
| | | > |
| | | <img :src="selectType == 'answer' ? dati_charu_blue : dati_charu" /> |
| | | <div>插入答题</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="上课组件" name="second"> |
| | | <div class="tabBox"> |
| | | <div class="giveLessons hover" @click="giveLessonsClick()"> |
| | | <img :src="xiake" /> |
| | | <span>{{ classStart ? '上课' : '下课' }}</span> |
| | | </div> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </div> |
| | | <!-- 画笔工具栏 --> |
| | | <div |
| | | draggable="true" |
| | | class="draggableBox" |
| | | @dragstart="dragstart($event)" |
| | | @dragend="dragend($event)" |
| | | :style="`left:${floatingToolData.elLeft}px;top:${floatingToolData.elTop}px`" |
| | | > |
| | | <!-- 画笔组件 --> |
| | | <div |
| | | class="hover" |
| | | v-for="item in floatingToolBox" |
| | | :key="item.name" |
| | | @click="floatItemHandle(item)" |
| | | @mouseover="floatOverHander(item)" |
| | | @mouseout="floatOutHander(item)" |
| | | > |
| | | <div v-if="item.isShow"> |
| | | <el-popover |
| | | placement="right" |
| | | width="120" |
| | | trigger="click" |
| | | v-if="floatingToolData.activeToolData == '标记'" |
| | | > |
| | | <div class="popinnerBox"> |
| | | <div class="label" v-if="floatingToolData.activeToolData == '标记'"> |
| | | <div class="labelItem hover" @click="labelShow('hide')"> |
| | | <img :src="hide" /> |
| | | <div>隐藏</div> |
| | | </div> |
| | | <div class="labelItem hover" @click="labelShow('show')"> |
| | | <img :src="show" /> |
| | | <div>显示</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <template #reference> |
| | | <div |
| | | :class=" |
| | | floatingToolData.activeToolData == item.name |
| | | ? 'floatToolActive floatToolItem' |
| | | : 'floatToolItem' |
| | | " |
| | | > |
| | | <img |
| | | :src="floatingToolData.activeToolData == item.name ? item.activeIcon : item.icon" |
| | | alt="" |
| | | /> |
| | | <div class="text">{{ item.name }}</div> |
| | | </div> |
| | | </template> |
| | | </el-popover> |
| | | <div |
| | | :class=" |
| | | floatingToolData.activeToolData == item.name |
| | | ? 'floatToolActive floatToolItem' |
| | | : 'floatToolItem' |
| | | " |
| | | v-else |
| | | > |
| | | <img |
| | | :src="floatingToolData.activeToolData == item.name ? item.activeIcon : item.icon" |
| | | alt="" |
| | | /> |
| | | <div class="text">{{ item.name }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div |
| | | class="brushBox" |
| | | :style="{ left: brushBoxLeft + 'px' }" |
| | | v-if="floatingToolData.activeToolData == '画笔'" |
| | | > |
| | | <div class="toolList"> |
| | |
| | | </div> |
| | | <template #reference> |
| | | <div class="floatToolItem hover" @click="toolSelectHandle('huabi')"> |
| | | <div class="imgBox"> |
| | | <img :src="huabi2" alt="" /> |
| | | </div> |
| | | <div class="text">画笔</div> |
| | | <el-tooltip class="box-item" effect="dark" content="画笔" placement="bottom"> |
| | | <img :src="huabi2" alt="" class="imgBox"/> |
| | | </el-tooltip> |
| | | <!-- <div class="text">画笔</div> --> |
| | | </div> |
| | | </template> |
| | | </el-popover> |
| | |
| | | </div> |
| | | <template #reference> |
| | | <div class="floatToolItem hover" @click="toolSelectHandle('wenzi')"> |
| | | <div class="imgBox"> |
| | | <img :src="wenzi2" alt="" /> |
| | | </div> |
| | | <div class="text">文字</div> |
| | | <el-tooltip class="box-item" effect="dark" content="文字" placement="bottom"> |
| | | <img :src="wenzi2" alt="" class="imgBox"/> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-popover> |
| | |
| | | </div> |
| | | <template #reference> |
| | | <div class="floatToolItem hover" @click="toolSelectHandle('tuxing')"> |
| | | <div class="imgBox"> |
| | | <img :src="tuxing" alt="" /> |
| | | </div> |
| | | <div class="text">图形</div> |
| | | <el-tooltip class="box-item" effect="dark" content="图形" placement="bottom"> |
| | | <img :src="tuxing" alt="" class="imgBox"/> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-popover> |
| | |
| | | <div class="text">橡皮擦</div> |
| | | </div> --> |
| | | <div class="floatToolItem hover" @click="toolSelectHandle('chexiao')"> |
| | | <div class="imgBox"> |
| | | <img :src="clearPrevious" alt="" /> |
| | | </div> |
| | | <div class="text">撤销</div> |
| | | <el-tooltip class="box-item" effect="dark" content="撤销" placement="bottom"> |
| | | <img :src="clearPrevious" alt="" class="imgBox"/> |
| | | </el-tooltip> |
| | | </div> |
| | | <!-- <div class="floatToolItem" @click="toolSelectHandle('chongzuo')"> |
| | | <div class="imgBox"> |
| | |
| | | <div class="text">重做</div> |
| | | </div> --> |
| | | <div class="floatToolItem hover" @click="toolSelectHandle('qingchu')"> |
| | | <div class="imgBox"> |
| | | <img :src="qingchu2" alt="" /> |
| | | </div> |
| | | <div class="text">清除</div> |
| | | <el-tooltip class="box-item" effect="dark" content="清除" placement="bottom"> |
| | | <img :src="qingchu2" alt="" class="imgBox"/> |
| | | </el-tooltip> |
| | | </div> |
| | | <div class="floatToolItem layOutTool hover" @click="toolSelectHandle('tuichu')"> |
| | | <div class="imgBox"> |
| | | <img :src="tuichu" alt="" /> |
| | | </div> |
| | | <div class="text">退出</div> |
| | | <div class="layOutTool"></div> |
| | | <div class="floatToolItem hover" @click="toolSelectHandle('tuichu')"> |
| | | <el-tooltip class="box-item" effect="dark" content="退出" placement="bottom"> |
| | | <img :src="tuichu" alt="" class="imgBox"/> |
| | | </el-tooltip> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 教学组件 --> |
| | | <div class="toolBox"> |
| | | <div class="toolTitle"> |
| | | <span>{{ toolState.open ? '学习组件' : '组件' }}</span> |
| | | <div class="text"></div> |
| | | </div> |
| | | <div class="menuList"> |
| | | <ul class="menu" v-if="teachToolsMenuData.length > 0"> |
| | | <li v-for="item in teachToolsMenuData" :key="item.key"> |
| | | <div |
| | | :class="item.name === activeTool ? 'activeItem hover' : 'menuItem hover'" |
| | | :style="!toolState.open ? 'padding:10px 15px' : ''" |
| | | v-if="item.isShow" |
| | | @click="selectTeachTools(item)" |
| | | > |
| | | <img :src="item.icon" alt="" /> |
| | | <span v-if="toolState.open">{{ item.name }}</span> |
| | | </div> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | <div :class="['openBox', toolState.open ? 'right' : '']"> |
| | | <!-- <img :src="shouqiR" v-if="toolState.open" @click="toolState.open = false" /> --> |
| | | <!-- <img :src="shouqiL" v-if="!toolState.open" @click="toolState.open = true" /> --> |
| | | <svg v-if="!toolState.open" @click="toolState.open = true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-bar-to-left"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12l10 0" /><path d="M10 12l4 4" /><path d="M10 12l4 -4" /><path d="M4 4l0 16" /></svg> |
| | | <svg v-if="toolState.open" @click="toolState.open = false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-bar-to-right"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 12l-10 0" /><path d="M14 12l-4 4" /><path d="M14 12l-4 -4" /><path d="M20 4l0 16" /></svg> |
| | | </div> |
| | | <div class="classRoomBox" v-if="false"> |
| | | <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> |
| | | <el-tab-pane label="备课组件" name="first"> |
| | | <div class="tabBox"> |
| | | <div class="insertSelect"> |
| | | <div |
| | | :class="selectType == 'resource' ? 'typeActive' : 'selectItem hover'" |
| | | @click="selectTypeClick('resource')" |
| | | > |
| | | <img :src="selectType == 'resource' ? charuziyuan_blue : charuziyuan" /> |
| | | <div>插入资源</div> |
| | | </div> |
| | | <div |
| | | :class="selectType == 'answer' ? 'typeActive' : 'selectItem hover'" |
| | | @click="selectTypeClick('answer')" |
| | | > |
| | | <img :src="selectType == 'answer' ? dati_charu_blue : dati_charu" /> |
| | | <div>插入答题</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="上课组件" name="second"> |
| | | <div class="tabBox"> |
| | | <div class="giveLessons hover" @click="giveLessonsClick()"> |
| | | <img :src="xiake" /> |
| | | <span>{{ classStart ? '上课' : '下课' }}</span> |
| | | </div> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </div> |
| | | <!-- 画笔工具栏 --> |
| | | <div |
| | | draggable="true" |
| | | class="draggableBox" |
| | | :style="`left:${floatingToolData.elLeft}px`" |
| | | v-if="floatingToolBox.length > 0" |
| | | > |
| | | <div |
| | | class="hover" |
| | | v-for="item in floatingToolBox" |
| | | :key="item.name" |
| | | @click="floatItemHandle(item)" |
| | | > |
| | | <div v-if="item.isShow"> |
| | | <el-popover |
| | | placement="right" |
| | | width="120" |
| | | trigger="click" |
| | | v-if="floatingToolData.activeToolData == '标记'" |
| | | > |
| | | <div class="popinnerBox"> |
| | | <div class="label" v-if="floatingToolData.activeToolData == '标记'"> |
| | | <div class="labelItem hover" @click="labelShow('hide')"> |
| | | <img :src="hide" /> |
| | | <div>隐藏</div> |
| | | </div> |
| | | <div class="labelItem hover" @click="labelShow('show')"> |
| | | <img :src="show" /> |
| | | <div>显示</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <template #reference> |
| | | <div |
| | | :class=" |
| | | floatingToolData.activeToolData == item.name |
| | | ? 'floatToolActive floatToolItem' |
| | | : 'floatToolItem' |
| | | " |
| | | > |
| | | <el-tooltip |
| | | class="box-item" |
| | | effect="dark" |
| | | :content="item.name" |
| | | placement="right" |
| | | > |
| | | <img :src="item.icon" alt="" /> |
| | | </el-tooltip> |
| | | <!-- <div class="text">{{ item.name }}</div> --> |
| | | </div> |
| | | </template> |
| | | </el-popover> |
| | | <div |
| | | :class=" |
| | | floatingToolData.activeToolData == item.name |
| | | ? 'floatToolActive floatToolItem' |
| | | : 'floatToolItem' |
| | | " |
| | | v-else |
| | | > |
| | | <el-tooltip class="box-item" effect="dark" :content="item.name" placement="right"> |
| | | <img :src="item.icon" alt="" /> |
| | | </el-tooltip> |
| | | <!-- <div class="text">{{ item.name }}</div> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 选中工具栏 --> |
| | | <div |
| | | class="dialogToolBox" |
| | |
| | | </div> |
| | | <div class="toolSelectBox" v-show="!(toolActive == '高亮' || toolActive == '划线')"> |
| | | <div |
| | | :class="item.name == toolActive ? 'dialogToolItem active' : 'dialogToolItem'" |
| | | v-for="item in dialogToolList" |
| | | :key="item.icon" |
| | | @click="dialogToolHandle(item)" |
| | | @mouseover="dialogOverHander(item)" |
| | | @mouseout="dialogOutHander(item)" |
| | | > |
| | | <img :src="item.name == toolActive ? item.activeIcon : item.icon" alt="" /> |
| | | <span>{{ item.name }}</span> |
| | | <div :class="item.name == toolActive ? 'dialogToolItem active' : 'dialogToolItem'" v-if="item.isShow"> |
| | | <el-tooltip class="box-item" effect="dark" :content="item.name" placement="bottom"> |
| | | <img :src="item.icon" alt="" /> |
| | | </el-tooltip> |
| | | </div> |
| | | <!-- <span>{{ item.name }}</span> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | v-show="lineDelete.showLineDelete" |
| | | :style="{ top: `${lineDelete.top}px`, left: `${lineDelete.left}px` }" |
| | | > |
| | | <el-button @click="delUserKey">删除</el-button> |
| | | <!-- <el-button @click="delUserKey">删除</el-button> --> |
| | | <div class="dialogToolItem"> |
| | | <el-tooltip class="box-item" effect="dark" content="删除" placement="bottom"> |
| | | <img :src="trash" @click="delUserKey"/> |
| | | </el-tooltip> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-dialog title="资源" align-center v-model="resourVisble" width="845" class="resourDialog"> |
| | |
| | | import { useRouter, useRoute } from 'vue-router' |
| | | import useClipboard from 'vue-clipboard3' |
| | | const { toClipboard } = useClipboard() |
| | | const request = inject('request') |
| | | const MG: any = inject('MG') |
| | | const toolClass = inject('toolClass') |
| | | const qiankunActions = inject('qiankunActions') |
| | | //获取路由器 |
| | |
| | | import dati_charu_blue from '../assets/images/operation/dati_charu_blue.png' |
| | | import xiake from '../assets/images/operation/xiake.png' |
| | | |
| | | import huabi from '../assets/images/operation/huabi-w.png' |
| | | import huabi1 from '../assets/images/operation/huabi-b.png' |
| | | import qingchu from '../assets/images/operation/Clearaway-w.png' |
| | | import qingchu1 from '../assets/images/operation/Clearaway-b.png' |
| | | import wenzi from '../assets/images/operation/wenzi-w.png' |
| | | import wenzi1 from '../assets/images/operation/wenzi-b.png' |
| | | import huabi from '../assets/images/operation/brush.svg' |
| | | import wenzi2 from '../assets/images/operation/wenzi.png' |
| | | import biaoqianw from '../assets/images/operation/biaoqian-w.png' |
| | | import biaoqian1 from '../assets/images/operation/biaoqian-b.png' |
| | | import baiban from '../assets/images/operation/baiban-w.png' |
| | | import baiban1 from '../assets/images/operation/baiban-b.png' |
| | | import biaozhu from '../assets/images/operation/biaozhu-w.png' |
| | | import biaozhu1 from '../assets/images/operation/biaozhu-b.png' |
| | | import jieping from '../assets/images/operation/screenshot-w.png' |
| | | import jieping1 from '../assets/images/operation/screenshot-b.png' |
| | | import clear from '../assets/images/operation/clear.png' |
| | | import biaoqianw from '../assets/images/operation/bookmark-plus.svg' |
| | | import baiban from '../assets/images/operation/chalkboard.svg' |
| | | import biaozhu from '../assets/images/operation/pencil-minus.svg' |
| | | import jieping from '../assets/images/operation/crop.svg' |
| | | import clearPrevious from '../assets/images/operation/clearPrevious.png' |
| | | import hide from '../assets/images/operation/hide.png' |
| | | import show from '../assets/images/operation/show.png' |
| | |
| | | import zoomIn from '../assets/images/operation/zoomIn.png' |
| | | import zoomOut from '../assets/images/operation/zoomOut.png' |
| | | import huabi2 from '../assets/images/operation/huabi.svg' |
| | | import trash from '../assets/images/operation/trash.svg' |
| | | |
| | | import shanchu from '../assets/images/operation/delete.png' |
| | | import bianji from '../assets/images/operation/bianji.png' |
| | |
| | | const screenWidth = ref( |
| | | window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth |
| | | ) |
| | | const brushBoxLeft = ref(500) |
| | | let userInfo = ref({}) |
| | | let microApp = null // 微应用实例 |
| | | const bookConfig = ref({}) |
| | | const activeCatalog = ref() |
| | | onMounted(() => { |
| | | getUserInfo() |
| | | setTimeout(() => { |
| | | canvasWith.value = document.querySelector('.content-box').offsetWidth |
| | | canvasheight.value = document.querySelector('.content-box').offsetHeight |
| | |
| | | if (screenWidth.value < 1180) { |
| | | menuState.open = false |
| | | toolState.open = false |
| | | if (!menuState.open) { |
| | | floatingToolData.elLeft = 90 |
| | | } |
| | | } |
| | | brushBoxLeft.value = (screenWidth.value - 450) / 2 |
| | | window.onresize = () => { |
| | | return (() => { |
| | | screenWidth.value = |
| | |
| | | console.log(window.qiankunActions) |
| | | window.qiankunActions.setGlobalState({ |
| | | state: 1, // 加载子应用 |
| | | bookId: localStorage.getItem('bookId'), |
| | | windowSelection: (data) => { |
| | | // 绑定子应用选择监听事件 |
| | | console.log(data, '子应用选择') |
| | |
| | | // if (window.qiankunState && window.qiankunState.aa) window.qiankunState.aa(1) |
| | | }) |
| | | |
| | | |
| | | watch( |
| | | () => screenWidth.value, |
| | | (val) => { |
| | |
| | | if (screenWidth.value < 1180) { |
| | | menuState.open = false |
| | | toolState.open = false |
| | | floatingToolData.elLeft = 100 |
| | | if (!menuState.open) { |
| | | floatingToolData.elLeft = 90 |
| | | } |
| | | } else { |
| | | floatingToolData.elLeft = 300 |
| | | } |
| | | } |
| | | ) |
| | | |
| | | |
| | | const getUserInfo = () => { |
| | | MG.identity.getCurrentAppUser().then((res) => { |
| | | console.log(res, '用户信息') |
| | | if(res){ |
| | | let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') |
| | | let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') |
| | | let phoneInfo = res.secretList.find((item) => item.type == 'MobilePhone') |
| | | let nameAndPassword = res.secretList.find((item) => item.type == 'LoginNameAndPassword') |
| | | |
| | | if (nameAndPassword) { |
| | | userInfo.value = { |
| | | name: nameAndPassword.credential, |
| | | } |
| | | localStorage.setItem('userInfo', JSON.stringify(userInfo.value)) |
| | | }else if(teacherRole && teacherInfos){ |
| | | userInfo.value = { |
| | | name: teacherInfos.name, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id |
| | | } |
| | | localStorage.setItem('userInfo', JSON.stringify(userInfo.value)) |
| | | } else if(phoneInfo){ |
| | | userInfo.value = { |
| | | name: phoneInfo.credential, |
| | | } |
| | | localStorage.setItem('userInfo', JSON.stringify(userInfo.value)) |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | let menuData = [] //菜单 |
| | | let teachToolsMenuData = [] //右侧学习组件 |
| | | let floatingToolBox = [] //中间悬浮组件 |
| | | let dialogToolList =[] //选中文字操作 |
| | | //获取当前书籍所需组件 |
| | | const getTextbookComponents = () => { |
| | | menuData = [] |
| | | teachToolsMenuData = [] |
| | | floatingToolBox = [] |
| | | floatingToolBox = [] |
| | | menuData = [ |
| | | { |
| | | name: '目录', |
| | |
| | | icon: biaoqian, |
| | | isShow: bookConfig.value.textbookComponents.indexOf('CF2E1400') > -1 |
| | | } |
| | | ]; |
| | | ] |
| | | teachToolsMenuData = [ |
| | | { |
| | | name: 'AI智能问答', |
| | |
| | | icon: moxinggongju, |
| | | isShow: bookConfig.value.textbookComponents.indexOf('366F6CF3') > -1 |
| | | } |
| | | ]; |
| | | ] |
| | | floatingToolBox = [ |
| | | { |
| | | icon: huabi, |
| | | activeIcon: huabi1, |
| | | name: '画笔', |
| | | isShow: bookConfig.value.textbookComponents.indexOf('800109C0') > -1 |
| | | }, |
| | | { |
| | | activeIcon: baiban1, |
| | | icon: baiban, |
| | | name: '白板', |
| | | isShow: false |
| | | isShow: bookConfig.value.textbookComponents.indexOf('029DB3E0') > -1 |
| | | }, |
| | | { |
| | | activeIcon: biaozhu1, |
| | | icon: biaozhu, |
| | | name: '标记', |
| | | isShow: bookConfig.value.textbookComponents.indexOf('2E613A8F') > -1 |
| | | }, |
| | | { |
| | | activeIcon: biaoqian1, |
| | | icon: biaoqianw, |
| | | name: '书签', |
| | | isShow: bookConfig.value.textbookComponents.indexOf('D2D30448') > -1 |
| | | }, |
| | | { |
| | | activeIcon: jieping1, |
| | | icon: jieping, |
| | | name: '截屏', |
| | | isShow: bookConfig.value.textbookComponents.indexOf('86F0A1B8') > -1 |
| | | } |
| | | ] |
| | | dialogToolList = [ |
| | | { icon: gaoliang,name: '高亮',isShow: bookConfig.value.textbookComponents.indexOf('395B91FC') > -1 }, |
| | | { icon: huaxian,name: '划线',isShow: bookConfig.value.textbookComponents.indexOf('229EC161') > -1 }, |
| | | { icon: biji2,name: '笔记',isShow: bookConfig.value.textbookComponents.indexOf('BC9B0CBD') > -1 }, |
| | | { icon: biaozhu2,name: '标注',isShow: bookConfig.value.textbookComponents.indexOf('A63EE24F') > -1 }, |
| | | { icon: fuzhi,name: '复制',isShow: bookConfig.value.textbookComponents.indexOf('7D5594B3') > -1 }, |
| | | { icon: AIyuedu,name: 'AI阅读',isShow: bookConfig.value.textbookComponents.indexOf('C05AA457') > -1 }, |
| | | { icon: cidian2,name: '词典',isShow: bookConfig.value.textbookComponents.indexOf('83FB80FD') > -1 }, |
| | | { icon: baidu,name: '百科',isShow: bookConfig.value.textbookComponents.indexOf('65F95274') > -1 } |
| | | ] |
| | | } |
| | | |
| | |
| | | const catalogueData = ref([]) |
| | | const getCatalogueData = () => { |
| | | axios |
| | | .get(bookConfig.value.resourceUrl + '/1/information.json') |
| | | .get(bookConfig.value.resourceUrl + '/information.json') |
| | | .then(function (response) { |
| | | console.log(response.data, '目录') |
| | | var json = response.data |
| | |
| | | |
| | | //获取资源 |
| | | //资源分类 |
| | | const classifySelectList = ref() |
| | | const classifySelectList = ref([]) |
| | | //资源类型 |
| | | const resourceType = ref('default') //默认/教师 |
| | | const activeClassify = ref('') |
| | |
| | | |
| | | const getResourceData = () => { |
| | | axios |
| | | .get(bookConfig.value.resourceUrl + '/1/resource.json?t=12') |
| | | .get(bookConfig.value.resourceUrl + '/resource.json?t=12') |
| | | .then(function (response) { |
| | | var json = response.data |
| | | // 处理获取到的json数据 |
| | |
| | | resourType.value = data.resourceType |
| | | if (data.resourceType == '视频') { |
| | | resourVisble.value = true |
| | | testVideo.value = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5 |
| | | if(data.md5){ |
| | | testVideo.value = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5 |
| | | }else{ |
| | | testVideo.value = bookConfig.value.resourceUrl + '/' + data.resourcePath |
| | | } |
| | | |
| | | } else if (data.resourceType == 'word') { |
| | | testWord.value = bookConfig.value.resourceUrl + '/resourceData/' + data.name |
| | | testWord.value = bookConfig.value.resourceUrl + '/' + data.resourcePath |
| | | } else { |
| | | if (window.qiankunState && window.qiankunState.gotoPage) { |
| | | window.qiankunState.gotoPage(Number(data.chapterNum), Number(data.pagination)) |
| | |
| | | ], |
| | | bgColorActive: '#FBF9F4' |
| | | }) |
| | | |
| | | watch( |
| | | () => menuState.open, |
| | | (val) => { |
| | | if (menuState.open == false) { |
| | | floatingToolData.elLeft = 90 |
| | | } else { |
| | | floatingToolData.elLeft = 390 |
| | | } |
| | | } |
| | | ) |
| | | |
| | | const fontSizeSelect = (item) => { |
| | | settingForm.fontSizeActive = item.key |
| | | window.qiankunActions.setGlobalState({ |
| | |
| | | let canvas = null |
| | | const floatingToolData = reactive({ |
| | | activeToolData: '', //选中工具 |
| | | elLeft: 400, |
| | | elTop: 300, |
| | | elLeft: 390, |
| | | startclientx: 0, |
| | | startclienty: 0 |
| | | }) |
| | | |
| | | //画布 |
| | | const canvasShow = ref(false) |
| | | |
| | | const floatOverHander = (item) => { |
| | | const curIndex = floatingToolBox.findIndex((f) => f.name == item.name) |
| | | switch (curIndex) { |
| | | case 0: |
| | | floatingToolBox[0].icon = huabi1 |
| | | break |
| | | case 1: |
| | | floatingToolBox[1].icon = baiban1 |
| | | break |
| | | case 2: |
| | | floatingToolBox[2].icon = biaozhu1 |
| | | break |
| | | case 3: |
| | | floatingToolBox[3].icon = biaoqian1 |
| | | break |
| | | case 4: |
| | | floatingToolBox[4].icon = jieping1 |
| | | break |
| | | } |
| | | } |
| | | const floatOutHander = (item) => { |
| | | const curIndex = floatingToolBox.findIndex((f) => f.name == item.name) |
| | | switch (curIndex) { |
| | | case 0: |
| | | floatingToolBox[0].icon = huabi |
| | | break |
| | | case 1: |
| | | floatingToolBox[1].icon = baiban |
| | | break |
| | | case 2: |
| | | floatingToolBox[2].icon = biaozhu |
| | | break |
| | | case 3: |
| | | floatingToolBox[3].icon = biaoqianw |
| | | break |
| | | case 4: |
| | | floatingToolBox[4].icon = jieping |
| | | break |
| | | } |
| | | } |
| | | |
| | | //截图事件 |
| | | const nameRef = ref() |
| | |
| | | break |
| | | } |
| | | } |
| | | const dragend = (e) => { |
| | | let x = e.clientX - floatingToolData.startclientx |
| | | let y = e.clientY - floatingToolData.startclienty |
| | | if (floatingToolData.elLeft + x > 0 || floatingToolData.elTop + y > 0) { |
| | | floatingToolData.elLeft = e.x - 40 |
| | | floatingToolData.elTop = e.y - 60 |
| | | } |
| | | } |
| | | const dragstart = (e) => { |
| | | floatingToolData.startclientx = e.clientX |
| | | floatingToolData.startclienty = e.clientY |
| | | } |
| | | |
| | | //画笔操作栏事件 |
| | | const toolSelectData = reactive({ |
| | | activeTool: '', |
| | |
| | | chapterNum: currentChapter.value, |
| | | chapterName: chapterData.label |
| | | }) |
| | | request({ |
| | | url: '/identity/api/ApiAppUserSetKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: 'reMark', |
| | |
| | | value: JSON.stringify(reMarkData.value) |
| | | } |
| | | ] |
| | | } |
| | | }) |
| | | }) |
| | | .then((res) => { |
| | | floatingToolData.activeToolData = '' |
| | | getReMarkList() |
| | |
| | | const getReMarkList = () => { |
| | | reMarkList.value = [] |
| | | reMarkData.value = [] |
| | | request({ |
| | | url: '/identity/api/ApiGetAppUserKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.getUserKey({ |
| | | domain: 'reMark', |
| | | keys: [bookConfig.value.bookId] |
| | | } |
| | | }).then((res) => { |
| | | }).then((res) => { |
| | | if (res && res.length > 0 && res[0].value) { |
| | | reMarkData.value = JSON.parse(res[0].value) |
| | | let list = JSON.parse(res[0].value) |
| | |
| | | //删除书签 |
| | | const deleteReMark = (item) => { |
| | | let list = reMarkList.value.filter((itemData) => itemData.id !== item.id) |
| | | request({ |
| | | url: '/identity/api/ApiAppUserSetKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: 'reMark', |
| | |
| | | value: JSON.stringify(list) |
| | | } |
| | | ] |
| | | } |
| | | }).then((res) => { |
| | | }).then((res) => { |
| | | ElMessage({ |
| | | message: '删除书签成功!', |
| | | type: 'success' |
| | |
| | | } |
| | | |
| | | screenshotLoading.value = true |
| | | request({ |
| | | url: '/identity/api/ApiAppUserSetKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: 'screenshot', |
| | |
| | | value: JSON.stringify(screenshotData.value) |
| | | } |
| | | ] |
| | | } |
| | | }) |
| | | }) |
| | | .then((res) => { |
| | | screenshotLoading.value = false |
| | | getScreenshotList() |
| | |
| | | const getScreenshotList = () => { |
| | | screenshotData.value = [] |
| | | screenshotList.value = [] |
| | | request({ |
| | | url: '/identity/api/ApiGetAppUserKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.getUserKey({ |
| | | domain: 'screenshot', |
| | | keys: [bookConfig.value.bookId] |
| | | } |
| | | }).then((res) => { |
| | | }).then((res) => { |
| | | if (res && res.length > 0 && res[0].value) { |
| | | screenshotData.value = JSON.parse(res[0].value) |
| | | let list = JSON.parse(res[0].value) |
| | |
| | | type: 'warning' |
| | | }) |
| | | .then(() => { |
| | | request({ |
| | | url: '/identity/api/ApiAppUserSetKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: 'screenshot', |
| | |
| | | value: JSON.stringify(list) |
| | | } |
| | | ] |
| | | } |
| | | }).then((res) => { |
| | | }).then((res) => { |
| | | ElMessage({ |
| | | message: '删除截图成功!', |
| | | type: 'success' |
| | |
| | | const toolActive = ref('') |
| | | const colorActive = ref('') |
| | | const noteColorActive = ref('') |
| | | const dialogToolList = reactive([ |
| | | { icon: gaoliang, activeIcon: gaoliang1, name: '高亮' }, |
| | | { icon: huaxian, activeIcon: huaxian1, name: '划线' }, |
| | | { icon: biji2, activeIcon: biji1, name: '笔记' }, |
| | | { icon: biaozhu2, activeIcon: biaozhu3, name: '标注' }, |
| | | { icon: fuzhi, activeIcon: fuzhi1, name: '复制' }, |
| | | { icon: AIyuedu, activeIcon: AIyuedu1, name: 'AI阅读' }, |
| | | { icon: cidian2, activeIcon: cidian1, name: '词典' }, |
| | | { icon: baidu, activeIcon: baidu, name: '百科' } |
| | | // { icon: yuyinyuedu, activeIcon: yuyinyuedu1, name: '语音阅读' } |
| | | // { icon: cidian2, activeIcon: cidian1, name: '翻译' } |
| | | ]) |
| | | |
| | | const colorSelectList = reactive([ |
| | | { |
| | | label: '黄色', |
| | |
| | | break |
| | | case '笔记': |
| | | formData.desc = '' |
| | | noteColorActive.value = '#F5E12A' |
| | | addNoteVisble.value = true |
| | | showToolBox.value = false |
| | | break |
| | |
| | | break |
| | | case '词典': |
| | | cidianVisible.value = true |
| | | console.log(dialogToolData.txt) |
| | | break |
| | | case '百科': |
| | | console.log('https://baike.baidu.com/item/' + dialogToolData.txt) |
| | |
| | | |
| | | break |
| | | } |
| | | request({ |
| | | url: '/identity/api/ApiAppUserSetKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: dom, |
| | |
| | | value: JSON.stringify(data) |
| | | } |
| | | ] |
| | | } |
| | | }).then((res) => { |
| | | }).then((res) => { |
| | | showToolBox.value = false |
| | | addNoteVisble.value = false |
| | | colorActive.value = '' |
| | |
| | | } |
| | | |
| | | const getSignData = () => { |
| | | request({ |
| | | url: '/identity/api/ApiGetAppUserKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.getUserKey({ |
| | | domain: 'highLightData-' + bookConfig.value.bookId, |
| | | keys: activeCatalog.value.map((item) => item + '') |
| | | } |
| | | }).then((res) => { |
| | | }).then((res) => { |
| | | if (res && res.length > 0) { |
| | | for (let i = 0; i < res.length; i++) { |
| | | const item = res[i] |
| | |
| | | } |
| | | } |
| | | }) |
| | | request({ |
| | | url: '/identity/api/ApiGetAppUserKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.getUserKey({ |
| | | domain: 'underline-' + bookConfig.value.bookId, |
| | | keys: activeCatalog.value.map((item) => item + '') |
| | | } |
| | | }).then((res) => { |
| | | }).then((res) => { |
| | | if (res && res.length > 0) { |
| | | for (let i = 0; i < res.length; i++) { |
| | | const item = res[i] |
| | |
| | | } |
| | | } |
| | | }) |
| | | request({ |
| | | url: '/identity/api/ApiGetAppUserKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.getUserKey({ |
| | | domain: 'notes-' + bookConfig.value.bookId, |
| | | keys: activeCatalog.value.map((item) => item + '') |
| | | } |
| | | }).then((res) => { |
| | | }).then((res) => { |
| | | if (res && res.length > 0) { |
| | | for (let i = 0; i < res.length; i++) { |
| | | const item = res[i] |
| | |
| | | chapterList.push(item.chapter + '') |
| | | }) |
| | | scribeData.noteList = [] |
| | | request({ |
| | | url: '/identity/api/ApiGetAppUserKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.getUserKey({ |
| | | domain: 'notes-' + bookConfig.value.bookId, |
| | | keys: chapterList |
| | | } |
| | | }).then((res) => { |
| | | }).then((res) => { |
| | | if (res && res.length > 0) { |
| | | for (let i = 0; i < res.length; i++) { |
| | | const item = res[i] |
| | |
| | | break |
| | | } |
| | | let list = data[dialogToolData.chapter].filter((item) => item.id != ids) |
| | | request({ |
| | | url: '/identity/api/ApiAppUserSetKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: dom, |
| | |
| | | value: JSON.stringify(list) |
| | | } |
| | | ] |
| | | } |
| | | }).then((res) => { |
| | | }).then((res) => { |
| | | lineDelete.showLineDelete = false |
| | | if (window.qiankunState && window.qiankunState.delSign) |
| | | window.qiankunState.delSign({ ids: [ids] }) |
| | |
| | | itemNote.color = noteColorActive.value |
| | | } |
| | | }) |
| | | request({ |
| | | url: '/identity/api/ApiAppUserSetKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: 'notes-' + bookConfig.value.bookId, |
| | |
| | | value: JSON.stringify(data.noteList) |
| | | } |
| | | ] |
| | | } |
| | | }).then((res) => { |
| | | }).then((res) => { |
| | | addNoteVisble.value = false |
| | | isUpdate.value = false |
| | | getNotesList() |
| | |
| | | type: 'warning' |
| | | }) |
| | | .then(() => { |
| | | request({ |
| | | url: '/identity/api/ApiAppUserSetKey', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity.setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: 'notes-' + bookConfig.value.bookId, |
| | |
| | | value: JSON.stringify(list) |
| | | } |
| | | ] |
| | | } |
| | | }).then((res) => { |
| | | }).then((res) => { |
| | | ElMessage({ |
| | | message: '删除笔记成功!', |
| | | type: 'success' |
| | |
| | | .userInfoBox { |
| | | display: flex; |
| | | align-items: center; |
| | | .userName{ |
| | | font-size: 18px; |
| | | margin-right:15px; |
| | | padding-right:15px; |
| | | border-right:1px solid #e0e0e0; |
| | | color: #2C2C2C; |
| | | } |
| | | .layout { |
| | | width: 69px; |
| | | height: 30px; |
| | |
| | | overflow: hidden; |
| | | flex: 1; |
| | | display: flex; |
| | | position: relative; |
| | | .menuBox { |
| | | width: 80px; |
| | | flex-shrink: 0; |
| | |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border-bottom: 1px solid #efefef; |
| | | } |
| | | .resourceBox { |
| | | padding: 10px 0; |
| | |
| | | .menuStateBox { |
| | | width: 25px; |
| | | height: 25px; |
| | | background: #fff; |
| | | border-radius: 3px 0px 0px 3px; |
| | | border: 1px solid #bce3ff; |
| | | position: fixed; |
| | | position: absolute; |
| | | line-height: 22px; |
| | | top: 50%; |
| | | left: 395px; |
| | | left: 380px; |
| | | text-align: center; |
| | | box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.16); |
| | | box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.3); |
| | | z-index: 2; |
| | | img { |
| | | height: 10px; |
| | |
| | | .pageBox { |
| | | flex: 1; |
| | | font-size: 16px; |
| | | position: relative; |
| | | .pageBox-header { |
| | | height: 57px; |
| | | padding: 0 20px; |
| | |
| | | } |
| | | |
| | | span { |
| | | width:80px; |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | |
| | | height: 25px; |
| | | background: #fff; |
| | | border-radius: 3px 0px 0px 3px; |
| | | border: 1px solid #bce3ff; |
| | | position: absolute; |
| | | top: 50%; |
| | | right: 67px; |
| | | box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.16); |
| | | box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.3); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | |
| | | } |
| | | } |
| | | .right { |
| | | right: 215px !important; |
| | | right: 198px !important; |
| | | border-radius: 0px 3px 3px 0px !important; |
| | | } |
| | | .classRoomBox { |
| | |
| | | } |
| | | |
| | | .draggableBox { |
| | | width: 85px; |
| | | background-image: linear-gradient(to bottom, #0093ff, #005dff); |
| | | position: fixed; |
| | | height: 310px; |
| | | top: 300px; |
| | | left: 450px; |
| | | width: 40px; |
| | | background-image: linear-gradient(to bottom, #65bbf9, #1299fb); |
| | | // background-color: rgba(44, 44, 44, 0.5); |
| | | position: absolute; |
| | | // height: 310px; |
| | | top: 70px; |
| | | left: 380px; |
| | | z-index: 2000; |
| | | border-radius: 10px; |
| | | padding: 5px; |
| | | padding: 6px; |
| | | overflow: hidden; |
| | | .floatToolItem { |
| | | height: 60px; |
| | | margin: 10px 0; |
| | | height: 28px; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border-radius: 5px; |
| | | color: #fff; |
| | | cursor: pointer; |
| | | img { |
| | | margin-right: 8px; |
| | | } |
| | | .text { |
| | | margin-right: 5px; |
| | | } |
| | | } |
| | | .floatToolItem:hover, |
| | | .floatToolActive { |
| | | background-color: #fff; |
| | | color: #0093ff; |
| | | background-color: rgba(255, 255, 255, 0.3); |
| | | } |
| | | } |
| | | |
| | | .brushBox { |
| | | position: fixed; |
| | | // left: 40%; |
| | | bottom: 20px; |
| | | position: absolute; |
| | | width:290px; |
| | | bottom: 40px; |
| | | left: 0; |
| | | right: 0; |
| | | z-index: 99; |
| | | margin:auto; |
| | | border-radius: 5px; |
| | | background: #fff; |
| | | // padding: 10px; |
| | | overflow: hidden; |
| | | border: 1px solid #0093ff; |
| | | box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.3); |
| | | .toolList { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | .floatToolItem { |
| | | margin: 6px; |
| | | width: 46px; |
| | | margin: 6px 8px; |
| | | padding: 5px; |
| | | width: 30px; |
| | | border-radius: 5px; |
| | | text-align: center; |
| | | flex: 1; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | // flex: 1; |
| | | font-size: 14px; |
| | | .imgBox { |
| | | height: 18px; |
| | | width: 18px; |
| | | text-align: center; |
| | | margin: 0 auto; |
| | | margin-bottom: 5px; |
| | | } |
| | | } |
| | | .floatToolItem:hover { |
| | | background-color: rgba(44, 44, 44, 0.2); |
| | | } |
| | | .layOutTool { |
| | | padding-left: 15px; |
| | | height:20px; |
| | | margin-right:5px; |
| | | border-left: 1px solid #e0e0e0; |
| | | } |
| | | } |
| | |
| | | position: fixed; |
| | | z-index: 2; |
| | | .toolSelectBox { |
| | | height: 57px; |
| | | height: 40px; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border-radius: 12px; |
| | | overflow: hidden; |
| | | padding: 5px; |
| | | background-image: linear-gradient(to right, #0093ff, #005dff); |
| | | background-color: rgba(90,90,90,0.9); |
| | | // background-image: linear-gradient(to right, #0093ff, #005dff); |
| | | .dialogToolItem { |
| | | user-select: none; |
| | | width: 60px; |
| | | width: 26px; |
| | | font-size: 12px; |
| | | border-radius: 5px; |
| | | padding: 5px 0; |
| | | padding:3px; |
| | | margin:0 5px; |
| | | cursor: pointer; |
| | | text-align: center; |
| | | img { |
| | | margin: 0 auto; |
| | | display: block; |
| | | margin-bottom: 5px; |
| | | height: 16px; |
| | | } |
| | | span { |
| | | color: #fff; |
| | | } |
| | | } |
| | | .dialogToolItem:hover, |
| | | .active { |
| | | background-color: #fff; |
| | | span { |
| | | color: #0093ff; |
| | | } |
| | | background-color: rgba(255, 255, 255, 0.2); |
| | | // span { |
| | | // color: #0093ff; |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | .lineDeleteBox { |
| | | position: fixed; |
| | | z-index: 2; |
| | | border: 1px solid #0093ff; |
| | | padding: 20px 8px; |
| | | box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.3); |
| | | padding: 5px 20px; |
| | | background: #fff; |
| | | border-radius: 5px; |
| | | .dialogToolItem{ |
| | | padding:3px; |
| | | border-radius: 5px; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | .dialogToolItem:hover{ |
| | | background-color: rgba(44, 44, 44, 0.2); |
| | | } |
| | | } |
| | | .wendabox { |
| | | width: 100%; |
New file |
| | |
| | | <template> |
| | | <div class="contentPage"> |
| | | <div class="headerBox">数字教材平台</div> |
| | | <div class="contentBox"> |
| | | <div class="leftBox"> |
| | | <menuView /> |
| | | </div> |
| | | <div class="rightBox"> |
| | | <div> |
| | | <router-view /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { useRouter, onBeforeRouteUpdate } from 'vue-router' |
| | | import { ref, onMounted } from 'vue' |
| | | import menuView from '@/views/components/menuView.vue' |
| | | const router = useRouter() |
| | | const routerVal = router.currentRoute.value |
| | | const path = ref(routerVal.path) |
| | | onBeforeRouteUpdate(async (to, from) => { |
| | | path.value = to.fullPath |
| | | }) |
| | | onMounted(() => {}) |
| | | |
| | | const goRouter = (item) => { |
| | | if (!localStorage.getItem('jsek-token')) { |
| | | return router.push({ |
| | | path: '/home', |
| | | query: { |
| | | showLogin: '1' |
| | | } |
| | | }) |
| | | } |
| | | router.push({ path: item.path }) |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | .contentPage { |
| | | height: 100%; |
| | | width: 100%; |
| | | font-size:14px; |
| | | } |
| | | .headerBox { |
| | | height: 48px; |
| | | width: 100%; |
| | | background: #fff; |
| | | box-shadow: 0 10px 10px -10px rgba(0, 0, 0, 0.07); |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | z-index: 2; |
| | | |
| | | font-size: 24px; |
| | | padding:0 20px; |
| | | line-height:48px; |
| | | color: #87CCFF; |
| | | font-family: Alibaba; |
| | | } |
| | | .contentBox { |
| | | height:100%; |
| | | display: flex; |
| | | background: #f1f1f1; |
| | | padding-top: 48px; |
| | | .leftBox { |
| | | background: #fff; |
| | | width:80px; |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="contentPage"> |
| | | 作业 |
| | | |
| | | </div> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { useRouter, onBeforeRouteUpdate } from "vue-router"; |
| | | import { ref, onMounted } from "vue"; |
| | | const router = useRouter(); |
| | | |
| | | |
| | | onMounted(() => { |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | |
| | | |
| | | </style> |
| | |
| | | <template> |
| | | <div class="loginPage"> |
| | | <div class="loginForm"> |
| | | <p>数字教材阅读器</p> |
| | | <el-form ref="ruleFormRef" :model="loginData" :rules="rules" label-width="80px"> |
| | | <el-form-item label="用户名:" prop="username"> |
| | | <el-input v-model="loginData.username"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="密码:" prop="password"> |
| | | <el-input type="password" v-model="loginData.password"></el-input> |
| | | </el-form-item> |
| | | <div class="btnBox"> |
| | | <el-button |
| | | style="width: 120px" |
| | | type="primary" |
| | | @click="submitForm(ruleFormRef)" |
| | | :loading="loading" |
| | | >登 录</el-button |
| | | > |
| | | <div class="loginBox"> |
| | | <div class="loginForm"> |
| | | <div class="singUpPhone"> |
| | | <h2>密码登录</h2> |
| | | <el-form ref="ruleFormRef" :model="loginData" :rules="rules" class=""> |
| | | <el-form-item prop="username"> |
| | | <!-- <el-input v-model="loginData.username"></el-input> --> |
| | | <el-input v-model="loginData.username" placeholder="请输入手机号" size="large"> |
| | | <template #prepend> |
| | | <el-select |
| | | v-model="select" |
| | | placeholder="Select" |
| | | class="selectPhone" |
| | | > |
| | | <el-option label="中国+86" value="86" /> |
| | | </el-select> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="password"> |
| | | <el-input type="password" v-model="loginData.password" placeholder="请输入密码"></el-input> |
| | | </el-form-item> |
| | | <div class="btnBox"> |
| | | <el-button |
| | | class="logInBtn" |
| | | type="primary" |
| | | @click="submitForm(ruleFormRef)" |
| | | :loading="loading" |
| | | >登 录</el-button |
| | | > |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | <el-image :src="dialogRightImg" class="rightImg" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref, reactive, inject } from 'vue' |
| | | import { ref, reactive, inject, onBeforeMount } from 'vue' |
| | | import { useRoute, useRouter } from 'vue-router' |
| | | import { ElMessage } from 'element-plus' |
| | | |
| | | import dialogRightImg from '@/assets/images/content/dialogRightImg.png' |
| | | const MG: any = inject('MG') |
| | | const route = useRoute() |
| | | const router = useRouter() |
| | | |
| | | const request = inject('request') |
| | | |
| | | const ruleFormRef = ref() |
| | | |
| | | const select = ref<string>('中国+86') |
| | | const loginData = ref({ |
| | | username: '', |
| | | password: '' |
| | |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | loading.value = true |
| | | request({ |
| | | url: '/identity/api/LoginByPassword', |
| | | method: 'post', |
| | | data: { |
| | | MG.identity |
| | | .loginByPassword({ |
| | | appRefCode: 'jingshieke', |
| | | loginName: loginData.value.username, |
| | | password: loginData.value.password, |
| | | platform: 'string' |
| | | } |
| | | }) |
| | | }) |
| | | .then((res) => { |
| | | console.log(res) |
| | | if (res.token != null) { |
| | | localStorage.setItem('token', res.token) |
| | | getUserInfo() |
| | | if (route.query.redirect) { |
| | | router.push(route.query.redirect) |
| | | } else { |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const getUserInfo = () => { |
| | | MG.identity.getCurrentAppUser().then((res) => { |
| | | console.log(res, '用户信息') |
| | | if (res) { |
| | | let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') |
| | | let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') |
| | | let phoneInfo = res.secretList.find((item) => item.type == 'MobilePhone') |
| | | let nameAndPassword = res.secretList.find((item) => item.type == 'LoginNameAndPassword') |
| | | |
| | | if (nameAndPassword) { |
| | | let userInfo = { |
| | | name: nameAndPassword.credential |
| | | } |
| | | localStorage.setItem('userInfo', JSON.stringify(userInfo)) |
| | | } else if (teacherRole && teacherInfos) { |
| | | let userInfo = { |
| | | name: teacherInfos.name, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id |
| | | } |
| | | localStorage.setItem('userInfo', JSON.stringify(userInfo)) |
| | | } else if (phoneInfo) { |
| | | let userInfo = { |
| | | name: phoneInfo.credential |
| | | } |
| | | localStorage.setItem('userInfo', JSON.stringify(userInfo)) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | position: relative; |
| | | .loginForm { |
| | | width: 400px; |
| | | height: 300px; |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 50%; |
| | | margin-top: -150px; |
| | | margin-left: -200px; |
| | | border: 1px solid #ccc; |
| | | border-radius: 10px; |
| | | padding: 20px; |
| | | p { |
| | | font-size: 20px; |
| | | font-weight: bold; |
| | | text-align: center; |
| | | margin-bottom: 50px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | .loginBox { |
| | | width: 800px; |
| | | height: 540px; |
| | | border-radius: 20px; |
| | | overflow:hidden; |
| | | display: flex; |
| | | background: #FFFFFF; |
| | | box-shadow: 0px 6px 9px 1px rgba(0,0,0,0.06); |
| | | .loginForm { |
| | | width: 410px; |
| | | padding:40px; |
| | | height: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-around; |
| | | .singUpPhone { |
| | | height: 400px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | |
| | | h2 { |
| | | padding-top: 35px; |
| | | font-size: 20px; |
| | | color: #000; |
| | | font-weight: 700; |
| | | text-align: center; |
| | | } |
| | | .el-form { |
| | | margin-top: 26px; |
| | | } |
| | | .selectPhone { |
| | | background: #fff; |
| | | } |
| | | } |
| | | } |
| | | .btnBox { |
| | | text-align: center; |
| | | margin-top: 50px; |
| | | .leftImg { |
| | | box-sizing: border-box; |
| | | width: 403px; |
| | | } |
| | | .el-input{ |
| | | height: 40px; |
| | | } |
| | | .el-select { |
| | | width: 100px; |
| | | height: 40px; |
| | | .el-select__wrapper { |
| | | height: 100% !important; |
| | | .el-input--suffix { |
| | | height: 100% !important; |
| | | background-color: #fff; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .logInBtn { |
| | | width: 304px; |
| | | height: 40px; |
| | | margin-top: 10px; |
| | | margin-bottom: 20px; |
| | | border-radius: 3px; |
| | | color: #fff; |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="contentPage"> |
| | | 消息 |
| | | |
| | | </div> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { useRouter, onBeforeRouteUpdate } from "vue-router"; |
| | | import { ref, onMounted } from "vue"; |
| | | const router = useRouter(); |
| | | |
| | | |
| | | onMounted(() => { |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | |
| | | |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="contentPage"> |
| | | 个人中心 |
| | | |
| | | </div> |
| | | </template> |
| | | <script setup lang="ts"> |
| | | import { useRouter, onBeforeRouteUpdate } from "vue-router"; |
| | | import { ref, onMounted } from "vue"; |
| | | const router = useRouter(); |
| | | |
| | | |
| | | onMounted(() => { |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | |
| | | |
| | | </style> |