3个文件已删除
18个文件已修改
1 文件已复制
14个文件已添加
2 文件已重命名
| | |
| | | Icon: [], |
| | | TypeId: [], |
| | | RefCode: [], |
| | | Description: [], |
| | | ChildrenCount: [], |
| | | ChildrenFolderCount: [], |
| | | CreateDate: [], |
| | |
| | | Icon: [], |
| | | TypeId: [], |
| | | RefCode: [], |
| | | Description: [], |
| | | ChildrenCount: [], |
| | | ChildrenFolderCount: [], |
| | | CreateDate: [], |
| | |
| | | Icon: [], |
| | | TypeId: [], |
| | | RefCode: [], |
| | | Description: [], |
| | | LinkTypes: [linkType.linkType], |
| | | PageQuery: { |
| | | Start: 0, |
| | |
| | | Name: [], |
| | | Icon: [], |
| | | RefCode: [], |
| | | Description: [], |
| | | TypeId: [], |
| | | SysType: [], |
| | | State: [], |
| | |
| | | const util = require("./components/util"); // 引入封装过的加载提示 |
| | | import { |
| | | loginInfo |
| | | } from "../../../../../../assets/js/login"; |
| | | const app = getApp(); |
| | | Component({ |
| | | properties: { |
| | |
| | | }; |
| | | this.triggerEvent("goTest", myEventDetail); |
| | | |
| | | }, |
| | | // 跳转音视频播放器 |
| | | goPlayer(e) { |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | const item = e.currentTarget.dataset.item; |
| | | const parent = e.currentTarget.dataset.parent; |
| | | console.log('item', item); |
| | | const parentProductLinkPath = parent ? |
| | | parent.productLinkPath : |
| | | wx.getStorageSync("teachResourcesPath"); |
| | | const parentName = parent ? parent.name : "教学资源"; |
| | | let url; |
| | | wx.navigateTo({ |
| | | url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parentProductLinkPath}&parentName=${parentName}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=${this.properties.tab}&applyState=${this.properties.applyState}&deadline=${this.properties.deadline}`, |
| | | }); |
| | | |
| | | } |
| | | }, |
| | | }, |
| | | }); |
| | |
| | | wx.navigateTo({ |
| | | url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parentProductLinkPath}&parentName=${parentName}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=${this.properties.tab}&applyState=${this.properties.applyState}&deadline=${this.properties.deadline}`, |
| | | }); |
| | | if (item.selectType == "pdf") { |
| | | if (item.selectType == "pdf" || item.selectType == "document") { |
| | | const fileLink = item.file ? item.file : item.freeFile |
| | | console.log(fileLink); |
| | | wx.navigateTo({ |
| | |
| | | fileLink + |
| | | "&fileName=" + |
| | | item.name + |
| | | "&fileType=" + |
| | | item.selectType + "&bookBuy=true" |
| | | "&fileType=pdf" + |
| | | "&bookBuy=true" |
| | | }); |
| | | } |
| | | if (item.selectType == "document") { |
| | | // freeFile |
| | | // if (item.selectType == "document") { |
| | | // item.selectType = "pptx"; |
| | | // } |
| | | const fileLink = item.file ? |
| | | app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.file : |
| | | app.config.requestCtx + |
| | | "/file/api/ApiDownload?md5=" + |
| | | item.freeFile; |
| | | console.log(fileLink, "fileLink"); |
| | | //提示加载中 |
| | | // 单次下载允许的最大文件为 200MB |
| | | wx.downloadFile({ |
| | | url: fileLink, |
| | | // filePath: wx.env.USER_DATA_PATH + `/${item.name}.${item.selectType}`, |
| | | filePath: wx.env.USER_DATA_PATH + `/${item.name}.${item.selectType}`, |
| | | success: function (res) { |
| | | console.log(res, "wx.downloadFile success res"); |
| | | if (res.statusCode != 200) { |
| | | util.hideLoadingWithErrorTips(); |
| | | return false; |
| | | } |
| | | var Path = res.tempFilePath; //返回的文件临时地址,用于后面打开本地预览所用 |
| | | let data = res.filePath; |
| | | wx.openDocument({ |
| | | filePath: data, |
| | | showMenu: true, |
| | | success: function (res) { |
| | | console.log("打开成功"); |
| | | util.hideLoading(); |
| | | }, |
| | | }); |
| | | }, |
| | | fail: function (err) { |
| | | console.log(err, "wx.downloadFile fail err"); |
| | | util.hideLoadingWithErrorTips(); |
| | | }, |
| | | }); |
| | | } |
| | | // if (item.selectType == "document") { |
| | | // // freeFile |
| | | // // if (item.selectType == "document") { |
| | | // // item.selectType = "pptx"; |
| | | // // } |
| | | // const fileLink = item.file ? |
| | | // app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.file : |
| | | // app.config.requestCtx + |
| | | // "/file/api/ApiDownload?md5=" + |
| | | // item.freeFile; |
| | | // console.log(fileLink, "fileLink"); |
| | | // //提示加载中 |
| | | // // 单次下载允许的最大文件为 200MB |
| | | // wx.downloadFile({ |
| | | // url: fileLink, |
| | | // // filePath: wx.env.USER_DATA_PATH + `/${item.name}.${item.selectType}`, |
| | | // filePath: wx.env.USER_DATA_PATH + `/${item.name}.${item.selectType}`, |
| | | // success: function (res) { |
| | | // console.log(res, "wx.downloadFile success res"); |
| | | // if (res.statusCode != 200) { |
| | | // util.hideLoadingWithErrorTips(); |
| | | // return false; |
| | | // } |
| | | // var Path = res.tempFilePath; //返回的文件临时地址,用于后面打开本地预览所用 |
| | | // let data = res.filePath; |
| | | // wx.openDocument({ |
| | | // filePath: data, |
| | | // showMenu: true, |
| | | // success: function (res) { |
| | | // console.log("打开成功"); |
| | | // util.hideLoading(); |
| | | // }, |
| | | // }); |
| | | // }, |
| | | // fail: function (err) { |
| | | // console.log(err, "wx.downloadFile fail err"); |
| | | // util.hideLoadingWithErrorTips(); |
| | | // }, |
| | | // }); |
| | | // } |
| | | if (item.selectType == "webpage") { |
| | | this.setData({ |
| | | webpageSrc: item.jsek_link, |
| | |
| | | app.MG.store |
| | | .getProductDetail(query) |
| | | .then(async (res) => { |
| | | if (!res.datas.cmsDatas[0].datas.length) { |
| | | return this.setData({ |
| | | noResources: true, |
| | | loading: false, |
| | | }); |
| | | } |
| | | // 云测试,递归请求里层数据 |
| | | if (type.refCode == "questionBank") { |
| | | const data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder' && item.childrenFolderCount > 0); |
| | | if (data.length > 0) { |
| | | let list = [] |
| | | console.log(query.cmsPath, query.cmsPath.length) |
| | | // 测试 6位// 正式 5位// 测试调用传20,内部7 正式调用传17 内部传6 |
| | | const addNum = query.cmsPath.length > 12 ? 7 : query.cmsPath.length > 14 ? 8 : 6 |
| | | const num = query.cmsPath.length + addNum |
| | | this.getTreeList(data, num, list, '\\', addNum) |
| | | list = this.ensureTreeConsistency(list) |
| | | let result = []; |
| | | this.findChildIds(list[0].children, result); |
| | | this.setData({ |
| | | test: list[0].children, |
| | | loading: false, |
| | | openTeachids: result, |
| | | }); |
| | | console.log(this.data.test, "test") |
| | | let data = [] |
| | | let result = []; |
| | | if (this.data.options.storeInfo == 'jsek_jslx') { |
| | | data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder'); |
| | | if (data.length > 0) { |
| | | this.setData({ |
| | | test: data, |
| | | loading: false, |
| | | openTeachids: result, |
| | | }); |
| | | } else { |
| | | this.setData({ |
| | | noResources: true, |
| | | loading: false, |
| | | }); |
| | | } |
| | | } else { |
| | | data = res.datas.cmsDatas[0].datas.filter((item) => item.type == 'questionBankFolder' && item.childrenFolderCount > 0); |
| | | if (data.length > 0) { |
| | | let list = [] |
| | | // 测试 6位// 正式 5位// 测试调用传20,内部7 正式调用传17 内部传6 |
| | | const addNum = query.cmsPath.length > 12 ? 7 : query.cmsPath.length > 14 ? 8 : 6 |
| | | const num = query.cmsPath.length + addNum |
| | | this.getTreeList(data, num, list, '\\', addNum) |
| | | list = this.ensureTreeConsistency(list) |
| | | this.findChildIds(list[0].children, result); |
| | | this.setData({ |
| | | test: list[0].children, |
| | | loading: false, |
| | | openTeachids: result, |
| | | }); |
| | | } else { |
| | | this.setData({ |
| | | noResources: true, |
| | | loading: false, |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | |
| | | // 获取展开项 |
| | | findChildIds(data, result) { |
| | | let index = 0 |
| | | for (let i = 0; i < data.length; i++) { |
| | | if (index < 3) { |
| | | const item = data[i] |
| | | if (item.childrenFolderCount > 0) { |
| | | result.push(item.id) |
| | | for (let j = 0; j < item.children.length; j++) { |
| | | if (index < 3) { |
| | | const childrenItme = item.children[j] |
| | | if (item.childrenCount > 0) { |
| | | result.push(childrenItme.id) |
| | | index += 1 |
| | | if (data) |
| | | for (let i = 0; i < data.length; i++) { |
| | | if (index < 3) { |
| | | const item = data[i] |
| | | if (item.childrenFolderCount > 0) { |
| | | result.push(item.id) |
| | | if (item.children) { |
| | | for (let j = 0; j < item.children.length; j++) { |
| | | if (index < 3) { |
| | | const childrenItme = item.children[j] |
| | | if (item.childrenCount > 0) { |
| | | result.push(childrenItme.id) |
| | | index += 1 |
| | | } |
| | | } else { |
| | | break |
| | | } |
| | | } |
| | | } else { |
| | | break |
| | | } |
| | | } else if (item.childrenCount > 0) { |
| | | result.push(item.id) |
| | | index += 1 |
| | | } |
| | | } else if (item.childrenCount > 0) { |
| | | result.push(item.id) |
| | | index += 1 |
| | | } else { |
| | | break |
| | | } |
| | | } else { |
| | | break |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // 图书添加购物车 |
| | |
| | | navBarHeight: '', |
| | | barHeight: '', |
| | | activeId: '', |
| | | storeInfo: '', |
| | | bookId: '', |
| | | bookName: '', |
| | | cmsId: '', |
| | |
| | | activeId: options.activeId, |
| | | bookId: options.bookId, |
| | | bookName: options.bookName, |
| | | storeInfo: options.storeInfo, |
| | | cmsId: options.cmsId, |
| | | parentName: options.parentName, |
| | | parentProductLinkPath: options.parentProductLinkPath, |
| | |
| | | size: 999 |
| | | } |
| | | } |
| | | if (this.data.storeInfo) { |
| | | query.storeInfo = this.data.storeInfo |
| | | } |
| | | app.MG.store.getProductDetail(query).then((res) => { |
| | | console.log(res); |
| | | res.datas.cmsDatas[0].datas.forEach((item) => { |
| | |
| | | dialogKey: false, |
| | | style: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx;', |
| | | activeId: '', |
| | | storeInfo: '', |
| | | bookId: '', |
| | | bookName: '', |
| | | cmsId: '', |
| | |
| | | navBarHeight: navBarHeight, |
| | | barHeight: systInfo.statusBarHeight, |
| | | activeId: options.activeId, |
| | | storeInfo: options.storeInfo, |
| | | bookId: options.bookId, |
| | | bookName: options.bookName, |
| | | cmsId: options.cmsId, |
| | |
| | | size: 999 |
| | | } |
| | | } |
| | | |
| | | if (this.data.storeInfo) { |
| | | query.storeInfo = this.data.storeInfo |
| | | } |
| | | app.MG.store.getProductDetail(query).then(res => { |
| | | let selectedId = -1; // 初始化选中项索引 |
| | | let showDataUrl = ''; |
| | |
| | | formPath: options.formPath, |
| | | flag: false |
| | | }) |
| | | console.log(this.data.storeInfo,13) |
| | | if (options.parentName !== "教学资源" && options.parentName !== "云学习") { |
| | | this.setData({ |
| | | parentName: options.parentName, |
| | |
| | | label: '课程', |
| | | key: 1, |
| | | linkType: 'Favoriteclass', |
| | | }, |
| | | { |
| | | label: '数字教材', |
| | | key: 2, |
| | | linkType: 'FavoriteTextBooks', |
| | | } |
| | | ], |
| | | list: [], |
New file |
| | |
| | | // pages/bookServices/detail/components/note/note.js |
| | | const app = getApp(); |
| | | Component({ |
| | | /** |
| | | * 组件的属性列表 |
| | | */ |
| | | properties: { |
| | | bookInfo: { |
| | | type: Object, |
| | | value: {}, |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | | * 组件的初始数据 |
| | | */ |
| | | data: { |
| | | inputStyle: |
| | | "border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx", |
| | | placeholderstyle: "font-size:28rpx", |
| | | flag: false, // 输入框是否显示 |
| | | submitType: "new", // 新建 or 编辑 |
| | | showNoteDialog: false, |
| | | textvalue: "", |
| | | noteId: "", |
| | | showInput: false, |
| | | submitTitle: "", |
| | | pageCount: { |
| | | page: 1, |
| | | total: 0, |
| | | }, |
| | | isMore: null, |
| | | noteList: [], |
| | | activeValues: 0, |
| | | loading: false, |
| | | noList: false, |
| | | }, |
| | | /** |
| | | * 组件的方法列表 |
| | | */ |
| | | methods: { |
| | | onReachBottom() { |
| | | const flag = this.data.noteList.length < this.data.pageCount.total; |
| | | if (flag) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1, |
| | | }); |
| | | this.getNoteList(); |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }); |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false, |
| | | }); |
| | | }, 100); |
| | | } |
| | | }, |
| | | handleSubmitTitle() { |
| | | this.setData({ |
| | | submitTitle: this.properties.bookInfo.name, |
| | | }); |
| | | }, |
| | | openDialog() { |
| | | this.setData({ |
| | | submitTitle: this.properties.bookInfo.name, |
| | | showNoteDialog: true, |
| | | }); |
| | | }, |
| | | closeDialog() { |
| | | this.setData({ |
| | | flag: false, |
| | | showNoteDialog: false, |
| | | submitTitle: "", |
| | | textvalue: "", |
| | | }); |
| | | }, |
| | | textareaChange(e) { |
| | | this.setData({ |
| | | textvalue: e.detail.value, |
| | | }); |
| | | }, |
| | | textareaBlur() { |
| | | console.log("失去焦点"); |
| | | }, |
| | | // 标题输入框值 |
| | | inputChange(e) { |
| | | this.setData({ |
| | | submitTitle: e.detail.value, |
| | | }); |
| | | }, |
| | | // 弹窗确定按钮 |
| | | confirmSuggest() { |
| | | const submitTitle = this.data.submitTitle.trim(); |
| | | const textvalue = this.data.textvalue.trim(); |
| | | if (!submitTitle.length) { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "请填写笔记标题", |
| | | }); |
| | | } else if (!textvalue.length) { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "请填写笔记内容", |
| | | }); |
| | | } |
| | | if (this.data.submitType == "new") { |
| | | this.makeNote(); |
| | | } else if (this.data.submitType == "edit") { |
| | | this.updateNote(); |
| | | } |
| | | this.setData({ |
| | | showNoteDialog: false, |
| | | }); |
| | | }, |
| | | handleChange(e) { |
| | | this.setData({ |
| | | activeValues: e.detail.value, |
| | | }); |
| | | }, |
| | | // 格式化笔记时间 |
| | | convertTimestamp(timestamp) { |
| | | const isoDate = new Date(timestamp); |
| | | const year = isoDate.getFullYear(); |
| | | const month = String(isoDate.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(isoDate.getDate()).padStart(2, "0"); |
| | | const hours = String(isoDate.getHours()).padStart(2, "0"); |
| | | const minutes = String(isoDate.getMinutes()).padStart(2, "0"); |
| | | const seconds = String(isoDate.getSeconds()).padStart(2, "0"); |
| | | const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | return formattedDate; |
| | | }, |
| | | changeLoading() { |
| | | this.setData({ |
| | | loading: true, |
| | | }); |
| | | }, |
| | | changeNoList() { |
| | | this.setData({ |
| | | noList: true, |
| | | }); |
| | | }, |
| | | // 获取笔记列表 |
| | | async getNoteList() { |
| | | if (!this.data.isMore) { |
| | | this.setData({ |
| | | loading: true, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | noList: false, |
| | | }); |
| | | let topicId; |
| | | await app.MG.ugc |
| | | .getProductUserSubmitTopic({ |
| | | productId: this.properties.bookInfo.id, |
| | | appRefCode: app.config.appRefCode, |
| | | }) |
| | | .then((res) => { |
| | | if (res) { |
| | | topicId = res.id; |
| | | } else { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "查询失败", |
| | | }); |
| | | } |
| | | }); |
| | | // loadings.value.bookResource = true |
| | | let query = { |
| | | start: 0, |
| | | size: this.data.pageCount.page * 5, |
| | | messageType: "note", |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate", |
| | | }, |
| | | appRefCode: app.config.appRefCode, |
| | | topicIdOrRefCode: topicId + "", |
| | | }; |
| | | await app.MG.ugc.getTopicMessageList(query).then((res) => { |
| | | if (!res.datas.length) { |
| | | return this.setData({ |
| | | loading: false, |
| | | noList: true, |
| | | noteList: res.datas, |
| | | }); |
| | | } |
| | | // notePage.value.total = res.totalSize |
| | | res.datas.forEach((item) => { |
| | | item.compliceHover = false; |
| | | item.deleteHover = false; |
| | | item.createDate = this.convertTimestamp(item.createDate); |
| | | }); |
| | | this.setData({ |
| | | "pageCount.total": res.totalSize, |
| | | noteList: res.datas, |
| | | loading: false, |
| | | noList: false, |
| | | }); |
| | | }); |
| | | }, |
| | | // 新建笔记接口 |
| | | async makeNote() { |
| | | const token = wx.getStorageSync("jsek-token"); |
| | | if (!token) { |
| | | return wx.getUserProfile({ |
| | | desc: "用户登录", |
| | | success: (res) => { |
| | | console.log(res); |
| | | }, |
| | | }); |
| | | } |
| | | let topicId; |
| | | await app.MG.ugc |
| | | .getProductUserSubmitTopic({ |
| | | productId: this.properties.bookInfo.id, |
| | | appRefCode: app.config.appRefCode, |
| | | }) |
| | | .then((res) => { |
| | | if (res) { |
| | | topicId = res.id; |
| | | } else { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "新建失败", |
| | | }); |
| | | } |
| | | }); |
| | | let query = { |
| | | topicIdOrRefCode: topicId + "", |
| | | name: this.data.submitTitle, |
| | | content: this.data.textvalue, |
| | | type: "note", |
| | | cmsTypeRefCode: "", |
| | | newDataListRequest: [], |
| | | }; |
| | | await app.MG.ugc.newTopicMessage(query).then((res) => { |
| | | wx.showToast({ |
| | | title: "新建成功", |
| | | }); |
| | | this.closeDialog(); |
| | | this.getNoteList(); |
| | | }); |
| | | }, |
| | | // 删除笔记 |
| | | deleteNote(e) { |
| | | const id = e.currentTarget.dataset.id; |
| | | const messageIds = []; |
| | | messageIds.push(id); |
| | | wx.showModal({ |
| | | title: "提示", |
| | | content: "确认删除该笔记吗?", //editable如果为true,这就是输入框的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | editable: false, //是否显示输入框 |
| | | placeholderText: "请输入内容吧", //输入框的默认内容 |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | app.MG.ugc |
| | | .delTopicMessage({ |
| | | messageIds, |
| | | }) |
| | | .then((res) => { |
| | | wx.showToast({ |
| | | title: "删除成功", |
| | | }); |
| | | // if ((notePage.value.total % 3) - 1 == 0) { |
| | | // notePage.value.page -= 1 |
| | | // } |
| | | this.getNoteList(); |
| | | }); |
| | | } else if (res.cancel) { |
| | | console.log("用户点击取消"); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | // 标题改变 |
| | | changeTitle(e) { |
| | | this.setData({ |
| | | flag: e.currentTarget.dataset.value, |
| | | }); |
| | | }, |
| | | // 编辑按钮 |
| | | editNote(e) { |
| | | const note = e.currentTarget.dataset.note; |
| | | this.setData({ |
| | | submitType: "edit", |
| | | textvalue: note.content, |
| | | submitTitle: note.name, |
| | | noteId: note.id, |
| | | }); |
| | | console.log(note.name, this.data.submitTitle); |
| | | this.setData({ |
| | | showNoteDialog: true, |
| | | }); |
| | | }, |
| | | // 编辑笔记接口 |
| | | updateNote() { |
| | | const token = wx.getStorageSync("jsek-token"); |
| | | if (!token) { |
| | | return wx.getUserProfile({ |
| | | desc: "用户登录", |
| | | success: (res) => { |
| | | console.log(res); |
| | | }, |
| | | }); |
| | | } |
| | | if (!this.data.submitTitle) { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "请填写笔记标题", |
| | | }); |
| | | } else if (!this.data.textvalue) { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "请填写笔记内容", |
| | | }); |
| | | } |
| | | let query = { |
| | | id: this.data.noteId, |
| | | name: this.data.submitTitle, |
| | | description: "string", |
| | | icon: "string", |
| | | type: "note", |
| | | content: this.data.textvalue, |
| | | newDataRequests: [], |
| | | updateDataRequests: [], |
| | | }; |
| | | app.MG.ugc.updateTopicMessage(query).then((res) => { |
| | | wx.showToast({ |
| | | title: "编辑成功", |
| | | }); |
| | | this.closeDialog(); |
| | | this.getNoteList(); |
| | | }); |
| | | this.setData({ |
| | | submitType: "new", |
| | | }); |
| | | }, |
| | | }, |
| | | }); |
New file |
| | |
| | | { |
| | | "component": true, |
| | | "usingComponents": { |
| | | "t-image": "tdesign-miniprogram/image/image", |
| | | "t-button": "tdesign-miniprogram/button/button", |
| | | "t-collapse": "tdesign-miniprogram/collapse/collapse", |
| | | "t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel", |
| | | "t-dialog": "tdesign-miniprogram/dialog/dialog", |
| | | "t-textarea": "tdesign-miniprogram/textarea/textarea", |
| | | "t-input": "tdesign-miniprogram/input/input", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-popup": "tdesign-miniprogram/popup/popup", |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-empty": "tdesign-miniprogram/empty/empty", |
| | | "t-skeleton": "tdesign-miniprogram/skeleton/skeleton" |
| | | } |
| | | } |
New file |
| | |
| | | <!--pages/bookServices/detail/components/note/note.wxml--> |
| | | <view class="note"> |
| | | <view class="note-btn"> |
| | | <t-button |
| | | theme="primary" |
| | | class="make-note" |
| | | bind:tap="openDialog" |
| | | style="width: 240rpx" |
| | | > |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/bookService/detail/makeNote.png" /> |
| | | <text class="note-btn-text">记笔记</text> |
| | | </view> |
| | | </t-button> |
| | | </view> |
| | | <view class="note-content"> |
| | | <t-collapse |
| | | value="{{activeValues}}" |
| | | bind:change="handleChange" |
| | | wx:if="{{!loading && noteList.length}}" |
| | | > |
| | | <t-collapse-panel |
| | | value="{{item.id}}" |
| | | expandIcon |
| | | wx:for="{{noteList}}" |
| | | wx:key="id" |
| | | > |
| | | <view slot="header" class="collapse-header"> |
| | | <t-image |
| | | class="note-icon" |
| | | src="/static/images/bookService/detail/note-icon.png" |
| | | ></t-image> |
| | | <view class="header-name">{{item.name}}</view> |
| | | </view> |
| | | <view> |
| | | <view class="note-content">{{item.content}}</view> |
| | | <view class="note-bottom"> |
| | | <view class="note-time">{{item.createDate}}</view> |
| | | <view class="bottom-btn"> |
| | | <image |
| | | src="/static/images/bookService/detail/compliceHover.png" |
| | | class="complice" |
| | | bind:tap="editNote" |
| | | data-note="{{item}}" |
| | | /> |
| | | <image |
| | | src="/static/images/bookService/detail/deleteHover.png" |
| | | class="delete" |
| | | bind:tap="deleteNote" |
| | | data-id="{{item.id}}" |
| | | /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </t-collapse-panel> |
| | | </t-collapse> |
| | | <view wx:if="{{noList}}" class="noData"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | </view> |
| | | <view class="bottom-box" wx:if="{{noteList.length}}"> |
| | | <t-loading wx:if="{{isMore == true}}"></t-loading> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | </view> |
| | | <view class="loading-box" wx:if="{{loading}}"> |
| | | <t-skeleton |
| | | row-col="{{[1,1,1,1,1,1]}}" |
| | | theme="paragraph" |
| | | animation="gradient" |
| | | loading="{{loading}}" |
| | | ></t-skeleton> |
| | | </view> |
| | | |
| | | <!-- 记笔记弹窗 --> |
| | | <t-popup |
| | | visible="{{showNoteDialog}}" |
| | | bind:visible-change="onVisibleChange" |
| | | placement="center" |
| | | > |
| | | <view class="popup"> |
| | | <view slot="title"> |
| | | <view class="title-text" wx:if="{{!flag}}"> |
| | | <text class="note-title">{{submitTitle}}</text> |
| | | <t-image |
| | | src="/static/images/bookService/detail/edit.png" |
| | | class="edit-icon" |
| | | bind:tap="changeTitle" |
| | | data-value="{{true}}" |
| | | ></t-image> |
| | | </view> |
| | | <view wx:else> |
| | | <t-input |
| | | value="{{submitTitle}}" |
| | | data-value="{{false}}" |
| | | bind:enter="changeTitle" |
| | | bind:blur="changeTitle" |
| | | bind:change="inputChange" |
| | | maxlength="{{50}}" |
| | | style="{{inputStyle}}" |
| | | ></t-input> |
| | | </view> |
| | | </view> |
| | | <view slot="content" class="content"> |
| | | <t-textarea |
| | | value="{{textvalue}}" |
| | | t-class="external-class" |
| | | label="" |
| | | placeholder="请输入笔记内容" |
| | | maxcharacter="500" |
| | | disableDefaultPadding="{{true}}" |
| | | indicator |
| | | bind:change="textareaChange" |
| | | bind:blur="" |
| | | style="{{inputStyle}}" |
| | | placeholder-style="{{placeholderstyle}}" |
| | | /> |
| | | </view> |
| | | <view class="submit-btn"> |
| | | <t-button theme="primary" size="large" block bind:tap="confirmSuggest" |
| | | >提交</t-button |
| | | > |
| | | </view> |
| | | </view> |
| | | <t-icon |
| | | t-class="close-btn" |
| | | name="close-circle" |
| | | size="32" |
| | | color="#fff" |
| | | bind:tap="closeDialog" |
| | | /> |
| | | </t-popup> |
New file |
| | |
| | | /* pages/bookServices/detail/components/note/note.wxss */ |
| | | |
| | | .note { |
| | | height: 100%; |
| | | padding-bottom: 50rpx; |
| | | } |
| | | |
| | | .popup { |
| | | padding: 40rpx; |
| | | width: 600rpx; |
| | | } |
| | | |
| | | |
| | | .note-btn { |
| | | /* height: 140rpx; */ |
| | | padding-bottom: 30rpx; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | align-items: center; |
| | | border-bottom: 1px solid #EFF0F1; |
| | | --td-button-primary-bg-color: #fff; |
| | | --td-button-primary-border-color: #ff6c00; |
| | | --td-button-primary-color: #ff6c00; |
| | | --td-button-primary-active-bg-color: #fff0e6; |
| | | } |
| | | |
| | | .note-btn image { |
| | | width: 28rpx; |
| | | height: 32rpx; |
| | | margin-right: 5rpx; |
| | | } |
| | | |
| | | .note-btn-text { |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | |
| | | |
| | | .note-title { |
| | | width: 90%; |
| | | height: 84rpx; |
| | | line-height: 84rpx; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .make-note { |
| | | margin: 0; |
| | | margin-right: 40rpx; |
| | | } |
| | | |
| | | .title-text { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .edit-icon { |
| | | margin-left: 10rpx; |
| | | width: 30rpx; |
| | | height: 30rpx; |
| | | } |
| | | |
| | | .header { |
| | | display: flex; |
| | | } |
| | | |
| | | .note-icon { |
| | | width: 44rpx; |
| | | height: 48rpx; |
| | | margin-right: 20rpx; |
| | | } |
| | | |
| | | .collapse-header { |
| | | display: flex; |
| | | } |
| | | |
| | | .collapse-header .header-name { |
| | | font-size: 32rpx; |
| | | width: 500rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .note-content { |
| | | height: min-content; |
| | | font-size: 28rpx; |
| | | color: #949494; |
| | | margin-bottom: 20rpx; |
| | | text-align: justify; |
| | | } |
| | | |
| | | .wrapper { |
| | | height: 100%; |
| | | } |
| | | |
| | | .note-bottom { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .bottom-btn { |
| | | height: 40rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .note-time { |
| | | color: #D9D9D9; |
| | | } |
| | | |
| | | .complice, |
| | | .delete { |
| | | width: 30rpx; |
| | | height: 30rpx; |
| | | } |
| | | |
| | | .delete { |
| | | margin-left: 40rpx; |
| | | } |
| | | |
| | | .loading-box { |
| | | width: 100%; |
| | | min-height: 550rpx; |
| | | } |
| | | |
| | | .content { |
| | | margin-top: 20rpx; |
| | | } |
| | | |
| | | .close-btn { |
| | | position: absolute; |
| | | left: 50%; |
| | | margin-left: -32rpx; |
| | | bottom: calc(-1 * (48rpx + 64rpx)); |
| | | } |
| | | |
| | | .submit-btn { |
| | | padding: 40rpx; |
| | | --td-button-border-radius: 60rpx; |
| | | --td-button-primary-bg-color: #ff6c00; |
| | | --td-button-primary-border-color: #ff6c00; |
| | | --td-button-primary-active-bg-color: #ff984d; |
| | | --td-button-primary-active-border-color: #ff984d; |
| | | } |
| | | |
| | | .bottom-box { |
| | | margin-top: 100rpx; |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .t-input__placeholder { |
| | | font-size: 28rpx !important |
| | | } |
| | | |
| | | .btn-content { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
New file |
| | |
| | | // pages/bookServices/detail/components/note/note.js |
| | | const app = getApp(); |
| | | import moment from 'moment' |
| | | Component({ |
| | | /** |
| | | * 组件的属性列表 |
| | | */ |
| | | properties: { |
| | | bookInfo: { |
| | | type: Object, |
| | | value: {}, |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | | * 组件的初始数据 |
| | | */ |
| | | data: { |
| | | inputStyle: "padding:10rpx", |
| | | placeholderstyle: "font-size:28rpx", |
| | | flag: false, // 输入框是否显示 |
| | | submitType: "new", // 新建 or 编辑 |
| | | showNoteDialog: false, |
| | | showInput: false, |
| | | userName: "", |
| | | mannder: "", |
| | | content: "", |
| | | lock: true, |
| | | phoneError: false, |
| | | pageCount: { |
| | | page: 1, |
| | | total: 0, |
| | | }, |
| | | isMore: null, |
| | | onlineQuestionsList: [], |
| | | activeValues: 0, |
| | | loading: false, |
| | | noList: false, |
| | | }, |
| | | onLoad() {}, |
| | | /** |
| | | * 组件的方法列表 |
| | | */ |
| | | methods: { |
| | | onReachBottom() { |
| | | const flag = this.data.noteList.length < this.data.pageCount.total; |
| | | if (flag) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1, |
| | | }); |
| | | this.getDataList(); |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }); |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false, |
| | | }); |
| | | }, 100); |
| | | } |
| | | }, |
| | | handleSubmitTitle() { |
| | | this.setData({ |
| | | submitTitle: this.properties.bookInfo.name, |
| | | }); |
| | | }, |
| | | openDialog() { |
| | | this.setData({ |
| | | submitTitle: this.properties.bookInfo.name, |
| | | showNoteDialog: true, |
| | | }); |
| | | }, |
| | | closeDialog() { |
| | | this.setData({ |
| | | flag: false, |
| | | showNoteDialog: false, |
| | | userName: "", |
| | | mannder: "", |
| | | content: "", |
| | | }); |
| | | }, |
| | | bindTnputBlur: function (e) { |
| | | this.setData({ |
| | | userName: e.detail.value, |
| | | }); |
| | | }, |
| | | onPhoneInput(e) { |
| | | const { |
| | | phoneError |
| | | } = this.data; |
| | | if (e.detail.value) { |
| | | const isPhoneNumber = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(e.detail.value); |
| | | if (phoneError === isPhoneNumber) { |
| | | this.setData({ |
| | | phoneError: !isPhoneNumber, |
| | | mannder: e.detail.value, |
| | | }); |
| | | } |
| | | } else { |
| | | this.setData({ |
| | | phoneError: false, |
| | | mannder: '' |
| | | }); |
| | | } |
| | | }, |
| | | bindTextAreaBlur: function (e) { |
| | | this.setData({ |
| | | content: e.detail.value, |
| | | }); |
| | | }, |
| | | // 弹窗确定按钮 |
| | | confirmSuggest() { |
| | | if (this.data.lock) { |
| | | this.data.lock = false; |
| | | if (this.data.userName.replace(/^\s*|\s*$/g, "") == '') { |
| | | this.data.lock = true; |
| | | wx.showToast({ |
| | | title: "联系人不能为空", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | return |
| | | } |
| | | if (this.data.mannder.replace(/^\s*|\s*$/g, "") == '') { |
| | | this.data.lock = true; |
| | | wx.showToast({ |
| | | title: "联系方式不能为空", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | return |
| | | } |
| | | if (this.data.content.replace(/^\s*|\s*$/g, "") == '') { |
| | | this.data.lock = true; |
| | | wx.showToast({ |
| | | title: "反馈内容不能为空", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | return |
| | | } |
| | | if (this.data.phoneError) { |
| | | this.data.lock = true; |
| | | return |
| | | } |
| | | |
| | | let submitData = { |
| | | content: this.data.content.replace(/^\s*|\s*$/g, ""), |
| | | name: this.data.userName.replace(/^\s*|\s*$/g, ""), |
| | | email: "", |
| | | phone: this.data.mannder.replace(/^\s*|\s*$/g, "") |
| | | }; |
| | | var data = { |
| | | topicIdOrRefCode: "onlineQuestioning", |
| | | name: "意见反馈", |
| | | content: JSON.stringify(submitData), |
| | | type: "ProductComment", |
| | | cmsTypeRefCode: "", |
| | | newDataListRequest: [] |
| | | }; |
| | | app.MG.ugc.newTopicMessage(data).then(res => { |
| | | this.data.lock = true; |
| | | if (res) { |
| | | wx.showToast({ |
| | | title: "提交成功", |
| | | icon: 'success', |
| | | duration: 1000, |
| | | }) |
| | | this.closeDialog(); |
| | | this.getDataList(); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | handleChange(e) { |
| | | this.setData({ |
| | | activeValues: e.detail.value, |
| | | }); |
| | | }, |
| | | // 格式化笔记时间 |
| | | convertTimestamp(timestamp) { |
| | | const isoDate = new Date(timestamp); |
| | | const year = isoDate.getFullYear(); |
| | | const month = String(isoDate.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(isoDate.getDate()).padStart(2, "0"); |
| | | const hours = String(isoDate.getHours()).padStart(2, "0"); |
| | | const minutes = String(isoDate.getMinutes()).padStart(2, "0"); |
| | | const seconds = String(isoDate.getSeconds()).padStart(2, "0"); |
| | | const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | return formattedDate; |
| | | }, |
| | | changeLoading() { |
| | | this.setData({ |
| | | loading: true, |
| | | }); |
| | | }, |
| | | changeNoList() { |
| | | this.setData({ |
| | | noList: true, |
| | | }); |
| | | }, |
| | | // 获取提问列表 |
| | | getDataList() { |
| | | let that = this |
| | | if (!this.data.isMore) { |
| | | this.setData({ |
| | | loading: true, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | noList: false, |
| | | }); |
| | | let topicId; |
| | | app.MG.ugc |
| | | .getTopicMessageList({ |
| | | appRefCode: app.config.appRefCode, |
| | | topicIdOrRefCode: 'onlineQuestioning', |
| | | start: that.data.pageCount.page * 5 - 5, |
| | | size: 5, |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | }, |
| | | }).then((res) => { |
| | | if (!res.datas.length) { |
| | | return this.setData({ |
| | | loading: false, |
| | | noList: true, |
| | | noteList: res.datas, |
| | | }); |
| | | } |
| | | // notePage.value.total = res.totalSize |
| | | res.datas.forEach((item) => { |
| | | item.title = JSON.parse(item.content).content; |
| | | item.createDate = moment(item.createDate).format("YYYY-MM-DD HH:mm:ss"); |
| | | item.updateDate = moment(item.updateDate).format("YYYY-MM-DD HH:mm:ss"); |
| | | item.feedBack = item.feedBack ? item.feedBack : '-' |
| | | }); |
| | | this.setData({ |
| | | "pageCount.total": res.totalSize, |
| | | onlineQuestionsList: res.datas, |
| | | loading: false, |
| | | noList: false, |
| | | }); |
| | | console.log(this.data.onlineQuestionsList, 3456) |
| | | }); |
| | | }, |
| | | |
| | | }, |
| | | }); |
New file |
| | |
| | | { |
| | | "component": true, |
| | | "usingComponents": { |
| | | "t-image": "tdesign-miniprogram/image/image", |
| | | "t-button": "tdesign-miniprogram/button/button", |
| | | "t-collapse": "tdesign-miniprogram/collapse/collapse", |
| | | "t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel", |
| | | "t-dialog": "tdesign-miniprogram/dialog/dialog", |
| | | "t-textarea": "tdesign-miniprogram/textarea/textarea", |
| | | "t-input": "tdesign-miniprogram/input/input", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-popup": "tdesign-miniprogram/popup/popup", |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-empty": "tdesign-miniprogram/empty/empty", |
| | | "t-skeleton": "tdesign-miniprogram/skeleton/skeleton" |
| | | } |
| | | } |
New file |
| | |
| | | <view class="note"> |
| | | <view class="note-btn"> |
| | | <view>共{{pageCount.total}}个</view> |
| | | <t-button theme="primary" class="make-note" bind:tap="openDialog" style="width: 240rpx"> |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/digitalCourses/bianji.png" /> |
| | | <text class="note-btn-text">提问</text> |
| | | </view> |
| | | </t-button> |
| | | </view> |
| | | <view class="note-content"> |
| | | <t-collapse value="{{activeValues}}" bind:change="handleChange" wx:if="{{!loading && onlineQuestionsList.length}}"> |
| | | <t-collapse-panel value="{{item.id}}" expandIcon wx:for="{{onlineQuestionsList}}" wx:key="id"> |
| | | <view slot="header" class="collapse-header"> |
| | | <view class="note-icon"></view> |
| | | <view class="header-name">{{item.title}}</view> |
| | | </view> |
| | | <view> |
| | | <view class="note-content">{{item.feedBack}}</view> |
| | | <view class="note-bottom"> |
| | | <view class="note-time">{{item.createDate}}</view> |
| | | </view> |
| | | </view> |
| | | </t-collapse-panel> |
| | | </t-collapse> |
| | | <view wx:if="{{noList}}" class="noData"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | </view> |
| | | <view class="bottom-box" wx:if="{{onlineQuestionsList.length}}"> |
| | | <t-loading wx:if="{{isMore == true}}"></t-loading> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | </view> |
| | | <view class="loading-box" wx:if="{{loading}}"> |
| | | <t-skeleton row-col="{{[1,1,1,1,1,1]}}" theme="paragraph" animation="gradient" loading="{{loading}}"></t-skeleton> |
| | | </view> |
| | | |
| | | <!-- 记笔记弹窗 --> |
| | | <t-popup visible="{{showNoteDialog}}" bind:visible-change="onVisibleChange" placement="center"> |
| | | <view class="popup"> |
| | | <view class="from-item"> |
| | | <view class="label"><text class="icon">*</text> 联系人: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入联系人" borderless value="{{userName}}" bindchange="bindTnputBlur" style="{{inputStyle}}" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> <text class="icon">*</text>联系方式: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="输入联系方式" borderless value="{{mannder}}" type="number" tips="{{phoneError ? '手机号输入不正确' : ''}}" bindchange="onPhoneInput" style="{{inputStyle}}" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> <text class="icon">*</text>反馈内容: </view> |
| | | <view class="item-content"> |
| | | <t-textarea placeholder="请输入反馈内容" value="{{content}}" disableDefaultPadding="{{true}}" autosize="{{true}}" maxlength="300" indicator bindchange="bindTextAreaBlur" style="{{inputStyle}}" /> |
| | | </view> |
| | | </view> |
| | | <view class="submit-btn"> |
| | | <t-button theme="primary" size="large" block bind:tap="confirmSuggest">提交</t-button> |
| | | </view> |
| | | </view> |
| | | <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="closeDialog" /> |
| | | </t-popup> |
New file |
| | |
| | | /* pages/bookServices/detail/components/note/note.wxss */ |
| | | |
| | | .note { |
| | | height: 100%; |
| | | padding-bottom: 50rpx; |
| | | } |
| | | |
| | | .popup { |
| | | padding: 40rpx; |
| | | width: 600rpx; |
| | | } |
| | | |
| | | .note-btn { |
| | | /* height: 140rpx; */ |
| | | padding-bottom: 30rpx; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | border-bottom: 1px solid #EFF0F1; |
| | | --td-button-primary-bg-color: #fff; |
| | | --td-button-primary-border-color: #ff6c00; |
| | | --td-button-primary-color: #ff6c00; |
| | | --td-button-primary-active-bg-color: #fff0e6; |
| | | } |
| | | |
| | | .note-btn image { |
| | | width: 28rpx; |
| | | height: 32rpx; |
| | | margin-right: 5rpx; |
| | | } |
| | | |
| | | .note-btn-text { |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .make-note { |
| | | margin: 0; |
| | | margin-right: 40rpx; |
| | | } |
| | | |
| | | .header { |
| | | display: flex; |
| | | } |
| | | |
| | | .note-icon { |
| | | width: 60rpx; |
| | | height: 60rpx; |
| | | background: #E1E1E1; |
| | | border-radius: 50%; |
| | | margin-right: 20rpx; |
| | | } |
| | | |
| | | .collapse-header { |
| | | display: flex; |
| | | } |
| | | |
| | | .collapse-header .header-name { |
| | | font-size: 32rpx; |
| | | width: 500rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .note-content { |
| | | height: min-content; |
| | | font-size: 28rpx; |
| | | color: #949494; |
| | | margin-bottom: 20rpx; |
| | | text-align: justify; |
| | | } |
| | | |
| | | .wrapper { |
| | | height: 100%; |
| | | } |
| | | |
| | | .note-bottom { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .bottom-btn { |
| | | height: 40rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .note-time { |
| | | color: #D9D9D9; |
| | | } |
| | | |
| | | .loading-box { |
| | | width: 100%; |
| | | min-height: 550rpx; |
| | | } |
| | | |
| | | .item-content { |
| | | margin: 20rpx 0; |
| | | } |
| | | |
| | | .t-input { |
| | | padding: 10rpx !important; |
| | | } |
| | | |
| | | .t-input__content, |
| | | .t-textarea { |
| | | border: 2rpx solid #D9D9D9 !important; |
| | | padding: 10rpx !important; |
| | | } |
| | | |
| | | .t-input__tips, |
| | | .from-item .label .icon { |
| | | color: #f56c6c !important; |
| | | margin-right: 5rpx; |
| | | } |
| | | |
| | | .t-input__placeholder, |
| | | .t-textarea__placeholder { |
| | | font-size: 28rpx !important; |
| | | } |
| | | |
| | | .close-btn { |
| | | position: absolute; |
| | | left: 50%; |
| | | margin-left: -32rpx; |
| | | bottom: calc(-1 * (48rpx + 64rpx)); |
| | | } |
| | | |
| | | .submit-btn { |
| | | padding: 40rpx; |
| | | --td-button-border-radius: 60rpx; |
| | | --td-button-primary-bg-color: #ff6c00; |
| | | --td-button-primary-border-color: #ff6c00; |
| | | --td-button-primary-active-bg-color: #ff984d; |
| | | --td-button-primary-active-border-color: #ff984d; |
| | | } |
| | | |
| | | .bottom-box { |
| | | margin-top: 100rpx; |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .btn-content { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
New file |
| | |
| | | const app = getApp(); |
| | | Component({ |
| | | properties: { |
| | | treeList: { |
| | | type: Array, |
| | | value: [], |
| | | }, |
| | | bookInfo: { |
| | | type: Object, |
| | | value: {}, |
| | | }, |
| | | tab: { |
| | | type: String, |
| | | value: "", |
| | | }, |
| | | openIds: { |
| | | type: Array, |
| | | value: [], |
| | | }, |
| | | }, |
| | | data: {}, |
| | | ready() {}, |
| | | |
| | | onLoad() { |
| | | console.log(this.properties.openIds, "1111") |
| | | }, |
| | | |
| | | methods: { |
| | | |
| | | // 节点展开 |
| | | handleChange(e) { |
| | | console.log(e, 123) |
| | | this.setData({ |
| | | openIds: e.detail.value, |
| | | }); |
| | | }, |
| | | async goTest(e) { |
| | | console.log(e, 666) |
| | | const value = e.currentTarget.dataset.item; |
| | | const parent = e.currentTarget.dataset.parent; |
| | | const token = wx.getStorageSync("jsek-token"); |
| | | if (!token) { |
| | | return wx.getUserProfile({ |
| | | desc: "用户登录", |
| | | success: (res) => { |
| | | console.log(res); |
| | | }, |
| | | }); |
| | | } |
| | | // 获取章节下是否有题目 |
| | | let idPathList = []; |
| | | let query = { |
| | | storeInfo: app.config.digitalCourses, |
| | | path: "*", |
| | | queryType: "*", |
| | | productId: this.properties.bookInfo.id, |
| | | cmsPath: value.productLinkPath, |
| | | pading: { |
| | | start: 0, |
| | | size: 999, |
| | | }, |
| | | }; |
| | | if (value.childrenFolderCount == 0) { |
| | | wx.hideLoading(); |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "暂无数据", |
| | | }); |
| | | } else { |
| | | const res = await app.MG.store.getProductDetail(query); |
| | | res.datas.cmsDatas[0].datas.forEach((item) => { |
| | | idPathList.push({ |
| | | id: item.id, |
| | | name: item.name, |
| | | productLinkPath: item.productLinkPath, |
| | | type: item.type, |
| | | }); |
| | | }); |
| | | } |
| | | wx.hideLoading(); |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/examination/examination?bookId=${ |
| | | this.properties.bookInfo.id |
| | | }&productLinkPath=${value.productLinkPath}&rootCmsItemId=${ |
| | | this.properties.bookInfo.rootCmsItemId |
| | | }&idPathList=${JSON.stringify(idPathList)}&answerTitle=${ |
| | | value.name |
| | | }&answerType=${"option"}&storeInfo=${app.config.digitalCourses}`, |
| | | }); |
| | | }, |
| | | }, |
| | | }); |
New file |
| | |
| | | { |
| | | "component": true, |
| | | "usingComponents": { |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-image": "tdesign-miniprogram/image/image", |
| | | "t-collapse": "tdesign-miniprogram/collapse/collapse", |
| | | "t-collapse-panel": "tdesign-miniprogram/collapse-panel/collapse-panel", |
| | | "t-button": "tdesign-miniprogram/button/button", |
| | | "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", |
| | | "tree": "/packageBookService/pages/bookServices/detail/components/testTree/index", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | } |
| | | } |
New file |
| | |
| | | <view class="tree"> |
| | | <t-collapse default-value="{{openIds}}" catchchange="handleChange"> |
| | | <view wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" wx:if="{{!item.children }}"> |
| | | <view class="listItems" wx:if="{{!item.children}}"> |
| | | <view class="itemsInfo" data-item="{{item}}" data-index="{{index}}"> |
| | | <view class="contentBox" bind:tap="goTest" data-item="{{item}}" data-parent="{{''}}"> |
| | | <view class="box-image fl-cn" style="width: 80%"> |
| | | <!-- 测试题 --> |
| | | <view class="teach-icon fl-cn"> |
| | | <image src="/static/images/bookService/detail/test-icon.png" mode="" /> |
| | | </view> |
| | | <!-- 名称 --> |
| | | <text class="name" style="width: 100%">{{item.name || '-'}}</text> |
| | | </view> |
| | | <view> |
| | | <image src="/static/images/bookService/detail/lianxi-icon.png" class="testSee"></image> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{item.id}}" wx:if="{{item.children}}"> |
| | | <view slot="header" class="header-title"> |
| | | <view class="title-checkBox"> |
| | | <!-- 章节名 --> |
| | | <view class="title-box"> |
| | | <view class="title-name">{{item.name}} </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="list" wx:for="{{item.children}}" wx:for-item="citem" wx:for-index="cindex" wx:key="cindex"> |
| | | <!-- // 判断 无子项 且为商品item 直接显示 --> |
| | | <view class="listItems" wx:if="{{!citem.children}}"> |
| | | <view class="itemsInfo" data-item="{{citem}}" data-index="{{cindex}}"> |
| | | <view class="contentBox" bind:tap="goTest" data-item="{{citem}}" data-parent="{{item}}"> |
| | | <view class="box-image fl-cn"> |
| | | <!-- 云测试图标 --> |
| | | <view class="teach-icon fl-cn"> |
| | | <image src="/static/images/bookService/detail/test-icon.png" mode="" /> |
| | | </view> |
| | | <!-- 名称 --> |
| | | <text class="name">{{citem.name || '-'}}</text> |
| | | </view> |
| | | <view> |
| | | <image src="/static/images/bookService/detail/lianxi-icon.png" class="testSee"></image> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- // 判断 不是商品 有子项 递归组件 --> |
| | | <tree wx:if="{{ citem.children }}" bookInfo="{{bookInfo}}" treeList="{{[citem]}}" tab="{{tab}}" openIds="{{openIds}}"></tree> |
| | | </view> |
| | | </t-collapse-panel> |
| | | </t-collapse> |
| | | </view> |
copy from packageBookService/pages/bookServices/detail/components/testTree/tree/index.wxss
copy to pages/digitalCourses/digitalCoursesDetails/components/testTree/index.wxss
New file |
| | |
| | | const app = getApp(); |
| | | Component({ |
| | | properties: { |
| | | treeList: { |
| | | type: Array, |
| | | value: [], |
| | | }, |
| | | learnList: { |
| | | type: Array, |
| | | value: [], |
| | | }, |
| | | bookInfo: { |
| | | type: Object, |
| | | value: {}, |
| | | }, |
| | | openIds: { |
| | | type: Array, |
| | | value: [], |
| | | }, |
| | | }, |
| | | data: { |
| | | sonPurchaseSaleMethodId: "", |
| | | superiorPurchaseSaleMethodId: [], |
| | | activeValues: [1, 2], |
| | | webpageSrc: "", |
| | | cloudShoppingCart: [], |
| | | selectAll: [], |
| | | shoppingCart: true, |
| | | stop: false, |
| | | cart: true, |
| | | canExecute: true |
| | | }, |
| | | ready() {}, |
| | | |
| | | onLoad() { |
| | | this.setData({ |
| | | sonPurchaseSaleMethodId: [], |
| | | }); |
| | | }, |
| | | methods: { |
| | | handleList(tree) { |
| | | for (let index = 0; index < tree.length; index++) { |
| | | const item = tree[index]; |
| | | if (item.sysType == "CmsItem" && !item.checked) {} |
| | | if (item.children && item.children.length > 0) { |
| | | this.handleList(item.children); |
| | | } |
| | | } |
| | | }, |
| | | // 节点展开 |
| | | handleChange(e) { |
| | | this.setData({ |
| | | openIds: e.detail.value, |
| | | }); |
| | | }, |
| | | |
| | | // 跳转音视频播放器 |
| | | goPlayer(e) { |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (token) { |
| | | const item = e.currentTarget.dataset.item; |
| | | const parent = e.currentTarget.dataset.parent; |
| | | console.log('item', item); |
| | | const parentProductLinkPath = parent ? |
| | | parent.productLinkPath : |
| | | wx.getStorageSync("teachResourcesPath"); |
| | | const parentName = parent ? parent.name : "教学资源"; |
| | | let url; |
| | | if (item.selectType == 'zip') { |
| | | if (this.properties.applyState == 'Normal') { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请前往PC端下载', |
| | | }) |
| | | } else { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请先申请下载', |
| | | }) |
| | | } |
| | | } |
| | | if (item.learnSelectType == "video") { |
| | | url = "/packageDomain/pages/resourceDetails/myVideo/index"; |
| | | } else if (item.learnSelectType == "audio") { |
| | | url = "/packageDomain/pages/resourceDetails/myAudio/index"; |
| | | } else if (item.selectType == "picture" || item.selectType == "zip") { |
| | | url = "/packageDomain/pages/resourceDetails/document/index"; |
| | | } |
| | | if ((!item.file && !item.freeFile && !item.protectedFile)) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '暂无资源', |
| | | }) |
| | | } |
| | | wx.navigateTo({ |
| | | url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parentProductLinkPath}&parentName=${parentName}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=jsek_cloudLearning&storeInfo=${app.config.digitalCourses}`, |
| | | }); |
| | | |
| | | } |
| | | }, |
| | | |
| | | |
| | | }, |
| | | }); |
New file |
| | |
| | | <view class="tree"> |
| | | <t-collapse default-value="{{openIds}}" catchchange="handleChange"> |
| | | <view wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" wx:if="{{item.sysType== 'CmsItem' }}"> |
| | | <view class="listItems" wx:if="{{item.childrenFolderCount <= 0 && item.sysType == 'CmsItem'}}"> |
| | | <view class="itemsInfo" data-item="{{item}}" data-index="{{index}}"> |
| | | <view class="contentBox" bind:tap="goPlayer" data-item="{{item}}" data-parent="{{''}}"> |
| | | <!-- 云学习 图标 --> |
| | | <view class="box-image fl-cn" style="width: 80%"> |
| | | <view class="teach-icon fl-cn"> |
| | | <image wx:if="{{item.selectType == 'audio' || item.learnSelectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" /> |
| | | <image wx:elif="{{item.selectType == 'video' || item.learnSelectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" /> |
| | | <!-- 资源无文件内容图标 --> |
| | | <image wx:else src="/static/images/bookService/detail/word.png" mode="" /> |
| | | </view> |
| | | <!-- 名称 --> |
| | | <text class="name" style="width: 100%">{{item.name || '-'}}</text> |
| | | </view> |
| | | <view> |
| | | <!-- 云学习试看图标 --> |
| | | <image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{!item.isbuy ? false : item.freeFile ? true : false}}"></image> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{item.id}}" wx:if="{{item.sysType == 'CmsFolder' }}"> |
| | | <view slot="header" class="header-title"> |
| | | <view class="title-checkBox" catchtap="catchTap"> |
| | | <!-- 章节名 --> |
| | | <view class="title-box"> |
| | | <view class="title-name">{{item.name}} </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="list" wx:for="{{item.children}}" wx:for-item="citem" wx:for-index="cindex" wx:key="cindex"> |
| | | <!-- // 判断 无子项 且为商品item 直接显示 --> |
| | | <view class="listItems" wx:if="{{citem.childrenFolderCount <= 0 && citem.sysType == 'CmsItem'}}"> |
| | | <view class="itemsInfo" data-item="{{citem}}" data-index="{{cindex}}"> |
| | | <view class="contentBox" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}"> |
| | | <!-- 云学习 图标 --> |
| | | <view class="box-image fl-cn"> |
| | | <view class="teach-icon fl-cn"> |
| | | <image wx:if="{{citem.selectType == 'audio' || citem.learnSelectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" /> |
| | | <image wx:elif="{{citem.selectType == 'video' || citem.learnSelectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" /> |
| | | <!-- 资源无文件内容图标 --> |
| | | <image wx:else src="/static/images/bookService/detail/word.png" mode="" /> |
| | | </view> |
| | | <!-- 名称 --> |
| | | <text class="name" style="width:540rpx">{{citem.name || '-'}}</text> |
| | | </view> |
| | | <view> |
| | | <!-- 云学习试看图标 --> |
| | | <image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{!citem.isbuy ? false : citem.freeFile ? true : false}}"></image> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- // 判断 不是商品 有子项 递归组件 --> |
| | | <tree wx:if="{{ citem.sysType == 'CmsFolder' }}" isShowCheck="{{isShowCheck}}" bookInfo="{{bookInfo}}" treeList="{{[citem]}}" learnList="{{learnList}}" itemId="{{itemId}}" openIds="{{openIds}}"></tree> |
| | | </view> |
| | | <!-- 暂无数据 --> |
| | | <view wx:if="{{!item.children || !item.children.length}}" class="noData"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | <view class="listItems" wx:if="{{children.length <= 0 && !loading}}"> |
| | | 暂无数据 |
| | | </view> |
| | | <view class="loading" wx:if="{{loading}}"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" /> |
| | | </view> |
| | | </t-collapse-panel> |
| | | </t-collapse> |
| | | </view> |
| | |
| | | // pages/digitalCourses/digitalCoursesDetails/index.js |
| | | const app = getApp() |
| | | import moment from 'moment' |
| | | import Toast from "tdesign-miniprogram/toast"; |
| | | Page({ |
| | | |
| | |
| | | */ |
| | | data: { |
| | | loading: true, |
| | | digitalsData: [], |
| | | digitalsData: {}, |
| | | expire: false, //商品或子商品销售方式是否过期 |
| | | isBuy: false, |
| | | tabValue: 0, |
| | | learnResourceIcon: { |
| | | name: "/static/images/digitalTextbooks/shengshu-t@2x.png", |
| | |
| | | }, |
| | | |
| | | dialogBox: false, |
| | | lecturerList: [{ |
| | | icon: '', |
| | | name: '林崇德', |
| | | title: '讲师', |
| | | introduce: '中国学生发展核心素养研制首席专家,围绕大中小学教材建设开展了一系列开创性、奠基性工作。建立完善了我国发展心理学教材体系。' |
| | | }, |
| | | { |
| | | icon: '', |
| | | name: '林崇德', |
| | | title: '教授', |
| | | introduce: '中国学生发展核心素养研制首席专家,围绕大中小学教材建设开展了一系列开创性、奠基性工作。建立完善了我国发展心理学教材体系。中国学生发展核心素养研制首席专家,围绕大中小学教材建设开展了一系列开创性、奠基性工作。建立完善了我国发展心理学教材体系' |
| | | } |
| | | ] |
| | | |
| | | lecturerList: [], |
| | | selectActive: 'learn', |
| | | learnList: [], |
| | | testList: [], |
| | | openTeachids: [], |
| | | onlineQuestionsList: [], |
| | | //分页 |
| | | page: 1, |
| | | limit: 6, |
| | | questionTotalCount: 0, |
| | | bottomLoading: false, |
| | | isMoreData: false, |
| | | noteList: [], |
| | | notePage: 1, |
| | | noteLimit: 6, |
| | | noteTotalCount: 0, |
| | | }, |
| | | formatDate(dateString) { |
| | | if (!dateString) { |
| | |
| | | |
| | | }, |
| | | digitalCoursesDetailsGet(digitalTextId) { |
| | | |
| | | let query = { |
| | | path: '*', |
| | | queryType: '*', |
| | |
| | | author: [], |
| | | isbn: [], |
| | | publicationDate: [], |
| | | speaker: [], |
| | | bookClassification: [], |
| | | paperPrice: [], |
| | | JDLink: [], |
| | |
| | | affiliatedUnit: [], |
| | | publishingUnit: [], |
| | | classHours: [], |
| | | productLinkPath: [] |
| | | productLinkPath: [], |
| | | |
| | | //epub试读百分比 |
| | | } |
| | | } |
| | | app.MG.store.getProductDetail(query).then(res => { |
| | | console.log(res); |
| | | if (res.datas.purchasedSaleMethodIdList.includes(res.datas.defaultSaleMethodId)) { |
| | | this.setData({ |
| | | isBuy: true |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | isBuy: false |
| | | }) |
| | | } |
| | | let times = new Date(res.datas.defaultSaleMethod.endDate).getTime() |
| | | let startTime = new Date(res.datas.defaultSaleMethod.beginDate).getTime() |
| | | if (times < new Date().getTime() || new Date().getTime() < startTime) { |
| | | this.setData({ |
| | | expire: true |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | expire: res.false |
| | | }) |
| | | } |
| | | res.datas.publicationDate = this.formatDate(res.datas.publicationDate) |
| | | res.datas.price = res.datas.price.toFixed(2) |
| | | |
| | | wx.setNavigationBarTitle({ |
| | | title: res.datas.name, |
| | | }) |
| | | let lecturer = [] |
| | | if (res.datas.datas.speaker && res.datas.datas.speaker.length > 0) { |
| | | res.datas.datas.speaker.forEach(item => { |
| | | if (res.datas.subItems && res.datas.subItems.QueryCms.length > 0) { |
| | | res.datas.subItems.QueryCms.forEach(item1 => { |
| | | if (JSON.parse(item.Data.Value).items[0] == item1.id) { |
| | | lecturer.push({ |
| | | name: item1.name, |
| | | icon: item1.icon ? item1.icon : '', |
| | | description: item1.description ? item1.description : '', |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setData({ |
| | | lecturerList: lecturer, |
| | | digitalsData: res.datas, |
| | | loading: false |
| | | }) |
| | |
| | | tabValue: value |
| | | }) |
| | | console.log(this.data.tabValue); |
| | | if (this.data.tabValue == 2) { |
| | | this.getResource() |
| | | } |
| | | if (this.data.tabValue == 3) { |
| | | this.selectComponent("#note").getNoteList(); |
| | | } |
| | | if (this.data.tabValue == 4) { |
| | | this.selectComponent("#question").getDataList(); |
| | | } |
| | | }, |
| | | |
| | | selectChange(event) { |
| | | console.log(event) |
| | | const value = event.target.dataset.value |
| | | this.setData({ |
| | | selectActive: value |
| | | }) |
| | | this.getResource() |
| | | }, |
| | | |
| | | getResource() { |
| | | let query = { |
| | | storeInfo: app.config.digitalCourses, |
| | | path: '*', |
| | | queryType: '*', |
| | | productId: this.data.digitalsData.id, |
| | | cmsPath: this.data.digitalsData.rootCmsItemId + '', |
| | | cmsType: '*', |
| | | itemFields: { |
| | | SysType: 'CmsFolder', |
| | | selectType: [], |
| | | freeFile: [], |
| | | file: [], |
| | | protectedFile: [], |
| | | resourcesClassification: [], |
| | | isDownload: [], |
| | | jsek_resourceBrief: [], |
| | | jsek_link: [], |
| | | jsek_questionBank: [], |
| | | learnSelectType: [] |
| | | }, |
| | | pading: { |
| | | start: 99, |
| | | size: 0 |
| | | } |
| | | } |
| | | app.MG.store.getProductDetail(query).then((res) => { |
| | | console.log(res.datas, 1111) |
| | | let test = [] |
| | | let learn = [] |
| | | if (res.datas.cmsDatas[0].datas.length > 0) { |
| | | res.datas.cmsDatas[0].datas.forEach((item) => { |
| | | if (item.type == 'questionBankFolder' || item.type == 'questionBankItem') { |
| | | test.push(item) |
| | | } else if (item.type != "resourceItem") { |
| | | learn.push(item) |
| | | } |
| | | }) |
| | | if (this.data.selectActive === 'learn') { |
| | | let list = [] |
| | | // 测试 6位// 正式 5位// 测试调用传20,内部7 正式调用传17 内部传6 |
| | | let addNum = query.cmsPath.length > 5 ? 7 : query.cmsPath.length > 6 ? 8 : 6 |
| | | const num = query.cmsPath.length + addNum |
| | | if (learn.some((item) => item.sysType == 'CmsFolder')) { |
| | | this.getTreeList(learn, num, list, '\\', addNum) |
| | | list = this.ensureTreeConsistency(list) |
| | | } else { |
| | | list = learn |
| | | } |
| | | let result = []; |
| | | this.findChildIds(list, result) |
| | | if (list.length > 0) { |
| | | this.setData({ |
| | | learnList: list, |
| | | openTeachids: result, |
| | | }); |
| | | } |
| | | } else { |
| | | const data = test.filter( |
| | | (item) => item.type == 'questionBankFolder' && item.childrenFolderCount > 0 |
| | | ) |
| | | if (data.length > 0) { |
| | | let list = [] |
| | | let addNum = query.cmsPath.length > 5 ? 7 : query.cmsPath.length > 6 ? 8 : 6 |
| | | const num = query.cmsPath.length + addNum |
| | | this.getTreeList(data, num, list, '\\', addNum) |
| | | list = this.ensureTreeConsistency(list) |
| | | let result = []; |
| | | this.findChildIds(list[0].children, result) |
| | | this.setData({ |
| | | testList: list[0].children, |
| | | openTeachids: result, |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 扁平化数据转换tree |
| | | getTreeList(rootList, pathLength, newArr, path, addNum) { |
| | | for (const item of rootList) { |
| | | // 此处原本 item.productLinkPath.length == pathLength 但 productLinkPath 长度个别书存在4、5位交错 |
| | | if ((pathLength - item.productLinkPath.length >= 0 && pathLength - item.productLinkPath.length <= 3) && item.productLinkPath.includes(path)) { |
| | | if (item.sysType == 'CmsItem') { |
| | | if (item.selectType == 'webpage') { |
| | | item.disabled = true |
| | | } else { |
| | | if (item.isDownload != 1) { |
| | | item.disabled = true |
| | | } |
| | | } |
| | | if (item.file && item.fileMap && item.fileMap[item.file]) { |
| | | if (item.fileMap[item.file].protectType == 'Private') item.disabled = true |
| | | } |
| | | } |
| | | // newArr.push(item) |
| | | // 在插入过程中对数据进行排序 |
| | | newArr = this.insertAndSortObjectsByProductLinkPath(newArr, item, addNum) |
| | | } |
| | | } |
| | | //给数组里面再添加一个children的空数组 |
| | | for (const i of newArr) { |
| | | i.children = [] |
| | | this.getTreeList(rootList, pathLength + addNum, i.children, i.productLinkPath, addNum) |
| | | if (i.children.length == 0) { |
| | | delete i.children |
| | | } |
| | | } |
| | | return newArr |
| | | }, |
| | | |
| | | // 去除树结构多余项 |
| | | ensureTreeConsistency(tree) { |
| | | for (let index = 0; index < tree.length; index++) { |
| | | const item = tree[index]; |
| | | if (item.children && item.children.length) { |
| | | const isFloder = item.children.findIndex(citem => citem.sysType == 'CmsFolder') |
| | | const isItem = item.children.findIndex(citem => citem.sysType == 'CmsItem') |
| | | if (isFloder > -1 && isItem > -1) { |
| | | item.children = item.children.filter(ditem => ditem.sysType == 'CmsItem') |
| | | } |
| | | this.ensureTreeConsistency(item.children) |
| | | } |
| | | } |
| | | return tree |
| | | }, |
| | | |
| | | // 排序数组 按照productLinkPath |
| | | insertAndSortObjectsByProductLinkPath(array, newObj, addNum) { |
| | | // 查找新对象应该插入的位置 |
| | | let insertIndex = array.findIndex(obj => Number(newObj.productLinkPath.substring(newObj.productLinkPath.length - addNum, newObj.productLinkPath.length)) < Number(obj.productLinkPath.substring(obj.productLinkPath.length - addNum, obj.productLinkPath.length))); |
| | | |
| | | // 如果没有找到合适的位置,则放在数组末尾 |
| | | if (insertIndex === -1) { |
| | | insertIndex = array.length; |
| | | } |
| | | // 插入新对象到数组 |
| | | array.splice(insertIndex, 0, newObj); |
| | | // 测试6 正式5 |
| | | // 对数组进行排序 |
| | | array.sort((a, b) => { |
| | | if (Number(a.productLinkPath.substring(a.productLinkPath.length - addNum, a.productLinkPath.length)) < Number(b.productLinkPath.substring(b.productLinkPath.length - addNum, b.productLinkPath.length))) { |
| | | return -1; |
| | | } |
| | | if (Number(a.productLinkPath.substring(a.productLinkPath.length - addNum, a.productLinkPath.length)) > Number(b.productLinkPath.substring(b.productLinkPath.length - addNum, b.productLinkPath.length))) { |
| | | return 1; |
| | | } |
| | | // a must be equal to b |
| | | return 0; |
| | | }); |
| | | |
| | | // 返回更新后的数组 |
| | | return array; |
| | | }, |
| | | |
| | | // 获取展开项 |
| | | findChildIds(data, result) { |
| | | let index = 0 |
| | | for (let i = 0; i < data.length; i++) { |
| | | if (index < 3) { |
| | | const item = data[i] |
| | | if (item.childrenFolderCount > 0) { |
| | | result.push(item.id) |
| | | for (let j = 0; j < item.children.length; j++) { |
| | | if (index < 3) { |
| | | const childrenItme = item.children[j] |
| | | if (item.childrenCount > 0) { |
| | | result.push(childrenItme.id) |
| | | index += 1 |
| | | } |
| | | } else { |
| | | break |
| | | } |
| | | } |
| | | } else if (item.childrenCount > 0) { |
| | | result.push(item.id) |
| | | index += 1 |
| | | } |
| | | } else { |
| | | break |
| | | } |
| | | } |
| | | }, |
| | | //学习笔记 |
| | | //在线提问 |
| | | // 图书添加购物车 |
| | | async addBookShopcCar() { |
| | | if (!this.data.expire) { |
| | |
| | | }, |
| | | |
| | | //购买按钮 |
| | | |
| | | async buyBtn() { |
| | | if (!this.data.expire) { |
| | | let bookOrdersId = ""; |
| | |
| | | orderNum: bookOrdersId, |
| | | }) |
| | | .then((res) => { |
| | | this.digitalTextbooksDetailsGet(this.data.digitalTextId) |
| | | if (res) { |
| | | wx.showToast({ |
| | | title: "领取成功", |
| | |
| | | }); |
| | | } |
| | | }, |
| | | showDialog(e) { |
| | | const { |
| | | key |
| | | } = e.currentTarget.dataset; |
| | | this.setData({ |
| | | [key]: true, |
| | | dialogKey: key |
| | | }); |
| | | }, |
| | | |
| | | |
| | | |
| | | closeDialog() { |
| | | const { |
| | |
| | | [dialogKey]: false |
| | | }); |
| | | }, |
| | | //申请证书 |
| | | onCertificate() { |
| | | |
| | | |
| | | var page = getCurrentPages().pop(); // 获取当前页面实例 |
| | | page.setData({ |
| | | // 动态设置禁止滚动的样式 |
| | |
| | | dialogBox: false, |
| | | scrollJudge: true |
| | | }) |
| | | } |
| | | }, |
| | | setCoolect() { |
| | | // 首页测试登录功能,后续注释 |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | // 如果不是第一次登录,会执行回调 |
| | | if (data) { |
| | | if (this.data.digitalsData.isFavourite) { |
| | | app.MG.store |
| | | .delProductLink({ |
| | | productIds: [this.data.digitalsData.id], |
| | | linkType: 'Favoriteclass' |
| | | }) |
| | | .then(() => { |
| | | this.setData({ |
| | | "digitalsData.isFavourite": false |
| | | }) |
| | | }) |
| | | } else { |
| | | let params = { |
| | | productIds: [this.data.digitalsData.id], |
| | | linkType: 'Favoriteclass' |
| | | } |
| | | app.MG.store.addProductLink(params).then((res) => { |
| | | this.setData({ |
| | | "digitalsData.isFavourite": true |
| | | }) |
| | | }) |
| | | } |
| | | } else { |
| | | // 出现错误,返回false |
| | | } |
| | | }) |
| | | } else { |
| | | if (this.data.digitalsData.isFavourite) { |
| | | app.MG.store |
| | | .delProductLink({ |
| | | productIds: [this.data.digitalsData.id], |
| | | linkType: 'Favoriteclass' |
| | | }) |
| | | .then(() => { |
| | | this.setData({ |
| | | "digitalsData.isFavourite": false |
| | | }) |
| | | }) |
| | | } else { |
| | | let params = { |
| | | productIds: [this.data.digitalsData.id], |
| | | linkType: 'Favoriteclass' |
| | | } |
| | | app.MG.store.addProductLink(params).then((res) => { |
| | | this.setData({ |
| | | "digitalsData.isFavourite": true |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | }) |
| | |
| | | "t-empty": "tdesign-miniprogram/empty/empty", |
| | | "t-button": "tdesign-miniprogram/button/button", |
| | | "t-input": "tdesign-miniprogram/input/input", |
| | | "t-dialog": "tdesign-miniprogram/dialog/dialog" |
| | | "t-dialog": "tdesign-miniprogram/dialog/dialog", |
| | | "tree": "/pages/digitalCourses/digitalCoursesDetails/components/tree/index", |
| | | "testTree": "/pages/digitalCourses/digitalCoursesDetails/components/testTree/index", |
| | | "note": "/pages/digitalCourses/digitalCoursesDetails/components/note/note", |
| | | "question": "/pages/digitalCourses/digitalCoursesDetails/components/question/question" |
| | | } |
| | | } |
| | |
| | | <import src="index.skeleton.wxml" /> |
| | | <template is="skeleton" wx:if="{{loading}}" /> |
| | | <view wx:else> |
| | | <view wx:else class="page-bookService"> |
| | | <scroll-view scroll-y="{{true}}" class="outsideContentBox"> |
| | | <view class="digital"> |
| | | <view class="book-box"> |
| | |
| | | <view class="course-content"> |
| | | <view class="lecturer" wx:for="{{lecturerList}}" wx:key="index" wx:for-item="item"> |
| | | <view class="lecturerImangBox"> |
| | | <image src="{{item.icon}}" mode="" /> |
| | | <image src="{{item.icon}}" mode="aspectFit" /> |
| | | </view> |
| | | <view class="lecturerInformation"> |
| | | <view class="lecturerName"> |
| | | <view class="name"> |
| | | {{item.name}} |
| | | </view> |
| | | <view class="title" style="font-weight: 400; font-size: 25rpx; color: #949494;">{{item.title}}</view> |
| | | <view class="title">{{item.title}}</view> |
| | | </view> |
| | | <view class="lecturerContent">{{item.introduce}}</view> |
| | | <view class="lecturerContent">{{item.description}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | </t-tab-panel> |
| | | <t-tab-panel icon="{{ tabValue == '2' ? courseLearningClick : courseLearning}}" label="课程学习" value="2"> |
| | | <view class="course-content"> |
| | | |
| | | <view class="tabsSelect"> |
| | | <view class="{{selectActive == 'learn' ? 'tabs-item selectActive' : 'tabs-item'}}" bind:tap="selectChange" data-value="{{'learn'}}">学习内容</view> |
| | | <view class="{{selectActive == 'test' ? 'tabs-item selectActive' : 'tabs-item'}}" bind:tap="selectChange" data-value="{{'test'}}">在线测试</view> |
| | | </view> |
| | | <view class="list-box"> |
| | | <view wx:if="{{selectActive == 'learn'}}"> |
| | | <tree id="test-tree" openIds="{{openTeachids}}" bookInfo="{{digitalsData}}" treeList="{{learnList}}" bind:goTest="goTest"> |
| | | </tree> |
| | | </view> |
| | | <view wx:if="{{selectActive == 'test'}}"> |
| | | <testTree id="tree" openIds="{{openTeachids}}" bookInfo="{{digitalsData}}" tab="{{tab}}" treeList="{{testList}}" bind:goTest="goTest"></testTree> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </t-tab-panel> |
| | | <t-tab-panel icon="{{ tabValue == '3' ? learningNotesClick : learningNotes}}" label="学习笔记" value="3"> |
| | | <view class="course-content"> |
| | | |
| | | <note bookInfo="{{digitalsData}}" id="note" class="note-list"></note> |
| | | <!-- <view class="topBox"> |
| | | <view></view> |
| | | <view class="note-btn"> |
| | | <t-button theme="primary" class="make-note" bind:tap="openDialog" style="width: 200rpx"> |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/bookService/detail/makeNote.png" /> |
| | | <text class="note-btn-text">记笔记</text> |
| | | </view> |
| | | </t-button> |
| | | </view> |
| | | </view> --> |
| | | </view> |
| | | </t-tab-panel> |
| | | <t-tab-panel icon="{{ tabValue == '4' ? onlineQuestioningClick : onlineQuestioning}}" label="在线提问" value="4"> |
| | | <view class="course-content"> |
| | | |
| | | <question bookInfo="{{digitalsData}}" id="question" class="note-list"></question> |
| | | <!-- <view class="topBox"> |
| | | <view>共{{questionTotalCount}}个</view> |
| | | <view class="note-btn"> |
| | | <t-button theme="primary" class="make-note" bind:tap="openDialog" style="width: 240rpx"> |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/digitalCourses/bianji.png" /> |
| | | <text class="note-btn-text">提问</text> |
| | | </view> |
| | | </t-button> |
| | | </view> |
| | | </view> |
| | | <view class="list-box"> |
| | | <view wx:for="{{onlineQuestionsList}}" wx:key="index" wx:for-item="item" class="list-Item"> |
| | | <view class="quesTitle"> |
| | | <view class="titleLeft"> |
| | | <view class="icon"></view> |
| | | <text>{{ item.title }}</text> |
| | | </view> |
| | | <view class="titleRight"> |
| | | {{item.createDate}} |
| | | </view> |
| | | </view> |
| | | <view class="noteContent"> |
| | | {{ item.back }} |
| | | </view> |
| | | </view> |
| | | </view> --> |
| | | </view> |
| | | </t-tab-panel> |
| | | </t-tabs> |
| | | </view> |
| | | <view class="box-bottom"> |
| | | <view class="application" bind:tap="onCertificate"> |
| | | <view class="bottom-btn" bind:tap="setCoolect"> |
| | | <view class="collectionImage"> |
| | | <image wx:if="{{!digitalsData.isFavourite}}" src="/static/images/digitalTextbooks/wodeshoucang@2x.png" mode="" /> |
| | | <image wx:else src="/static/images/bookService/detail/collecting.png" mode="" /> |
| | | </view> |
| | | <view class="btn-text"> |
| | | 收藏 |
| | | </view> |
| | | </view> |
| | | <view class="bottom-btn" bind:tap="onCertificate"> |
| | | <view class="applicationImageBox"> |
| | | <image src="/static/images/digitalCourses/zhengshushenqing@2x.png" mode="" /> |
| | | </view> |
| | | <view>证书申请</view> |
| | | </view> |
| | | <view class="shopCarColor" bind:tap="addBookShopcCar" wx:if="{{!isBuy}}">加入购物车</view> |
| | | <view class="buyColor" bind:tap="buyBtn" wx:if="{{!isBuy}}">立即购买</view> |
| | | <view class="bottom-btn shopCarColor" bind:tap="addBookShopcCar" wx:if="{{!isBuy}}">加入购物车</view> |
| | | <view class="bottom-btn buyColor" bind:tap="buyBtn" wx:if="{{!isBuy}}">立即购买</view> |
| | | </view> |
| | | <t-toast id="t-toast" /> |
| | | </scroll-view> |
| | |
| | | <view class="dialog-title">学习证书申请</view> |
| | | <view style="width: 100%; height: 2rpx; background-color: #F4F4F4;"></view> |
| | | <view class="input-box"> |
| | | <t-input style="{{inputStyle}}" class="input" placeholder="请输入真实姓名" value="{{input}}" bind:change="inputChange"></t-input> |
| | | <t-input class="input" borderless placeholder="请输入真实姓名" value="{{input}}" bind:change="inputChange"></t-input> |
| | | </view> |
| | | </view> |
| | | <view class="row-btn"> |
| | |
| | | height: 100%; |
| | | } |
| | | |
| | | .page-bookService { |
| | | width: 100vw; |
| | | height: 100%; |
| | | } |
| | | |
| | | .outsideContentBox { |
| | | position: relative; |
| | | background-color: #F2F3F8; |
| | | height: calc(100vh - env(safe-area-inset-bottom) - 60px); |
| | | } |
| | | |
| | | .digitalCoursesDetailsTitle { |
| | | background: #FFFFFF; |
| | | /* box-shadow: 0rpx 9rpx 18rpx 2rpx rgba(0, 0, 0, 0.08); */ |
| | |
| | | right: -50rpx; |
| | | z-index: 0; |
| | | } |
| | | |
| | | |
| | | .tabBox { |
| | | min-height: calc(100% - 800rpx); |
| | |
| | | width: 140rpx; |
| | | height: 180rpx; |
| | | border: 2rpx solid #ccc; |
| | | position: relative; |
| | | } |
| | | |
| | | .lecturerInformation { |
| | |
| | | |
| | | .lecturerName { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | /* justify-content: space-between; */ |
| | | margin-bottom: 10rpx; |
| | | } |
| | | |
| | | .lecturerName .name { |
| | | color: #333; |
| | | width: 200rpx; |
| | | } |
| | | |
| | | .lecturerName .title { |
| | | color: #949494; |
| | | } |
| | | |
| | | .lecturerContent { |
| | |
| | | line-height: 35rpx; |
| | | } |
| | | |
| | | .outsideContentBox { |
| | | /* height: calc(100vh - 120rpx); */ |
| | | position: relative; |
| | | height: calc(100vh - env(safe-area-inset-bottom) - 60px); |
| | | background-color: #F2F3F8; |
| | | .tabsSelect { |
| | | width: 400rpx; |
| | | height: 68rpx; |
| | | margin: 0 auto; |
| | | display: flex; |
| | | align-items: center; |
| | | border: 2rpx solid #FF6C00; |
| | | border-radius: 10rpx; |
| | | } |
| | | |
| | | .tabs-item { |
| | | height: 68rpx; |
| | | line-height: 68rpx; |
| | | text-align: center; |
| | | |
| | | flex: 1; |
| | | } |
| | | |
| | | .selectActive { |
| | | color: #fff; |
| | | border-radius: 8rpx; |
| | | background-color: #FF6C00; |
| | | } |
| | | |
| | | .topBox { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | padding-bottom: 20rpx; |
| | | border-bottom: 2rpx solid #EFF0F1; |
| | | } |
| | | |
| | | .note-btn { |
| | | display: flex; |
| | | --td-button-primary-bg-color: #fff; |
| | | --td-button-primary-border-color: #ff6c00; |
| | | --td-button-primary-color: #ff6c00; |
| | | --td-button-primary-active-bg-color: #fff0e6; |
| | | } |
| | | |
| | | .note-btn image { |
| | | width: 28rpx; |
| | | height: 32rpx; |
| | | margin-right: 10rpx; |
| | | } |
| | | |
| | | .note-btn-text { |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .btn-content { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | |
| | | .box-bottom { |
| | | position: fixed; |
| | |
| | | border: 1px solid #DDD; |
| | | } |
| | | |
| | | .box-bottom image { |
| | | width: 38rpx; |
| | | height: 40rpx; |
| | | } |
| | | |
| | | .bottom-btn { |
| | | background-color: #fff; |
| | | width: 25%; |
| | | display: flex; |
| | | flex: 1; |
| | | align-items: center; |
| | | justify-content: center; |
| | | flex-direction: column; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .bottom-btn:nth-child(1), |
| | | .bottom-btn:nth-child(2) { |
| | | border-right: 1px solid #DDD; |
| | | } |
| | | |
| | | .shopCarColor { |
| | | width: 200rpx; |
| | | height: 110rpx; |
| | | border-right: 1px solid #DDD; |
| | | color: #fff; |
| | | background-color: #f0ad36; |
| | |
| | | } |
| | | |
| | | .buyColor { |
| | | width: 200rpx; |
| | | height: 110rpx; |
| | | border-right: 1px solid #DDD; |
| | | color: #fff; |
| | | background-color: #f04d3b; |
| | |
| | | align-items: center; |
| | | } |
| | | |
| | | .application { |
| | | width: 351rpx; |
| | | /* height: 100rpx; */ |
| | | background: #FFF; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border-top: 2rpx solid #eee; |
| | | font-weight: 400; |
| | | font-size: 22rpx; |
| | | color: #010101; |
| | | } |
| | | |
| | | .applicationImageBox { |
| | | width: 35rpx; |
| | | height: 35rpx; |
| | | margin-bottom: 5rpx; |
| | | } |
| | | |
| | | |
| | | .certificateChart { |
| | |
| | | height: 325rpx; |
| | | border: 1rpx solid #ccc; |
| | | margin-right: 50rpx; |
| | | } |
| | | |
| | | .custom-panel { |
| | | /* min-height: 400px; */ |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | .wrapper { |
| | | margin-bottom: 32rpx; |
| | | } |
| | | |
| | | .placeholder { |
| | |
| | | color: white; |
| | | } |
| | | |
| | | .input { |
| | | --td-input-border-radius: 20rpx; |
| | | border-radius: 20rpx; |
| | | border: 2rpx solid #ccc; |
| | | } |
| | | |
| | | .t-input { |
| | | background-color: var(--td-input-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); |
| | | display: flex; |
| | | align-items: center; |
| | | flex: 1; |
| | | padding: var(--td-input-vertical-padding, 22rpx) !important; |
| | | padding: var(--td-input-vertical-padding, 10rpx) !important; |
| | | } |
| | | |
| | | .t-input__content, |
| | | .t-textarea { |
| | | border: 2rpx solid #D9D9D9 !important; |
| | | border-radius: 15rpx; |
| | | padding: 10rpx !important; |
| | | } |
| | | |
| | | .t-input__tips, |
| | | .from-item .label .icon { |
| | | color: #f56c6c !important; |
| | | margin-right: 5rpx; |
| | | } |
| | | |
| | | .t-input__placeholder, |
| | | .t-textarea__placeholder { |
| | | font-size: 28rpx !important; |
| | | } |
| | |
| | | loading: false |
| | | }) |
| | | this.getCourseList(newData[0]) |
| | | |
| | | |
| | | }) |
| | | }, |
| | | |
| | |
| | | app.MG.store |
| | | .delProductLink({ |
| | | productIds: [this.data.digitalsData.id], |
| | | linkType: 'FavoriteBookCity' |
| | | linkType: 'FavoriteTextBooks' |
| | | }) |
| | | .then(() => { |
| | | this.setData({ |
| | |
| | | } else { |
| | | let params = { |
| | | productIds: [this.data.digitalsData.id], |
| | | linkType: 'FavoriteBookCity' |
| | | linkType: 'FavoriteTextBooks' |
| | | } |
| | | app.MG.store.addProductLink(params).then((res) => { |
| | | this.setData({ |
| | |
| | | app.MG.store |
| | | .delProductLink({ |
| | | productIds: [this.data.digitalsData.id], |
| | | linkType: 'FavoriteBookCity' |
| | | linkType: 'FavoriteTextBooks' |
| | | }) |
| | | .then(() => { |
| | | this.setData({ |
| | |
| | | } else { |
| | | let params = { |
| | | productIds: [this.data.digitalsData.id], |
| | | linkType: 'FavoriteBookCity' |
| | | linkType: 'FavoriteTextBooks' |
| | | } |
| | | app.MG.store.addProductLink(params).then((res) => { |
| | | this.setData({ |
| | |
| | | .page-bookService { |
| | | width: 100vw; |
| | | height: 100%; |
| | | /* position: relative; */ |
| | | } |
| | | |
| | | .box-bottom { |
| | |
| | | <!--pages/digitalTextbooks/digitalTextbooks.wxml--> |
| | | <import src="index.skeleton.wxml" /> |
| | | <template is="skeleton" wx:if="{{loading}}" /> |
| | | |
| | | |
| | | <view wx:if="{{!loading}}"> |
| | | |
| | | |
| | | <view style="width: 100%; height: {{barHeight}}px;"></view> |
| | | <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> |
| | | <view> |
| | |
| | | </view> |
| | | <t-search model:value="{{searchValue}}" shape="round" placeholder="请输入关键词/书名/ISBN/作者" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" /> |
| | | </view> |
| | | |
| | | |
| | | |
| | | <t-tabs defaultValue="{{0}}" bind:change="selectTab" t-class="custom-tabs" t-class-content="custom-panel"> |
| | | <t-tab-panel wx:for="{{tabList}}" wx:key="index" wx:for-item="item" wx:for-index="index" label="{{item.name}}" value="{{index}}" style="{{tabPanelstyle}}"> |
| | | |
| | |
| | | book.learnSelectType == "audio" |
| | | ) { |
| | | url = "/packageDomain/pages/resourceDetails/myAudio/index"; |
| | | } else if (book.selectType == "picture" || book.selectType == "zip") { |
| | | } else if (book.selectType == "picture") { |
| | | url = "/packageDomain/pages/resourceDetails/document/index"; |
| | | } |
| | | this.setData({ |
| | |
| | | formPath: book.learnSelectType ? 'jsek_cloudLearning' : '' |
| | | }) |
| | | wx.redirectTo({ |
| | | url: `${url}?productLinkPath=${this.data.productLinkPath}&parentProductLinkPath=${this.data.parentProductLinkPath}&bookId=${book.productLinkInfo.ProductId}&bookName=${book.productLinkInfo.Name}&cmsId=${book.id}&storeInfo=${book.storeInfo}&formPath=${this.data.formPath}`, |
| | | url: `${url}?productLinkPath=${this.data.productLinkPath}&parentProductLinkPath=${this.data.parentProductLinkPath}&bookId=${book.productLinkInfo.ProductId}&activeId=${book.id}&bookName=${book.productLinkInfo.Name}&cmsId=${book.id}&storeInfo=${book.storeInfo}&formPath=${this.data.formPath}`, |
| | | }); |
| | | |
| | | if (book.selectType == "pdf") { |
| | | if (book.selectType == "pdf" || book.selectType == 'document') { |
| | | const fileLink = book.file ? book.file : book.freeFile |
| | | console.log(fileLink); |
| | | wx.navigateTo({ |
| | | wx.redirectTo({ |
| | | url: "/packageBookService/pages/components/webView/index?md5=" + |
| | | fileLink + |
| | | "&fileName=" + |
| | | book.name + |
| | | "&fileType=" + |
| | | book.selectType + "&bookBuy=true" |
| | | "&fileType=pdf" + "&bookBuy=true" |
| | | }); |
| | | } |
| | | if (book.selectType == 'document') { |
| | | if (book.selectType == 'zip') { |
| | | const fileLink = book.file ? |
| | | app.config.requestCtx + "/file/api/ApiDownload?md5=" + book.file : |
| | | app.config.requestCtx + |
| | |
| | | success: function (res) { |
| | | console.log(res, "wx.downloadFile success res"); |
| | | if (res.statusCode != 200) { |
| | | util.hideLoadingWithErrorTips(); |
| | | return false; |
| | | } |
| | | var Path = res.tempFilePath; //返回的文件临时地址,用于后面打开本地预览所用 |
| | | let data = res.filePath; |
| | | wx.openDocument({ |
| | | filePath: data, |
| | | showMenu: true, |
| | | success: function (res) { |
| | | console.log("打开成功"); |
| | | util.hideLoading(); |
| | | }, |
| | | }); |
| | | }, |
| | | fail: function (err) { |
| | | console.log(err, "wx.downloadFile fail err"); |
| | | util.hideLoadingWithErrorTips(); |
| | | }, |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | |
| | | text: '专题讨论', |
| | | key: 4, |
| | | icon: '/static/images/home/zhuantitaolun@2x.png', |
| | | // url: '/pages/specialDiscussion/index', |
| | | url: '' |
| | | url: '/pages/specialDiscussion/index', |
| | | // url: '' |
| | | }, |
| | | { |
| | | text: '线上书展', |