Merge refs/remotes/origin/master into refs/heads/master
| | |
| | | }) |
| | | ) |
| | | } |
| | | |
| | | res.forEach((item) => { |
| | | const obj = { |
| | | baseType: item.typeField.baseType, |
| | |
| | | name: '', |
| | | }, |
| | | bookDetail: {}, |
| | | bookItemDetail: {}, |
| | | link: { |
| | | jd: '', |
| | | tamll: '', |
| | |
| | | }, |
| | | flag: true, |
| | | applyResourceLoading: false, |
| | | noResources: false |
| | | noResources: false, |
| | | selectedIds: "",//商品或子商品销售方式 |
| | | bookBuy: false, //商品或子商品是否购买 |
| | | expire: false,//商品或子商品销售方式是否过期 |
| | | noFile: false, //商品或子商有无电子书文件 |
| | | num: 0, //样书申请单数量 |
| | | alreadyPaperBookList: [], //已申请纸质样书 |
| | | alreadyElectronicBookList: [], //已申请电子样书 |
| | | paperBookList: [], //样书单纸质书 |
| | | electronicBookList: [], //样书单电子书 |
| | | paperBookCount: 0, //纸质书剩余次数 |
| | | ebookCount: 0, //电子书剩余次数 |
| | | userInfo: {}, |
| | | }, |
| | | |
| | | |
| | |
| | | name: options.name, |
| | | }, |
| | | }); |
| | | |
| | | this.getBookInfo(options.id); |
| | | this.getResourceClass() // 获取资源所属分类 |
| | | const token = wx.getStorageSync('jsek-token') |
| | |
| | | this.getApplyInfo(options.id) |
| | | this.getMockData() |
| | | } |
| | | if (wx.getStorageSync(app.config.userInfoKey)) { |
| | | this.setData({ |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | | } |
| | | if (wx.getStorageSync("paperBookList")) { |
| | | this.setData({ |
| | | paperBookList: wx.getStorageSync("paperBookList"), |
| | | }) |
| | | } |
| | | if (wx.getStorageSync("electronicBookList")) { |
| | | this.setData({ |
| | | electronicBookList: wx.getStorageSync("electronicBookList"), |
| | | }) |
| | | } |
| | | this.setData({ |
| | | num: this.data.paperBookList.length + this.data.electronicBookList.length |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | |
| | | cmsDatas: res.datas.cmsDatas[0].datas, |
| | | buyIdList: res.datas.purchasedSaleMethodIdList |
| | | }); |
| | | this.getSubTtem(); |
| | | // 获取图书分类 |
| | | const iconType = JSON.parse(res.datas.bookClassification)[0][0]; |
| | | const classType = JSON.parse(res.datas.bookClassification)[0][1]; |
| | |
| | | console.log('图书信息', this.data.bookDetail); |
| | | }); |
| | | |
| | | }, |
| | | //请求子商品的文件 |
| | | getSubTtem() { |
| | | const obj = { |
| | | path: '*', |
| | | queryType: 'SubProduct', |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 6 |
| | | }, |
| | | mainProductId: this.data.bookDetail.id, |
| | | fields: { |
| | | author: [], |
| | | bookshelf_pdf: [], |
| | | bookshelf_protectedEpub: [], |
| | | bookshelf_freeEpub: [], //epub试读百分比 |
| | | bookshelf_probationPage: [] //pdf试读页数 |
| | | } |
| | | } |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | if (res.datas && res.datas.length > 0) { |
| | | this.setData({ |
| | | bookItemDetail: res.datas[0], |
| | | selectedIds: res.datas[0].defaultSaleMethod.id, |
| | | bookBuy: res.datas[0].purchasedSaleMethodIdList.indexOf(res.datas[0].defaultSaleMethodId) > -1 |
| | | }); |
| | | console.log(this.data.bookItemDetail, 'bookItemData.value'); |
| | | let times = new Date(res.datas[0].defaultSaleMethod.endDate).getTime() |
| | | let startTime = new Date(res.datas[0].defaultSaleMethod.beginDate).getTime() |
| | | if (times < new Date().getTime() || new Date().getTime() < startTime) { |
| | | this.setData({ |
| | | expire: true |
| | | }); |
| | | } else { |
| | | this.setData({ |
| | | expire: false |
| | | }); |
| | | } |
| | | if (res.datas[0].bookshelf_pdf || res.datas[0].bookshelf_protectedEpub) { |
| | | this.setData({ |
| | | noFile: true |
| | | }); |
| | | } |
| | | } else { |
| | | if (this.data.bookDetail.pdf || this.data.bookDetail.protectedEpub) { |
| | | this.setData({ |
| | | noFile: true |
| | | }); |
| | | } |
| | | this.setData({ |
| | | selectedIds: this.data.bookDetail.defaultSaleMethodId, |
| | | bookBuy: this.data.bookDetail.purchasedSaleMethodIdList.indexOf(this.data.bookDetail.defaultSaleMethodId) > -1 |
| | | }); |
| | | let times = new Date(this.data.bookDetail.defaultSaleMethod.endDate).getTime() |
| | | let startTime = new Date(this.data.bookDetail.defaultSaleMethod.beginDate).getTime() |
| | | if (times < new Date().getTime() || new Date().getTime() < startTime) { |
| | | this.setData({ |
| | | expire: true |
| | | }); |
| | | } else { |
| | | this.setData({ |
| | | expire: false |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 获取图书分类 |
| | | async getBookClass(iconType, classType) { |
| | |
| | | |
| | | // 图书添加购物车 |
| | | async addBookShopcCar() { |
| | | |
| | | const token = wx.getStorageSync('jsek-token') |
| | | if (!token) { |
| | | return wx.getUserProfile({ |
| | |
| | | shoppingCartGetId.push(item.saleMethod.id) |
| | | }) |
| | | console.log(shoppingCartGetId, 'shoppingCartGetId'); |
| | | console.log(this.data.bookDetail.defaultSaleMethodId, 'this.data.bookDetail.defaultSaleMethodId'); |
| | | const determine = shoppingCartGetId.some((item) => item == this.data.bookDetail.defaultSaleMethodId) |
| | | console.log(this.data.selectedIds, '销售方式id'); |
| | | const determine = shoppingCartGetId.some((item) => item == this.data.selectedIds) |
| | | console.log(determine); |
| | | |
| | | if (!determine) { |
| | | let query = { |
| | | requests: [ |
| | | { |
| | | saleMethodId: this.data.bookDetail.defaultSaleMethodId, |
| | | saleMethodId: this.data.selectedIds, |
| | | storeEventId: null, |
| | | agentCode: '电子书' |
| | | } |
| | |
| | | |
| | | |
| | | async buyBook() { |
| | | if (!this.data.expire) { |
| | | let bookOrdersId = '' |
| | | let query = { |
| | | remarks: '电子书', |
| | | requests: [ |
| | | { |
| | | saleMethodId: this.data.bookDetail.defaultSaleMethodId, |
| | | saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ? this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId, |
| | | count: 1 |
| | | } |
| | | ] |
| | |
| | | } else { |
| | | console.log(222); |
| | | } |
| | | |
| | | } else { |
| | | wx.showToast({ |
| | | title: "商品不在有效期", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 获取教学资源下载是否申请通过 |
| | |
| | | } |
| | | else if (this.data.tabValue == 'jsek_cloudLearning') { |
| | | const tree = this.selectComponent('#tree') |
| | | |
| | | tree.onCloudShoppingCart() |
| | | |
| | | |
| | | } else if (this.data.tabValue == 'questionBank') { |
| | | this.buyMock() |
| | | } else { |
| | |
| | | } |
| | | }, |
| | | |
| | | //样书申请 |
| | | //申请电子样书 |
| | | appplyElectronicBook() { |
| | | console.log(this.data.bookDetail) |
| | | if (this.data.bookDetail.isApplyBook == 2 || this.data.bookDetail.isApplyBook == 4) { |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null |
| | | if (role) { |
| | | if (role == 'Teacher') { |
| | | if (this.data.noFile) { |
| | | this.getSelectBookCount() |
| | | } else { |
| | | wx.showToast({ |
| | | title: "暂无电子书文件,请联系管理员!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } else { |
| | | wx.showModal({ |
| | | title: '尊敬的用户,您好!', //提示的标题 |
| | | content: '请先进行教师认证?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) { |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | //申请纸质样书 |
| | | appplyPaperBook() { |
| | | if (this.data.bookDetail.isApplyBook == 3 || this.data.bookDetail.isApplyBook == 4) { |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null |
| | | if (role) { |
| | | if (role == 'Teacher') { |
| | | this.getSelectPaperBookCount() |
| | | } else { |
| | | wx.showModal({ |
| | | title: '尊敬的用户,您好!', //提示的标题 |
| | | content: '请先进行教师认证?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) { |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | //获取当前已申请次数(纸质) |
| | | getSelectPaperBookCount() { |
| | | app.MG.app |
| | | .getTicketResult({ |
| | | ticketRefCodeOrGuid: 'paperSampleBookapplyNum', |
| | | roleId: this.data.userInfo.roleId |
| | | }) |
| | | .then((res) => { |
| | | this.setData({ |
| | | paperBookCount: res.totalCount - res.usedCount |
| | | }) |
| | | this.getAlreadyBookList(this.data.bookDetail, 'pBook') |
| | | }) |
| | | }, |
| | | //获取当前已申请次数(电子) |
| | | getSelectBookCount() { |
| | | app.MG.app |
| | | .getTicketResult({ |
| | | ticketRefCodeOrGuid: 'electronicSampleBookapplyNum', |
| | | roleId: this.data.userInfo.roleId |
| | | }) |
| | | .then((res) => { |
| | | this.setData({ |
| | | ebookCount: res.totalCount - res.usedCount |
| | | }) |
| | | this.getAlreadyBookList(this.data.bookDetail, 'eBook') |
| | | }) |
| | | }, |
| | | //获取已申请的样书列表 |
| | | getAlreadyBookList(item, type) { |
| | | let topicIdOrRefCode = null |
| | | if (type == 'eBook') { |
| | | topicIdOrRefCode = 'applyBook' |
| | | } else { |
| | | topicIdOrRefCode = 'applyEntityBook' |
| | | } |
| | | const data = { |
| | | start: 0, |
| | | size: 9999, |
| | | topicIdOrRefCode, |
| | | appRefCode: app.config.appRefCode, |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | } |
| | | } |
| | | app.MG.ugc.getTopicMessageList(data).then((res) => { |
| | | let itemAttr = null |
| | | let isHas = false |
| | | itemAttr = { |
| | | id: item.id, |
| | | title: item.name || '--', |
| | | icon: item.icon, |
| | | checked: false, |
| | | defaultSaleMethodId: item.defaultSaleMethodId, |
| | | md5: item.datas.Icon, |
| | | author: item.author || '--', |
| | | price: item.price || '--', |
| | | isbn: item.isbn || '--', |
| | | publicationDate: item.publicationDate |
| | | } |
| | | res.datas.map((item) => { |
| | | if (item.feedBack) { |
| | | item.feedBack = JSON.parse(item.feedBack) |
| | | if (item.feedBack.endDate) { |
| | | const currentDate = new Date() |
| | | let times = new Date(item.feedBack.endDate + ' 23:59:59').getTime() |
| | | if (times < currentDate.getTime()) { |
| | | item.isExpiry = true |
| | | } |
| | | } |
| | | } |
| | | if (item.content) { |
| | | item.content = JSON.parse(item.content) |
| | | item.content.map((e) => (item.productId = e.id)) |
| | | } |
| | | }) |
| | | let objVal = null |
| | | if (type != 'eBook') { |
| | | objVal = res.datas.find( |
| | | (i) => i.productId == item.id && i.state != 'Reject' && i.state == 'WaitAudit' |
| | | ) |
| | | } else { |
| | | objVal = res.datas.find((i) => i.productId == item.id && i.state != 'Reject') |
| | | } |
| | | if (objVal && !objVal.isExpiry && type == 'eBook') { |
| | | wx.showToast({ |
| | | title: "您已申请该样书", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } else if (objVal && type != 'eBook') { |
| | | wx.showToast({ |
| | | title: "您已申请该样书", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } else { |
| | | if (type == 'eBook') { |
| | | if (this.data.ebookCount > 0) { |
| | | const eBookData = this.data.electronicBookList |
| | | if (eBookData.length == 2) { |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return false |
| | | } |
| | | if (eBookData.length > 0) { |
| | | for (let i = 0; i < eBookData.length; i++) { |
| | | if (eBookData[i].id == item.id) { |
| | | isHas = true |
| | | } |
| | | } |
| | | if (!isHas) { |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | electronicBookList: [...this.data.electronicBookList, ...[itemAttr]], |
| | | num: this.data.electronicBookList.length + this.data.paperBookList.length |
| | | }) |
| | | wx.setStorageSync("electronicBookList", this.data.electronicBookList); |
| | | } else { |
| | | wx.showToast({ |
| | | title: "该书已在清单列表中", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | electronicBookList: [itemAttr], |
| | | num: 1 + this.data.paperBookList.length |
| | | }) |
| | | wx.setStorageSync("electronicBookList", [itemAttr]); |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "您的电子样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } else { |
| | | if (this.data.paperBookCount > 0) { |
| | | const pBookData = this.data.paperBookList |
| | | if (pBookData.length == 2) { |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return false |
| | | } |
| | | if (pBookData.length > 0) { |
| | | for (let i = 0; i < pBookData.length; i++) { |
| | | if (pBookData[i].id == item.id) { |
| | | isHas = true |
| | | } |
| | | } |
| | | if (!isHas) { |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | paperBookList: [...this.data.paperBookList, ...[itemAttr]], |
| | | num: this.data.paperBookList.lenght + this.data.electronicBookList.length |
| | | }) |
| | | wx.setStorageSync("paperBookList", this.data.paperBookList); |
| | | } else { |
| | | wx.showToast({ |
| | | title: "该书已在清单列表中", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | paperBookList: [itemAttr], |
| | | num: 1 + this.data.electronicBookList.length |
| | | }) |
| | | wx.setStorageSync("paperBookList", [itemAttr]); |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "您的纸质样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | //去样书申请单 |
| | | goApply() { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/sampleBookList/applicationForm/index", |
| | | }); |
| | | }, |
| | | |
| | | }) |
| | |
| | | </view> |
| | | <!-- 购买按钮 --> |
| | | <view class="box-bottom"> |
| | | <view class="bottom-btn"> |
| | | <view class="bottom-btn" bind:tap="appplyElectronicBook"> |
| | | <view> |
| | | <t-image src="/static/images/bookService/detail/ebook.png"></t-image> |
| | | </view> |
| | | <view class="btn-text">电子样书申请</view> |
| | | </view> |
| | | <view class="bottom-btn"> |
| | | <view class="bottom-btn" bind:tap="appplyPaperBook"> |
| | | <view> |
| | | <t-image src="/static/images/bookService/detail/paper-book.png"></t-image> |
| | | </view> |
| | |
| | | <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" /> |
| | | |
| | | <view class="applyBox" bindtap="goApply"> |
| | | <view class="box"> |
| | | <t-image src="/static/images/home/yangshuForm.png" mode="heightFix" class="img" /> |
| | | <view class="num" wx:if="{{num > 0}}">{{num}}</view> |
| | | </view> |
| | | </view> |
| | |
| | | } |
| | | |
| | | .box-bottom image { |
| | | width: 36rpx; |
| | | width: 38rpx; |
| | | height: 44rpx; |
| | | } |
| | | |
| | |
| | | .noData { |
| | | height: 100%; |
| | | } |
| | | |
| | | .applyBox { |
| | | width: 184rpx; |
| | | height: 184rpx; |
| | | position: fixed; |
| | | bottom: 20%; |
| | | right: 0; |
| | | } |
| | | |
| | | .applyBox .box { |
| | | width: 184rpx; |
| | | height: 184rpx; |
| | | color: #fff; |
| | | position: relative; |
| | | } |
| | | |
| | | .applyBox .box .t-image { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | .num { |
| | | background-color: #FD3D16; |
| | | color: #fff; |
| | | border: 2rpx solid #FFFFFF; |
| | | font-size: 24rpx; |
| | | line-height: 30rpx; |
| | | font-weight: 400; |
| | | width: 48rpx; |
| | | height: 32rpx; |
| | | text-align: center; |
| | | border-radius: 9px; |
| | | position: absolute; |
| | | top: 30rpx; |
| | | left: 118rpx; |
| | | } |
| | |
| | | <t-collapse-panel value="{{item.id}}" expandIcon wx:for="{{noteList}}"> |
| | | <view slot="header" class="collapse-header"> |
| | | <t-image class="note-icon" src="/static/images/bookService/detail/note-icon.png"></t-image> |
| | | <view class="header-name">{{item.name}}</view> |
| | | <view class="header-name">{{titleName}}</view> |
| | | </view> |
| | | <view> |
| | | <view class="note-content">{{item.content}}</view> |
| | |
| | | // item.deleteHover = false |
| | | item.createDate = this.convertTimestamp(item.createDate) |
| | | }) |
| | | console.log(res, 'res'); |
| | | this.setData({ |
| | | "pageCount.total": res.totalSize, |
| | | noteList: res.datas, |
| | |
| | | "t-image": "tdesign-miniprogram/image/image", |
| | | "t-textarea": "tdesign-miniprogram/textarea/textarea", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-popup": "tdesign-miniprogram/popup/popup" |
| | | "t-popup": "tdesign-miniprogram/popup/popup", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | }, |
| | | "navigationStyle": "custom" |
| | | } |
| | |
| | | <t-tab-panel label="笔记" value="1" style="{{tabPanelstyle}}"> |
| | | |
| | | <view class="wrapper"> |
| | | <view wx:if="{{!noteList.length}}" class="noData"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | |
| | | </view> |
| | | <t-collapse value="{{activeValues}}" bind:change="handleChange"> |
| | | <t-collapse-panel value="{{item.id}}" expandIcon wx:for="{{noteList}}"> |
| | | <view slot="header" class="collapse-header"> |
| | | <t-image class="note-icon" src="/static/images/bookService/detail/note-icon.png"></t-image> |
| | | <view class="header-name">{{item.name}}</view> |
| | | <view class="header-name">{{titleName}}</view> |
| | | </view> |
| | | <view> |
| | | <view class="note-content">{{item.content}}</view> |
| | |
| | | .t-tabs__track { |
| | | background-color: #FF6C00 !important; |
| | | } |
| | | |
| | | .noData { |
| | | margin-top: 120rpx; |
| | | } |
| | |
| | | workInfo: null, |
| | | schoolName: "", |
| | | courseName: "", |
| | | detailedAddress: "" |
| | | }, |
| | | contactInfo: { |
| | | fullName: "", |
| | |
| | | 'teacherInfo.workInfo': res[0].cmsTypeLinks[0].children, |
| | | }) |
| | | } |
| | | console.log(this.data.teacherInfo.workInfo, 333) |
| | | }) |
| | | }, |
| | | //获取当前已申请次数(电子) |
| | |
| | | }) |
| | | return |
| | | } |
| | | |
| | | const mailAddress = JSON.stringify(that.data.contactInfo) |
| | | that.setData({ |
| | | teacherInfo: { |
| | | detailedAddress: mailAddress, |
| | | } |
| | | 'teacherInfo.detailedAddress': mailAddress |
| | | }) |
| | | console.log(that.data.teacherInfo.workInfo, 345) |
| | | |
| | | data = { |
| | | topicIdOrRefCode: 'applyEntityBook', |
| | | name: that.data.userInfo.name || '', |
| | |
| | | }) |
| | | wx.setStorageSync("paperBookList", that.data.paperBookList); |
| | | } |
| | | |
| | | wx.showModal({ |
| | | title: '提示!', //提示的标题 |
| | | content: '您的样书申请已提交,管理员审核中!申请状态在【个人中心—样书申请】中查询。', //提示的内容 |
| | |
| | | width: 100%; |
| | | } |
| | | |
| | | .page-content { |
| | | padding-bottom: env(safe-area-inset-bottom); |
| | | |
| | | } |
| | | |
| | | .t-tabs__track { |
| | | display: none; |
| | | |
| | |
| | | icon: 'success', |
| | | duration: 1000, |
| | | }) |
| | | this.getDataList(false) |
| | | that.getDataList(false) |
| | | }); |
| | | } else if (res.cancel) { |
| | | console.log('用户点击了取消') |
| | |
| | | const app = getApp() |
| | | import tool from "../../../assets/js/toolClass.js"; |
| | | import FormData from '../../../utils/formdata/index.js'; |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | userInfoBox: false, |
| | | editType: '', |
| | | userInfoForm: { |
| | | icon: '', |
| | | nickName: '', |
| | | phone: '', |
| | | email: '', |
| | | captcha: '', |
| | |
| | | // 用户信息优先级:教师认证 > 微信 > 学生(注册时默认) |
| | | if (res) { |
| | | let defaultUser = {}; |
| | | let nickNameData = res.infoList.find((item) => item.type == 'nickName') |
| | | let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') |
| | | let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') |
| | | let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword') |
| | |
| | | if (teacherRole && teacherInfos) { |
| | | defaultUser = { |
| | | ...teacherInfos, |
| | | fullName: teacherInfos.fullName, |
| | | icon: teacherInfos.icon, |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : teacherInfos.name, |
| | | icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo ? WeChatInfo.icon : '', |
| | | userId: res.userId, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id, |
| | |
| | | } else if (WeChatInfo) { |
| | | defaultUser = { |
| | | ...WeChatInfo, |
| | | fullName: WeChatInfo.name, |
| | | icon: WeChatInfo.icon, |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, |
| | | icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | userId: res.userId, |
| | | phoneNumber: phoneInfo?.credential, |
| | | Email: emailInfo?.credential |
| | | } |
| | | } else if (secretData) { |
| | | defaultUser = { |
| | | fullName: secretData.credential, |
| | | icon: "", |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : secretData.credential, |
| | | icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : '', |
| | | userId: res.userId, |
| | | phoneNumber: phoneInfo?.credential, |
| | | Email: emailInfo?.credential |
| | |
| | | userInfoBox: true, |
| | | editType: info, |
| | | "userInfoForm.captcha": "", |
| | | "userInfoForm.code": "" |
| | | "userInfoForm.code": "", |
| | | "userInfoForm.nickName": '' |
| | | }); |
| | | } |
| | | this.getImgCapcha() |
| | |
| | | countDown: 0, |
| | | }); |
| | | }, |
| | | editIconInfo(e) { |
| | | var that = this; |
| | | wx.chooseMedia({ |
| | | // count: 1, // 默认9 |
| | | sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 |
| | | sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 |
| | | success: function (res) { |
| | | // 返回选定照片的本地文件路径列表,tempFilePath也可以作为img标签的src属性显示图片 |
| | | console.log(res.tempFiles[0]) |
| | | tool.getFileMd5(res.tempFiles[0]).then((e) => { |
| | | console.log(e, 4) |
| | | let formData = new FormData(); |
| | | formData.append('Md5', e); |
| | | formData.append('FileName', e); |
| | | formData.append('FileType', res.tempFiles[0].fileType); |
| | | formData.appendFile("file", res.tempFiles[0].tempFilePath); |
| | | const data = formData.getData(); |
| | | let _token = wx.getStorageSync(app.config.tokenKey); |
| | | let header = {}; |
| | | if (_token == null) { |
| | | header["Authorization"] = `Basic ${Base64.encode(website.clientId + ":" + website.clientSecret)}`; |
| | | } else { |
| | | header["Authorization"] = `Bearer ` + _token; |
| | | } |
| | | new Promise((resolve, reject) => { |
| | | wx.request({ |
| | | url: app.config.requestCtx + '/file/api/ApiUpload', |
| | | method: 'POST', |
| | | header: { |
| | | 'content-type': data.contentType, |
| | | ...header |
| | | }, |
| | | data: data.buffer, |
| | | success(res) { |
| | | console.log(res) |
| | | if (res.statusCode == 200) { |
| | | resolve(res.data); |
| | | if (res.data) { |
| | | that.setData({ |
| | | 'userInfoForm.icon': app.config.requestCtx + `/file/GetPreViewImage?md5=` + e, |
| | | }); |
| | | let userTypeInfo = { |
| | | requests: [ |
| | | { |
| | | data: JSON.stringify({ nickName: that.data.userInfo.nickName, icon: that.data.userInfoForm.icon }), |
| | | name: '用户昵称头像', |
| | | type: 'nickName' |
| | | } |
| | | ] |
| | | } |
| | | app.MG.identity.setAppUserInfo(userTypeInfo).then((res) => { |
| | | if (res) { |
| | | wx.showToast({ |
| | | title: "修改成功", |
| | | icon: 'success', |
| | | duration: 1000, |
| | | }) |
| | | this.getUserInfo() |
| | | this.setData({ |
| | | userInfoBox: false, |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | reject('运行时错误,请稍后再试'); |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | }) |
| | | } |
| | | }); |
| | | }, |
| | | onNameInput(e) { |
| | | this.setData({ |
| | | "userInfoForm.nickName": e.detail.value, |
| | | }); |
| | | }, |
| | | //输入手机号 |
| | | onPhoneInput(e) { |
| | | console.log(e) |
| | |
| | | }, |
| | | |
| | | confirmInfo() { |
| | | if (this.data.changeType == 'phone') { |
| | | if (this.data.editType == 'nickName') { |
| | | let userTypeInfo = { |
| | | requests: [ |
| | | { |
| | | data: JSON.stringify({ nickName: this.data.userInfoForm.nickName, icon: this.data.userInfo.icon }), |
| | | name: '用户昵称头像', |
| | | type: 'nickName' |
| | | } |
| | | ] |
| | | } |
| | | app.MG.identity.setAppUserInfo(userTypeInfo).then((res) => { |
| | | if (res) { |
| | | wx.showToast({ |
| | | title: "修改成功", |
| | | icon: 'success', |
| | | duration: 1000, |
| | | }) |
| | | this.getUserInfo() |
| | | this.setData({ |
| | | userInfoBox: false, |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | } else if (this.data.editType == 'phone') { |
| | | let query = { |
| | | phoneNumber: this.data.userInfoForm.phone, |
| | | phoneCaptcha: this.data.userInfoForm.code |
| | |
| | | <view class="itemList"> |
| | | <view class="label">头像</view> |
| | | <view class="contentImg"> |
| | | <t-avatar image="{{defaultAvatarUrl}}" class="user-center-card__header__avatar" /> |
| | | <t-avatar image="{{userInfo.icon}}" class="user-center-card__header__avatar" /> |
| | | </view> |
| | | <view class="iconEdit" data-info="{{'icon'}}" bindtap="editIconInfo"> |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> |
| | | </view> |
| | | </view> |
| | | <view class="itemList"> |
| | | <view class="label">用户名</view> |
| | | <view class="content">{{userInfo.fullName || '微信用户'}}</view> |
| | | <view class="content" data-info="{{'nickName'}}" bindtap="editUserInfo">{{userInfo.nickName || '微信用户'}}</view> |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> |
| | | </view> |
| | | <view class="itemList"> |
| | |
| | | <t-popup visible="{{userInfoBox}}" bind:visible-change="onVisibleChange" placement="bottom"> |
| | | <view class="block"> |
| | | <view class="body"> |
| | | <view class="from-item" wx:if="{{editType == 'nickName'}}"> |
| | | <view class="label"> 昵称: </view> |
| | | <view class="item-content"> |
| | | <view class="inputBox1"> |
| | | <t-input placeholder="输入用户名" borderless value="{{userInfoForm.nickName}}" bindchange="onNameInput" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="from-item" wx:if="{{editType == 'phone'}}"> |
| | | <view class="label"> 手机号: </view> |
| | | <view class="item-content"> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="from-item" wx:if="{{editType !== 'nickName'}}"> |
| | | <view class="label"> 图形验证码: </view> |
| | | <view class="item-content"> |
| | | <view class="inputBox"> |
| | |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .iconEdit { |
| | | padding: 40rpx 0; |
| | | } |
| | | |
| | | .content { |
| | | flex: 1; |
| | | color: #5C5C5C; |
| | |
| | | } |
| | | |
| | | .block .body .from-item .label { |
| | | width: 170rpx; |
| | | width: 200rpx; |
| | | height: 72rpx; |
| | | line-height: 72rpx; |
| | | font-size: 28rpx; |
| | | font-size: 32rpx; |
| | | } |
| | | |
| | | .block .body .from-item .item-content { |
| | |
| | | } |
| | | |
| | | .inputBox1 { |
| | | width: 540rox; |
| | | height: 72rpx; |
| | | border: 2rpx solid #D9D9D9; |
| | | flex: 1; |
| | | } |
| | | |
| | | .inputBox1 .t-input { |
| | | width: 440rpx !important; |
| | | } |
| | | |
| | | .block .body .inputBox { |
| | | width: 280rpx; |
| | | width: 250rpx; |
| | | height: 72rpx; |
| | | border: 2rpx solid #D9D9D9; |
| | | } |
| | |
| | | |
| | | .imgCode { |
| | | height: 72rpx; |
| | | width: 200rpx; |
| | | width: 190rpx; |
| | | } |
| | | |
| | | .code { |
| | | width: 200rpx; |
| | | width: 190rpx; |
| | | height: 72rpx; |
| | | margin-left: 20rpx; |
| | | } |
| | | |
| | | .btn { |
| | | width: 200rpx; |
| | | width: 190rpx; |
| | | height: 72rpx; |
| | | padding: 0 10rpx !important; |
| | | background: #ff6c00; |
| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | isMore: null, |
| | | higherList: [], |
| | | vocationalList: [], |
| | | teacherList: [], |
| | |
| | | value: '', |
| | | BarHeight: '', |
| | | navBarHeight: '', |
| | | |
| | | start: 1, |
| | | tabValue: '' |
| | | }, |
| | | |
| | | /** |
| | |
| | | barHeight: systInfo.statusBarHeight, |
| | | }) |
| | | |
| | | let event = |
| | | { |
| | | detail: { value: "0" } |
| | | } |
| | | |
| | | this.onTabsChange(event) |
| | | |
| | | |
| | | |
| | |
| | | |
| | | }, |
| | | onTabsChange(event) { |
| | | console.log(`Change tab, tab-panel value is ${event.detail.value}.`); |
| | | |
| | | const value = event.detail.value |
| | | |
| | | if (value === '0') { |
| | | console.log(value); |
| | | this.setData({ |
| | | tabValue: value |
| | | }) |
| | | } else if (value === '1') { |
| | | console.log(value); |
| | | this.setData({ |
| | | tabValue: value |
| | | }) |
| | | } else if (value === '2') { |
| | | console.log(value); |
| | | this.setData({ |
| | | tabValue: value |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | onTabsClick(event) { |
| | | console.log(`Click tab, tab-panel value is ${event.detail.value}.`); |
| | | }, |
| | | |
| | | //高等教育 |
| | | higherGet(keyword) { |
| | | let searchObj = { |
| | |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: '999' |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | |
| | | }) |
| | | console.log(this.data.higherList, '5555'); |
| | | }) |
| | | |
| | | wx.stopPullDownRefresh() |
| | | |
| | | }, |
| | | |
| | |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: '999' |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | |
| | | }) |
| | | |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | // 职业教育 |
| | | teacherGet(keyword) { |
| | |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: '999' |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | |
| | | }) |
| | | |
| | | }) |
| | | |
| | | wx.stopPullDownRefresh() |
| | | |
| | | }, |
| | | downloadData(event) { |
| | |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | onReachBottom(e) { |
| | | if (this.data.tabValue == 0) { |
| | | console.log(0); |
| | | if (this.data.higherList.length < this.data.higherTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.higherGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | |
| | | } else if (this.data.tabValue == 1) { |
| | | |
| | | if (this.data.teacherList.length < this.data.teacherTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.teacherGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | console.log(2); |
| | | } else if (this.data.tabValue == 2) { |
| | | |
| | | if (this.data.vocationalList.length < this.data.vocationalTotal && this.data.vocationalList.length > 9) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.vocationalGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | console.log(2); |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | onPullDownRefresh() { |
| | | |
| | | |
| | | this.setData({ |
| | | start: 1 |
| | | }) |
| | | this.vocationalGet() |
| | | this.higherGet() |
| | | this.teacherGet() |
| | | |
| | | }, |
| | | |
| | | }) |
| | |
| | | "t-tabs": "tdesign-miniprogram/tabs/tabs", |
| | | "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", |
| | | "t-search": "tdesign-miniprogram/search/search", |
| | | "t-icon": "tdesign-miniprogram/icon/icon" |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-image": "tdesign-miniprogram/image/image" |
| | | }, |
| | | "navigationStyle": "custom" |
| | | "navigationStyle": "custom", |
| | | "enablePullDownRefresh": true, |
| | | "onReachBottomDistance": 200, |
| | | "backgroundTextStyle": "dark" |
| | | } |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | </t-tab-panel> |
| | | <t-tab-panel label="职业教育({{vocationalTotal}})" value="1"> |
| | | <view class="outsideHigherBox"> |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | |
| | | </t-tab-panel> |
| | | <t-tab-panel label="教师教育({{teacherTotal}})" value="2"> |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | </t-tab-panel> |
| | | |
| | | </t-tabs> |
| | |
| | | .t-tabs__track { |
| | | background-color: #FF6C00 !important; |
| | | } |
| | | |
| | | .bottom-box { |
| | | display: flex; |
| | | justify-content: center; |
| | | color: #999; |
| | | height: 80rpx; |
| | | font-size: 28rpx; |
| | | --td-loading-color: #ff6c00 |
| | | } |
| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | keynoteDisabled: true, |
| | | value: '', |
| | | keyword: '', |
| | | nameSort: null, |
| | |
| | | price: 'jsek_teacherEducation', |
| | | label: '教师教育', |
| | | }, |
| | | |
| | | ], |
| | | |
| | | }, |
| | | multipleSelect: { |
| | | value: [], |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | // 获取屏幕高度 |
| | | wx.getSystemInfo({ |
| | | success: function (res) { |
| | | // this.setData({ |
| | | // windowHeight: res.windowHeight |
| | | // }) |
| | | |
| | | // 获取节点的类名 |
| | | var query = wx.createSelectorQuery(); |
| | | query.select('.assembleContent').boundingClientRect(); |
| | | query.exec(function (res) { |
| | | |
| | | // console.log(res, 'res'); |
| | | let node = res[0]; |
| | | node.setStyle({ |
| | | backgroundColor: '#0256b9', |
| | | }) |
| | | // // 修改节点样式 |
| | | // if (node) { |
| | | // node.setStyle({ |
| | | // backgroundColor: 'red', |
| | | // color: 'white' |
| | | // }); |
| | | // } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // console.log(this.data.filteredItems, 88888); |
| | | const systInfo = wx.getSystemInfoSync(); |
| | |
| | | |
| | | if (this.data.filteredItems = []) { |
| | | console.log(11111); |
| | | singleSelectOptions.push({ |
| | | label: '禁用选项', |
| | | value: 'disabled', |
| | | disabled: true, |
| | | }); |
| | | } |
| | | |
| | | // singleSelectOptions.push({ |
| | | // label: '禁用选项', |
| | | // label: '暂无数据', |
| | | // value: 'disabled', |
| | | // disabled: true, |
| | | // }); |
| | | } else { |
| | | console.log(7889); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 更新数据 |
| | |
| | | const newValue = e.detail.value; |
| | | const selectedOption = this.data.product.options.find(option => option.value === newValue); |
| | | const newPrice = selectedOption ? selectedOption.price : null; |
| | | console.log(newValue, 'newValue'); |
| | | console.log(newPrice, 'newPrice'); |
| | | if (newPrice) { |
| | | this.setData({ |
| | | keynoteDisabled: false |
| | | }) |
| | | |
| | | } else { |
| | | this.setData({ |
| | | keynoteDisabled: true |
| | | }) |
| | | } |
| | | this.setData({ |
| | | 'product.value': newValue, |
| | | 'product.price': newPrice, // 将选中的 price 值保存在数据中 |
| | |
| | | }); |
| | | }, |
| | | handleConfirm(event) { |
| | | |
| | | const { value } = event.detail; |
| | | // 确认操作的处理逻辑 |
| | | |
| | |
| | | this.data.nameSort = 'Desc' |
| | | // console.log('sssssss'); |
| | | this.bookExhibitionGet() |
| | | |
| | | |
| | | }, |
| | | onBookExhibitionDetails: function (event) { |
| | | const item = event.currentTarget.dataset.item; |
| | |
| | | "t-dropdown-menu": "tdesign-miniprogram/dropdown-menu/dropdown-menu", |
| | | "t-dropdown-item": "tdesign-miniprogram/dropdown-item/dropdown-item", |
| | | "t-toast": "tdesign-miniprogram/toast/toast", |
| | | "t-icon": "tdesign-miniprogram/icon/icon" |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | }, |
| | | "onReachBottomDistance": 200, |
| | | "navigationStyle": "custom", |
| | |
| | | |
| | | <!-- 弹出框 禁止 --> |
| | | <t-toast id="t-toast" /> |
| | | |
| | | <view class="bigTitleBox"> |
| | | <view style="width: 100%; height: {{barHeight}}px; "></view> |
| | | <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> |
| | | <view> |
| | |
| | | <t-search model:value="{{value}}" placeholder="请输入书展名称" bind:submit="onSearchSubmit" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view> |
| | | |
| | | </view> |
| | | |
| | | <view class="outsideMenuBox"> |
| | | <view class="menuBox"> |
| | | <t-dropdown-menu class="classification"> |
| | | |
| | | <t-dropdown-item options="{{product.options}}" value="{{product.value}}" bindchange="onChange" /> |
| | | <t-dropdown-item label="重点项目" options="{{multipleSelect.options}}" value="{{multipleSelect.value}}" bindchange="handleMultipleSelect" multiple bind:confirm="handleConfirm" bind:reset="handleReset" /> |
| | | <t-dropdown-item disabled="{{keynoteDisabled}}" label=" 重点项目" options="{{multipleSelect.options}}" value="{{multipleSelect.value}}" bindchange="handleMultipleSelect" multiple bind:confirm="handleConfirm" bind:reset="handleReset" /> |
| | | |
| | | |
| | | |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view class="assembleContent"> |
| | | <view class="titleBox"> |
| | |
| | | |
| | | </view> |
| | | <view class="outside"> |
| | | <view wx:if="{{bookExhibitionList.length }}"> |
| | | <view wx:if="{{!bookExhibitionList.length }}" class="noData"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | |
| | |
| | | |
| | | .assembleContent { |
| | | background-color: #F2F3F8; |
| | | |
| | | min-height: 90vh; |
| | | } |
| | | |
| | | .t-dropdown-menu:after, |
| | | .t-dropdown-menu::after { |
| | | height: 0px; |
| | |
| | | background-color: var(--td-component-border, var(--td-gray-color-4, #fff)) !important; |
| | | |
| | | } |
| | | |
| | | .noData { |
| | | /* display: flex; |
| | | justify-content: center; */ |
| | | margin: 0 auto; |
| | | margin-top: 100rpx; |
| | | } |
| | |
| | | checkedList: [], |
| | | selectedCount: 0, |
| | | totalPrice: 0.00, |
| | | type: '' |
| | | type: '', |
| | | start: 1, |
| | | totalSize: '', |
| | | isMore: null, |
| | | }, |
| | | |
| | | onLoad(options) { |
| | | |
| | | wx.setNavigationBarTitle({ |
| | | title: '购物车' |
| | | }); |
| | |
| | | shoppingCartGet() { |
| | | let query = { |
| | | start: 0, |
| | | size: 999, |
| | | size: this.data.start * 4, |
| | | filterList: [], |
| | | searchList: [] |
| | | }; |
| | | app.MG.store.getShoppingCartProductList(query).then(res => { |
| | | console.log(res, 'res'); |
| | | |
| | | this.setData({ |
| | | totalSize: res.totalSize |
| | | }) |
| | | |
| | | res.datas.forEach(item => { |
| | | item.imgUrl = getPublicImage(item.productMonWithLinkDto.product.icon, '', '160'); |
| | | console.log(item); |
| | | console.log(item.saleMethod.type, 'item.saleMethod.type') |
| | | |
| | | this.setData({ |
| | | type: item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product' |
| | | }) |
| | |
| | | shoppingCartData: res.datas |
| | | }); |
| | | }); |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | |
| | | bottomChange(e) { |
| | |
| | | wx.navigateTo({ |
| | | url: '/pages/testLogin/index' |
| | | }); |
| | | }, |
| | | //触底函数 |
| | | onReachBottom() { |
| | | if (this.data.shoppingCartData.length < this.data.totalSize) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.shoppingCartGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | }, |
| | | // 下拉函数 |
| | | onPullDownRefresh() { |
| | | |
| | | this.setData({ |
| | | start: 1 |
| | | }) |
| | | console.log(978); |
| | | this.shoppingCartGet() |
| | | }, |
| | | |
| | | }); |
| | |
| | | "t-cell": "tdesign-miniprogram/cell/cell", |
| | | "t-button": "tdesign-miniprogram/button/button", |
| | | "t-toast": "tdesign-miniprogram/toast/toast", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | } |
| | | "t-empty": "tdesign-miniprogram/empty/empty", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-image": "tdesign-miniprogram/image/image" |
| | | }, |
| | | "enablePullDownRefresh": true, |
| | | "onReachBottomDistance": 200, |
| | | "backgroundTextStyle": "dark" |
| | | } |
| | |
| | | </view> |
| | | <view slot="right" class="btn delete-btn" bind:tap="onDelete" data-item="{{item}}">删除</view> |
| | | </t-swipe-cell> |
| | | |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="bottomBox"> |
| | |
| | | /* margin: 10rpx 0; */ |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | .bottom-box { |
| | | display: flex; |
| | | justify-content: center; |
| | | color: #999; |
| | | height: 80rpx; |
| | | font-size: 28rpx; |
| | | --td-loading-color: #ff6c00 |
| | | } |
| | |
| | | <view class="user-center-card__header"> |
| | | <t-avatar image="{{userInfo.icon || defaultAvatarUrl}}" class="user-center-card__header__avatar" /> |
| | | <view> |
| | | <view class="user-center-card__header__name">{{userInfo.fullName || '微信用户'}}</view> |
| | | <view class="user-center-card__header__name">{{userInfo.nickName || '微信用户'}}</view> |
| | | <view class="userTypeBox"> |
| | | <text>{{userInfo.userType}}</text> |
| | | <text class="edit" bindtap="editUserType">修改</text> |
| | |
| | | <view class="user-center-card__header"> |
| | | <t-avatar t-class="avatar" mode="aspectFill" class="user-center-card__header__avatar" image="{{userInfo.icon || defaultAvatarUrl}}" /> |
| | | <view> |
| | | <view class="user-center-card__header__name">{{userInfo.fullName || '微信用户'}}</view> |
| | | <view class="user-center-card__header__name">{{userInfo.nickName || '微信用户'}}</view> |
| | | <view class="userTypeBox"> |
| | | <text>{{userInfo.userType}}</text> |
| | | <text bindtap="editUserType">修改</text> |
| | |
| | | type = '-' |
| | | } |
| | | let defaultUser = {}; |
| | | let nickNameData = res.infoList.find((item) => item.type == 'nickName') |
| | | let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') |
| | | let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') |
| | | let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword') |
| | |
| | | if (teacherRole && teacherInfos) { |
| | | defaultUser = { |
| | | ...teacherInfos, |
| | | fullName: teacherInfos.fullName, |
| | | icon: teacherInfos.icon, |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : teacherInfos.name, |
| | | icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo ? WeChatInfo.icon : '', |
| | | userId: res.userId, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id, |
| | |
| | | } else if (WeChatInfo) { |
| | | defaultUser = { |
| | | ...WeChatInfo, |
| | | fullName: WeChatInfo.name, |
| | | icon: WeChatInfo.icon, |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, |
| | | icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | userId: res.userId, |
| | | userType: type |
| | | } |
| | |
| | | }); |
| | | } else if (secretData) { |
| | | defaultUser = { |
| | | fullName: secretData.credential, |
| | | icon: "", |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : secretData.credential, |
| | | icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : "", |
| | | userId: res.userId, |
| | | userType: type |
| | | } |
| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | isMore: null, |
| | | tabPanelstyle: 'display:flex;justify-content:center;align-items:center;', |
| | | navBarHeight: '', |
| | | barHeight: '', |
| | |
| | | biblioClassificationData: [],//书展 |
| | | biblioClassificationTotal: 0, |
| | | bookFairData: [],//书目 |
| | | bookFairTotal: 0 |
| | | bookFairTotal: 0, |
| | | pageCount: { |
| | | page: 1, |
| | | total: 0, |
| | | }, |
| | | tabValue: '' |
| | | }, |
| | | |
| | | /** |
| | |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | this.setData({ |
| | | |
| | | navBarHeight: navBarHeight, |
| | | barHeight: systInfo.statusBarHeight, |
| | | searchVal: options.searchVal |
| | |
| | | |
| | | this.retrievalPageGet() |
| | | this.bibliographyGet() |
| | | let event = { |
| | | detail: { |
| | | |
| | | value: "0" |
| | | } |
| | | } |
| | | this.onTabsChange(event) |
| | | }, |
| | | |
| | | /** |
| | |
| | | this.retrievalPageGet() |
| | | this.bibliographyGet() |
| | | }, |
| | | |
| | | |
| | | //标签的切换 |
| | | onTabsChange(event) { |
| | | console.log(`Change tab, tab-panel searchVal is ${event.detail.searchVal}.`); |
| | | const value = event.detail.value |
| | | if (value === '0') { |
| | | this.setData({ |
| | | tabValue: value, |
| | | isMore: false |
| | | }) |
| | | } else if (value === '1') { |
| | | console.log(value, 'tab'); |
| | | this.setData({ |
| | | tabValue: value, |
| | | isMore: false |
| | | }) |
| | | } else if (value === '2') { |
| | | this.setData({ |
| | | tabValue: value, |
| | | isMore: false |
| | | }) |
| | | } else if (value === '3') { |
| | | this.setData({ |
| | | tabValue: value, |
| | | isMore: false |
| | | }) |
| | | } else if (value === '4') { |
| | | this.setData({ |
| | | tabValue: value, |
| | | isMore: false |
| | | }) |
| | | } else if (value === '5') { |
| | | this.setData({ |
| | | tabValue: value, |
| | | isMore: false |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | |
| | | onTabsClick(event) { |
| | | console.log(`Click tab, tab-panel searchVal is ${event.detail.searchVal}.`); |
| | | }, |
| | | |
| | | |
| | | |
| | | retrievalPageGet() { |
| | |
| | | }, |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 999 |
| | | Size: this.data.pageCount.page * 9, |
| | | }, |
| | | SortQuery: [ |
| | | { |
| | |
| | | }, |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 999 |
| | | Size: this.data.pageCount.page * 4 |
| | | }, |
| | | SortQuery: [ |
| | | { |
| | |
| | | }, |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 999 |
| | | Size: this.data.pageCount.page * 9, |
| | | }, |
| | | SortQuery: [ |
| | | { |
| | |
| | | }, |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 999 |
| | | Size: this.data.pageCount.page * 6, |
| | | }, |
| | | SortQuery: [ |
| | | { |
| | |
| | | |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 999 |
| | | Size: this.data.pageCount.page * 10 |
| | | }, |
| | | SortQuery: [ |
| | | { |
| | |
| | | }) |
| | | this.setData({ |
| | | bookData: datas1, |
| | | bookTotal: data1.totalCount |
| | | bookTotal: data1.totalCount, |
| | | |
| | | }) |
| | | |
| | | |
| | |
| | | datas5.forEach((items) => { |
| | | items.subtitleName = items.subtitle + items.name |
| | | }) |
| | | console.log(datas5, 'sadasd'); |
| | | // console.log(datas5, 'sadasd'); |
| | | this.setData({ |
| | | biblioClassificationData: datas5, |
| | | biblioClassificationTotal: data5.totalCount |
| | |
| | | |
| | | |
| | | }) |
| | | |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | bibliographyGet() { |
| | | let bibliographyObj = {} |
| | |
| | | queryType: '*', |
| | | paging: { |
| | | start: 0, |
| | | size: 999 |
| | | size: this.data.pageCount.page * 9, |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | |
| | | }, |
| | | SysType: "CmsItem" |
| | | }).then(res => { |
| | | // console.log(res); |
| | | |
| | | this.setData({ |
| | | bookFairData: res.datas, |
| | | bookFairTotal: res.total |
| | | }) |
| | | |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | downloadData(event) { |
| | | console.log(111); |
| | |
| | | const item = e.currentTarget.dataset.item |
| | | wx.navigateTo({ |
| | | url: '/packageBookService/pages/bookServices/detail/index?id=' + item.id + '&name=' + item.name |
| | | |
| | | |
| | | }) |
| | | }, |
| | | onBookExhibitionDetails(e) { |
| | |
| | | url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // 假设跳转到详情页面,并传递了id参数 |
| | | }); |
| | | }, |
| | | //触底函数 |
| | | onReachBottom() { |
| | | console.log("上拉加载...."); |
| | | }, |
| | | |
| | | //上拉函数 |
| | | onPullDownRefresh() { |
| | | console.log("下拉刷新..."); |
| | | }, |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom(e) { |
| | | if (this.data.tabValue == 0) { |
| | | console.log(0); |
| | | if (this.data.bookData.length < this.data.bookTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | |
| | | } else if (this.data.tabValue == 1) { |
| | | |
| | | if (this.data.courseData.length < this.data.courseTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | console.log(2); |
| | | } else if (this.data.tabValue == 2) { |
| | | |
| | | if (this.data.digitalTextbooksData.length < this.data.digitalTextbooksTotal && this.data.digitalTextbooksData.length > 9) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | console.log(2); |
| | | } else if (this.data.tabValue == 3) { |
| | | if (this.data.seminarData.length < this.data.seminarTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | } |
| | | console.log(3); |
| | | } else if (this.data.tabValue == 4) { |
| | | if (this.data.bookFairData.length < this.data.bookFairTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.bibliographyGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | } |
| | | console.log(4); |
| | | } else if (this.data.tabValue == 5) { |
| | | if (this.data.biblioClassificationData.length < this.data.biblioClassificationTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | |
| | | // 下拉函数 |
| | | onPullDownRefresh() { |
| | | |
| | | if (this.data.tabValue == 4) { |
| | | this.setData({ |
| | | "pageCount.page": 1 |
| | | }) |
| | | this.bibliographyGet() |
| | | } else { |
| | | this.setData({ |
| | | "pageCount.page": 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | }) |
| | |
| | | "t-search": "tdesign-miniprogram/search/search", |
| | | "t-tabs": "tdesign-miniprogram/tabs/tabs", |
| | | "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | "t-empty": "tdesign-miniprogram/empty/empty", |
| | | "t-toast": "tdesign-miniprogram/toast/toast", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-image": "tdesign-miniprogram/image/image" |
| | | }, |
| | | "navigationStyle": "custom", |
| | | "enablePullDownRefresh": true |
| | | "enablePullDownRefresh": true, |
| | | "onReachBottomDistance": 200, |
| | | "backgroundTextStyle": "dark" |
| | | } |
| | |
| | | |
| | | <view class="example-search"> |
| | | <t-search bind:submit="onSearchSubmit" class="searchBox" model:value="{{searchVal}}" placeholder="请输入关键词/书名/ISBN/作者" /> |
| | | |
| | | <view class="cancellation" bind:tap="onCancellation">取消</view> |
| | | </view> |
| | | |
| | |
| | | </view> |
| | | |
| | | |
| | | |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | |
| | | </t-tab-panel> |
| | | <t-tab-panel label="课程({{courseTotal}})" value="1"> |
| | |
| | | <view wx:if="{{courseData.length <= 0}}" class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | <view wx:if="{{courseData.length>0}}"> |
| | | <view> |
| | | <view wx:for="{{courseData}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}" class="listItemBox"> |
| | | <view class="listItem flex"> |
| | | <view class="specialSubject-img"> |
| | |
| | | |
| | | </view> |
| | | |
| | | |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | </t-tab-panel> |
| | | <t-tab-panel label="数字教材({{digitalTextbooksTotal}})" value="2"> |
| | | |
| | |
| | | </view> |
| | | |
| | | |
| | | |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | |
| | | |
| | | |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | |
| | | </t-tab-panel> |
| | | <t-tab-panel label="书目({{bookFairTotal}})" value="4"> |
| | |
| | | |
| | | |
| | | |
| | | |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | |
| | | |
| | | |
| | |
| | | |
| | | </view> |
| | | |
| | | |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | |
| | | </t-tab-panel> |
| | | </t-tabs> |
| | |
| | | font-weight: 400; |
| | | font-size: 22rpx; |
| | | color: #333333; |
| | | word-break: break-all; |
| | | display: -webkit-box; |
| | | -webkit-line-clamp: 1; |
| | | -webkit-box-orient: vertical; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | |
| | |
| | | border-radius: 5px; |
| | | overflow: hidden; |
| | | box-shadow: 0px 0px 20rpx 2px #f1f1f1; |
| | | min-height: 170rpx; |
| | | } |
| | | |
| | | |
| | |
| | | .body-info { |
| | | padding: 20rpx; |
| | | font-size: 28rpx; |
| | | min-height: 110rpx; |
| | | } |
| | | |
| | | .body-info .name { |
| | |
| | | margin: 0 auto; |
| | | margin-top: 250rpx; |
| | | } |
| | | |
| | | .bottom-box { |
| | | display: flex; |
| | | justify-content: center; |
| | | color: #999; |
| | | height: 80rpx; |
| | | font-size: 28rpx; |
| | | --td-loading-color: #ff6c00 |
| | | } |
| | | |
| | | .loading-box { |
| | | width: 100%; |
| | | height: calc(100vh - 500rpx); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | --td-loading-color: #ff6c00; |
| | | } |