详情页tabs样式优化,答题添加页面退出拦截,合并代码
| | |
| | | theme="primary" |
| | | style="height: 72rpx; font-size: 28rpx" |
| | | bind:tap="goBuyResource" |
| | | style="margin: {{!isshowDrawBtn ? '0 30rpx' : ''}}" |
| | | style="height: 72rpx; font-size: 28rpx;margin: {{!isshowDrawBtn ? '0 30rpx' : ''}}" |
| | | > |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/bookService/detail/yijiangoumai.png" /> |
| | | <text>资源购买</text> |
| | | </view> |
| | | </t-button> |
| | | <t-button |
| | | <!-- <t-button |
| | | class="btn" |
| | | theme="primary" |
| | | style="height: 72rpx; font-size: 28rpx" |
| | |
| | | > |
| | | <image src="/static/images/bookService/detail/renwudan/icon.png" /> |
| | | 学习任务单 |
| | | </t-button> |
| | | </t-button> --> |
| | | </view> |
| | |
| | | // pages/bookServices/detail/components/note/note.js |
| | | const app = getApp() |
| | | const app = getApp(); |
| | | Component({ |
| | | /** |
| | | * 组件的属性列表 |
| | |
| | | properties: { |
| | | bookInfo: { |
| | | type: Object, |
| | | value: {} |
| | | } |
| | | value: {}, |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | | * 组件的初始数据 |
| | | */ |
| | | data: { |
| | | inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding:16rpx', |
| | | placeholderstyle: 'font-size:28rpx', |
| | | 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: '', |
| | | textvalue: "", |
| | | noteId: "", |
| | | showInput: false, |
| | | submitTitle: "", |
| | | pageCount: { |
| | |
| | | */ |
| | | methods: { |
| | | onReachBottom() { |
| | | const flag = this.data.noteList.length < this.data.pageCount.total |
| | | 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() |
| | | "pageCount.page": this.data.pageCount.page + 1, |
| | | }); |
| | | this.getNoteList(); |
| | | } else { |
| | | this.setData({ |
| | | isMore: true |
| | | }) |
| | | isMore: true, |
| | | }); |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | isMore: false, |
| | | }); |
| | | }, 100); |
| | | } |
| | | }, |
| | | handleSubmitTitle() { |
| | | this.setData({ |
| | | submitTitle: this.properties.bookInfo.name |
| | | }) |
| | | submitTitle: this.properties.bookInfo.name, |
| | | }); |
| | | }, |
| | | openDialog() { |
| | | this.setData({ |
| | | submitTitle: this.properties.bookInfo.name, |
| | | showNoteDialog: true |
| | | }) |
| | | showNoteDialog: true, |
| | | }); |
| | | }, |
| | | closeDialog() { |
| | | this.setData({ |
| | | flag: false, |
| | | showNoteDialog: false, |
| | | submitTitle: '', |
| | | submitTitle: "", |
| | | textvalue: "", |
| | | }) |
| | | }); |
| | | }, |
| | | textareaChange(e) { |
| | | this.setData({ |
| | | textvalue: e.detail.value |
| | | }) |
| | | textvalue: e.detail.value, |
| | | }); |
| | | }, |
| | | textareaBlur() { |
| | | console.log('失去焦点'); |
| | | console.log("失去焦点"); |
| | | }, |
| | | // 标题输入框值 |
| | | inputChange(e) { |
| | | this.setData({ |
| | | submitTitle: e.detail.value |
| | | }) |
| | | submitTitle: e.detail.value, |
| | | }); |
| | | }, |
| | | // 弹窗确定按钮 |
| | | confirmSuggest() { |
| | | const submitTitle = this.data.submitTitle.trim() |
| | | const textvalue = this.data.textvalue.trim() |
| | | const submitTitle = this.data.submitTitle.trim(); |
| | | const textvalue = this.data.textvalue.trim(); |
| | | if (!submitTitle.length) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请填写笔记标题', |
| | | }) |
| | | icon: "error", |
| | | title: "请填写笔记标题", |
| | | }); |
| | | } else if (!textvalue.length) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请填写笔记内容', |
| | | }) |
| | | icon: "error", |
| | | title: "请填写笔记内容", |
| | | }); |
| | | } |
| | | if (this.data.submitType == 'new') { |
| | | this.makeNote() |
| | | } else if (this.data.submitType == 'edit') { |
| | | this.updateNote() |
| | | if (this.data.submitType == "new") { |
| | | this.makeNote(); |
| | | } else if (this.data.submitType == "edit") { |
| | | this.updateNote(); |
| | | } |
| | | this.setData({ |
| | | showNoteDialog: false |
| | | }) |
| | | showNoteDialog: false, |
| | | }); |
| | | }, |
| | | handleChange(e) { |
| | | this.setData({ |
| | | activeValues: e.detail.value |
| | | }) |
| | | 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 |
| | | 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 |
| | | }) |
| | | loading: true, |
| | | }); |
| | | }, |
| | | changeNoList() { |
| | | this.setData({ |
| | | noList: true, |
| | | }); |
| | | }, |
| | | // 获取笔记列表 |
| | | async getNoteList() { |
| | | if (!this.data.isMore) { |
| | | this.setData({ |
| | | loading: true, |
| | | noList: false |
| | | }) |
| | | let topicId |
| | | }); |
| | | } |
| | | this.setData({ |
| | | noList: false, |
| | | }); |
| | | let topicId; |
| | | await app.MG.ugc |
| | | .getProductUserSubmitTopic({ |
| | | productId: this.properties.bookInfo.id, |
| | | appRefCode: app.config.appRefCode |
| | | appRefCode: app.config.appRefCode, |
| | | }) |
| | | .then((res) => { |
| | | if (res) { |
| | | topicId = res.id |
| | | topicId = res.id; |
| | | } else { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: '查询失败', |
| | | }) |
| | | title: "查询失败", |
| | | }); |
| | | } |
| | | }) |
| | | }); |
| | | // loadings.value.bookResource = true |
| | | let query = { |
| | | start: 0, |
| | | size: this.data.pageCount.page * 5, |
| | | messageType: 'note', |
| | | messageType: "note", |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | type: "Desc", |
| | | field: "CreateDate", |
| | | }, |
| | | appRefCode: app.config.appRefCode, |
| | | topicIdOrRefCode: topicId + '' |
| | | } |
| | | topicIdOrRefCode: topicId + "", |
| | | }; |
| | | await app.MG.ugc.getTopicMessageList(query).then((res) => { |
| | | if (!res.datas.length) { |
| | | return this.setData({ |
| | | noList: true, |
| | | 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) |
| | | }) |
| | | item.compliceHover = false; |
| | | item.deleteHover = false; |
| | | item.createDate = this.convertTimestamp(item.createDate); |
| | | }); |
| | | this.setData({ |
| | | "pageCount.total": res.totalSize, |
| | | noteList: res.datas, |
| | | loading: false |
| | | }) |
| | | }) |
| | | loading: false, |
| | | noList: false, |
| | | }); |
| | | }); |
| | | }, |
| | | // 新建笔记接口 |
| | | async makeNote() { |
| | | const token = wx.getStorageSync('jsek-token') |
| | | const token = wx.getStorageSync("jsek-token"); |
| | | if (!token) { |
| | | return wx.getUserProfile({ |
| | | desc: '用户登录', |
| | | desc: "用户登录", |
| | | success: (res) => { |
| | | console.log(res); |
| | | }, |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | let topicId |
| | | let topicId; |
| | | await app.MG.ugc |
| | | .getProductUserSubmitTopic({ |
| | | productId: this.properties.bookInfo.id, |
| | | appRefCode: app.config.appRefCode |
| | | appRefCode: app.config.appRefCode, |
| | | }) |
| | | .then((res) => { |
| | | if (res) { |
| | | topicId = res.id |
| | | topicId = res.id; |
| | | } else { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '新建失败', |
| | | }) |
| | | icon: "error", |
| | | title: "新建失败", |
| | | }); |
| | | } |
| | | }) |
| | | }); |
| | | let query = { |
| | | topicIdOrRefCode: topicId + '', |
| | | topicIdOrRefCode: topicId + "", |
| | | name: this.data.submitTitle, |
| | | content: this.data.textvalue, |
| | | type: 'note', |
| | | cmsTypeRefCode: '', |
| | | newDataListRequest: [] |
| | | } |
| | | type: "note", |
| | | cmsTypeRefCode: "", |
| | | newDataListRequest: [], |
| | | }; |
| | | await app.MG.ugc.newTopicMessage(query).then((res) => { |
| | | wx.showToast({ |
| | | title: '新建成功', |
| | | }) |
| | | this.closeDialog() |
| | | this.getNoteList() |
| | | }) |
| | | title: "新建成功", |
| | | }); |
| | | this.closeDialog(); |
| | | this.getNoteList(); |
| | | }); |
| | | }, |
| | | // 删除笔记 |
| | | deleteNote(e) { |
| | | const id = e.currentTarget.dataset.id |
| | | const messageIds = [] |
| | | messageIds.push(id) |
| | | const id = e.currentTarget.dataset.id; |
| | | const messageIds = []; |
| | | messageIds.push(id); |
| | | wx.showModal({ |
| | | title: '提示', |
| | | content: '确认删除该笔记吗?', //editable如果为true,这就是输入框的内容 |
| | | title: "提示", |
| | | content: "确认删除该笔记吗?", //editable如果为true,这就是输入框的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | editable: false, //是否显示输入框 |
| | | placeholderText: '请输入内容吧', //输入框的默认内容 |
| | | placeholderText: "请输入内容吧", //输入框的默认内容 |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | app.MG.ugc |
| | | .delTopicMessage({ |
| | | messageIds |
| | | messageIds, |
| | | }) |
| | | .then((res) => { |
| | | wx.showToast({ |
| | | title: '删除成功', |
| | | }) |
| | | title: "删除成功", |
| | | }); |
| | | // if ((notePage.value.total % 3) - 1 == 0) { |
| | | // notePage.value.page -= 1 |
| | | // } |
| | | this.getNoteList() |
| | | }) |
| | | this.getNoteList(); |
| | | }); |
| | | } else if (res.cancel) { |
| | | console.log('用户点击取消') |
| | | console.log("用户点击取消"); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | }); |
| | | }, |
| | | // 标题改变 |
| | | changeTitle(e) { |
| | | this.setData({ |
| | | flag: e.currentTarget.dataset.value |
| | | }) |
| | | flag: e.currentTarget.dataset.value, |
| | | }); |
| | | }, |
| | | // 编辑按钮 |
| | | editNote(e) { |
| | | const note = e.currentTarget.dataset.note |
| | | const note = e.currentTarget.dataset.note; |
| | | this.setData({ |
| | | submitType: "edit", |
| | | textvalue: note.content, |
| | | submitTitle: note.name, |
| | | noteId: note.id |
| | | }) |
| | | noteId: note.id, |
| | | }); |
| | | console.log(note.name, this.data.submitTitle); |
| | | this.setData({ |
| | | showNoteDialog: true |
| | | }) |
| | | showNoteDialog: true, |
| | | }); |
| | | }, |
| | | // 编辑笔记接口 |
| | | updateNote() { |
| | | const token = wx.getStorageSync('jsek-token') |
| | | const token = wx.getStorageSync("jsek-token"); |
| | | if (!token) { |
| | | return wx.getUserProfile({ |
| | | desc: '用户登录', |
| | | desc: "用户登录", |
| | | success: (res) => { |
| | | console.log(res); |
| | | } |
| | | }) |
| | | }, |
| | | }); |
| | | } |
| | | if (!this.data.submitTitle) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请填写笔记标题', |
| | | }) |
| | | icon: "error", |
| | | title: "请填写笔记标题", |
| | | }); |
| | | } else if (!this.data.textvalue) { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请填写笔记内容', |
| | | }) |
| | | icon: "error", |
| | | title: "请填写笔记内容", |
| | | }); |
| | | } |
| | | let query = { |
| | | id: this.data.noteId, |
| | | name: this.data.submitTitle, |
| | | description: 'string', |
| | | icon: 'string', |
| | | type: 'note', |
| | | description: "string", |
| | | icon: "string", |
| | | type: "note", |
| | | content: this.data.textvalue, |
| | | newDataRequests: [], |
| | | updateDataRequests: [] |
| | | } |
| | | updateDataRequests: [], |
| | | }; |
| | | app.MG.ugc.updateTopicMessage(query).then((res) => { |
| | | wx.showToast({ |
| | | title: '编辑成功', |
| | | }) |
| | | this.closeDialog() |
| | | this.getNoteList() |
| | | }) |
| | | title: "编辑成功", |
| | | }); |
| | | this.closeDialog(); |
| | | this.getNoteList(); |
| | | }); |
| | | this.setData({ |
| | | submitType: "new" |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | submitType: "new", |
| | | }); |
| | | }, |
| | | }, |
| | | }); |
| | |
| | | bind:tap="openDialog" |
| | | style="width: 240rpx" |
| | | > |
| | | <view slot="content"> |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/bookService/detail/makeNote.png" /> |
| | | 记笔记 |
| | | <text class="note-btn-text">记笔记</text> |
| | | </view> |
| | | </t-button> |
| | | </view> |
| | |
| | | |
| | | .note { |
| | | height: 100%; |
| | | padding-bottom: 50rpx; |
| | | } |
| | | |
| | | .popup { |
| | |
| | | .note-btn image { |
| | | width: 28rpx; |
| | | height: 32rpx; |
| | | margin-top: 24rpx; |
| | | margin-right: 5rpx; |
| | | } |
| | | |
| | | .note-btn-text { |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | |
| | |
| | | font-size: 28rpx; |
| | | color: #949494; |
| | | margin-bottom: 20rpx; |
| | | max-height: 600rpx; |
| | | text-align: justify; |
| | | /* padding-bottom: 200rpx; */ |
| | | } |
| | | |
| | | .wrapper { |
| | |
| | | .t-input__placeholder { |
| | | font-size: 28rpx !important |
| | | } |
| | | |
| | | .btn-content { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | |
| | | methods: { |
| | | copy() { |
| | | wx.setClipboardData({ |
| | | data: "11", |
| | | data: "http://182.92.203.7:3007/jsek/website/#/home/index", |
| | | success: function (res) { |
| | | wx.showToast({ title: "复制成功" }); |
| | | }, |
| | | fail: function (res) { |
| | | wx.showToast({ |
| | | title: "失败", |
| | | }); |
| | | console.log(res); |
| | | }, |
| | | }); |
| | | }, |
| | |
| | | <view> |
| | | 资源下载申请已通过<text wx:if="{{deadline}}" |
| | | >,有效日期截至:{{ deadline }}</text |
| | | ></view> |
| | | <!-- <view style="display: flex; align-items: center; margin-top: 10rpx"> |
| | | ></view |
| | | > |
| | | <view style="display: flex; align-items: center; margin-top: 10rpx"> |
| | | <text>下载资源请到PC端京师E课</text> |
| | | <t-button style="font-size: 24rpx; height: 50rpx" bind:tap="copy">复制</t-button> |
| | | </view> --> |
| | | <t-button style="font-size: 24rpx; height: 50rpx" bind:tap="copy" |
| | | >复制</t-button |
| | | > |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{applyState == 'Reject'}}" |
| | | >资源下载需要申请,请先申请并等待审核通过后方可下载</view |
| | |
| | | // pages/bookServices/detail/components/testResource/testResource.js |
| | | const app = getApp() |
| | | const app = getApp(); |
| | | Component({ |
| | | /** |
| | | * 组件的属性列表 |
| | |
| | | properties: { |
| | | list: { |
| | | type: Array, |
| | | value: [] |
| | | value: [], |
| | | }, |
| | | bookInfo: { |
| | | type: Object, |
| | |
| | | }, |
| | | mockData: { |
| | | type: Object, |
| | | value: {} |
| | | } |
| | | value: {}, |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | | * 组件的初始数据 |
| | | */ |
| | | data: { |
| | | selectBtn: 'test', // test mock |
| | | radioItem: 'test', |
| | | selectBtn: "test", // test mock |
| | | radioItem: "test", |
| | | loading: false, |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | methods: { |
| | | async goTest(e) { |
| | | const value = e.currentTarget.dataset.value |
| | | const token = wx.getStorageSync('jsek-token') |
| | | const value = e.currentTarget.dataset.value; |
| | | const token = wx.getStorageSync("jsek-token"); |
| | | if (!token) { |
| | | return wx.getUserProfile({ |
| | | desc: '用户登录', |
| | | desc: "用户登录", |
| | | success: (res) => { |
| | | console.log(res); |
| | | } |
| | | }) |
| | | }, |
| | | }); |
| | | } |
| | | wx.showLoading({ |
| | | title: '加载中', |
| | | }) |
| | | title: "加载中", |
| | | }); |
| | | // 获取章节下是否有题目 |
| | | let idPathList = [] |
| | | let idPathList = []; |
| | | let query = { |
| | | path: '*', |
| | | queryType: '*', |
| | | path: "*", |
| | | queryType: "*", |
| | | productId: this.properties.bookInfo.id, |
| | | cmsPath: value.productLinkPath, |
| | | pading: { |
| | | start: 0, |
| | | size: 999 |
| | | } |
| | | } |
| | | size: 999, |
| | | }, |
| | | }; |
| | | if (value.childrenFolderCount == 0) { |
| | | wx.hideLoading() |
| | | wx.hideLoading(); |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: '暂无数据', |
| | | }) |
| | | title: "暂无数据", |
| | | }); |
| | | } else { |
| | | const res = await app.MG.store.getProductDetail(query) |
| | | 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 |
| | | }) |
| | | }) |
| | | type: item.type, |
| | | }); |
| | | }); |
| | | } |
| | | wx.hideLoading() |
| | | 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'}`, |
| | | }) |
| | | 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"}`, |
| | | }); |
| | | }, |
| | | goMycollect(e) { |
| | | const answertype = e.currentTarget.dataset.answertype |
| | | const token = wx.getStorageSync('jsek-token') |
| | | const answertype = e.currentTarget.dataset.answertype; |
| | | const token = wx.getStorageSync("jsek-token"); |
| | | if (!token) { |
| | | return wx.getUserProfile({ |
| | | desc: '用户登录', |
| | | desc: "用户登录", |
| | | success: (res) => { |
| | | console.log(res); |
| | | } |
| | | }) |
| | | }, |
| | | }); |
| | | } |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/examination/examination?bookId=${this.properties.bookInfo.id}&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${answertype == 'collectQuestion' ? '我的收藏' : '我的错题'}&answerType=${answertype}`, |
| | | }) |
| | | url: `/packageBookService/pages/bookServices/examination/examination?bookId=${ |
| | | this.properties.bookInfo.id |
| | | }&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${ |
| | | answertype == "collectQuestion" ? "我的收藏" : "我的错题" |
| | | }&answerType=${answertype}`, |
| | | }); |
| | | }, |
| | | // 练习 组件切换 |
| | | onRadioChange(e) { |
| | | this.setData({ |
| | | radioItem: e.detail.value |
| | | }) |
| | | radioItem: e.detail.value, |
| | | }); |
| | | if (e.detail.value == "mock") { |
| | | } |
| | | }, |
| | | async getMockId() { |
| | | wx.showLoading({ |
| | | title: '加载中' |
| | | }) |
| | | let id |
| | | title: "加载中", |
| | | }); |
| | | let id; |
| | | let query = { |
| | | start: 0, |
| | | size: 99, |
| | | productId: this.properties.bookInfo.id |
| | | } |
| | | productId: this.properties.bookInfo.id, |
| | | }; |
| | | await app.MG.edu.getQuizConfigListByProduct(query).then((res) => { |
| | | id = res.datas[0].id |
| | | }) |
| | | return id |
| | | id = res.datas[0].id; |
| | | }); |
| | | return id; |
| | | }, |
| | | // 组卷跳转答题界面 |
| | | async goMackPaper(e) { |
| | |
| | | // if (!token) { |
| | | // return logIn() |
| | | // } |
| | | const mockid = await this.getMockId() |
| | | wx.hideLoading() |
| | | const item = e.currentTarget.dataset.item |
| | | const mockid = await this.getMockId(); |
| | | wx.hideLoading(); |
| | | const item = e.currentTarget.dataset.item; |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/examination/examination?bookId=${this.properties.bookInfo.id}&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${item.name}&answerType=${'mock'}&uuid=${item.id}&mockid=${mockid}`, |
| | | }) |
| | | url: `/packageBookService/pages/bookServices/examination/examination?bookId=${ |
| | | this.properties.bookInfo.id |
| | | }&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${ |
| | | item.name |
| | | }&answerType=${"mock"}&uuid=${item.id}&mockid=${mockid}`, |
| | | }); |
| | | }, |
| | | // 购买组卷 |
| | | buyMock() { |
| | | var myEventDetail = {} |
| | | var myEventDetail = {}; |
| | | var myEventOption = { |
| | | bubbles: true, |
| | | composed: true |
| | | } |
| | | this.triggerEvent('buyMock', myEventDetail, myEventOption) |
| | | } |
| | | } |
| | | }) |
| | | composed: true, |
| | | }; |
| | | this.triggerEvent("buyMock", myEventDetail, myEventOption); |
| | | }, |
| | | changeTestLoaidng(type) { |
| | | this.setData({ |
| | | loading: type, |
| | | }); |
| | | }, |
| | | }, |
| | | }); |
| | |
| | | <image |
| | | src="{{ radioItem == 'test' ? '/static/images/bookService/detail/practice-icon.png' : '/static/images/bookService/detail/notest.png'}}" |
| | | ></image> |
| | | <text style="color: {{radioItem == 'test' ? '#fff':''}};" |
| | | <text style="color: {{radioItem == 'test' ? '#fff':'#ff6c00'}};" |
| | | >练习</text |
| | | > |
| | | </view> |
| | |
| | | <image |
| | | src="{{ radioItem == 'mock' ? '/static/images/bookService/detail/checkpaper.png' : '/static/images/bookService/detail/zujuan.png'}}" |
| | | ></image> |
| | | <text style="color: {{radioItem == 'mock' ? '#fff':''}};" |
| | | <text style="color: {{radioItem == 'mock' ? '#fff':'#ff6c00'}};" |
| | | >组卷</text |
| | | > |
| | | </view> |
| | |
| | | > |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/bookService/detail/cuoti.png"></image> |
| | | <text>我的错题</text> |
| | | <text class="primary-color">我的错题</text> |
| | | </view> |
| | | </t-button> |
| | | <t-button |
| | |
| | | > |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/bookService/detail/wodeshoucang.png"></image> |
| | | <text> 我的收藏</text> |
| | | <text class="primary-color"> 我的收藏</text> |
| | | </view> |
| | | </t-button> |
| | | </view> |
| | |
| | | <t-button class="buy-mock-btn" bind:tap="buyMock">购买组卷</t-button> |
| | | </view> |
| | | </view> |
| | | <view class="loading-box" wx:if="{{}}"> |
| | | <t-loading loading="{{}}" /> |
| | | </view> |
| | | </view> |
| | |
| | | padding-top: 20rpx; |
| | | } |
| | | |
| | | .primary-color { |
| | | color: #ff6c00; |
| | | } |
| | | |
| | | .resource-list { |
| | | height: 80rpx; |
| | | margin: 20rpx; |
| | |
| | | } |
| | | |
| | | .radio-content { |
| | | padding: 0 8rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | |
| | | shoppingCart: true, |
| | | stop: false, |
| | | }, |
| | | ready() { |
| | | this.setData({}); |
| | | console.log("准备"); |
| | | }, |
| | | ready() {}, |
| | | |
| | | onLoad() { |
| | | this.setData({ |
| | |
| | | treeList: function (newValue) { |
| | | const list = []; |
| | | let checked = ""; |
| | | console.log("新值", this.properties.treeList); |
| | | this.properties.treeList.forEach((item) => { |
| | | if (item.children && item.children.length > 0) { |
| | | list.push(...this.flattenTree([item])); |
| | |
| | | wx:if="{{isShowCheck}}" |
| | | /> |
| | | <!-- 章节名 --> |
| | | <view style="width: 100%"> |
| | | <text>{{item.name}} </text |
| | | ><text wx:if="{{item.sysType =='CmsFolder'}}" |
| | | >({{item.children ? item.children.length : 0}})</text |
| | | > |
| | | <view class="title-box"> |
| | | <text class="title-name">{{item.name}} </text> |
| | | <view wx:if="{{item.sysType =='CmsFolder'}}" class="title-num"> |
| | | ({{item.children ? item.children.length : 0}}) |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | class="listItems" |
| | | wx:if="{{citem.childrenFolderCount <= 0 && citem.sysType == 'CmsItem'}}" |
| | | > |
| | | <view |
| | | class="itemsInfo" |
| | | wx:if="{{citem.name}}" |
| | | data-item="{{citem}}" |
| | | data-index="{{cindex}}" |
| | | > |
| | | <view class="itemsInfo" data-item="{{citem}}" data-index="{{cindex}}"> |
| | | <view |
| | | class="contentBox" |
| | | bind:tap="goPlayer" |
| | |
| | | <text |
| | | class="name" |
| | | style="{{ tab == 'jsek_teachingResources' ? 'width: 300rpx;' : 'width: 400rpx;'}}" |
| | | >{{citem.name}}</text |
| | | >{{citem.name || '-'}}</text |
| | | > |
| | | </view> |
| | | <!-- 教学资源类型 --> |
| | |
| | | align-items: center; |
| | | --td-checkbox-vertical-padding: 0 |
| | | } |
| | | |
| | | .title-box { |
| | | width: 100%; |
| | | display: flex; |
| | | align-items: flex-start; |
| | | } |
| | | |
| | | .title-checkBox { |
| | | width: 100%; |
| | | display: flex; |
| | | } |
| | | |
| | | |
| | | |
| | | .title-name { |
| | | display: inline-block; |
| | | /* max-width: 60%; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; */ |
| | | } |
| | | |
| | | .t-class { |
| | | background-color: #F7F7F7; |
| | | } |
| | |
| | | // pages/bookServices/detail/index.js |
| | | import Toast from "tdesign-miniprogram/toast"; |
| | | import tool from "../../../../assets/js/toolClass"; |
| | | import { |
| | | loginInfo |
| | | } from "../../../../assets/js/login"; |
| | | import { loginInfo } from "../../../../assets/js/login"; |
| | | const app = getApp(); |
| | | Page({ |
| | | /** |
| | |
| | | if (token) { |
| | | this.getShoppingCartProductGet(); |
| | | this.getApplyInfo(options.id); |
| | | this.getMockData(); |
| | | this.getAlreadyPBookList(); |
| | | this.getAlreadyEBookList(); |
| | | } |
| | |
| | | onReachBottom() { |
| | | if (this.data.tabValue == "jsek_note") { |
| | | const child = this.selectComponent("#note"); |
| | | child.onReachBottom(); |
| | | if (!child.data.noList) child.onReachBottom(); |
| | | } |
| | | }, |
| | | |
| | |
| | | }, |
| | | // 返回 |
| | | goBack() { |
| | | let bookPathList = wx.getStorageSync("bookPathList"); |
| | | if (bookPathList && JSON.parse(bookPathList).length) { |
| | | bookPathList = JSON.parse(bookPathList); |
| | | this.setData({ |
| | | pageLoading: true, |
| | | tabValue: "brief", |
| | | }); |
| | | this.onLoad(bookPathList[bookPathList.length - 1]); |
| | | bookPathList.pop(); |
| | | wx.setStorageSync("bookPathList", JSON.stringify(bookPathList)); |
| | | } else { |
| | | wx.navigateBack(); |
| | | } |
| | | }, |
| | | // 获取图书详情 |
| | | getBookInfo(id) { |
| | |
| | | this.getSubTtem(); |
| | | // 获取图书分类 |
| | | let className = ""; |
| | | if ( |
| | | Array.isArray(res.datas.bookClassification) && |
| | | res.datas.bookClassification.length |
| | | ) { |
| | | const iconType = JSON.parse(res.datas.bookClassification)[0][0]; |
| | | const classType = JSON.parse(res.datas.bookClassification)[0][1]; |
| | | if (res.datas.bookClassification) { |
| | | const bookClassification = JSON.parse(res.datas.bookClassification); |
| | | if (Array.isArray(bookClassification) && bookClassification.length) { |
| | | const iconType = bookClassification[0][0]; |
| | | const classType = bookClassification[0][1]; |
| | | className = await this.getBookClass(iconType, classType); |
| | | } |
| | | } |
| | | |
| | | // 获取组卷销售id |
| | | if (res.datas.saleMethod && res.datas.saleMethod.length) { |
| | | res.datas.saleMethod.forEach((item) => { |
| | |
| | | }; |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | if (res.datas && res.datas.length > 0) { |
| | | console.log(res.datas[0], 2) |
| | | console.log(res.datas[0], 2); |
| | | this.setData({ |
| | | bookItemDetail: res.datas[0], |
| | | selectedIds: res.datas[0].defaultSaleMethod.id, |
| | | bookBuy: res.datas[0].purchasedSaleMethodIdList.indexOf( |
| | | bookBuy: |
| | | res.datas[0].purchasedSaleMethodIdList.indexOf( |
| | | res.datas[0].defaultSaleMethodId |
| | | ) > -1, |
| | | "bookDetail.price": this.numFormat(res.datas[0].price), |
| | |
| | | } |
| | | this.setData({ |
| | | selectedIds: this.data.bookDetail.defaultSaleMethodId, |
| | | bookBuy: this.data.bookDetail.purchasedSaleMethodIdList.indexOf( |
| | | bookBuy: |
| | | this.data.bookDetail.purchasedSaleMethodIdList.indexOf( |
| | | this.data.bookDetail.defaultSaleMethodId |
| | | ) > -1, |
| | | }); |
| | |
| | | }, |
| | | // 跳转网店 |
| | | goShop(e) { |
| | | const { |
| | | link |
| | | } = e.currentTarget.dataset; |
| | | const { link } = e.currentTarget.dataset; |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/webpage/index?url=${link}`, |
| | | }); |
| | | }, |
| | | // tag切换 |
| | | onTabsChange(e) { |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | this.setData({ |
| | | tabValue: e.detail.value, |
| | | noResources: false, |
| | |
| | | ) { |
| | | this.getResourceData(checkData); |
| | | } |
| | | if (e.detail.value == "questionBank" && token) this.getMockData(); |
| | | } else { |
| | | this.setData({ |
| | | noResources: true, |
| | |
| | | if (token) { |
| | | child.changeLoading(); |
| | | child.getNoteList(); |
| | | } else { |
| | | child.changeNoList(); |
| | | } |
| | | } else if (e.detail.label == "电子书") { |
| | | const child = this.selectComponent("#eBook"); |
| | |
| | | const list = await this.getAllResource(res.datas.cmsDatas[0].datas); |
| | | let result = []; |
| | | if (type.refCode == "jsek_teachingResources") { |
| | | console.log("教学资源", list); |
| | | this.findChildIds(list, result); |
| | | this.setData({ |
| | | teach: list, |
| | | loading: false, |
| | | openTeachids: result, |
| | | }); |
| | | console.log("教学资源", list); |
| | | } else if (type.refCode == "jsek_cloudLearning") { |
| | | let arr = this.handleTreeData(list).filter( |
| | | (item) => item.saleMethod[0] |
| | |
| | | item.checked = false; |
| | | } else if (this.data.tabValue == "jsek_cloudLearning") { |
| | | item.checked = false; |
| | | item.isbuy = this.resourceIsBuy(item); |
| | | item.isbuy = this.isShowNeedBuy(item); |
| | | item.isShopCar = this.isShoppingCart(item); |
| | | } |
| | | }); |
| | |
| | | res.datas.forEach((item) => { |
| | | shoppingCartGetId.push(item.saleMethod.id); |
| | | }); |
| | | console.log(shoppingCartGetId, "shoppingCartGetId"); |
| | | console.log(this.data.selectedIds, "销售方式id"); |
| | | const determine = shoppingCartGetId.some( |
| | | (item) => item == this.data.selectedIds |
| | | ); |
| | | console.log(determine); |
| | | if (!determine) { |
| | | let query = { |
| | | requests: [{ |
| | | requests: [ |
| | | { |
| | | saleMethodId: this.data.selectedIds, |
| | | storeEventId: null, |
| | | agentCode: "电子书", |
| | | }, ], |
| | | }, |
| | | ], |
| | | }; |
| | | const addRes = app.MG.store.addShoppingCart(query); |
| | | this.showSuccessToast(); |
| | |
| | | let bookOrdersId = ""; |
| | | let query = { |
| | | remarks: "电子书", |
| | | requests: [{ |
| | | saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ? |
| | | this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId, |
| | | requests: [ |
| | | { |
| | | saleMethodId: this.data.bookItemDetail.defaultSaleMethodId |
| | | ? this.data.bookItemDetail.defaultSaleMethodId |
| | | : this.data.bookDetail.defaultSaleMethodId, |
| | | count: 1, |
| | | }, ], |
| | | }, |
| | | ], |
| | | }; |
| | | // 发起订单初始化请求并等待结果 |
| | | const res = await app.MG.store.initOrder(query); |
| | |
| | | // 检查订单号是否存在 |
| | | if (bookOrdersId) { |
| | | if (this.data.bookDetail.price == "0.00") { |
| | | app.MG.store.confirmOrder({ |
| | | orderNum: bookOrdersId |
| | | }).then(res => { |
| | | app.MG.store |
| | | .confirmOrder({ |
| | | orderNum: bookOrdersId, |
| | | }) |
| | | .then((res) => { |
| | | if (res) { |
| | | wx.showToast({ |
| | | title: "领取成功", |
| | |
| | | }); |
| | | this.getBookInfo(this.data.bookDetail.id); |
| | | } |
| | | }) |
| | | }); |
| | | } else { |
| | | const url = "/pages/cart/paymentPage/index?orderNumber=" + bookOrdersId; |
| | | const url = |
| | | "/pages/cart/paymentPage/index?orderNumber=" + bookOrdersId; |
| | | wx.navigateTo({ |
| | | url, |
| | | }); |
| | |
| | | } else { |
| | | console.log(222); |
| | | } |
| | | |
| | | } else { |
| | | wx.showToast({ |
| | | title: "商品不在有效期", |
| | |
| | | cmsTypeRefCode: "", |
| | | newDataListRequest: [], |
| | | name: this.data.bookDetail.name, // name为申请的书本名称 |
| | | content: JSON.stringify([{ |
| | | content: JSON.stringify([ |
| | | { |
| | | name: this.data.bookDetail.name, |
| | | id: this.data.bookDetail.id, |
| | | // defaultSaleMethodId: bookData.value.defaultSaleMethodId, |
| | | icon: this.data.bookDetail.icon, |
| | | }, ]), |
| | | }, |
| | | ]), |
| | | }; |
| | | app.MG.ugc.newTopicMessage(query).then(async (res) => { |
| | | if (res) { |
| | |
| | | wx.showModal({ |
| | | title: "尊敬的用户,您好!", |
| | | content: "请先进行教师认证!", |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | complete: (res) => { |
| | | if (res.cancel) {} |
| | | if (res.cancel) { |
| | | } |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | |
| | | wx.showModal({ |
| | | title: "尊敬的用户,您好!", |
| | | content: "请先进行教师认证!", |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | complete: (res) => { |
| | | if (res.cancel) {} |
| | | if (res.cancel) { |
| | | } |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | |
| | | wx.showModal({ |
| | | title: "尊敬的用户,您好!", |
| | | content: "请先进行教师认证!", |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | complete: (res) => { |
| | | if (res.cancel) {} |
| | | if (res.cancel) { |
| | | } |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | |
| | | const isSHow = this.data.buyIdList.some( |
| | | (item) => item == data.saleMethod[0].Id |
| | | ); |
| | | return !isSHow; |
| | | } else { |
| | | return false; |
| | | } |
| | | }, |
| | | // 云学习资源是否显示锁图标(未购买,且资源售价大于零) |
| | | isShowNeedBuy(data) { |
| | | if (data.saleMethod && data.saleMethod.length) { |
| | | const isSHow = this.data.buyIdList.some( |
| | | (item) => item == data.saleMethod[0].Id |
| | | ); |
| | | if (isSHow) { |
| | | return false; |
| | | } else { |
| | | return data.saleMethod[0].price > 0 ? true : false; |
| | | } |
| | | return !isSHow; |
| | | } else { |
| | | return false; |
| | |
| | | if (new RegExp("(" + k + ")").test(fmt)) { |
| | | fmt = fmt.replace( |
| | | RegExp.$1, |
| | | RegExp.$1.length == 1 ? |
| | | o[k] : |
| | | ("00" + o[k]).substr(("" + o[k]).length) |
| | | RegExp.$1.length == 1 |
| | | ? o[k] |
| | | : ("00" + o[k]).substr(("" + o[k]).length) |
| | | ); |
| | | } |
| | | } |
| | |
| | | }, |
| | | // 获取组卷答题数据 |
| | | getMockData() { |
| | | // const child = this.selectComponent("#test-resource"); |
| | | // if (child) child.changeTestLoaidng(true); |
| | | this.setData({ |
| | | "mockData.useCount": 0, |
| | | "mockData.mockList": [], |
| | |
| | | try { |
| | | let query = { |
| | | remarks: "组卷", |
| | | requests: [{ |
| | | requests: [ |
| | | { |
| | | saleMethodId: this.data.mockData.id, |
| | | count: 1, |
| | | }, ], |
| | | }, |
| | | ], |
| | | }; |
| | | if (this.data.flag) { |
| | | this.setData({ |
| | |
| | | }); |
| | | // 记录购买时间,并设状态state为1,表示刚购买完成组卷 |
| | | app.MG.identity.setUserKey({ |
| | | setKeyRequests: [{ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: "mockData", |
| | | key: this.data.bookDetail.id + "", |
| | | value: JSON.stringify(this.data.mockData.mockList), |
| | | }, ], |
| | | }, |
| | | ], |
| | | }); |
| | | }, |
| | | // 获取相关图书 |
| | |
| | | (item) => item.id != this.data.bookDetail.id |
| | | ); |
| | | let bookArr = []; |
| | | // if (Arr.length > 3) { |
| | | // for (var i = 0; i < 3; i++) { |
| | | // var _num = Math.floor(Math.random() * Arr.length); |
| | | // var mm = Arr[_num]; |
| | | // Arr.splice(_num, 1); |
| | | // bookArr.push(mm); |
| | | // } |
| | | // } else { |
| | | // bookArr = Arr; |
| | | // } |
| | | if (Arr.length > 9) { |
| | | for (var i = 0; i < 9; i++) { |
| | | var _num = Math.floor(Math.random() * Arr.length); |
| | | var mm = Arr[_num]; |
| | | Arr.splice(_num, 1); |
| | | bookArr.push(mm); |
| | | } |
| | | } else { |
| | | bookArr = Arr; |
| | | } |
| | | this.setData({ |
| | | relatedBookData: Arr, |
| | | relatedBookData: bookArr, |
| | | relatedBookLoading: false, |
| | | }); |
| | | if (!this.data.relatedBookData.length) |
| | | this.setData({ |
| | | noRelatedBookData: true, |
| | | }); |
| | | console.log("相关图书", this.data.relatedBookData); |
| | | }); |
| | | }, |
| | | goBookDetails(e) { |
| | | console.log(e); |
| | | this.setData({ |
| | | tabValue: "brief", |
| | | pageLoading: true, |
| | | }); |
| | | let bookPathList = wx.getStorageSync("bookPathList"); |
| | | const bookPath = { |
| | | id: this.data.bookDetail.id, |
| | | name: this.data.bookDetail.name, |
| | | }; |
| | | if (bookPathList) { |
| | | bookPathList = JSON.parse(bookPathList); |
| | | if (bookPathList.length > 8) bookPathList.shift(); |
| | | bookPathList.push(bookPath); |
| | | } else { |
| | | bookPathList = [bookPath]; |
| | | } |
| | | |
| | | wx.setStorageSync("bookPathList", JSON.stringify(bookPathList)); |
| | | this.onLoad({ |
| | | id: e.detail.id, |
| | | name: e.detail.name, |
| | |
| | | return false; |
| | | } |
| | | wx.navigateTo({ |
| | | url: "/packageBookService/pages/components/webView/index?md5=" + |
| | | url: |
| | | "/packageBookService/pages/components/webView/index?md5=" + |
| | | this.data.fileInfo.md5 + |
| | | "&fileName=" + |
| | | this.data.fileInfo.bookName + |
| | |
| | | wx.showModal({ |
| | | title: "尊敬的用户,您好!", //提示的标题 |
| | | content: "请先进行教师认证?", //提示的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) {} |
| | | } else if (res.cancel) { |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | |
| | | wx.showModal({ |
| | | title: "尊敬的用户,您好!", //提示的标题 |
| | | content: "请先进行教师认证?", //提示的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) {} |
| | | } else if (res.cancel) { |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | |
| | | <view style="width: 100%; height: {{barHeight}}px; "></view> |
| | | <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> |
| | | <view> |
| | | <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> |
| | | <t-icon |
| | | name="chevron-left" |
| | | size="30" |
| | | data-name="{{item}}" |
| | | bind:click="goBack" |
| | | /> |
| | | </view> |
| | | <view class="navbar-title">{{options.name}}</view> |
| | | </view> |
| | | <t-toast id="t-toast" /> |
| | | <scroll-view scroll-y="{{true}}" class="book" bindscrolltolower="onReachBottom"> |
| | | <scroll-view |
| | | scroll-y="{{true}}" |
| | | class="book" |
| | | bindscrolltolower="onReachBottom" |
| | | > |
| | | <!-- 图书详情 --> |
| | | <view class="book-box"> |
| | | <view class="book-detail" id="book-detail"> |
| | | <view class="detail-left"> |
| | | <view class="book-img"> |
| | | <image loading="" src="{{bookDetail.icon ? bookDetail.icon : '/static/images/default-book-img.png'}}" mode="aspectFill" aria-label="{{bookDetail.name}}" /> |
| | | <image |
| | | loading="" |
| | | src="{{bookDetail.icon ? bookDetail.icon : '/static/images/default-book-img.png'}}" |
| | | mode="aspectFill" |
| | | aria-label="{{bookDetail.name}}" |
| | | /> |
| | | </view> |
| | | <view class="book-use"> |
| | | <view class="collect" bind:tap="setCollect"> |
| | | <view> |
| | | <image loading="" src="/static/images/bookService/detail/collect.png" wx:if="{{!bookDetail.isFavourite}}" /> |
| | | <image loading="" src="/static/images/bookService/detail/collecting.png" wx:if="{{bookDetail.isFavourite}}" /> |
| | | <image |
| | | loading="" |
| | | src="/static/images/bookService/detail/collect.png" |
| | | wx:if="{{!bookDetail.isFavourite}}" |
| | | /> |
| | | <image |
| | | loading="" |
| | | src="/static/images/bookService/detail/collecting.png" |
| | | wx:if="{{bookDetail.isFavourite}}" |
| | | /> |
| | | </view> |
| | | <view class="use-title">收藏</view> |
| | | </view> |
| | | <view class="suggest" bind:tap="suggestBtn"> |
| | | <view> |
| | | <image loading="" src="/static/images/bookService/detail/suggest.png" /> |
| | | <image |
| | | loading="" |
| | | src="/static/images/bookService/detail/suggest.png" |
| | | /> |
| | | </view> |
| | | <view class="use-title">我要建议</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="detail-right"> |
| | | <view class="book-name">{{bookDetail.name}}</view> |
| | | <view class="book-name showTow">{{bookDetail.name}}</view> |
| | | <view class="book-message"> |
| | | <view class="message-li" wx:if="{{bookDetail.seriesName}}"> |
| | | <view class="li-title">丛书名:</view> |
| | |
| | | <view class="li-content">{{bookDetail.isbn}}</view> |
| | | </view> |
| | | <view class="message-li"> |
| | | <view class="li-title" wx:if="{{bookDetail.publicationDate}}">出版时间:</view> |
| | | <view class="li-title" wx:if="{{bookDetail.publicationDate}}" |
| | | >出版时间:</view |
| | | > |
| | | <view class="li-content">{{bookDetail.publicationDate}}</view> |
| | | </view> |
| | | <view class="message-li" wx:if="{{bookDetail.class}}" style="height: 80rpx"> |
| | | <view |
| | | class="message-li" |
| | | wx:if="{{bookDetail.class}}" |
| | | style="height: 80rpx" |
| | | > |
| | | <view class="li-title">图书分类:</view> |
| | | <view class="class-name showTow">{{bookDetail.class}}</view> |
| | | </view> |
| | | </view> |
| | | <image src="/static/images/bookService/detail/square.png" class="right-background" /> |
| | | <image |
| | | src="/static/images/bookService/detail/square.png" |
| | | class="right-background" |
| | | /> |
| | | </view> |
| | | </view> |
| | | <!-- 销售信息 --> |
| | |
| | | <!-- 电子书售价 --> |
| | | <view class="electron-price" wx:if="{{bookDetail.price}}"> |
| | | <view> |
| | | <image src="/static/images/bookService/detail/electon-price.png" /> |
| | | <image |
| | | src="/static/images/bookService/detail/electon-price.png" |
| | | /> |
| | | </view> |
| | | <view class="price"> |
| | | <view class="price-text">{{bookDetail.price == '0.00' ? '免费' : '¥'+ |
| | | bookDetail.price}}</view> |
| | | <view class="price-old" wx:if="{{bookDetail.oldPrice != '0.00'}}">¥{{bookDetail.oldPrice}} |
| | | <view class="price-text" |
| | | >{{bookDetail.price == '0.00' ? '免费' : '¥'+ |
| | | bookDetail.price}}</view |
| | | > |
| | | <view class="price-old" wx:if="{{bookDetail.oldPrice != '0.00'}}" |
| | | >¥{{bookDetail.oldPrice}} |
| | | </view> |
| | | </view> |
| | | <view> </view> |
| | |
| | | <view> |
| | | <image src="/static/images/bookService/detail/paper-price.png" /> |
| | | </view> |
| | | <view class="price">{{bookDetail.paperPrice == '0.00' ? '免费' : |
| | | '¥'+bookDetail.paperPrice}}</view> |
| | | <view class="price" |
| | | >{{bookDetail.paperPrice == '0.00' ? '免费' : |
| | | '¥'+bookDetail.paperPrice}}</view |
| | | > |
| | | </view> |
| | | </view> |
| | | <!-- 网店 --> |
| | | <view class="book-web"> |
| | | <image src="/static/images/bookService/detail/jd.png" wx:if="{{bookDetail.JDLink}}" bind:tap="goShop" data-link="{{bookDetail.JDLink}}" data-type="jd" /> |
| | | <image class="tmall-image" src="/static/images/bookService/detail/tmall.png" bind:tap="goShop" data-link="{{bookDetail.tmallLink}}" wx:if="{{bookDetail.tmallLink}}" /> |
| | | <image src="/static/images/bookService/detail/dangdang.png" bind:tap="goShop" data-link="{{bookDetail.dangdangLink}}" wx:if="{{bookDetail.dangdangLink}}" /> |
| | | <image src="/static/images/bookService/detail/weidian.png" bind:tap="goShop" data-link="{{bookDetail.weidianLink}}" wx:if="{{bookDetail.weidianLink}}" /> |
| | | <image |
| | | src="/static/images/bookService/detail/jd.png" |
| | | wx:if="{{bookDetail.JDLink}}" |
| | | bind:tap="goShop" |
| | | data-link="{{bookDetail.JDLink}}" |
| | | data-type="jd" |
| | | /> |
| | | <image |
| | | class="tmall-image" |
| | | src="/static/images/bookService/detail/tmall.png" |
| | | bind:tap="goShop" |
| | | data-link="{{bookDetail.tmallLink}}" |
| | | wx:if="{{bookDetail.tmallLink}}" |
| | | /> |
| | | <image |
| | | src="/static/images/bookService/detail/dangdang.png" |
| | | bind:tap="goShop" |
| | | data-link="{{bookDetail.dangdangLink}}" |
| | | wx:if="{{bookDetail.dangdangLink}}" |
| | | /> |
| | | <image |
| | | src="/static/images/bookService/detail/weidian.png" |
| | | bind:tap="goShop" |
| | | data-link="{{bookDetail.weidianLink}}" |
| | | wx:if="{{bookDetail.weidianLink}}" |
| | | /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="book-resource"> |
| | | <t-tabs value="{{tabValue}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel" class="tab-class"> |
| | | <t-tab-panel label="图书简介" icon="{{ tabValue == 'brief' ? briefIconClick : briefIcon}}" value="brief" style="{{tabPanelstyle}}"> |
| | | <book-brief content="{{bookDetail.content}}" authorIntroduction="{{bookDetail.authorIntroduction}}" wx:if="{{bookDetail.content || bookDetail.authorIntroduction}}"></book-brief> |
| | | <view wx:if="{{!bookDetail.content && !bookDetail.authorIntroduction}}" class="noData"> |
| | | <t-tabs |
| | | value="{{tabValue}}" |
| | | bind:change="onTabsChange" |
| | | t-class="custom-tabs" |
| | | t-class-content="custom-panel" |
| | | class="tab-class" |
| | | > |
| | | <t-tab-panel |
| | | label="图书简介" |
| | | icon="{{ tabValue == 'brief' ? briefIconClick : briefIcon}}" |
| | | value="brief" |
| | | style="{{tabPanelstyle}}" |
| | | > |
| | | <book-brief |
| | | content="{{bookDetail.content}}" |
| | | authorIntroduction="{{bookDetail.authorIntroduction}}" |
| | | wx:if="{{bookDetail.content || bookDetail.authorIntroduction}}" |
| | | ></book-brief> |
| | | <view |
| | | wx:if="{{!bookDetail.content && !bookDetail.authorIntroduction}}" |
| | | class="noData" |
| | | > |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | </t-tab-panel> |
| | |
| | | style="{{tabPanelstyle}}" |
| | | > |
| | | </t-tab-panel> --> |
| | | <t-tab-panel label="教学资源" icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}" value="jsek_teachingResources" class="{{loading ? 'loading': ''}}"> |
| | | <view wx:if="{{!loading && teach.length && !noResources && applyState}}"> |
| | | <teach-resource applyState="{{applyState}}" rejectCause="{{rejectCause}}" deadline="{{deadline}}" bind:applyResource="applyResource" applyResourceLoading="{{applyResourceLoading}}"></teach-resource> |
| | | <tree id="teach-tree" openIds="{{openTeachids}}" bookInfo="{{bookDetail}}" treeList="{{teach}}" tab="{{tabValue}}" applyState="{{applyState}}" bind:downloadTeach="downloadTeach" bind:handleTree="handleTree" openTeachids="{{openTeachids}}" wx:if="{{teach.length}}"></tree> |
| | | <t-tab-panel |
| | | label="教学资源" |
| | | icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}" |
| | | value="jsek_teachingResources" |
| | | class="{{loading ? 'loading': ''}}" |
| | | > |
| | | <view |
| | | wx:if="{{!loading && teach.length && !noResources && applyState}}" |
| | | > |
| | | <teach-resource |
| | | applyState="{{applyState}}" |
| | | rejectCause="{{rejectCause}}" |
| | | deadline="{{deadline}}" |
| | | bind:applyResource="applyResource" |
| | | applyResourceLoading="{{applyResourceLoading}}" |
| | | ></teach-resource> |
| | | <tree |
| | | id="teach-tree" |
| | | openIds="{{openTeachids}}" |
| | | bookInfo="{{bookDetail}}" |
| | | treeList="{{teach}}" |
| | | tab="{{tabValue}}" |
| | | applyState="{{applyState}}" |
| | | bind:downloadTeach="downloadTeach" |
| | | bind:handleTree="handleTree" |
| | | openTeachids="{{openTeachids}}" |
| | | wx:if="{{teach.length}}" |
| | | ></tree> |
| | | </view> |
| | | <t-loading theme="circular" size="60rpx" class="loading" loading="{{loading }}" /> |
| | | <t-loading |
| | | theme="circular" |
| | | size="60rpx" |
| | | class="loading" |
| | | loading="{{loading }}" |
| | | /> |
| | | <view wx:if="{{noResources}}" class="noData"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | </t-tab-panel> |
| | | <t-tab-panel label="云学习" icon="{{tabValue == 'jsek_cloudLearning' ? learnResourceClickIcon : learnResourceIcon}}" value="jsek_cloudLearning" style="{{tabPanelstyle}}"> |
| | | <t-tab-panel |
| | | label="云学习" |
| | | icon="{{tabValue == 'jsek_cloudLearning' ? learnResourceClickIcon : learnResourceIcon}}" |
| | | value="jsek_cloudLearning" |
| | | style="{{tabPanelstyle}}" |
| | | > |
| | | <view wx:if="{{!loading && learn.length}}"> |
| | | <learn-resource bind:getFreeResource="getFreeResource" bind:allAddShoppiingCar="allAddShoppiingCar" id="learn-resource" buyResourceData="{{buyResourceData}}" bookId="{{bookDetail.id}}" isshowDrawBtn="{{isshowDrawBtn}}"></learn-resource> |
| | | <learn-resource |
| | | bind:getFreeResource="getFreeResource" |
| | | bind:allAddShoppiingCar="allAddShoppiingCar" |
| | | id="learn-resource" |
| | | buyResourceData="{{buyResourceData}}" |
| | | bookId="{{bookDetail.id}}" |
| | | isshowDrawBtn="{{isshowDrawBtn}}" |
| | | ></learn-resource> |
| | | |
| | | <tree id="tree" openIds="{{openLearnids}}" bookInfo="{{bookDetail}}" tab="{{tabValue}}" treeList="{{learn}}" buyIds="{{buyIdList}}" openLearnids="{{openLearnids}}" bind:updateShoppingCartHidden="updateShoppingCartHidden" bind:updateCloudLearning="updateCloudLearning"></tree> |
| | | <tree |
| | | id="tree" |
| | | openIds="{{openLearnids}}" |
| | | bookInfo="{{bookDetail}}" |
| | | tab="{{tabValue}}" |
| | | treeList="{{learn}}" |
| | | buyIds="{{buyIdList}}" |
| | | openLearnids="{{openLearnids}}" |
| | | bind:updateShoppingCartHidden="updateShoppingCartHidden" |
| | | bind:updateCloudLearning="updateCloudLearning" |
| | | ></tree> |
| | | </view> |
| | | <view wx:if="{{noResources}}" class="noData"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | </t-tab-panel> |
| | | <t-tab-panel label="云测试" icon="{{tabValue == 'questionBank' ? testResourceClickIocn : testResourceIocn}}" value="questionBank" style="{{tabPanelstyle}}"> |
| | | <t-tab-panel |
| | | label="云测试" |
| | | icon="{{tabValue == 'questionBank' ? testResourceClickIocn : testResourceIocn}}" |
| | | value="questionBank" |
| | | style="{{tabPanelstyle}}" |
| | | > |
| | | <view wx:if="{{!loading}}"> |
| | | <test-resource list="{{test}}" bookInfo="{{bookDetail}}" mockData="{{mockData}}" bind:buyMock="buyMock"></test-resource> |
| | | <test-resource |
| | | id="test-resource" |
| | | list="{{test}}" |
| | | bookInfo="{{bookDetail}}" |
| | | mockData="{{mockData}}" |
| | | bind:buyMock="buyMock" |
| | | ></test-resource> |
| | | </view> |
| | | </t-tab-panel> |
| | | <t-tab-panel label="云笔记" icon="{{tabValue == 'jsek_note' ? noteClickIcon: noteIcon}}" value="jsek_note" style="{{tabPanelstyle}}"> |
| | | <t-tab-panel |
| | | label="云笔记" |
| | | icon="{{tabValue == 'jsek_note' ? noteClickIcon: noteIcon}}" |
| | | value="jsek_note" |
| | | style="{{tabPanelstyle}}" |
| | | > |
| | | <note bookInfo="{{bookDetail}}" id="note" class="note-list"></note> |
| | | </t-tab-panel> |
| | | <t-tab-panel label="相关图书" icon="{{tabValue == 'related_books' ? linkClickIcon: linkIcon}}" value="related_books" style="{{tabPanelstyle}}"> |
| | | <related-books relatedBookData="{{relatedBookData}}" relatedBookLoading="{{relatedBookLoading}}" noRelatedBookData="{{noRelatedBookData}}" bind:goBookDetails="goBookDetails"></related-books> |
| | | <t-tab-panel |
| | | label="相关图书" |
| | | icon="{{tabValue == 'related_books' ? linkClickIcon: linkIcon}}" |
| | | value="related_books" |
| | | style="{{tabPanelstyle}}" |
| | | > |
| | | <related-books |
| | | relatedBookData="{{relatedBookData}}" |
| | | relatedBookLoading="{{relatedBookLoading}}" |
| | | noRelatedBookData="{{noRelatedBookData}}" |
| | | bind:goBookDetails="goBookDetails" |
| | | ></related-books> |
| | | </t-tab-panel> |
| | | </t-tabs> |
| | | </view> |
| | | </scroll-view> |
| | | <!-- 我要建议弹窗 --> |
| | | <suggest class="suggest-component" id="suggest-component" bookIcon="{{bookDetail.icon}}" bookName="{{bookDetail.name}}"></suggest> |
| | | <suggest |
| | | class="suggest-component" |
| | | id="suggest-component" |
| | | bookIcon="{{bookDetail.icon}}" |
| | | bookName="{{bookDetail.name}}" |
| | | ></suggest> |
| | | <!-- 教学资源下载提示弹窗 --> |
| | | <t-dialog class="teachDownloadDialog" visible="{{isShowTeachDownload}}" title="提示" content="请前往PC端下载" confirm-btn="{{ confirmBtn }}" bind:confirm="closeTeachDownload" /> |
| | | <t-dialog |
| | | class="teachDownloadDialog" |
| | | visible="{{isShowTeachDownload}}" |
| | | title="提示" |
| | | content="请前往PC端下载" |
| | | confirm-btn="{{ confirmBtn }}" |
| | | bind:confirm="closeTeachDownload" |
| | | /> |
| | | |
| | | <view class="applyBox" bindtap="goApply"> |
| | | <view class="box"> |
| | | <t-image src="/static/images/home/yangshuForm1.png" mode="heightFix" class="img" /> |
| | | <t-image |
| | | src="/static/images/home/yangshuForm1.png" |
| | | mode="heightFix" |
| | | class="img" |
| | | /> |
| | | <view class="num" wx:if="{{num > 0}}">{{num}}</view> |
| | | </view> |
| | | </view> |
| | |
| | | <view class="box-bottom"> |
| | | <view class="bottom-btn" bind:tap="appplyElectronicBook"> |
| | | <view> |
| | | <t-image loading="" src="/static/images/bookService/detail/ebook.png"></t-image> |
| | | <t-image |
| | | loading="" |
| | | src="/static/images/bookService/detail/ebook.png" |
| | | ></t-image> |
| | | </view> |
| | | <view class="btn-text">电子样书申请</view> |
| | | </view> |
| | | <view class="bottom-btn" bind:tap="appplyPaperBook"> |
| | | <view> |
| | | <t-image src="/static/images/bookService/detail/paper-book.png"></t-image> |
| | | <t-image |
| | | src="/static/images/bookService/detail/paper-book.png" |
| | | ></t-image> |
| | | </view> |
| | | <view class="btn-text">纸质样书申请</view> |
| | | </view> |
| | | <view class="{{!bookBuy && bookDetail.isSell == '1' ? 'bottom-btn tryRead' : 'bottom-btn try'}}" bind:tap="goRead" wx:if="{{!bookBuy}}"> |
| | | <view |
| | | class="{{!bookBuy && bookDetail.isSell ? 'bottom-btn tryRead' : 'bottom-btn try'}}" |
| | | bind:tap="goRead" |
| | | wx:if="{{!bookBuy}}" |
| | | > |
| | | <view> |
| | | <t-image src="/static/images/bookService/detail/shidu.png"></t-image> |
| | | </view> |
| | | <view class="btn-text">试读</view> |
| | | </view> |
| | | |
| | | <view class="shopCar shopCarColor" bind:tap="addBookShopcCar" wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}">加入购物车</view> |
| | | <view class="buy buyColor" bind:tap="buyBtn" wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}">立即购买</view> |
| | | <view class="buy receiveColor" bind:tap="buyBtn" wx:if="{{!bookBuy && bookDetail.price == '0.00' && bookDetail.isSell == '1'}}">免费领取</view> |
| | | <view |
| | | class="shopCar shopCarColor" |
| | | bind:tap="addBookShopcCar" |
| | | wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell}}" |
| | | >加入购物车</view |
| | | > |
| | | <view |
| | | class="buy buyColor" |
| | | bind:tap="buyBtn" |
| | | wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell}}" |
| | | >立即购买</view |
| | | > |
| | | <view |
| | | class="buy receiveColor" |
| | | bind:tap="buyBtn" |
| | | wx:if="{{!bookBuy && bookDetail.price == '0.00' && bookDetail.isSell}}" |
| | | >免费领取</view |
| | | > |
| | | <view class="buy read" bind:tap="goRead" wx:if="{{bookBuy}}">立即查看</view> |
| | | </view> |
| | | </view> |
| | |
| | | font-size: 36rpx; |
| | | color: #000000; |
| | | margin-bottom: 30rpx; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .showTow { |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | // wx.enableAlertBeforeUnload({ |
| | | // message: "未提交,是否退出答题?", |
| | | // success: function (res) { |
| | | // console.log('确定', res); |
| | | // }, |
| | | // fail: function (err) { |
| | | // console.log("失败:", err); |
| | | // }, |
| | | // }); |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = |
| | |
| | | const oldVal = value; // 记录属性的旧值 |
| | | value = newVal; // 更新属性的值 |
| | | callback.call(context, newVal, oldVal); // 调用回调函数,传递新值和旧值 |
| | | }, |
| | | }); |
| | | }, |
| | | // 返回拦截 |
| | | beforeleave() { |
| | | wx.showModal({ |
| | | title: "提示", |
| | | content: "未提交,是否退出答题", |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | complete: (res) => { |
| | | if (res.cancel) { |
| | | } |
| | | if (res.confirm) { |
| | | this.setData({ |
| | | submitStatus: true, |
| | | }); |
| | | wx.navigateBack(); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | |
| | | }, |
| | | // 提交逻辑 |
| | | submitPaper() { |
| | | // 关闭退出页面监听 |
| | | wx.disableAlertBeforeUnload(); |
| | | this.setData({ |
| | | submitStatus: true, |
| | | loading: true, |
| | |
| | | let value = JSON.parse(res[0].value); |
| | | // 有答题记录,得分赋值 |
| | | if (value) { |
| | | wx.disableAlertBeforeUnload(); |
| | | this.setData({ |
| | | submitStatus: true, |
| | | }); |
| | |
| | | wx.showModal({ |
| | | title: "提示", |
| | | content: "收藏夹暂无数据", //editable如果为true,这就是输入框的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | editable: false, //是否显示输入框 |
| | | showCancel: false, |
| | | success: (res) => { |
| | |
| | | wx.showModal({ |
| | | title: "提示", |
| | | content: "错题集暂无数据", //editable如果为true,这就是输入框的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | editable: false, //是否显示输入框 |
| | | showCancel: false, |
| | | success: (res) => { |
| | |
| | | bind:onChangeSlider="onChangeSlider" |
| | | ></question-options> |
| | | </view> |
| | | |
| | | <page-container |
| | | wx:if="{{(answerType == 'mock' || answerType == 'option') && !submitStatus}}" |
| | | show="{{true}}" |
| | | duration="{{false}}" |
| | | overlay="{{false}}" |
| | | bind:beforeleave="beforeleave" |
| | | ></page-container> |
| | |
| | | style="height: min-content" |
| | | > |
| | | <text>{{contentItem.value}}、</text> |
| | | <text class="radio-textimg">{{contentItem.txt}}</text> |
| | | |
| | | <view class="radio-textimg">{{contentItem.txt}}</view> |
| | | <image src="{{contentItem.img}}" mode="aspectFit" /> |
| | | </view> |
| | | <!-- 富文本 --> |
| | |
| | | wx:if="{{item.analysisCon}}" |
| | | style="color: {{isNight ? '#fff' : '#000'}};" |
| | | > |
| | | <text style="font-size: {{sliderValue || 32}}rpx;">答案解析:</text> |
| | | <text style="font-size: {{sliderValue || 32}}rpx;" class="answer-analysis">答案解析:</text> |
| | | <rich-text |
| | | style="font-size: {{sliderValue || 32}}rpx;" |
| | | nodes="{{item.analysisCon}}" |
| | |
| | | } |
| | | |
| | | .radio-item { |
| | | max-height: 300rpx; |
| | | min-height: 100rpx; |
| | | padding: 0 32rpx; |
| | | min-height: 98rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | |
| | | } |
| | | |
| | | .judge-rich-box { |
| | | height: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | |
| | | --td-button-primary-border-color: #ff6c00; |
| | | --td-button-primary-active-border-color: #ff6c00; |
| | | } |
| | | |
| | | .answer-analysis { |
| | | display: inline-block; |
| | | width: 192rpx; |
| | | } |
| | |
| | | |
| | | // pages/bookServices/examination/questionOptions/index.js |
| | | Component({ |
| | | /** |
| | |
| | | }, |
| | | questionDataList: { |
| | | type: Array, |
| | | value: [] |
| | | value: [], |
| | | }, |
| | | cardList: { |
| | | type: Array, |
| | | value: [] |
| | | value: [], |
| | | }, |
| | | subjectiveTotal: { |
| | | type: Number, |
| | | value: 0 |
| | | value: 0, |
| | | }, |
| | | countdownTime: { |
| | | type: Number, |
| | |
| | | }, |
| | | answerType: { |
| | | type: String, |
| | | value: '' |
| | | value: "", |
| | | }, |
| | | subjectiveNum: { |
| | | type: Number, |
| | | value: 0 |
| | | value: 0, |
| | | }, |
| | | subjectiveGrade: { |
| | | type: Number, |
| | | value: 0 |
| | | value: 0, |
| | | }, |
| | | correctNum: { |
| | | type: Number, |
| | | value: 0 |
| | | value: 0, |
| | | }, |
| | | submitStatus: { |
| | | type: Boolean, |
| | | value: false |
| | | value: false, |
| | | }, |
| | | mockSumTime: { |
| | | type: Number, |
| | |
| | | }, |
| | | isNight: { |
| | | type: Boolean, |
| | | value: false |
| | | } |
| | | value: false, |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | |
| | | setUpPopup: false, |
| | | testReportState: false, |
| | | sliderValue: 36, |
| | | useTime: '', |
| | | radioItem: 'daytime' |
| | | useTime: "", |
| | | radioItem: "daytime", |
| | | }, |
| | | observers: { |
| | | "countdownTime": function (newValue, oldValue) { |
| | | if (this.properties.answerType == 'option') { |
| | | countdownTime: function (newValue, oldValue) { |
| | | if (this.properties.answerType == "option") { |
| | | this.setData({ |
| | | useTime: this.formatTime(2 * 60 * 60 * 1000 - this.properties.countdownTime) |
| | | }) |
| | | } |
| | | else if (this.properties.answerType == 'option') { |
| | | useTime: this.formatTime( |
| | | 2 * 60 * 60 * 1000 - this.properties.countdownTime |
| | | ), |
| | | }); |
| | | } else if (this.properties.answerType == "option") { |
| | | this.setData({ |
| | | useTime: this.formatTime(this.properties.mockSumTime - this.properties.countdownTime) |
| | | }) |
| | | useTime: this.formatTime( |
| | | this.properties.mockSumTime - this.properties.countdownTime |
| | | ), |
| | | }); |
| | | } |
| | | if (newValue == 0 && (this.properties.answerType == 'option' || this.properties.answerType == 'mock')) { |
| | | this.timeout() |
| | | if ( |
| | | newValue == 0 && |
| | | (this.properties.answerType == "option" || |
| | | this.properties.answerType == "mock") |
| | | ) { |
| | | this.timeout(); |
| | | } |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | created() {}, |
| | | |
| | | /** |
| | | * 组件的方法列表 |
| | |
| | | formatTime(ms) { |
| | | const hours = Math.floor((ms / (1000 * 60 * 60)) % 24) |
| | | .toString() |
| | | .padStart(2, '0') |
| | | .padStart(2, "0"); |
| | | const minutes = Math.floor((ms / (1000 * 60)) % 60) |
| | | .toString() |
| | | .padStart(2, '0') |
| | | .padStart(2, "0"); |
| | | const seconds = Math.floor((ms / 1000) % 60) |
| | | .toString() |
| | | .padStart(2, '0') |
| | | return `${hours}:${minutes}:${seconds}` |
| | | .padStart(2, "0"); |
| | | return `${hours}:${minutes}:${seconds}`; |
| | | }, |
| | | // 判断是否输入答案 |
| | | isHaveAnswer(data) { |
| | | if (typeof data == 'string') { |
| | | if (typeof data == "string") { |
| | | data = data |
| | | .replace(/<[^>]*>/g, '') |
| | | .replace(/ /g, '') |
| | | .trim() |
| | | .replace(/<[^>]*>/g, "") |
| | | .replace(/ /g, "") |
| | | .trim(); |
| | | if (data.length) { |
| | | return true |
| | | return true; |
| | | } else { |
| | | return false |
| | | return false; |
| | | } |
| | | } else { |
| | | const answer = data.find((item) => item.length > 0) |
| | | const answer = data.find((item) => item.length > 0); |
| | | if (answer) { |
| | | return true |
| | | return true; |
| | | } else { |
| | | return false |
| | | return false; |
| | | } |
| | | } |
| | | }, |
| | | setCollect() { |
| | | var myEventDetail = { |
| | | } |
| | | var myEventDetail = {}; |
| | | var myEventOption = { |
| | | bubbles: true, |
| | | composed: true, |
| | | } |
| | | this.triggerEvent('setCollect', myEventDetail, myEventOption) |
| | | }; |
| | | this.triggerEvent("setCollect", myEventDetail, myEventOption); |
| | | }, |
| | | // 答题卡按钮 |
| | | handlePopup() { |
| | | this.setData({ |
| | | questionCardState: true |
| | | }) |
| | | questionCardState: true, |
| | | }); |
| | | }, |
| | | // 答题卡跳转题目 |
| | | goQuestion(e) { |
| | | var myEventDetail = { |
| | | id: e.currentTarget.dataset.id |
| | | } |
| | | id: e.currentTarget.dataset.id, |
| | | }; |
| | | var myEventOption = { |
| | | bubbles: true, |
| | | composed: true, |
| | | } |
| | | this.triggerEvent('goQuestion', myEventDetail, myEventOption) |
| | | }; |
| | | this.triggerEvent("goQuestion", myEventDetail, myEventOption); |
| | | }, |
| | | // 答题卡遮罩层点击 |
| | | onVisibleChange(e) { |
| | |
| | | // 设置按钮 |
| | | setUpBtn() { |
| | | this.setData({ |
| | | setUpPopup: true |
| | | }) |
| | | setUpPopup: true, |
| | | }); |
| | | }, |
| | | // 滑块变化 |
| | | onChangeSlider(e) { |
| | | const value = e.detail.value |
| | | const value = e.detail.value; |
| | | console.log(value); |
| | | this.triggerEvent('onChangeSlider', { value }) |
| | | this.triggerEvent("onChangeSlider", { value }); |
| | | }, |
| | | // 设置遮罩层点击 |
| | | onSetUpChange(e) { |
| | | this.setData({ |
| | | setUpPopup: e.detail.visible |
| | | }) |
| | | setUpPopup: e.detail.visible, |
| | | }); |
| | | }, |
| | | // 设置模式切换 |
| | | onRadioChange(e) { |
| | | this.setData({ |
| | | radioItem: e.detail.value |
| | | }) |
| | | const value = e.detail.value == 'night' ? true : false |
| | | radioItem: e.detail.value, |
| | | }); |
| | | const value = e.detail.value == "night" ? true : false; |
| | | wx.setNavigationBarColor({ |
| | | backgroundColor: '#222', |
| | | frontColor: '#222', |
| | | }) |
| | | backgroundColor: "#222", |
| | | frontColor: "#222", |
| | | }); |
| | | |
| | | this.triggerEvent('changeBGColor', { value }) |
| | | this.triggerEvent("changeBGColor", { value }); |
| | | }, |
| | | // 重做按钮 |
| | | resterBtn() { |
| | | wx.showModal({ |
| | | title: '提示', |
| | | content: '是否重新开始答题?',//editable如果为true,这就是输入框的内容 |
| | | title: "提示", |
| | | content: "是否重新开始答题?", //editable如果为true,这就是输入框的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | editable: false,//是否显示输入框 |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | this.restart() |
| | | this.restart(); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | }); |
| | | }, |
| | | // 重做事件 |
| | | restart() { |
| | | var myEventDetail = { |
| | | } |
| | | var myEventDetail = {}; |
| | | var myEventOption = { |
| | | bubbles: true, |
| | | composed: true, |
| | | } |
| | | this.triggerEvent('restart', myEventDetail, myEventOption) |
| | | }; |
| | | this.triggerEvent("restart", myEventDetail, myEventOption); |
| | | }, |
| | | |
| | | // 还有N道题未做弹窗 |
| | | confrimPromptDialog() { |
| | | wx.showModal({ |
| | | title: '提示', |
| | | title: "提示", |
| | | content: `您还有 ${this.data.noReady}道题未答,是否提交?`,//editable如果为true,这就是输入框的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | editable: false,//是否显示输入框 |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | this.submitPaper() |
| | | this.submitPaper(); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | }); |
| | | }, |
| | | // 底部提交按钮 |
| | | submitBtn() { |
| | | this.setData({ |
| | | noReady: 0 |
| | | }) |
| | | noReady: 0, |
| | | }); |
| | | // 我的错题和收藏 直接走提交逻辑 |
| | | if (this.properties.answerType == 'collectQuestion' || this.properties.answerType == 'errorQuestion') { |
| | | this.submitPaper() |
| | | return wx.navigateBack() |
| | | } else if (this.properties.answerType == 'option' || this.properties.answerType == 'mock') { |
| | | if (this.properties.submitStatus) return wx.navigateBack() |
| | | this.properties.questionDataList.forEach(item => { |
| | | if ( |
| | | this.properties.answerType == "collectQuestion" || |
| | | this.properties.answerType == "errorQuestion" |
| | | ) { |
| | | this.submitPaper(); |
| | | return wx.navigateBack(); |
| | | } else if ( |
| | | this.properties.answerType == "option" || |
| | | this.properties.answerType == "mock" |
| | | ) { |
| | | if (this.properties.submitStatus) return wx.navigateBack(); |
| | | this.properties.questionDataList.forEach((item) => { |
| | | if (!this.isHaveAnswer(item.userAnswer)) { |
| | | this.setData({ |
| | | noReady: this.data.noReady + 1 |
| | | }) |
| | | noReady: this.data.noReady + 1, |
| | | }); |
| | | } |
| | | }) |
| | | }); |
| | | // 未做完,打开提示弹窗 |
| | | if (this.data.noReady > 0) { |
| | | this.confrimPromptDialog() |
| | | this.confrimPromptDialog(); |
| | | } else { |
| | | // 做完了直接执行提交事件 |
| | | this.submitPaper() |
| | | this.submitPaper(); |
| | | } |
| | | } |
| | | |
| | | }, |
| | | // 提交事件 |
| | | submitPaper() { |
| | | var myEventDetail = { |
| | | } |
| | | var myEventDetail = {}; |
| | | var myEventOption = { |
| | | bubbles: true, |
| | | composed: true, |
| | | } |
| | | this.triggerEvent('submitPaper', myEventDetail, myEventOption) |
| | | }; |
| | | this.triggerEvent("submitPaper", myEventDetail, myEventOption); |
| | | }, |
| | | // 打开测试报告弹窗 |
| | | openTestReportDialog() { |
| | | this.setData({ |
| | | testReportState: true |
| | | }) |
| | | testReportState: true, |
| | | }); |
| | | }, |
| | | // 关闭测试报告弹窗 |
| | | closeTestReportDialog(e) { |
| | | this.setData({ |
| | | testReportState: false |
| | | }) |
| | | testReportState: false, |
| | | }); |
| | | }, |
| | | // 测试报告弹窗查看答案解析按钮 |
| | | viewAnswer() { |
| | | this.closeTestReportDialog() |
| | | this.closeTestReportDialog(); |
| | | }, |
| | | // 答题时间到 |
| | | timeout() { |
| | | wx.showModal({ |
| | | title: '提示', |
| | | content: '答题时间已到',//editable如果为true,这就是输入框的内容 |
| | | title: "提示", |
| | | content: "答题时间已到", //editable如果为true,这就是输入框的内容 |
| | | confirmColor: "#ff6c00", |
| | | cancelColor: "#949494", |
| | | editable: false,//是否显示输入框 |
| | | showCancel: false, |
| | | success: (res) => { |
| | | } |
| | | }) |
| | | this.submitPaper() |
| | | success: (res) => {}, |
| | | }); |
| | | this.submitPaper(); |
| | | }, |
| | | } |
| | | }) |
| | | }, |
| | | }); |
| | |
| | | const app = getApp(); |
| | | import { |
| | | loginInfo |
| | | } from '../../../../assets/js/login'; |
| | | import { loginInfo } from "../../../../assets/js/login"; |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | barHeight: '', |
| | | navBarHeight: '', |
| | | searchValue: '', |
| | | path: '', |
| | | barHeight: "", |
| | | navBarHeight: "", |
| | | searchValue: "", |
| | | path: "", |
| | | pathList: [], |
| | | pageCount: { |
| | | page: 1, |
| | |
| | | }, |
| | | isMore: null, |
| | | assortCheck: { |
| | | name: '', |
| | | code: '', |
| | | name: "", |
| | | code: "", |
| | | }, |
| | | bookList: [], |
| | | stairList: { |
| | | value: '', |
| | | options: [{ |
| | | value: '', |
| | | label: '一级', |
| | | }, ], |
| | | value: "", |
| | | options: [ |
| | | { |
| | | value: "", |
| | | label: "一级", |
| | | }, |
| | | ], |
| | | }, |
| | | secondList: { |
| | | value: [], |
| | |
| | | options: [], |
| | | }, |
| | | sortList: { |
| | | value: 'default', |
| | | options: [{ |
| | | value: 'default', |
| | | label: '默认排序', |
| | | }, { |
| | | value: 'name-asc', |
| | | label: '名称正序' |
| | | value: "default", |
| | | options: [ |
| | | { |
| | | value: "default", |
| | | label: "默认排序", |
| | | }, |
| | | { |
| | | value: 'name-desc', |
| | | label: '名称倒叙' |
| | | value: "name-asc", |
| | | label: "名称正序", |
| | | }, |
| | | { |
| | | value: 'time-asc', |
| | | label: '出版时间正序' |
| | | value: "name-desc", |
| | | label: "名称倒叙", |
| | | }, |
| | | { |
| | | value: 'time-desc', |
| | | label: '出版时间倒叙' |
| | | } |
| | | value: "time-asc", |
| | | label: "出版时间正序", |
| | | }, |
| | | { |
| | | value: "time-desc", |
| | | label: "出版时间倒叙", |
| | | }, |
| | | ], |
| | | }, |
| | | newTextBook: { |
| | | value: [], |
| | | options: [], |
| | | }, |
| | | stairCode: '', // 一级分类选中项 |
| | | secondCode: '', // 二级分类选中项 |
| | | sort: '', // 排序 |
| | | stairCode: "", // 一级分类选中项 |
| | | secondCode: "", // 二级分类选中项 |
| | | sort: "", // 排序 |
| | | enable: false, |
| | | loadingProps: { |
| | | size: '50rpx' |
| | | size: "50rpx", |
| | | }, |
| | | loading: false, |
| | | noData: false, |
| | |
| | | disabledProject: false, |
| | | disabledNewForms: false, |
| | | triggered: false, |
| | | backTop: "", |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | |
| | | onLoad(options) { |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | const navBarHeight = |
| | | (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | this.setData({ |
| | | barHeight: systInfo.statusBarHeight, |
| | | navBarHeight: navBarHeight, |
| | |
| | | // 一级分类和path赋值 |
| | | if (options.stairCode) { |
| | | this.setData({ |
| | | 'stairList.value': options.stairCode, |
| | | "stairList.value": options.stairCode, |
| | | stairCode: options.stairCode, |
| | | path: `${options.assortCode}\\${options.stairCode}`, |
| | | }); |
| | |
| | | if (options.secondCode) { |
| | | this.setData({ |
| | | secondCode: options.secondCode, |
| | | pathList: [{ |
| | | pathList: [ |
| | | { |
| | | Path: options.secondCode, |
| | | Type: '*', |
| | | Type: "*", |
| | | StoreRefCode: app.config.goodsStore, |
| | | }], |
| | | }) |
| | | }, |
| | | ], |
| | | }); |
| | | } |
| | | // 获取二级分类 |
| | | this.getSecondList(`${options.assortCode}\\${options.stairCode}`); |
| | | this.getBookList(`${options.assortCode}\\${options.stairCode}`); |
| | | // 获取重点项目 |
| | | this.getProjectList('bookClassification'); |
| | | this.getProjectList('newFormsTextbooks'); |
| | | this.getProjectList("bookClassification"); |
| | | this.getProjectList("newFormsTextbooks"); |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | onPullDownRefresh() { |
| | | this.setData({ |
| | | triggered: true |
| | | }) |
| | | triggered: true, |
| | | }); |
| | | this.setData({ |
| | | 'pageCount.page': 1 |
| | | }) |
| | | "pageCount.page": 1, |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | |
| | |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom(e) { |
| | | const flag = this.data.bookList.length < this.data.pageCount.total |
| | | const flag = this.data.bookList.length < this.data.pageCount.total; |
| | | if (flag) { |
| | | if (!this.data.isRequesting) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.getBookList(this.data.path) |
| | | "pageCount.page": this.data.pageCount.page + 1, |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | } |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | }); |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | console.log('没有更多了'); |
| | | isMore: false, |
| | | }); |
| | | }, 100); |
| | | } |
| | | }, |
| | | |
| | |
| | | // 获取一级列表 |
| | | getStairList(path) { |
| | | this.setData({ |
| | | disabledStair: false |
| | | }) |
| | | disabledStair: false, |
| | | }); |
| | | const query = { |
| | | path, |
| | | filterList: [], |
| | | queryType: '\\', |
| | | queryType: "\\", |
| | | searchList: [], |
| | | size: '30', |
| | | start: '0', |
| | | size: "30", |
| | | start: "0", |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { |
| | | type: 'Asc', |
| | | field: 'LinkOrder' |
| | | type: "Asc", |
| | | field: "LinkOrder", |
| | | }, |
| | | }; |
| | | app.MG.store.getStoreChannelList(query).then(async (res) => { |
| | | const options = [{ |
| | | value: '', |
| | | label: '一级', |
| | | }, ]; |
| | | const options = [ |
| | | { |
| | | value: "", |
| | | label: "一级", |
| | | }, |
| | | ]; |
| | | for (let index = 0; index < res.datas.length; index++) { |
| | | const item = res.datas[index]; |
| | | options.push({ |
| | |
| | | }); |
| | | } |
| | | this.setData({ |
| | | 'stairList.options': options, |
| | | 'stairList.value': this.data.stairCode, |
| | | "stairList.options": options, |
| | | "stairList.value": this.data.stairCode, |
| | | }); |
| | | if (!options.length) { |
| | | this.setData({ |
| | | disabledStair: true |
| | | }) |
| | | disabledStair: true, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | const query = { |
| | | path, |
| | | filterList: [], |
| | | queryType: '\\', |
| | | queryType: "\\", |
| | | searchList: [], |
| | | size: '30', |
| | | start: '0', |
| | | size: "30", |
| | | start: "0", |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { |
| | | type: 'Asc', |
| | | field: 'LinkOrder' |
| | | type: "Asc", |
| | | field: "LinkOrder", |
| | | }, |
| | | }; |
| | | app.MG.store.getStoreChannelList(query).then((res) => { |
| | | if (!res.datas.length) { |
| | | this.setData({ |
| | | disabledSecondList: true |
| | | }) |
| | | disabledSecondList: true, |
| | | }); |
| | | } else { |
| | | this.setData({ |
| | | disabledSecondList: false |
| | | }) |
| | | disabledSecondList: false, |
| | | }); |
| | | } |
| | | for (let index = 0; index < res.datas.length; index++) { |
| | | const item = res.datas[index]; |
| | |
| | | }); |
| | | } |
| | | this.setData({ |
| | | 'secondList.options': options, |
| | | "secondList.options": options, |
| | | }); |
| | | const second = [this.data.secondCode] |
| | | const second = [this.data.secondCode]; |
| | | this.setData({ |
| | | 'secondList.value': second |
| | | }) |
| | | "secondList.value": second, |
| | | }); |
| | | }); |
| | | }, |
| | | // 获取重点项目 |
| | | getProjectList(type) { |
| | | this.setData({ |
| | | disabledProject: false, |
| | | disabledNewForms: false |
| | | }) |
| | | disabledNewForms: false, |
| | | }); |
| | | const options = []; |
| | | const arr = []; |
| | | let array = []; |
| | |
| | | refCodes: [type], |
| | | }; |
| | | app.MG.store.getProductTypeField(query).then((res) => { |
| | | array = JSON.parse(res[0].config).option.filter(item => item.value == this.data.assortCheck.code); |
| | | array = JSON.parse(res[0].config).option.filter( |
| | | (item) => item.value == this.data.assortCheck.code |
| | | ); |
| | | for (let index = 0; index < array.length; index++) { |
| | | const element = array[index]; |
| | | if (element.child) { |
| | |
| | | } |
| | | } |
| | | } |
| | | if (type == 'bookClassification') { |
| | | if (type == "bookClassification") { |
| | | for (let index = 0; index < arr.length; index++) { |
| | | const element = arr[index]; |
| | | options.push({ |
| | |
| | | } |
| | | if (!options.length) { |
| | | this.setData({ |
| | | disabledProject: true |
| | | }) |
| | | disabledProject: true, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | 'majorProjectList.options': options, |
| | | "majorProjectList.options": options, |
| | | }); |
| | | } else if (type == 'newFormsTextbooks') { |
| | | } else if (type == "newFormsTextbooks") { |
| | | for (let index = 0; index < arr.length; index++) { |
| | | const element = arr[index]; |
| | | options.push({ |
| | |
| | | } |
| | | if (!options.length) { |
| | | this.setData({ |
| | | disabledNewForms: true |
| | | }) |
| | | disabledNewForms: true, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | 'newTextBook.options': options, |
| | | "newTextBook.options": options, |
| | | }); |
| | | console.log('重点项目', this.data.newTextBook); |
| | | console.log("重点项目", this.data.newTextBook); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | this.setData({ |
| | | loading: true, |
| | | noData: false, |
| | | isRequesting: true |
| | | }) |
| | | isRequesting: true, |
| | | }); |
| | | let sort; |
| | | let pathObj = {}; |
| | | if (this.data.pathList.length) { |
| | |
| | | } else { |
| | | pathObj = { |
| | | path, |
| | | queryType: '*', |
| | | queryType: "*", |
| | | }; |
| | | } |
| | | if (this.data.sortList.value == 'name-asc') { |
| | | if (this.data.sortList.value == "name-asc") { |
| | | sort = { |
| | | Name: 'Asc', |
| | | BaseType: '' |
| | | } |
| | | } else if (this.data.sortList.value == 'name-desc') { |
| | | Name: "Asc", |
| | | BaseType: "", |
| | | }; |
| | | } else if (this.data.sortList.value == "name-desc") { |
| | | sort = { |
| | | Name: 'Desc', |
| | | BaseType: '' |
| | | } |
| | | } else if (this.data.sortList.value == 'time-asc') { |
| | | Name: "Desc", |
| | | BaseType: "", |
| | | }; |
| | | } else if (this.data.sortList.value == "time-asc") { |
| | | sort = { |
| | | PublicationDate: 'Asc', |
| | | BaseType: 'DateTime' |
| | | } |
| | | } else if (this.data.sortList.value == 'time-desc') { |
| | | PublicationDate: "Asc", |
| | | BaseType: "DateTime", |
| | | }; |
| | | } else if (this.data.sortList.value == "time-desc") { |
| | | sort = { |
| | | PublicationDate: 'Desc', |
| | | BaseType: 'DateTime' |
| | | } |
| | | } else if (this.data.sortList.value == 'default') { |
| | | PublicationDate: "Desc", |
| | | BaseType: "DateTime", |
| | | }; |
| | | } else if (this.data.sortList.value == "default") { |
| | | sort = { |
| | | field: 'order', |
| | | type: 'Desc' |
| | | } |
| | | field: "order", |
| | | type: "Desc", |
| | | }; |
| | | } |
| | | // if (this.data.sort) { |
| | | // sort = { |
| | |
| | | let searchObj = {}; |
| | | if (this.data.searchValue) { |
| | | searchObj = { |
| | | 'Name*': this.data.searchValue, |
| | | '||author*': this.data.searchValue, |
| | | '||isbn*': this.data.searchValue, |
| | | '||seriesName*': this.data.searchValue, |
| | | "Name*": this.data.searchValue, |
| | | "||author*": this.data.searchValue, |
| | | "||isbn*": this.data.searchValue, |
| | | "||seriesName*": this.data.searchValue, |
| | | }; |
| | | } |
| | | const query = { |
| | | ...pathObj, |
| | | filterList: [{ |
| | | value: 'Normal', |
| | | field: 'state', |
| | | }, ], |
| | | filterList: [ |
| | | { |
| | | value: "Normal", |
| | | field: "state", |
| | | }, |
| | | ], |
| | | sort, |
| | | paging: { |
| | | start: 0, |
| | |
| | | author: [], |
| | | publicationDate: [], |
| | | ...searchObj, |
| | | 'bookClassification*': this.data.majorProjectList.value, |
| | | 'newFormsTextbooks*': this.data.newTextBook.value, |
| | | "bookClassification*": this.data.majorProjectList.value, |
| | | "newFormsTextbooks*": this.data.newTextBook.value, |
| | | }, |
| | | }; |
| | | app.MG.store.getProductList(query).then((res) => { |
| | | this.setData({ |
| | | bookList: res.datas, |
| | | isMore: null, |
| | | enable: false, |
| | | "pageCount.total": res.total, |
| | | loading: false, |
| | | isRequesting: false |
| | | isRequesting: false, |
| | | }); |
| | | if (!res.datas.length) { |
| | | this.setData({ |
| | | noData: true, |
| | | }) |
| | | }); |
| | | } |
| | | if (this.data.triggered) { |
| | | this.setData({ |
| | | triggered: false |
| | | }) |
| | | triggered: false, |
| | | }); |
| | | wx.showToast({ |
| | | title: '刷新成功', |
| | | }) |
| | | title: "刷新成功", |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | // 一级分类切换 |
| | | onChangeStair(e) { |
| | | const path = e.detail.value.length ? |
| | | `${this.data.assortCheck.code}\\${e.detail.value}` : |
| | | this.data.assortCheck.code; |
| | | const path = e.detail.value.length |
| | | ? `${this.data.assortCheck.code}\\${e.detail.value}` |
| | | : this.data.assortCheck.code; |
| | | console.log(this.data.path); |
| | | |
| | | this.setData({ |
| | | backTop: "#assort-title", |
| | | pathList: [], |
| | | stairCode: e.detail.value, |
| | | secondCode: '', |
| | | secondCode: "", |
| | | path: path, |
| | | 'stairList.value': e.detail.value, |
| | | "stairList.value": e.detail.value, |
| | | }); |
| | | |
| | | if (e.detail.value == '') { |
| | | if (e.detail.value == "") { |
| | | this.setData({ |
| | | disabledSecondList: true |
| | | disabledSecondList: true, |
| | | }); |
| | | } else { |
| | | this.getSecondList(path); |
| | |
| | | const element = e.detail.value[index]; |
| | | pathList.push({ |
| | | Path: element, |
| | | Type: '*', |
| | | Type: "*", |
| | | StoreRefCode: app.config.goodsStore, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | backTop: "#assort-title", |
| | | pathList: pathList, |
| | | 'secondList.value': e.detail.value, |
| | | "secondList.value": e.detail.value, |
| | | }); |
| | | }, |
| | | // |
| | |
| | | // 重点项目改变 |
| | | changeMajorProject(e) { |
| | | this.setData({ |
| | | 'majorProjectList.value': e.detail.value, |
| | | backTop: "#assort-title", |
| | | "majorProjectList.value": e.detail.value, |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | // 重点项目重置 |
| | | resetMajorProject() { |
| | | this.setData({ |
| | | 'majorProjectList.value': [], |
| | | "majorProjectList.value": [], |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | // 排序切换 |
| | | onSortChange(e) { |
| | | this.setData({ |
| | | 'sortList.value': e.detail.value |
| | | }) |
| | | backTop: "#assort-title", |
| | | "sortList.value": e.detail.value, |
| | | }); |
| | | |
| | | let path; |
| | | if (this.data.secondCode) { |
| | |
| | | }); |
| | | this.getBookList(path); |
| | | }, |
| | | // 新形态教材改变 |
| | | changeNewText(e) { |
| | | this.setData({ |
| | | 'newTextBook.value': e.detail.value, |
| | | backTop: "#assort-title", |
| | | "newTextBook.value": e.detail.value, |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | resetNewText() { |
| | | this.setData({ |
| | | 'newTextBook.value': [], |
| | | "newTextBook.value": [], |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | }, |
| | |
| | | // }, |
| | | // 搜索图书 |
| | | searchBook(e) { |
| | | console.log(e.detail.value); |
| | | this.setData({ |
| | | backTop: "#assort-title", |
| | | searchValue: e.detail.value, |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | // 跳转图书详情 |
| | | goDetail(e) { |
| | | const { |
| | | book |
| | | } = e.currentTarget.dataset; |
| | | const { book } = e.currentTarget.dataset; |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, |
| | | }); |
| | | }, |
| | | onRefresh() { |
| | | this.setData({ |
| | | enable: true |
| | | enable: true, |
| | | }); |
| | | this.getBookList(this.data.path) |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | openDropdown() { |
| | | console.log('展开哦', ); |
| | | console.log("展开哦"); |
| | | this.setData({ |
| | | showDropdown: true |
| | | }) |
| | | showDropdown: true, |
| | | }); |
| | | }, |
| | | closeDropdown() { |
| | | console.log('关闭'); |
| | | console.log("关闭"); |
| | | this.setData({ |
| | | showDropdown: false |
| | | }) |
| | | } |
| | | showDropdown: false, |
| | | }); |
| | | }, |
| | | }); |
| | |
| | | </view> |
| | | <scroll-view |
| | | scroll-y="{{true}}" |
| | | scroll-into-view="{{backTop}}" |
| | | refresher-enabled="{{true}}" |
| | | lower-threshold="{{200}}" |
| | | refresher-threshold="{{80}}" |
| | |
| | | /> |
| | | </view> |
| | | </view> |
| | | <view class="assort-title"> |
| | | <view class="assort-title" id="assort-title"> |
| | | <view class="title-box"></view> |
| | | <view class="title-name">{{assortCheck.name}}</view> |
| | | </view> |
| | |
| | | /> |
| | | </view> |
| | | </view> |
| | | <view class="bottom-box"> |
| | | <view class="bottom-box" wx:if="{{bookList.length}}"> |
| | | <t-loading |
| | | theme="circular" |
| | | size="40rpx" |
| | | class="wrapper" |
| | | wx:if="{{isMore == true}}" |
| | | loading="{{isMore}}" |
| | | /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | |
| | | 'contactInfo.phone': JSON.parse(this.data.userInfo.data).phone, |
| | | 'contactInfo.detailedAddress': JSON.parse(this.data.userInfo.data).detailedAddress, |
| | | }) |
| | | } else { |
| | | wx.showModal({ |
| | | title: '尊敬的用户,您好!', //提示的标题 |
| | | content: '请先进行教师认证?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | if (wx.getStorageSync("paperBookList")) { |
| | | this.setData({ |
| | |
| | | author: [], |
| | | isbn: [], |
| | | publicationDate: [], |
| | | pdf: [], |
| | | protectedEpub: [], |
| | | isApplyBook: [], |
| | | 'isApplyBook>': ['1'], |
| | | ...searchObj, |
| | |
| | | }) |
| | | } else { |
| | | that.setData({ |
| | | bookList: [], |
| | | pageTotalCount: 0, |
| | | bottomLoading: false, |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |
| | |
| | | }, |
| | | |
| | | //选择电子样书 |
| | | async onChangeElectron(e) { |
| | | onChangeElectron(e) { |
| | | const item = e.currentTarget.dataset.book; |
| | | console.log(item) |
| | | const index = this.data.bookList.findIndex(citem => citem.id == item.id) |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null |
| | | if (role && role == 'Teacher') { |
| | | // 是教师 |
| | | if (e.detail.checked) { |
| | | // 点击选中 |
| | | //商品有无电子书 |
| | | const obj = { |
| | | path: '*', |
| | | queryType: 'SubProduct', |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 1 |
| | | }, |
| | | mainProductId: item.id, |
| | | fields: { |
| | | bookshelf_pdf: [], |
| | | bookshelf_protectedEpub: [], |
| | | } |
| | | } |
| | | const res = await app.MG.store.getProductList(obj) |
| | | if (res.datas.length > 0) { |
| | | if (!res.datas[0].bookshelf_pdf && !res.datas[0].bookshelf_protectedEpub) { |
| | | wx.showToast({ |
| | | title: "暂无电子书文件,请联系管理员!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return false; |
| | | } |
| | | } else { |
| | | if (!item.pdf && !item.protectedEpub) { |
| | | wx.showToast({ |
| | | title: "暂无电子书文件,请联系管理员!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //申请次数 |
| | | if (this.data.ebookCount == 0) { |
| | | wx.showToast({ |
| | | title: "您的电子样书申请次数已用尽,若要继续,请联系管理员!", |
| | |
| | | "t-search": "tdesign-miniprogram/search/search", |
| | | "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh" |
| | | } |
| | | } |
| | |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | list: [], |
| | | pageTotalCount: 0, |
| | | skeletonLoding: false, |
| | | }) |
| | | } |
| | |
| | | data: { |
| | | active: 0, |
| | | activeName: "bookOpinion", |
| | | tabList: [{ |
| | | tabList: [ |
| | | { |
| | | label: '图书建议', |
| | | key: 0, |
| | | value: 'bookOpinion' |
| | |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | list: [], |
| | | pageTotalCount: 0, |
| | | skeletonLoding: false, |
| | | }) |
| | | } |
| | |
| | | <view wx:if="{{activeName == 'bookOpinion'}}" class="listBox"> |
| | | <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| | | <view class="icon"> |
| | | <t-image src="{{item.content.icon ? item.content.icon : '/static/images/default-book-img.png'}}" mode="aspectFill" class="img" /> |
| | | <t-image src="{{item.content.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="item-con"> |
| | | <view class="titleBox"> |
| | |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | list: [], |
| | | pageTotalCount: 0, |
| | | skeletonLoding: false, |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | list: [], |
| | | pageTotalCount: 0, |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |
| | |
| | | // pages/bookServices/assort/index.js |
| | | import { getPublicImage } from '../../../assets/js/middleGround/tool' |
| | | import { getPublicImage } from "../../../assets/js/middleGround/tool"; |
| | | const app = getApp(); |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | placeholderstyle: 'font-size:28rpx', |
| | | barHeight: "", |
| | | navBarHeight: "", |
| | | placeholderstyle: "font-size:28rpx", |
| | | assortList: [], |
| | | assortCheck: { |
| | | name: '', |
| | | code: '', |
| | | name: "", |
| | | code: "", |
| | | }, |
| | | startList: [], |
| | | |
| | | startCheck: { |
| | | id: '', |
| | | code: '' |
| | | id: "", |
| | | code: "", |
| | | }, |
| | | bookList: [], |
| | | loading: false, |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = |
| | | (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | this.setData({ |
| | | barHeight: systInfo.statusBarHeight, |
| | | navBarHeight: navBarHeight, |
| | | }); |
| | | this.getAssortList(); |
| | | }, |
| | | |
| | |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | if (typeof this.getTabBar === 'function' && this.getTabBar()) { |
| | | if (typeof this.getTabBar === "function" && this.getTabBar()) { |
| | | this.getTabBar().setData({ |
| | | active: 1 |
| | | }) |
| | | active: 1, |
| | | }); |
| | | } |
| | | }, |
| | | |
| | |
| | | // 获取侧边栏列表 |
| | | getAssortList() { |
| | | this.setData({ |
| | | loading: true |
| | | }) |
| | | loading: true, |
| | | }); |
| | | const query = { |
| | | path: '*', |
| | | path: "*", |
| | | filterList: [ |
| | | { |
| | | value: 'Normal', |
| | | field: 'state', |
| | | value: "Normal", |
| | | field: "state", |
| | | }, |
| | | ], |
| | | queryType: '\\', |
| | | queryType: "\\", |
| | | searchList: [], |
| | | size: '30', |
| | | start: '0', |
| | | size: "30", |
| | | start: "0", |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' }, |
| | | sort: { type: "Asc", field: "LinkOrder" }, |
| | | }; |
| | | app.MG.store.getStoreChannelList(query).then((res) => { |
| | | const list = res.datas.filter((item) => item.refCode != 'jsek_homepageBookService'); |
| | | const list = res.datas.filter( |
| | | (item) => item.refCode != "jsek_homepageBookService" |
| | | ); |
| | | this.setData({ |
| | | assortList: list, |
| | | loading: false |
| | | loading: false, |
| | | }); |
| | | this.setData({ |
| | | assortCheck: { |
| | |
| | | path, |
| | | filterList: [ |
| | | { |
| | | value: 'Normal', |
| | | field: 'state' |
| | | } |
| | | value: "Normal", |
| | | field: "state", |
| | | }, |
| | | ], |
| | | queryType: '\\', |
| | | queryType: "\\", |
| | | searchList: [], |
| | | size: '30', |
| | | start: '0', |
| | | size: "30", |
| | | start: "0", |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' }, |
| | | sort: { type: "Asc", field: "LinkOrder" }, |
| | | }; |
| | | app.MG.store.getStoreChannelList(query).then(async (res) => { |
| | | // 获取二级分类 |
| | | for (let index = 0; index < res.datas.length; index++) { |
| | | const item = res.datas[index]; |
| | | item.icon ? item.icon = getPublicImage(item.icon, 500) : item.icon = item.icon |
| | | item.icon |
| | | ? (item.icon = getPublicImage(item.icon, 500)) |
| | | : (item.icon = item.icon); |
| | | item.children = await this.getSecondList(item); |
| | | } |
| | | console.log(res.datas); |
| | |
| | | this.setData({ |
| | | startList: res.datas, |
| | | listLoding: false, |
| | | 'startCheck.id': res.datas[0].id, |
| | | 'startCheck..code': '' |
| | | "startCheck.id": res.datas[0].id, |
| | | "startCheck..code": "", |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | path, |
| | | filterList: [ |
| | | { |
| | | value: 'Normal', |
| | | field: 'state' |
| | | } |
| | | value: "Normal", |
| | | field: "state", |
| | | }, |
| | | ], |
| | | coverSize: { |
| | | width: 500 |
| | | width: 500, |
| | | }, |
| | | queryType: '\\', |
| | | queryType: "\\", |
| | | searchList: [], |
| | | size: '30', |
| | | start: '0', |
| | | size: "30", |
| | | start: "0", |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' }, |
| | | sort: { type: "Asc", field: "LinkOrder" }, |
| | | }; |
| | | await app.MG.store.getStoreChannelList(query).then((res) => { |
| | | for (let index = 0; index < res.datas.length; index++) { |
| | | const element = res.datas[index]; |
| | | if (element.icon) |
| | | element.icon = getPublicImage(element.icon, 500) |
| | | |
| | | if (element.icon) element.icon = getPublicImage(element.icon, 500); |
| | | } |
| | | datas = res.datas; |
| | | }); |
| | |
| | | tabClick(e) { |
| | | const data = e.currentTarget.dataset.tabdata; |
| | | this.setData({ |
| | | 'startCheck.id': data.id, |
| | | 'startCheck.code': data.refCode, |
| | | "startCheck.id": data.id, |
| | | "startCheck.code": data.refCode, |
| | | }); |
| | | console.log(data); |
| | | }, |
| | | // 跳转列表页 |
| | | goPageList(e) { |
| | | const tab = e.currentTarget.dataset.tabdata |
| | | const stair = e.currentTarget.dataset.stair |
| | | const tab = e.currentTarget.dataset.tabdata; |
| | | const stair = e.currentTarget.dataset.stair; |
| | | this.setData({ |
| | | 'startCheck.id': tab.id, |
| | | 'startCheck.code': tab.refCode |
| | | }) |
| | | "startCheck.id": tab.id, |
| | | "startCheck.code": tab.refCode, |
| | | }); |
| | | if (stair) { |
| | | const secondCode = `${stair.pathLinks[0].linkPath}\\${stair.id}`; |
| | | wx.navigateTo({ |
| | |
| | | url: `/packageBookService/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}`, |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | navToSearchPage(e) { |
| | | wx.navigateTo({ |
| | |
| | | { |
| | | "navigationBarTitleText": "图书服务", |
| | | "navigationStyle": "custom", |
| | | "onReachBottomDistance": 10, |
| | | "backgroundTextStyle": "light", |
| | | "disableScroll": true, |
| | |
| | | <!--图书服务分类--> |
| | | <page-meta style="width: 100vw; overflow: hidden"> |
| | | <view style="width: 100%; height: {{barHeight}}px; "></view> |
| | | <view class="nacigationBar" style="width: 100%; height: {{navBarHeight}}px;"> |
| | | <view class="navbar-title">图书服务</view> |
| | | </view> |
| | | <view class="page-header"> |
| | | <!-- 搜索框 --> |
| | | <view class="search"> |
| | |
| | | padding-bottom: calc(env(safe-area-inset-bottom) + 96rpx); |
| | | } |
| | | |
| | | .navbar-title { |
| | | text-align: center; |
| | | color: #0F1214; |
| | | font-size: 40rpx; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .page-header { |
| | | position: relative; |
| | | } |
| | |
| | | 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: '' |
| | | }); |
| | | } |
| | | }, |
| | |
| | | if (this.data.mannder.replace(/^\s*|\s*$/g, "") == '') { |
| | | this.data.lock = true; |
| | | wx.showToast({ |
| | | title: "联系方式不能为空", |
| | | title: "反馈内容不能为空", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |