Merge refs/remotes/origin/master into refs/heads/master
| | |
| | | }, |
| | | "[javascript]": { |
| | | "editor.formatOnSave": true, |
| | | "editor.defaultFormatter": "vscode.typescript-language-features" |
| | | "editor.defaultFormatter": "HookyQR.beautify" |
| | | }, |
| | | "[json]": { |
| | | "editor.defaultFormatter": "vscode.json-language-features" |
| | |
| | | }, |
| | | "editor.tabSize": 2, |
| | | "[wxml]": { |
| | | "editor.defaultFormatter": "esbenp.prettier-vscode" |
| | | "editor.defaultFormatter": "wechat.miniprogram.wxml-language-features" |
| | | }, |
| | | "[css]": { |
| | | "editor.defaultFormatter": "HookyQR.beautify" |
| | |
| | | "pages/downloads/index", |
| | | "pages/activateProduct/index", |
| | | "pages/sampleBooks/index", |
| | | "pages/personalCenter/publishBooks/index", |
| | | "pages/publishBooks/index", |
| | | "pages/feedBack/index", |
| | | "pages/aboutUs/index", |
| | | "pages/userSetting/index" |
| | |
| | | // export const requestCtx = "http://182.92.203.7:3001"; // 请求地址 |
| | | // export const appId = 27; |
| | | // export const requestCtx = "http://jsysf.bnuic.com"; // 请求地址 |
| | | export const requestCtx = "https://jsek.bnuic.com" // 请求地址 |
| | | export const appId = 3; |
| | | export const requestCtx = "http://182.92.203.7:3001"; // 请求地址 |
| | | export const appId = 27; |
| | | // export const requestCtx = "https://jsek.bnuic.com" // 请求地址 |
| | | // export const appId = 3; |
| | | // export const epubUrl = "http://182.92.203.7:3007/epubReadMobile/"; |
| | | export const epubUrl = "http://jsysf.bnuic.com/epubReadMobile/#/"; |
| | | export const requestTimeOut = 300000; // 请求超时时间 |
| | |
| | | import { setSessionGuid } from "./userAction" |
| | | import { |
| | | setSessionGuid |
| | | } from "./userAction" |
| | | |
| | | |
| | | export const loginInfo = (app, callback) => { |
| | |
| | | } |
| | | url += "?" + option |
| | | } |
| | | debugger |
| | | console.log(url); |
| | | wx.navigateTo({ |
| | | url: "/pages/bindInfo/index?page=" + encodeURIComponent(url), |
| | |
| | | let defaultUser = {}; |
| | | let WeChatInfo = res.infoList.find((item) => item.type === "WeChat"); |
| | | let phoneNumber = res.secretList.find(i => i.type == 'MobilePhone') |
| | | |
| | | if (WeChatInfo) { |
| | | defaultUser = { |
| | | nickName: WeChatInfo.name, |
| | | avatarUrl: WeChatInfo.icon, |
| | | weChatId: WeChatInfo.id |
| | | weChatId: WeChatInfo.id, |
| | | userId: res.userId, |
| | | } |
| | | } |
| | | if (phoneNumber) { |
| | |
| | | import request from "../../../request/index"; |
| | | import { tokenKey } from "../../config"; |
| | | import { |
| | | tokenKey |
| | | } from "../../config"; |
| | | import toolClass from "../../toolClass"; |
| | | let token = wx.getStorageSync(tokenKey) ? wx.getStorageSync(tokenKey) : '' |
| | | let token = wx.getStorageSync(tokenKey) ? wx.getStorageSync(tokenKey) : ''; |
| | | const ugcApi = { |
| | | // 获取商品点赞Topic |
| | | getProductLikesTopic(data) { |
| | | return request({ |
| | | url: token |
| | | ? "/ugc/api/ApiAppUserGetProductLikesTopic" |
| | | : "/ugc/api/ApiGetProductLikesTopic", |
| | | url: token ? |
| | | "/ugc/api/ApiAppUserGetProductLikesTopic" : "/ugc/api/ApiGetProductLikesTopic", |
| | | method: "post", |
| | | data, |
| | | }); |
| | |
| | | // 获取商品评论Topic |
| | | getProductCommentTopic(data) { |
| | | return request({ |
| | | url: token |
| | | ? "/ugc/api/ApiAppUserGetProductCommentTopic" |
| | | : "/ugc/api/ApiGetProductCommentTopic", |
| | | url: token ? |
| | | "/ugc/api/ApiAppUserGetProductCommentTopic" : "/ugc/api/ApiGetProductCommentTopic", |
| | | method: "post", |
| | | data, |
| | | }); |
| | |
| | | // 获取MessageList |
| | | getTopicMessageList(data) { |
| | | return request({ |
| | | url: token |
| | | ? "/ugc/api/ApiAppUserGetTopicMessageList" |
| | | : "/ugc/api/ApiGetTopicMessageList", |
| | | url: token ? |
| | | "/ugc/api/ApiAppUserGetTopicMessageList" : "/ugc/api/ApiGetTopicMessageList", |
| | | method: "post", |
| | | data, |
| | | }); |
| | |
| | | loading: false, |
| | | shoppingList: [], |
| | | shoppingCartGetId: [], |
| | | methodId: [] |
| | | methodId: [], |
| | | paymentPage: false, |
| | | superior: false |
| | | }, |
| | | |
| | | /** |
| | |
| | | this.getShoppingCartProductGet() |
| | | this.getBookInfo(options.bookId) |
| | | }, |
| | | batchPurchase() { |
| | | let saleMethodIds = [] |
| | | let requests = [] |
| | | const child = this.selectComponent('#tree') |
| | | |
| | | console.log(child.data.superiorPurchaseSaleMethodId, 'superiorPurchaseSaleMethodId'); |
| | | const item = child.data.superiorPurchaseSaleMethodId |
| | | if (item) { |
| | | item.forEach(item => { |
| | | if (item.saleMethod != 0) { |
| | | saleMethodIds = item.saleMethod[0].Id |
| | | requests.push({ saleMethodIds, count: 1 }) |
| | | } |
| | | }) |
| | | console.log(requests, 'saleMethodId'); |
| | | let query = { |
| | | remarks: '云学习', |
| | | requests, |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | // 发起订单初始化请求并等待结果 |
| | | const res = app.MG.store.initOrder(query) |
| | | let bookOrdersId = res.orderNumber |
| | | // 检查订单号是否存在 |
| | | if (bookOrdersId) { |
| | | const url = '/pages/cart/paymentPage/index?orderNumber=' + bookOrdersId |
| | | wx.navigateTo({ |
| | | url |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // console.log(child.data.sonPurchaseSaleMethodId, 'child.data.'); |
| | | // this.data.methodId.push(child.data.sonPurchaseSaleMethodId) |
| | | |
| | | |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | |
| | | const child = this.selectComponent('#tree') |
| | | child.checkAll() |
| | | }, |
| | | //购买按钮 |
| | | batchPurchase() { |
| | | let saleMethodIds = [] |
| | | let requests = [] |
| | | let item = [] |
| | | const child = this.selectComponent('#tree') |
| | | |
| | | console.log(child.data.superiorPurchaseSaleMethodId, 'superiorPurchaseSaleMethodId'); |
| | | console.log(child.data.sonPurchaseSaleMethodId, 'child.data'); |
| | | item = child.data.superiorPurchaseSaleMethodId |
| | | const sonItem = child.data.sonPurchaseSaleMethodId |
| | | |
| | | if (item) { |
| | | console.log(item, 'sadsdasd'); |
| | | // 拿到id |
| | | item.forEach(items => { |
| | | if (items.saleMethod != 0) { |
| | | saleMethodIds.push(items.saleMethod[0].Id) |
| | | } |
| | | }) |
| | | console.log(saleMethodIds, 'saleMethodIds'); |
| | | |
| | | app.MG.store.initOrder({ |
| | | requests: saleMethodIds.map(id => ({ |
| | | saleMethodId: id, |
| | | count: 1, |
| | | })), |
| | | }).then(res => { |
| | | if (res) { |
| | | wx.navigateTo({ |
| | | url: '/pages/cart/paymentPage/index?orderNumber=' + res.orderNumber, |
| | | }) |
| | | this.setData({ |
| | | superior: true |
| | | }) |
| | | |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | if (item.length == 0 && sonItem) { |
| | | |
| | | |
| | | app.MG.store.initOrder({ |
| | | requests: sonItem.map(id => ({ |
| | | saleMethodId: id, |
| | | count: 1, |
| | | })), |
| | | }).then(res => { |
| | | if (res) { |
| | | wx.navigateTo({ |
| | | url: '/pages/cart/paymentPage/index?orderNumber=' + res.orderNumber, |
| | | }) |
| | | this.setData({ |
| | | paymentPage: true |
| | | }) |
| | | |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | }) |
| | |
| | | <!-- 内容 --> |
| | | |
| | | <view class="buy-resource" wx:if="{{!loading}}"> |
| | | <tree id="tree" treeList="{{learn}}" tab="{{'jsek_cloudLearning'}}" isShowCheck="{{true}}" openIds="{{openLearnids}}" /> |
| | | <tree id="tree" paymentPage="{{paymentPage}}" superior="{{superior}}" treeList="{{learn}}" tab="{{'jsek_cloudLearning'}}" isShowCheck="{{true}}" openIds="{{openLearnids}}" /> |
| | | </view> |
| | | |
| | | <view class="noData" wx:if="{{loading}}"> |
| | |
| | | isShowCheck: { |
| | | type: Boolean, |
| | | value: false, |
| | | }, |
| | | paymentPage: { |
| | | type: Boolean, |
| | | value: false, |
| | | }, |
| | | superior: { |
| | | type: Boolean, |
| | | value: false, |
| | | } |
| | | }, |
| | | data: { |
| | |
| | | console.log('准备'); |
| | | }, |
| | | onShow() { |
| | | debugger |
| | | this.setData({ |
| | | sonPurchaseSaleMethodId: '' |
| | | }) |
| | | }, |
| | | onLoad() { |
| | | this.setData({ |
| | | sonPurchaseSaleMethodId: '' |
| | | }) |
| | | }, |
| | | observers: { |
| | | 'openIds': function (newValue) { |
| | |
| | | treeList: updatedTreeList // 更新 treeList 数据 |
| | | }); |
| | | |
| | | if (!list.checked) { |
| | | if (this.properties.superior) { |
| | | console.log(852); |
| | | |
| | | this.properties.superior = false |
| | | this.setData({ |
| | | superiorPurchaseSaleMethodId: [] |
| | | }) |
| | | } |
| | | if (!this.properties.superior) { |
| | | this.setData({ |
| | | superiorPurchaseSaleMethodId: list |
| | | }) |
| | | console.log(this.data.superiorPurchaseSaleMethodId, 'superiorPurchaseSaleMethodId'); |
| | | } |
| | | } |
| | | |
| | | // console.log(this.data.superiorPurchaseSaleMethodId, 'superiorPurchaseSaleMethodId'); |
| | | list.forEach(items => { |
| | | console.log(items.checked, 'itesasd'); |
| | | if (!items.checked) { |
| | |
| | | }) |
| | | } |
| | | }) |
| | | this.onCloudShoppingCart() |
| | | // this.onCloudShoppingCart() |
| | | }, |
| | | // 子项勾选 |
| | | checkResource(e) { |
| | | const citem = e.currentTarget.dataset.item |
| | | // console.log(e); |
| | | |
| | | |
| | | console.log(citem, '5648'); |
| | | const updataList = this.checkResoucrceInfo(this.properties.treeList, citem.id) |
| | | console.log(updataList); |
| | | console.log(citem.checked, 'citem.checked'); |
| | | if (!citem.checked) { |
| | | //选中的时候添加id |
| | | let sonPurchaseSaleMethodId = this.data.sonPurchaseSaleMethodId || [] |
| | | console.log(this.properties.paymentPage, 'this.properties.paymentPage'); |
| | | if (this.properties.paymentPage) { |
| | | console.log(789987); |
| | | sonPurchaseSaleMethodId = [] |
| | | this.properties.paymentPage = false |
| | | } |
| | | if (!this.properties.paymentPage) { |
| | | sonPurchaseSaleMethodId.push(citem.saleMethod[0].Id) |
| | | } |
| | | |
| | | |
| | | this.setData({ |
| | | sonPurchaseSaleMethodId: sonPurchaseSaleMethodId |
| | | }) |
| | | console.log(this.data.sonPurchaseSaleMethodId); |
| | | } else { |
| | | // 取消选中的时候删除id |
| | | |
| | | } |
| | | |
| | | this.setData({ |
| | | treeList: updataList, |
| | | sonPurchaseSaleMethodId: citem.saleMethod[0].Id |
| | | }) |
| | | |
| | | }) |
| | | }, |
| | | // 加入购物车 |
| | | async onCloudShoppingCart() { |
| | |
| | | shoppingList: [], |
| | | loading: false, |
| | | isShowTeachDownload: false, // 提示PC下载弹窗状态 |
| | | confirmBtn: { content: '我知道了', variant: 'base' }, |
| | | confirmBtn: { |
| | | content: '我知道了', |
| | | variant: 'base' |
| | | }, |
| | | mockData: { |
| | | id: 0, // 销售id |
| | | price: 0, // 售价 |
| | |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | if (wx.getStorageSync("paperBookList")) { |
| | | this.setData({ |
| | | paperBookList: wx.getStorageSync("paperBookList"), |
| | |
| | | num: this.data.paperBookList.length + this.data.electronicBookList.length |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | |
| | | }, |
| | | // 跳转网店 |
| | | goShop(e) { |
| | | const { link } = e.currentTarget.dataset; |
| | | const { |
| | | link |
| | | } = e.currentTarget.dataset; |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/webpage/index?url=${link}`, |
| | | }) |
| | |
| | | 'buyResourceData.refCode': checkData.refCode |
| | | }) |
| | | } |
| | | if ((e.detail.value == 'jsek_teachingResources' && !this.data.teach.length) |
| | | || (e.detail.value == 'jsek_cloudLearning' && !this.data.learn.length) |
| | | || (e.detail.value == 'questionBank' && !this.data.test.length)) { |
| | | if ((e.detail.value == 'jsek_teachingResources' && !this.data.teach.length) || |
| | | (e.detail.value == 'jsek_cloudLearning' && !this.data.learn.length) || |
| | | (e.detail.value == 'questionBank' && !this.data.test.length)) { |
| | | this.getResourceData(checkData) |
| | | } |
| | | } else { |
| | |
| | | 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() |
| | |
| | | Toast({ |
| | | context: this, |
| | | selector: '#t-toast', |
| | | message: '已添加', |
| | | theme: 'success', |
| | | message: '该书已在购物车,请勿重复添加', |
| | | theme: 'warning', |
| | | direction: 'column', |
| | | }); |
| | | } |
| | |
| | | let bookOrdersId = '' |
| | | let query = { |
| | | remarks: '电子书', |
| | | requests: [ |
| | | { |
| | | requests: [{ |
| | | saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ? this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId, |
| | | count: 1 |
| | | } |
| | | ] |
| | | }] |
| | | } |
| | | // 发起订单初始化请求并等待结果 |
| | | const res = await app.MG.store.initOrder(query) |
| | |
| | | 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) { |
| | |
| | | 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) |
| | | ) |
| | | } |
| | | } |
| | |
| | | try { |
| | | let query = { |
| | | remarks: '组卷', |
| | | requests: [ |
| | | { |
| | | requests: [{ |
| | | saleMethodId: this.data.mockData.id, |
| | | count: 1 |
| | | } |
| | | ] |
| | | }] |
| | | } |
| | | if (this.data.flag) { |
| | | this.setData({ |
| | |
| | | } else { |
| | | // 0元直接领取 |
| | | // 确认订单 |
| | | const confirmOrderRes = await app.MG.store.confirmOrder({ orderNum: res.orderNumber }) |
| | | const confirmOrderRes = await app.MG.store.confirmOrder({ |
| | | orderNum: res.orderNumber |
| | | }) |
| | | if (confirmOrderRes) { |
| | | wx.showToast({ |
| | | icon: "success", |
| | |
| | | const id = tool.uuid(8) |
| | | const createDate = this.DateFormat(new Date().getTime(), 'yyyy-MM-dd') |
| | | const mockList = this.data.mockData.mockList |
| | | mockList.push({ id, createDate, name: `第${num + 1}套试卷`, state: '0' }) |
| | | mockList.push({ |
| | | id, |
| | | createDate, |
| | | name: `第${num + 1}套试卷`, |
| | | state: '0' |
| | | }) |
| | | this.setData({ |
| | | 'mockData.mockList': mockList |
| | | }) |
| | | // 记录购买时间,并设状态state为1,表示刚购买完成组卷 |
| | | app.MG.identity.setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | setKeyRequests: [{ |
| | | domain: 'mockData', |
| | | key: this.data.bookDetail.id + '', |
| | | value: JSON.stringify(this.data.mockData.mockList) |
| | | } |
| | | ] |
| | | }] |
| | | }) |
| | | }, |
| | | // 底部购买按钮 |
| | |
| | | if (this.data.tabValue == 'brief' && !this.data.bookBuy) { |
| | | this.buyBook() |
| | | } |
| | | else if (this.data.tabValue == 'jsek_cloudLearning') { |
| | | const tree = this.selectComponent('#tree') |
| | | tree.onCloudShoppingCart() |
| | | } else if (this.data.tabValue == 'questionBank') { |
| | | this.buyMock() |
| | | } else { |
| | | console.log(this.data.tabValue); |
| | | } |
| | | // else if (this.data.tabValue == 'jsek_cloudLearning') { |
| | | // const tree = this.selectComponent('#tree') |
| | | // tree.onCloudShoppingCart() |
| | | // } else if (this.data.tabValue == 'questionBank') { |
| | | // this.buyMock() |
| | | // } else { |
| | | // console.log(this.data.tabValue); |
| | | // } |
| | | }, |
| | | |
| | | goRead() { |
| | |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) { |
| | | } |
| | | } else if (res.cancel) {} |
| | | } |
| | | }) |
| | | } |
| | |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) { |
| | | } |
| | | } else if (res.cancel) {} |
| | | } |
| | | }) |
| | | } |
| | |
| | | const app = getApp(); |
| | | import { loginInfo } from '../../../../assets/js/login'; |
| | | import { |
| | | loginInfo |
| | | } from '../../../../assets/js/login'; |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | |
| | | bookList: [], |
| | | stairList: { |
| | | value: '', |
| | | options: [ |
| | | { |
| | | options: [{ |
| | | value: '', |
| | | label: '一级', |
| | | }, |
| | | ], |
| | | }, ], |
| | | }, |
| | | secondList: { |
| | | value: [], |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | console.log(options) |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | |
| | | Path: options.secondCode, |
| | | Type: '*', |
| | | StoreRefCode: app.config.goodsStore, |
| | | } |
| | | ], |
| | | }], |
| | | }) |
| | | } |
| | | // 获取二级分类 |
| | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | }, |
| | | onReady() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | }, |
| | | onShow() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | |
| | | 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) => { |
| | | const options = [ |
| | | { |
| | | const options = [{ |
| | | value: '', |
| | | label: '一级', |
| | | }, |
| | | ]; |
| | | }, ]; |
| | | for (let index = 0; index < res.datas.length; index++) { |
| | | const item = res.datas[index]; |
| | | options.push({ |
| | |
| | | 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) => { |
| | | for (let index = 0; index < res.datas.length; index++) { |
| | |
| | | } |
| | | const query = { |
| | | ...pathObj, |
| | | filterList: [ |
| | | { |
| | | filterList: [{ |
| | | value: 'Normal', |
| | | field: 'state', |
| | | }, |
| | | ], |
| | | }, ], |
| | | sort, |
| | | paging: { |
| | | start: 0, |
| | |
| | | }, |
| | | // 一级分类切换 |
| | | 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; |
| | | this.setData({ |
| | | pathList: [], |
| | | stairCode: e.detail.value, |
| | |
| | | }, |
| | | // 跳转图书详情 |
| | | 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 }); |
| | | this.setData({ |
| | | enable: true |
| | | }); |
| | | this.getBookList(this.data.path) |
| | | }, |
| | | }); |
| | |
| | | <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> |
| | | <t-search |
| | | model:value="{{searchValue}}" |
| | | shape="round" |
| | | placeholder="请输入关键词/书名/ISBN/作者" |
| | | class="navBar-search" |
| | | style="width: 464rpx" |
| | | bind:submit="searchBook" |
| | | /> |
| | | <t-search model:value="{{searchValue}}" shape="round" placeholder="请输入关键词/书名/ISBN/作者" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" /> |
| | | </view> |
| | | |
| | | <view class="bookServices-list"> |
| | | <view class="list-header"> |
| | | <scroll-view scroll-x="{{true}}" class="header-scroll"> |
| | | <!-- <scroll-view scroll-x="{{true}}" class="header-scroll"> --> |
| | | <view class="header-scroll"> |
| | | <t-dropdown-menu style="width: 1000rpx"> |
| | | <t-dropdown-item |
| | | options="{{stairList.options}}" |
| | | value="{{stairList.value}}" |
| | | bindchange="onChangeStair" |
| | | /> |
| | | <t-dropdown-item |
| | | label="二级" |
| | | options="{{secondList.options}}" |
| | | optionsColumns="2" |
| | | multiple |
| | | value="{{secondList.value}}" |
| | | bind:confirm="onConfirmSecond" |
| | | bind:change="onChangeSecond" |
| | | /> |
| | | <t-dropdown-item |
| | | label="重点项目" |
| | | options="{{majorProjectList.options}}" |
| | | optionsColumns="2" |
| | | multiple |
| | | defaultValue="{{majorProjectList.value}}" |
| | | bind:confirm="changeMajorProject" |
| | | bind:reset="resetMajorProject" |
| | | /> |
| | | <t-dropdown-item |
| | | label="新形态教材" |
| | | options="{{newTextBook.options}}" |
| | | optionsColumns="2" |
| | | multiple |
| | | defaultValue="{{newTextBook.value}}" |
| | | bind:confirm="changeNewText" |
| | | bind:reset="resetNewText" |
| | | /> |
| | | <t-dropdown-item options="{{stairList.options}}" value="{{stairList.value}}" bindchange="onChangeStair" /> |
| | | <t-dropdown-item label="二级" options="{{secondList.options}}" optionsColumns="2" multiple value="{{secondList.value}}" bind:confirm="onConfirmSecond" bind:change="onChangeSecond" /> |
| | | <t-dropdown-item label="重点项目" options="{{majorProjectList.options}}" optionsColumns="2" multiple defaultValue="{{majorProjectList.value}}" bind:confirm="changeMajorProject" bind:reset="resetMajorProject" /> |
| | | <t-dropdown-item label="新形态教材" options="{{newTextBook.options}}" optionsColumns="2" multiple defaultValue="{{newTextBook.value}}" bind:confirm="changeNewText" bind:reset="resetNewText" /> |
| | | </t-dropdown-menu> |
| | | </scroll-view> |
| | | </view> |
| | | <!-- </scroll-view> --> |
| | | <view class="header-sort" bind:tap="sortClick"> |
| | | <text class="sort-name">排序</text> |
| | | <!-- <view class="sort-icon"> --> |
| | | <t-icon |
| | | name="swap-left" |
| | | size="28rpx" |
| | | class="icon-right" |
| | | color="{{sort == 'Asc' ? '#ff6c00' : ''}}" |
| | | /> |
| | | <t-icon |
| | | name="swap-left" |
| | | size="28rpx" |
| | | class="icon-left" |
| | | color="{{sort == 'Desc' ? '#ff6c00' : ''}}" |
| | | /> |
| | | <t-icon name="swap-left" size="28rpx" class="icon-right" color="{{sort == 'Asc' ? '#ff6c00' : ''}}" /> |
| | | <t-icon name="swap-left" size="28rpx" class="icon-left" color="{{sort == 'Desc' ? '#ff6c00' : ''}}" /> |
| | | <!-- </view> --> |
| | | </view> |
| | | </view> |
| | | <t-pull-down-refresh |
| | | value="{{enable}}" |
| | | loadingProps="{{loadingProps}}" |
| | | loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" |
| | | bind:refresh="onRefresh" |
| | | class="down-refresh" |
| | | > |
| | | <scroll-view |
| | | scroll-y="{{true}}" |
| | | class="list-container" |
| | | bindrefresherrefresh="onPullDownRefresh" |
| | | bindscrolltolower="onReachBottom" |
| | | > |
| | | <t-pull-down-refresh value="{{enable}}" loadingProps="{{loadingProps}}" loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" bind:refresh="onRefresh" class="down-refresh"> |
| | | <scroll-view scroll-y="{{true}}" class="list-container" bindrefresherrefresh="onPullDownRefresh" bindscrolltolower="onReachBottom"> |
| | | <view class="assort-title"> |
| | | <view class="title-box"></view> |
| | | <view class="title-name">{{assortCheck.name}}</view> |
| | | </view> |
| | | <view class="page-content"> |
| | | <view class="book-list" wx:if="{{!loaidng}}"> |
| | | <view |
| | | class="book-box" |
| | | wx:for="{{bookList}}" |
| | | wx:key="id" |
| | | bind:tap="goDetail" |
| | | data-book="{{item}}" |
| | | > |
| | | <view class="book-box" wx:for="{{bookList}}" wx:key="id" bind:tap="goDetail" data-book="{{item}}"> |
| | | <view class="book-img"> |
| | | <image |
| | | src="{{item.icon ? item.icon : '/static/images/default-book-img.png'}}" |
| | | aria-label="{item.name{}}" |
| | | mode="widthFix" |
| | | /> |
| | | <image src="{{item.icon ? item.icon : '/static/images/default-book-img.png'}}" aria-label="{item.name{}}" mode="widthFix" /> |
| | | </view> |
| | | <view class="book-name book-color">{{ item.name}}</view> |
| | | <view class="book-author book-color">{{item.author}}</view> |
| | |
| | | </view> |
| | | <!-- loading --> |
| | | <view class="loading-box" wx:if="{{loaidng}}"> |
| | | <t-loading |
| | | theme="circular" |
| | | size="60rpx" |
| | | class="wrapper" |
| | | loading="{{loaidng}}" |
| | | wx:if="{{loaidng}}" |
| | | /> |
| | | <t-loading theme="circular" size="60rpx" class="wrapper" loading="{{loaidng}}" wx:if="{{loaidng}}" /> |
| | | </view> |
| | | </view> |
| | | <view class="bottom-box"> |
| | | <t-loading |
| | | theme="circular" |
| | | size="40rpx" |
| | | class="wrapper" |
| | | wx:if="{{isMore == true}}" |
| | | /> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | </scroll-view> |
| | |
| | | .header-scroll { |
| | | height: 100%; |
| | | width: 85vw; |
| | | overflow-x: auto; |
| | | } |
| | | |
| | | .icon-left { |
| | |
| | | |
| | | .mp-slider-bar { |
| | | margin: 0 18rpx; |
| | | /* margin-top: 10rpx; */ |
| | | } |
| | | |
| | | .t-tabs__item--active { |
| | |
| | | |
| | | .publicText { |
| | | display: flex; |
| | | |
| | | } |
| | | |
| | | .noData { |
| | | margin-top: 150rpx; |
| | | } |
| | | |
| | | .audioIconBox { |
| | | width: 50rpx; |
| | | } |
| | |
| | | import { worksDataBytool } from "../../../../assets/js/toolClass.js"; |
| | | import { |
| | | worksDataBytool |
| | | } from "../../../../assets/js/toolClass.js"; |
| | | const app = getApp(); |
| | | Page({ |
| | | data: { |
| | |
| | | phone: "", |
| | | detailedAddress: "" |
| | | }, |
| | | phoneError: false, |
| | | paperBookList: [], //样书单纸质书 |
| | | electronicBookList: [], //样书单电子书 |
| | | ebookCount: 0, |
| | |
| | | this.getSelectBookCount(); |
| | | this.getSelectPaperBookCount(); |
| | | this.getPaperType(); |
| | | } else { |
| | | wx.navigateTo({ |
| | | url: "/pages/testLogin/index", |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | |
| | | tabClick(item) { |
| | |
| | | }, |
| | | |
| | | getElectronType() { |
| | | app.MG.resource.getCmsTypeByRefCode({ refCodes: ['jsek_electronicSampleBook'] }).then((res) => { |
| | | app.MG.resource.getCmsTypeByRefCode({ |
| | | refCodes: ['jsek_electronicSampleBook'] |
| | | }).then((res) => { |
| | | this.setData({ |
| | | description: res[0].description, |
| | | 'teacherInfo.workInfo': res[0].cmsTypeLinks[0].children, |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | //姓名 |
| | | onFullNameInput(e) { |
| | | this.setData({ |
| | | "contactInfo.fullName": e.detail.value, |
| | | }); |
| | | }, |
| | | //输入手机号 |
| | | onPhoneInput(e) { |
| | | const { |
| | | phoneError |
| | | } = this.data; |
| | | 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, |
| | | "contactInfo.phone": e.detail.value, |
| | | }); |
| | | } |
| | | }, |
| | | onAddressInput() { |
| | | this.setData({ |
| | | "contactInfo.detailedAddress": e.detail.value, |
| | | }); |
| | | }, |
| | | |
| | | |
| | | submit() { |
| | | let that = this; |
| | |
| | | }) |
| | | return |
| | | } |
| | | |
| | | const mailAddress = JSON.stringify(that.data.contactInfo) |
| | | that.setData({ |
| | | 'teacherInfo.detailedAddress': mailAddress |
| | |
| | | wx.navigateTo({ |
| | | url: "/packagePersonal/pages/sampleBooks/index?stateTab=1&tabActive=" + that.data.active, |
| | | }); |
| | | } else if (res.cancel) { |
| | | } |
| | | } else if (res.cancel) {} |
| | | } |
| | | }) |
| | | }) |
| | |
| | | }) |
| | | wx.setStorageSync("paperBookList", pList); |
| | | } |
| | | } else if (res.cancel) { |
| | | } |
| | | } else if (res.cancel) {} |
| | | } |
| | | }) |
| | | }, |
| | |
| | | "usingComponents": { |
| | | "t-tabs": "tdesign-miniprogram/tabs/tabs", |
| | | "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", |
| | | "t-input": "tdesign-miniprogram/input/input", |
| | | "t-cascader": "tdesign-miniprogram/cascader/cascader", |
| | | "t-swipe-cell": "tdesign-miniprogram/swipe-cell/swipe-cell", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | |
| | | <view class="container"> |
| | | <view class="page-header"> |
| | | <t-tabs t-class="t-tabs" defaultValue="{{active}}" split="{{false}}" bind:change="tabClick"> |
| | | <t-tab-panel label="纸质样书" value="0" /> |
| | | <t-tab-panel label="电子样书" value="1" /> |
| | | </t-tabs> |
| | | </view> |
| | | <view class="page-content"> |
| | | <view class="content"> |
| | | <view class="bookListBox"> |
| | |
| | | <view class="item"> |
| | | <text class="label">姓名:</text> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="userName" auto-focus="true" adjust-position="true" value="{{contactInfo.fullName}}" placeholder="请输入姓名" bindinput="bindTnputBlur" adjust-position="{{false}}" /> |
| | | <t-input placeholder="请输入真实姓名" borderless value="{{contactInfo.fullName}}" bindchange="onFullNameInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="item"> |
| | | <text class="label">联系电话:</text> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="userName" auto-focus="true" adjust-position="true" value="{{contactInfo.phone}}" placeholder="请输入联系电话" bindinput="bindTnputBlur" adjust-position="{{false}}" /> |
| | | <t-input placeholder="输入联系电话" borderless value="{{contactInfo.phone}}" type="number" tips="{{phoneError ? '手机号输入不正确' : ''}}" bindchange="onPhoneInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="item"> |
| | | <text class="label">详细地址:</text> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="userName" auto-focus="true" adjust-position="true" value="{{contactInfo.detailedAddress}}" placeholder="请输入详细地址" bindinput="bindTnputBlur" adjust-position="{{false}}" /> |
| | | <t-input placeholder="请输入详细地址" borderless value="{{contactInfo.detailedAddress}}" bindchange="onAddressInput" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | height: 100vh; |
| | | } |
| | | |
| | | .page-header { |
| | | width: 100%; |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | z-index: 1; |
| | | } |
| | | |
| | | .page-content { |
| | | padding-top: 96rpx; |
| | | margin-top: -30rpx; |
| | | } |
| | | |
| | | .content { |
| | | height: calc(100vh - env(safe-area-inset-bottom) - 96rpx); |
| | | box-sizing: border-box; |
| | | height: calc(100vh - env(safe-area-inset-bottom) - 86rpx); |
| | | overflow-y: auto; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | .t-tabs { |
| | | margin-top: 20rpx; |
| | | padding-top: 20rpx; |
| | | background: none !important; |
| | | width: 100%; |
| | | position: fixed; |
| | | top: 0rpx; |
| | | left: 0; |
| | | z-index: 1 |
| | | } |
| | | |
| | | .t-tabs__wrapper { |
| | |
| | | background: #fff; |
| | | min-height: 200rpx; |
| | | border-radius: 10rpx; |
| | | margin-top: -30rpx; |
| | | |
| | | padding: 60rpx 40rpx 40rpx 40rpx; |
| | | } |
| | | |
| | |
| | | flex: 1; |
| | | } |
| | | |
| | | .weui-input { |
| | | height: 60rpx; |
| | | .item-content .t-input { |
| | | padding: 0 !important; |
| | | } |
| | | |
| | | .t-input__placeholder { |
| | | font-size: 28rpx !important |
| | | } |
| | | |
| | | .btn-area { |
| | |
| | | import { |
| | | loginInfo |
| | | } from '../../../assets/js/login'; |
| | | const app = getApp(); |
| | | Page({ |
| | | |
| | |
| | | Path: options.secondCode, |
| | | Type: '*', |
| | | StoreRefCode: app.config.goodsStore, |
| | | } |
| | | ], |
| | | }], |
| | | }) |
| | | } |
| | | this.getIconTypeList(); |
| | | |
| | | // 获取重点项目 |
| | | this.getProjectList('bookClassification'); |
| | | //新形态教材 |
| | | this.getProjectList('newFormsTextbooks'); |
| | | if (wx.getStorageSync(app.config.tokenKey)) { |
| | | this.getAlreadyPBookList() |
| | | this.getAlreadyEBookList() |
| | | } |
| | | if (wx.getStorageSync(app.config.userInfoKey)) { |
| | | |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.setData({ |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | | } |
| | | this.getBookList(false); |
| | | this.getAlreadyPBookList() |
| | | this.getAlreadyEBookList() |
| | | // 获取申请次数 |
| | | this.getSelectPaperBookCount() |
| | | this.getSelectBookCount() |
| | | |
| | | } |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | | this.getAlreadyPBookList() |
| | | this.getAlreadyEBookList() |
| | | // 获取申请次数 |
| | | this.getSelectPaperBookCount() |
| | | this.getSelectBookCount() |
| | | } |
| | | }, |
| | | |
| | | /** |
| | |
| | | this.setData({ |
| | | num: this.data.paperBookList.length + this.data.electronicBookList.length |
| | | }) |
| | | |
| | | this.getBookList(false); |
| | | }, |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | |
| | | // 获取纸质书剩余次数 |
| | | getSelectPaperBookCount(item) { |
| | | app.MG.app |
| | | .getTicketResult({ |
| | | ticketRefCodeOrGuid: 'paperSampleBookapplyNum', |
| | | roleId: this.data.userInfo.roleId |
| | | }) |
| | | .then((res) => { |
| | | this.setData({ |
| | | paperBookCount: res.totalCount - res.usedCount |
| | | }) |
| | | }) |
| | | }, |
| | | // 获取电子书剩余次数 |
| | | getSelectBookCount(item) { |
| | | app.MG.app |
| | | .getTicketResult({ |
| | | ticketRefCodeOrGuid: 'electronicSampleBookapplyNum', |
| | | roleId: this.data.userInfo.roleId |
| | | }) |
| | | .then((res) => { |
| | | this.setData({ |
| | | ebookCount: res.totalCount - res.usedCount |
| | | }) |
| | | }) |
| | | }, |
| | | //获取高级分类 |
| | | getIconTypeList() { |
| | | let query = { |
| | | path: '*', |
| | | filterList: [ |
| | | { |
| | | filterList: [{ |
| | | value: 'Normal', |
| | | field: 'state' |
| | | } |
| | | ], |
| | | }], |
| | | queryType: '\\', |
| | | searchList: [], |
| | | size: '5', |
| | | start: '0', |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' } |
| | | sort: { |
| | | type: 'Asc', |
| | | field: 'LinkOrder' |
| | | } |
| | | } |
| | | app.MG.store.getStoreChannelList(query).then((res) => { |
| | | let list = []; |
| | |
| | | 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) => { |
| | | let options = []; |
| | |
| | | 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) => { |
| | | if (res.datas.length > 0) { |
| | |
| | | } |
| | | const query = { |
| | | ...pathObj, |
| | | filterList: [ |
| | | { |
| | | filterList: [{ |
| | | value: 'Normal', |
| | | field: 'state', |
| | | }, |
| | | ], |
| | | }, ], |
| | | sort, |
| | | paging: { |
| | | start: that.data.page * that.data.limit - that.data.limit, |
| | |
| | | }, |
| | | // 一级分类切换 |
| | | 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; |
| | | this.setData({ |
| | | pathList: [], |
| | | stairCode: e.detail.value, |
| | |
| | | }, |
| | | // 跳转图书详情 |
| | | 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}`, |
| | | }); |
| | |
| | | //纸质样书 |
| | | onChangePaper(e) { |
| | | const item = e.currentTarget.dataset.book; |
| | | const index = this.data.bookList.findIndex(citem => citem.id == item.id) |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null |
| | | if (role) { |
| | | if (item.paperDisabled) { |
| | | if (role && role == 'Teacher') { |
| | | // 是教师 |
| | | if (e.detail.checked) { |
| | | // 点击选中 |
| | | if (this.data.paperBookCount == 0) { |
| | | wx.showToast({ |
| | | title: "该样书已申请", |
| | | icon: 'none', |
| | | title: "您的纸质样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | return |
| | | return false; |
| | | } |
| | | if (item.paperChecked) { |
| | | if (this.data.paperBookList.length >= 2) { |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | return false; |
| | | } |
| | | this.addBookFun(item, "pBook") |
| | | this.setData({ |
| | | ["bookList[" + index + "].paperChecked"]: e.detail.checked |
| | | }) |
| | | } else { |
| | | // 取消选中 |
| | | let pList = this.data.paperBookList; |
| | | if (pList.length > 0) { |
| | | pList.forEach((obj, index) => { |
| | |
| | | } |
| | | }) |
| | | } |
| | | item.paperChecked = false; |
| | | if (this.data.bookList.length > 0) { |
| | | this.data.bookList.forEach(i => { |
| | | if (i.id == item.id) { |
| | | i.paperChecked = false; |
| | | } |
| | | this.setData({ |
| | | paperBookList: pList, |
| | | num: this.data.num - 1, |
| | | ["bookList[" + index + "].paperChecked"]: e.detail.checked |
| | | }) |
| | | } |
| | | wx.setStorageSync("paperBookList", JSON.stringify(pList)); |
| | | wx.showToast({ |
| | | title: "已从样书申请单移除", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | paperBookList: pList, |
| | | num: pList.length + this.data.electronicBookList.length |
| | | }) |
| | | wx.setStorageSync("paperBookList", JSON.stringify(pList)); |
| | | return |
| | | } |
| | | if (role == 'Teacher') { |
| | | this.getSelectPaperBookCount(item) |
| | | } else { |
| | | item.paperChecked = false |
| | | wx.showModal({ |
| | | title: '尊敬的用户,您好!', //提示的标题 |
| | | content: '请先进行教师认证?', //提示的内容 |
| | |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) { |
| | | item.paperChecked = false |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | item.paperChecked = false |
| | | } |
| | | }, |
| | | getSelectPaperBookCount(item) { |
| | | app.MG.app |
| | | .getTicketResult({ |
| | | ticketRefCodeOrGuid: 'paperSampleBookapplyNum', |
| | | roleId: this.data.userInfo.roleId |
| | | }) |
| | | .then((res) => { |
| | | this.setData({ |
| | | paperBookCount: res.totalCount - res.usedCount |
| | | }) |
| | | if (!item.paperDisabled) { |
| | | this.getAlreadyBookList(item, 'pBook') |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //选择电子样书 |
| | | onChangeElectron(e) { |
| | | const item = e.currentTarget.dataset.book; |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null; |
| | | if (role) { |
| | | if (item.electronDisabled) { |
| | | 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) { |
| | | // 点击选中 |
| | | if (this.data.ebookCount == 0) { |
| | | wx.showToast({ |
| | | title: "该样书已申请", |
| | | icon: 'none', |
| | | title: "您的电子样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | return |
| | | return false; |
| | | } |
| | | if (item.electronChecked) { |
| | | if (this.data.electronicBookList.length >= 2) { |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | return false; |
| | | } |
| | | this.addBookFun(item, "eBook") |
| | | this.setData({ |
| | | ["bookList[" + index + "].electronChecked"]: e.detail.checked |
| | | }) |
| | | } else { |
| | | // 取消选中 |
| | | let eList = this.data.electronicBookList; |
| | | if (eList.length > 0) { |
| | | eList.forEach((obj, index) => { |
| | |
| | | } |
| | | }) |
| | | } |
| | | if (this.data.bookList.length > 0) { |
| | | this.data.bookList.forEach(i => { |
| | | if (i.id == item.id) { |
| | | i.electronChecked = false; |
| | | } |
| | | this.setData({ |
| | | electronicBookList: eList, |
| | | num: this.data.num - 1, |
| | | ["bookList[" + index + "].electronChecked"]: e.detail.checked |
| | | }) |
| | | } |
| | | item.electronChecked = false; |
| | | wx.setStorageSync("electronicBookList", JSON.stringify(eList)); |
| | | wx.showToast({ |
| | | title: "已从样书申请单移除", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | electronicBookList: eList, |
| | | num: eList.length + this.data.paperBookList.length |
| | | }) |
| | | wx.setStorageSync("electronicBookList", eList); |
| | | return |
| | | } |
| | | if (role == 'Teacher') { |
| | | //有无子商品,子商品有无电子书文件 |
| | | const obj = { |
| | | path: '*', |
| | | queryType: 'SubProduct', |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 6 |
| | | }, |
| | | mainProductId: item.id, |
| | | fields: { |
| | | bookshelf_pdf: [], |
| | | bookshelf_protectedEpub: [], |
| | | } |
| | | } |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | if (res.datas.length > 0) { |
| | | if (res.datas[0].bookshelf_pdf || res.datas[0].bookshelf_protectedEpub) { |
| | | this.getSelectBookCount(item) |
| | | } else { |
| | | wx.showToast({ |
| | | title: "暂无电子书文件,请联系管理员!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } else { |
| | | this.getSelectBookCount(item) |
| | | } |
| | | }) |
| | | } else { |
| | | item.electronChecked = false |
| | | wx.showModal({ |
| | | title: '尊敬的用户,您好!', //提示的标题 |
| | | content: '请先进行教师认证?', //提示的内容 |
| | |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) { |
| | | item.electronChecked = false |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | item.electronChecked = false |
| | | } |
| | | }, |
| | | getSelectBookCount(item) { |
| | | app.MG.app |
| | | .getTicketResult({ |
| | | ticketRefCodeOrGuid: 'electronicSampleBookapplyNum', |
| | | roleId: this.data.userInfo.roleId |
| | | }) |
| | | .then((res) => { |
| | | this.setData({ |
| | | ebookCount: res.totalCount - res.usedCount |
| | | }) |
| | | if (!item.electronDisabled) { |
| | | this.getAlreadyBookList(item, 'eBook') |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | getAlreadyBookList(item, type) { |
| | | // 添加样书 |
| | | addBookFun(item, type) { |
| | | let itemAttr = null |
| | | let isHas = false |
| | | const eList = this.data.electronicBookList; |
| | | const pList = this.data.paperBookList; |
| | | itemAttr = { |
| | | id: item.id, |
| | | title: item.name || '-', |
| | |
| | | isbn: item.isbn || '-', |
| | | publicationDate: item.publicationDate |
| | | } |
| | | |
| | | if (type == 'eBook') { |
| | | if (this.data.ebookCount > 0) { |
| | | const eBookData = this.data.electronicBookList |
| | | if (eBookData.length == 2) { |
| | | item.electronChecked = false; |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | eList.push(itemAttr) |
| | | this.setData({ |
| | | electronicBookList: eList, |
| | | }) |
| | | return false |
| | | wx.setStorageSync("electronicBookList", eList); |
| | | } else { |
| | | pList.push(itemAttr) |
| | | this.setData({ |
| | | paperBookList: pList, |
| | | }) |
| | | wx.setStorageSync("paperBookList", pList); |
| | | } |
| | | if (eBookData.length > 0) { |
| | | for (let i = 0; i < eBookData.length; i++) { |
| | | if (eBookData[i].id == item.id) { |
| | | isHas = true |
| | | } |
| | | } |
| | | if (!isHas) { |
| | | this.setData({ |
| | | num: this.data.num + 1 |
| | | }) |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | electronicBookList: [...this.data.electronicBookList, ...[itemAttr]], |
| | | }) |
| | | wx.setStorageSync("electronicBookList", this.data.electronicBookList); |
| | | this.setData({ |
| | | num: this.data.electronicBookList.length + this.data.paperBookList.length |
| | | }) |
| | | this.getBookList(false); |
| | | } else { |
| | | let list = this.data.electronicBookList; |
| | | list.forEach((obj, index) => { |
| | | if (obj.id == item.id) { |
| | | list.splice(index, 1); |
| | | } |
| | | }) |
| | | item.electronChecked = false |
| | | wx.showToast({ |
| | | title: "已从样书申请单移除", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | electronicBookList: list, |
| | | num: list.length + this.data.paperBookList.length |
| | | }) |
| | | wx.setStorageSync("electronicBookList", list); |
| | | this.getBookList(false); |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | electronicBookList: [itemAttr], |
| | | num: 1 + this.data.paperBookList.length |
| | | }) |
| | | wx.setStorageSync("electronicBookList", [itemAttr]); |
| | | |
| | | } |
| | | } else { |
| | | item.electronChecked = false |
| | | wx.showToast({ |
| | | title: "您的电子样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } else { |
| | | if (this.data.paperBookCount > 0) { |
| | | const pBookData = this.data.paperBookList |
| | | if (pBookData.length == 2) { |
| | | item.paperChecked = false |
| | | 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) { |
| | | item.paperChecked = true |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | paperBookList: [...this.data.paperBookList, ...[itemAttr]], |
| | | }) |
| | | wx.setStorageSync("paperBookList", this.data.paperBookList); |
| | | this.setData({ |
| | | num: this.data.paperBookList.length + this.data.electronicBookList.length |
| | | }) |
| | | |
| | | } else { |
| | | let list = this.data.paperBookList; |
| | | list.forEach((obj, index) => { |
| | | if (obj.id == item.id) { |
| | | list.splice(index, 1); |
| | | } |
| | | }) |
| | | item.paperChecked = false |
| | | wx.showToast({ |
| | | title: "已从样书申请单移除", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | paperChecked: list, |
| | | num: list.length + this.data.electronicBookList.length |
| | | }) |
| | | wx.setStorageSync("paperBookList", list); |
| | | } |
| | | } else { |
| | | item.paperChecked = true; |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | paperBookList: [itemAttr], |
| | | num: 1 + this.data.electronicBookList.length |
| | | }) |
| | | wx.setStorageSync("paperBookList", [itemAttr]); |
| | | } |
| | | } else { |
| | | item.paperChecked = false |
| | | wx.showToast({ |
| | | title: "您的纸质样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | //去样书申请单 |
| | | goApply() { |
| | |
| | | </view> |
| | | <view class="list-header"> |
| | | <view class="header-scroll"> |
| | | <scroll-view scroll-x scroll-with-animation='true' class="srcolbox"> |
| | | <!-- <scroll-view scroll-x scroll-with-animation='true' class="srcolbox"> --> |
| | | <view class="srcolbox"> |
| | | <t-dropdown-menu> |
| | | <t-dropdown-item label="总分类" options="{{iconList.options}}" default-value="{{iconList.value}}" optionsColumns="2" bindchange="onChangeIcon" arrow-icon="" /> |
| | | <t-dropdown-item label="一级" options="{{stairList.options}}" value="{{stairList.value}}" optionsColumns="2" bindchange="onChangeStair" arrow-icon="" /> |
| | | <t-dropdown-item label="总分类" options="{{iconList.options}}" value="{{iconList.value}}" optionsColumns="2" bindchange="onChangeIcon" /> |
| | | <t-dropdown-item label="一级" options="{{stairList.options}}" value="{{stairList.value}}" optionsColumns="2" bindchange="onChangeStair" /> |
| | | <t-dropdown-item label="二级" options="{{secondList.options}}" optionsColumns="2" multiple value="{{secondList.value}}" bind:confirm="onConfirmSecond" bind:change="onChangeSecond" /> |
| | | </t-dropdown-menu> |
| | | </scroll-view> |
| | | </view> |
| | | <!-- </scroll-view> --> |
| | | </view> |
| | | <view class="header-sort" bind:tap="sortClick"> |
| | | <view class="sort-name">排序</view> |
| | |
| | | <view class="book-name book-color" bind:tap="goDetail" data-book="{{item}}">{{ item.name}}</view> |
| | | <view class="book-author book-color">{{item.author}}</view> |
| | | <view class="checkbox"> |
| | | <t-checkbox label="纸质样书" icon="rectangle" borderless='true' default-checked="{{item.paperChecked}}" disabled="{{item.paperDisabled || item.isApplyBook == '1' || item.isApplyBook == '2'}}" data-book="{{item}}" bind:change="onChangePaper" /> |
| | | <t-checkbox label="电子样书" icon="rectangle" borderless='true' class="eBook" default-checked="{{item.electronChecked}}" disabled="{{item.electronDisabled || item.isApplyBook=='1' || item.isApplyBook=='3' }}" data-book="{{item}}" bind:change="onChangeElectron" /> |
| | | <t-checkbox label="纸质样书" icon="rectangle" borderless='true' checked="{{item.paperChecked}}" disabled="{{item.paperDisabled || item.isApplyBook == '1' || item.isApplyBook == '2'}}" data-book="{{item}}" bind:change="onChangePaper" /> |
| | | <t-checkbox label="电子样书" icon="rectangle" borderless='true' class="eBook" checked="{{item.electronChecked}}" disabled="{{item.electronDisabled || item.isApplyBook=='1' || item.isApplyBook=='3' }}" data-book="{{item}}" bind:change="onChangeElectron" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | } |
| | | |
| | | .t-dropdown-menu__item--active { |
| | | height: 86rpx !important; |
| | | /* height: 86rpx !important; */ |
| | | background: #F6F6F6 !important; |
| | | border-radius: 40rpx 40rpx 0 0; |
| | | /* border-radius: 40rpx 40rpx 0 0; */ |
| | | } |
| | | |
| | | .t-radio__title { |
| | |
| | | |
| | | .title .icon { |
| | | height: 36rpx; |
| | | width: 160rpx; |
| | | width: 140rpx; |
| | | line-height: 60rpx; |
| | | } |
| | | |
| | |
| | | const app = getApp(); |
| | | import SparkMD5 from 'spark-md5' |
| | | import tool from "../../../assets/js/toolClass.js"; |
| | | import { getTopicMsgCmsItemFile } from '../../../assets/js/middleGround/tool.js'; |
| | | import { |
| | | getTopicMsgCmsItemFile |
| | | } from '../../../assets/js/middleGround/tool.js'; |
| | | import FormData from '../../../utils/formdata/index.js'; |
| | | import { |
| | | loginInfo |
| | | } from '../../../assets/js/login'; |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad() { |
| | | //获取职称 |
| | | this.getpositionalTitle(); |
| | | this.getAgreement(); |
| | | |
| | | if (wx.getStorageSync(app.config.tokenKey)) { |
| | | this.getUserRole() |
| | | } |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.getUserRole() |
| | | } |
| | | }) |
| | | } else { |
| | | this.getUserRole() |
| | | } |
| | | }, |
| | |
| | | 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') |
| | | let WeChatInfo = res.infoList.find((item) => item.type === "WeChat"); |
| | | let defaultUser = {}; |
| | | if (teacherRole && teacherInfos) { |
| | |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id, |
| | | } |
| | | this.setData({ |
| | | currAuthStep: 2, |
| | | }); |
| | | |
| | | } else if (WeChatInfo) { |
| | | defaultUser = { |
| | |
| | | icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | userId: res.userId, |
| | | } |
| | | this.setData({ |
| | | currAuthStep: 3, |
| | | }); |
| | | } else if (secretData) { |
| | | defaultUser = { |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : secretData.credential, |
| | | icon: nickNameData ? JSON.parse(nickNameData.data).icon : "", |
| | | userId: res.userId, |
| | | } |
| | | |
| | | } |
| | | wx.setStorageSync(app.config.userInfoKey, JSON.stringify(defaultUser)); |
| | | } |
| | | }) |
| | | }, |
| | | //获取字段 |
| | | getType() { |
| | | app.MG.resource.getCmsTypeByRefCode({ |
| | | refCodes: ['jsek_teacherCertification'] |
| | |
| | | this.newGetTeacherInfo() |
| | | }) |
| | | }, |
| | | //获取教师状态 |
| | | newGetTeacherInfo() { |
| | | const data = { |
| | | start: 0, |
| | |
| | | md5: this.data.teacherInfo.relevantCertificates, |
| | | linkType: 'LinkFile', |
| | | linkProtectType: 'Public', |
| | | url: |
| | | app.config.requestCtx + `/file/GetPreViewImage?md5=` + this.data.teacherInfo.relevantCertificates, |
| | | url: app.config.requestCtx + `/file/GetPreViewImage?md5=` + this.data.teacherInfo.relevantCertificates, |
| | | imgUrl: app.config.requestCtx + `/file/GetPreViewImage?md5=` + this.data.teacherInfo.relevantCertificates, |
| | | } |
| | | arr.push(imgObj); |
| | |
| | | } |
| | | |
| | | } |
| | | } catch (error) { |
| | | } |
| | | } catch (error) {} |
| | | }) |
| | | }, |
| | | |
| | | //获取职称 |
| | | getpositionalTitle() { |
| | | const data = { |
| | | refCodes: ['positionalTitle'] |
| | |
| | | |
| | | //选择职称 |
| | | onTeachPicker() { |
| | | this.setData({ teachVisible: true }); |
| | | this.setData({ |
| | | teachVisible: true |
| | | }); |
| | | }, |
| | | onPickerChange(e) { |
| | | const { label } = e.detail; |
| | | const { |
| | | label |
| | | } = e.detail; |
| | | this.setData({ |
| | | teachVisible: false, |
| | | teachText: label[0], |
| | |
| | | }, |
| | | //输入手机号 |
| | | onPhoneInput(e) { |
| | | const { phoneError } = this.data; |
| | | const { |
| | | phoneError |
| | | } = this.data; |
| | | 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({ |
| | |
| | | }, |
| | | //输入座机 |
| | | onTelphoneInput(e) { |
| | | const { telphoneError } = this.data; |
| | | const { |
| | | telphoneError |
| | | } = this.data; |
| | | const isPhoneNumber = /^0\d{2}-\d{8}$|^0\d{3}-\d{7}$/.test(e.detail.value); |
| | | if (telphoneError === isPhoneNumber) { |
| | | this.setData({ |
| | |
| | | } |
| | | }, |
| | | onEmailInput(e) { |
| | | const { emailError } = this.data; |
| | | const { |
| | | emailError |
| | | } = this.data; |
| | | const isPhoneNumber = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(e.detail.value); |
| | | if (emailError === isPhoneNumber) { |
| | | this.setData({ |
| | |
| | | chooseImg(e) { |
| | | var that = this; |
| | | wx.chooseMedia({ |
| | | // count: 1, // 默认9 |
| | | count: 1, |
| | | sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 |
| | | sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 |
| | | success: function (res) { |
| | |
| | | data: data.buffer, |
| | | success(res1) { |
| | | if (res1.statusCode == 200) { |
| | | resolve(res1.data); if (res1.data) { |
| | | resolve(res1.data); |
| | | if (res1.data) { |
| | | let arr = []; |
| | | let imgObj = { |
| | | md5: md5, |
| | | linkType: 'LinkFile', |
| | | linkProtectType: 'Public', |
| | | url: |
| | | app.config.requestCtx + `/file/GetPreViewImage?md5=` + md5, |
| | | url: app.config.requestCtx + `/file/GetPreViewImage?md5=` + md5, |
| | | imgUrl: res.tempFiles[0].tempFilePath |
| | | } |
| | | arr = [...that.data.imgPics, ...[imgObj]]; |
| | |
| | | delete basicInfo.worksInfo |
| | | delete basicInfo.state |
| | | const userInfo = { |
| | | requests: [ |
| | | { |
| | | requests: [{ |
| | | data: JSON.stringify(basicInfo), |
| | | name: that.data.teacherInfo.fullName + '', |
| | | type: 'newTeacherInfo' |
| | | } |
| | | ] |
| | | }] |
| | | } |
| | | app.MG.identity.setAppUserInfo(userInfo).then((res) => { |
| | | if (res) { |
| | |
| | | delete basicInfo.worksInfo |
| | | delete basicInfo.state |
| | | const userInfo = { |
| | | requests: [ |
| | | { |
| | | requests: [{ |
| | | data: JSON.stringify(basicInfo), |
| | | name: that.data.teacherInfo.fullName + '', |
| | | type: 'teacherInfo' |
| | | } |
| | | ] |
| | | }] |
| | | } |
| | | app.MG.identity.setAppUserInfo(userInfo).then((res) => { |
| | | app.MG.ugc.newTopicMessage(data).then(() => { |
| | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() { |
| | | }, |
| | | onReachBottom() {}, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | |
| | | border-radius: 50rpx; |
| | | } |
| | | |
| | | /* 上传图片样式 */ |
| | | .weui-uploader { |
| | | height: 152rpx; |
| | | } |
| | | |
| | | .tp_add { |
| | | width: 152rpx; |
| | |
| | | const app = getApp(); |
| | | import moment from 'moment' |
| | | import tool2 from "../../../assets/js/toolClass.js" |
| | | import { getPublicImage } from "../../../assets/js/middleGround/tool.js"; |
| | | import { |
| | | getPublicImage |
| | | } from "../../../assets/js/middleGround/tool.js"; |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | data: { |
| | | active: 0, |
| | | activeName: "FavoriteBookCity", |
| | | tabList: [ |
| | | { |
| | | tabList: [{ |
| | | label: '图书', |
| | | key: 0, |
| | | linkType: 'FavoriteBookCity', |
| | |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | list: [], |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |
| | |
| | | }) |
| | | }, |
| | | goBookDetails(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}`, |
| | | }); |
| | |
| | | const app = getApp(); |
| | | import moment from 'moment' |
| | | import tool2 from "../../../assets/js/toolClass.js" |
| | | import { getPublicImage } from "../../../assets/js/middleGround/tool.js"; |
| | | import { |
| | | getPublicImage |
| | | } from "../../../assets/js/middleGround/tool.js"; |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | */ |
| | | data: { |
| | | active: 0, |
| | | tabList: [ |
| | | { |
| | | tabList: [{ |
| | | label: '全部', |
| | | value: 'all', |
| | | }, |
| | |
| | | value: 'Cancel', |
| | | } |
| | | ], |
| | | searchText: "", |
| | | list: [], |
| | | //分页 |
| | | page: 1, |
| | |
| | | that.setData({ |
| | | skeletonLoding: true, |
| | | active: item.detail.value, |
| | | queryFilter: info.value == 'all' ? [] : [{ field: 'State', value: info.value }], |
| | | queryFilter: info.value == 'all' ? [] : [{ |
| | | field: 'State', |
| | | value: info.value |
| | | }], |
| | | list: [], |
| | | page: 1, |
| | | bottomLoading: false, |
| | | isMoreData: false, |
| | | searchText: "" |
| | | }) |
| | | that.getDataList(false); |
| | | }, |
| | | |
| | | getDataList(isReachBottom) { |
| | | var searchArr = []; |
| | | console.log(this.data.searchText, "earch") |
| | | if (this.data.searchText != undefined && this.data.searchText != "") { |
| | | searchArr.push({ |
| | | compareType: "Contains", |
| | | field: "orderNumber", |
| | | keywords: this.data.searchText, |
| | | }) |
| | | } |
| | | const data = { |
| | | start: this.data.page * this.data.limit - this.data.limit, |
| | | size: this.data.limit, |
| | | filterList: this.data.queryFilter, |
| | | searchList: searchArr, |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | list: false, |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |
| | |
| | | console.log(error) |
| | | } |
| | | }) |
| | | }, |
| | | onSearchOrder(e) { |
| | | this.setData({ |
| | | searchText: e.detail.value, |
| | | }) |
| | | this.getDataList(false); |
| | | }, |
| | | |
| | | |
| | |
| | | limit: 12, |
| | | pageTotalCount: 0, |
| | | bottomLoading: false, |
| | | isMoreData: false |
| | | isMoreData: false, |
| | | searchText: '' |
| | | }) |
| | | this._freshing = true; |
| | | this.setData({ |
| | |
| | | }, |
| | | |
| | | onCancel(e) { |
| | | let { orderNum } = e.currentTarget.dataset |
| | | let { |
| | | orderNum |
| | | } = e.currentTarget.dataset |
| | | wx.showModal({ |
| | | title: '提示', //提示的标题 |
| | | content: '确定要取消订单?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | app.MG.store.cancelOrder({ orderNum: orderNum }).then(() => { |
| | | app.MG.store.cancelOrder({ |
| | | orderNum: orderNum |
| | | }).then(() => { |
| | | wx.showToast({ |
| | | title: "订单已取消", |
| | | icon: 'success', |
| | |
| | | <view class="container"> |
| | | <view class="page-header"> |
| | | <view class="search"> |
| | | <t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" placeholder="请输入订单编号" leftIcon=""> |
| | | <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" bind:tap="navToSearchPage" /> |
| | | </t-search> |
| | | <t-search model:value="{{searchText}}" shape="round" clearable="{{false}}" placeholder="请输入订单编号" class="navBar-search" style="width: 90%" bind:submit="onSearchOrder" /> |
| | | </view> |
| | | <t-tabs t-class="t-tabs" defaultValue="{{active}}" split="{{false}}" bind:change="tabBookClick"> |
| | | <t-tab-panel wx:for="{{tabList}}" wx:for-index="index" wx:key="index" label="{{item.label}}" value="{{index}}" /> |
| | |
| | | "t-search": "tdesign-miniprogram/search/search", |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-image": "tdesign-miniprogram/image/image" |
| | | "t-image": "tdesign-miniprogram/image/image", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | }, |
| | | "navigationStyle": "custom", |
| | | "enablePullDownRefresh": true, |
| | |
| | | <view class="bibliographyList"> |
| | | <view class="titlesBox"> |
| | | <!--pages/bibliographyList/index.wxml--> |
| | | <view wx:if="{{downloadLoadin}}" class="loadinBox"> |
| | | <t-loading class="colors" theme="circular" size="70rpx" class="wrapper" /> |
| | | |
| | | </view> |
| | | <view class="bibliographyListBox"> |
| | | <view class="bibliographyListBox"></view> |
| | | <view class="titleBox"> |
| | | <view style="width: 100%; height: {{barHeight}}px; "></view> |
| | | <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> |
| | |
| | | </view> |
| | | |
| | | <view class="example-search"> |
| | | <t-search model:value="{{value}}" placeholder="请输入书目名称" bind:submit="onSearchSubmit" /> |
| | | <t-search model:value="{{value}}" placeholder="请输入书目名称" bind:submit="onSearchSubmit"> |
| | | |
| | | |
| | | </t-search> |
| | | <!-- <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" /> --> |
| | | |
| | | |
| | | |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | |
| | | |
| | | <t-tabs class="contentBox" defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel"> |
| | | <t-tab-panel label="高等教育({{higherTotal}})" value="0"> |
| | | <view class="outsideHigherBox"> |
| | | |
| | | <view wx:if="{{higherList.length <= 0}}" class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | |
| | | <view wx:else class="outsideHigherBox"> |
| | | <view class="higherBox" wx:for="{{higherList}}" wx:key="index" wx:for-item="item" wx:for-index="index" bind:tap="downloadData" data-item="{{item}}"> |
| | | <view class="outsideHigherImageBox"> |
| | | <image class="higherImageBox" src="{{item.icon}}" mode="" /> |
| | |
| | | <view class="higherTextBox">{{item.name}}</view> |
| | | </view> |
| | | |
| | | |
| | | </view> |
| | | <view class="bottom-box"> |
| | | <view wx:if="{{higherList.length > 0}}" 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 wx:if="{{vocationalList.length <= 0}}" class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | |
| | | |
| | | |
| | | <view wx:else class="outsideHigherBox"> |
| | | <view class="higherBox" wx:for="{{vocationalList}}" wx:key="index" wx:for-item="item" wx:for-index="index" bind:tap="downloadData" data-item="{{item}}"> |
| | | <view class="outsideHigherImageBox"> |
| | | <image class="higherImageBox" src="{{item.icon}}" mode="" /> |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | <view class="bottom-box"> |
| | | |
| | | <view wx:if="{{vocationalList.length > 0}}" 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 class="outsideHigherBox"> |
| | | |
| | | <view wx:if="{{teacherList.length <= 0}}" class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | <view wx:else class="outsideHigherBox"> |
| | | <view class="higherBox" wx:for="{{teacherList}}" wx:key="index" wx:for-item="item" wx:for-index="index" data-item="{{item}}" bind:tap="downloadData"> |
| | | <view class="outsideHigherImageBox"> |
| | | <image class="higherImageBox" src="{{item.icon}}" mode="" /> |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | <view class="bottom-box"> |
| | | |
| | | <view wx:if="{{teacherList.length > 0}}" 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> |
| | |
| | | .example-search { |
| | | background-color: #fff; |
| | | /* padding: 16rpx 32rpx; */ |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | color: #FF6C00; |
| | | } |
| | | |
| | | .t-loading__spinner { |
| | | /* .t-loading__spinner { |
| | | color: #FF6C00 !important; |
| | | } */ |
| | | |
| | | .bibliographyList { |
| | | position: relative; |
| | | } |
| | | |
| | | .titlesBox { |
| | | position: fixed; |
| | | top: 0; |
| | | background-color: #fff; |
| | | width: 100%; |
| | | z-index: 999; |
| | | height: 200rpx; |
| | | } |
| | | |
| | | .contentBox { |
| | | margin-top: 200rpx; |
| | | } |
| | | |
| | | .noDataBox { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | margin: 0 auto; |
| | | margin-top: 250rpx; |
| | | } |
| | |
| | | <t-dropdown-menu class="classification"> |
| | | <t-dropdown-item options="{{product.options}}" value="{{product.value}}" bindchange="onChange" /> |
| | | <t-dropdown-item class="{{keynoteDisabled ? 'disableds' : ' '}}" disabled="{{keynoteDisabled}}" label=" 重点项目" options="{{multipleSelect.options}}" value="{{multipleSelect.value}}" bindchange="handleMultipleSelect" multiple bind:confirm="handleConfirm" bind:reset="handleReset" show-overlay="{{true}}"> |
| | | |
| | | |
| | | |
| | | </t-dropdown-item> |
| | | |
| | | </t-dropdown-menu> |
| | | |
| | | |
| | | |
| | | <view class="outsideSortBox"> |
| | | <view class="sortBox" bind:tap="onSwapRight"> |
| | | <text>排序</text> |
| | |
| | | import { getPublicImage } from '../../assets/js/middleGround/tool'; |
| | | import Toast from 'tdesign-miniprogram/toast/index'; |
| | | |
| | | import { loginInfo } from '../../assets/js/login'; |
| | | Page({ |
| | | data: { |
| | | onDisabled: false, |
| | |
| | | totalPrice: totalPrice.toFixed(2) |
| | | }); |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | goPaymentPage() { |
| | | |
| | | |
| | | // 首页测试登录功能,后续注释 |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | // 如果不是第一次登录,会执行回调 |
| | | if (data) { |
| | | |
| | | |
| | | const selectedItems = this.data.shoppingCartData.filter(item => item.checked); |
| | | // console.log(selectedItems, 789); |
| | | const selectedIds = selectedItems.map(item => item.id); |
| | |
| | | direction: 'column', |
| | | }); |
| | | } |
| | | } else { |
| | | // 出现错误,返回false |
| | | } |
| | | }) |
| | | } else { |
| | | // 如果是第一次登录,会跳转至绑定用户信息页面,填写完用户信息后进行登录并储存token和用户信息,结束后跳转回当前页面(携带页面参数) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }, |
| | | onLogin() { |
| | | wx.navigateTo({ |
| | |
| | | app.MG.store.confirmOrder(query).then(res => { |
| | | console.log(res.orderNumber, 'res'); |
| | | if (res.orderNumber) { |
| | | const resOrderNum = { |
| | | let resOrderNum = { |
| | | orderNum: res.orderNumber, |
| | | }; |
| | | |
| | | console.log(resOrderNum, 'resOrderNum'); |
| | | // 用户未绑定微信 报500 |
| | | app.MG.store.makeWeChatPay(resOrderNum).then(payRes => { |
| | | console.log(payRes, 'payRes'); |
| | | const payVal = JSON.parse(payRes); |
| | | wx.requestPayment({ |
| | | "appId": payVal.appId, |
| | |
| | | import { fetchHome } from '../../services/home/home'; |
| | | import { |
| | | fetchHome |
| | | } from '../../services/home/home'; |
| | | import moment from 'moment' |
| | | import { loginInfo } from '../../assets/js/login'; |
| | | import { |
| | | loginInfo |
| | | } from '../../assets/js/login'; |
| | | const app = getApp() |
| | | Page({ |
| | | data: { |
| | |
| | | autoplay: true, //轮播图参数 |
| | | duration: '500',//轮播图参数 |
| | | interval: 5000,//轮播图参数 |
| | | navigation: { type: 'dots' },//轮播图参数 |
| | | navigation: { |
| | | type: 'dots' |
| | | }, //轮播图参数 |
| | | bannerList: [], //轮播图列表 |
| | | specialSubjectList: [],//专题讨论 |
| | | activeItem: 0,//精选课程默认选中 |
| | |
| | | |
| | | // 首页测试登录功能,后续注释 |
| | | // 检查登录状态 |
| | | // const token = wx.getStorageSync(app.config.tokenKey) |
| | | // if (!token) { |
| | | // loginInfo(app, (data) => { |
| | | // // 如果不是第一次登录,会执行回调 |
| | | // if (data) { |
| | | // // 登录成功,自动记录token和用户信息,并返回true |
| | | // } else { |
| | | // // 出现错误,返回false |
| | | // } |
| | | // }) |
| | | // } else { |
| | | // // 如果是第一次登录,会跳转至绑定用户信息页面,填写完用户信息后进行登录并储存token和用户信息,结束后跳转回当前页面(携带页面参数) |
| | | // } |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | // 如果不是第一次登录,会执行回调 |
| | | if (data) { |
| | | // 登录成功,自动记录token和用户信息,并返回true |
| | | } else { |
| | | // 出现错误,返回false |
| | | } |
| | | }) |
| | | } else { |
| | | // 如果是第一次登录,会跳转至绑定用户信息页面,填写完用户信息后进行登录并储存token和用户信息,结束后跳转回当前页面(携带页面参数) |
| | | } |
| | | |
| | | this.init(); |
| | | }, |
| | | onReachBottom() { |
| | | }, |
| | | onReachBottom() {}, |
| | | onPullDownRefresh() { |
| | | this.setData({ |
| | | 'baseRefresh.value': true, |
| | |
| | | const list = [] |
| | | app.MG.resource.getItem({ |
| | | path: 'jsek_banner\\jsek_homeBannerApplet', |
| | | fields: { jsek_link: [] }, |
| | | paging: { start: 0, size: 9 } |
| | | fields: { |
| | | jsek_link: [] |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 9 |
| | | } |
| | | }).then(res => { |
| | | for (let i = 0; i < res.datas.length; i++) { |
| | | const item = res.datas[i] |
| | |
| | | |
| | | |
| | | loadHomePage() { |
| | | fetchHome().then(({ tabList }) => { |
| | | fetchHome().then(({ |
| | | tabList |
| | | }) => { |
| | | this.setData({ |
| | | tabList, |
| | | }); |
| | |
| | | size: '20', |
| | | start: '0', |
| | | storeRefCode: app.config.digitalCourses, |
| | | sort: { type: 'Asc', field: 'LinkOrder' } |
| | | sort: { |
| | | type: 'Asc', |
| | | field: 'LinkOrder' |
| | | } |
| | | } |
| | | app.MG.store.getStoreChannelList(data).then((res) => { |
| | | if (res.datas && res.datas.length > 0) { |
| | |
| | | size: '20', |
| | | start: '0', |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' } |
| | | sort: { |
| | | type: 'Asc', |
| | | field: 'LinkOrder' |
| | | } |
| | | } |
| | | app.MG.store.getStoreChannelList(data).then((res) => { |
| | | if (res.datas && res.datas.length > 0) { |
| | |
| | | dataList.push(...res.datas) |
| | | this.setData({ |
| | | bookTypeList: dataList, |
| | | activeItem1: 0 |
| | | activeItem1: 0, |
| | | bookTypeData: dataList[0], |
| | | }) |
| | | this.getBooksList(dataList[0]) |
| | | } |
| | |
| | | //图书服务 |
| | | tabBookClick(item) { |
| | | let info = this.data.bookTypeList[item.detail.value] |
| | | bookTypeData |
| | | this.setData({ |
| | | bookTypeData: info, |
| | | }) |
| | |
| | | fields: { |
| | | author: [], |
| | | }, |
| | | filterList: [ |
| | | { |
| | | filterList: [{ |
| | | value: 'Normal', |
| | | field: 'state' |
| | | } |
| | | ], |
| | | }], |
| | | sort: { |
| | | Name: 'Asc', |
| | | BaseType: '' |
| | |
| | | }, |
| | | // 跳转图书详情 |
| | | 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}`, |
| | | }); |
| | | }, |
| | | goSubjectDetail(e) { |
| | | const { book } = e.currentTarget.dataset; |
| | | const { |
| | | book |
| | | } = e.currentTarget.dataset; |
| | | wx.showToast({ |
| | | title: "建设中", |
| | | icon: 'none', |
| | |
| | | }) |
| | | }, |
| | | goCourseDetail(e) { |
| | | const { book } = e.currentTarget.dataset; |
| | | const { |
| | | book |
| | | } = e.currentTarget.dataset; |
| | | wx.showToast({ |
| | | title: "建设中", |
| | | icon: 'none', |
| | |
| | | }) |
| | | }, |
| | | goReadBookDetail(e) { |
| | | const { book } = e.currentTarget.dataset; |
| | | const { |
| | | book |
| | | } = e.currentTarget.dataset; |
| | | wx.showToast({ |
| | | title: "建设中", |
| | | icon: 'none', |
| | |
| | | }) |
| | | }, |
| | | goTextBookDetail(e) { |
| | | const { book } = e.currentTarget.dataset; |
| | | const { |
| | | book |
| | | } = e.currentTarget.dataset; |
| | | wx.showToast({ |
| | | title: "建设中", |
| | | icon: 'none', |
| | |
| | | }) |
| | | }, |
| | | addCart(e) { |
| | | const { info } = e.currentTarget.dataset; |
| | | const { |
| | | info |
| | | } = e.currentTarget.dataset; |
| | | wx.showToast({ |
| | | title: "建设中", |
| | | icon: 'none', |
| | |
| | | }) |
| | | } else { |
| | | let query = { |
| | | requests: [ |
| | | { |
| | | requests: [{ |
| | | saleMethodId: info.defaultSaleMethodId, |
| | | storeEventId: null, |
| | | agentCode: '电子书' |
| | | } |
| | | ] |
| | | }] |
| | | } |
| | | const addRes = app.MG.store.addShoppingCart(query) |
| | | if (addRes) { |
| | |
| | | this.data.lock = false; |
| | | if (this.data.userName.replace(/^\s*|\s*$/g, "")) { |
| | | if (this.data.mannder.replace(/^\s*|\s*$/g, "")) { |
| | | if (!this.data.phoneError) { |
| | | if (this.data.content.replace(/^\s*|\s*$/g, "")) { |
| | | let submitData = { |
| | | content: this.data.content.replace(/^\s*|\s*$/g, ""), |
| | |
| | | } else { |
| | | this.data.lock = true; |
| | | wx.showToast({ |
| | | title: "联系方式格式不正确", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | } |
| | | } else { |
| | | this.data.lock = true; |
| | | wx.showToast({ |
| | | title: "联系方式不能为空", |
| | | icon: 'none', |
| | | duration: 1000 |
| | |
| | | <view class="from-item"> |
| | | <view class="label"> 联系人: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入联系人" borderless value="{{userName}}" type="number" bindchange="bindTnputBlur" /> |
| | | <t-input placeholder="请输入联系人" borderless value="{{userName}}" bindchange="bindTnputBlur" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | |
| | | const app = getApp() |
| | | const menuData = [ |
| | | { |
| | | const menuData = [{ |
| | | title: '我的订单', |
| | | icon: '/static/images/personal/order.png', |
| | | url: '/packagePersonal/pages/myOrder/index', |
| | |
| | | type: 'publishBooks', |
| | | } |
| | | ]; |
| | | const moreMenu = [ |
| | | { |
| | | const moreMenu = [{ |
| | | title: '我的消息', |
| | | icon: '/static/images/personal/notification.png', |
| | | url: '/packagePersonal/pages/myMassage/index', |
| | |
| | | type: 'feedback', |
| | | } |
| | | ]; |
| | | const moreMenu1 = [ |
| | | { |
| | | const moreMenu1 = [{ |
| | | title: '关于我们', |
| | | icon: '/static/images/personal/about.png', |
| | | url: '/packagePersonal/pages/aboutUs/index?types=jsek_aboutUs', |
| | |
| | | type: 'contact', |
| | | } |
| | | ]; |
| | | const userTypeList = [ |
| | | { |
| | | const userTypeList = [{ |
| | | lable: '中职教师', |
| | | value: 'vocSchoolTeachers' |
| | | }, |
| | |
| | | visible: false, |
| | | baseRefresh: { |
| | | value: false |
| | | } |
| | | }, |
| | | loadingProps: { |
| | | size: '50rpx', |
| | | }, |
| | | scrollTop: 0, |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() { |
| | | }, |
| | | onReachBottom() {}, |
| | | // 获取登录用户身份 |
| | | getUserInfo() { |
| | | app.MG.identity.getCurrentAppUser().then(res => { |
| | |
| | | }); |
| | | }, |
| | | tabUserTypeClick(e) { |
| | | let { info } = e.currentTarget.dataset; |
| | | let { |
| | | info |
| | | } = e.currentTarget.dataset; |
| | | this.setData({ |
| | | userTypeActive: info.value, |
| | | }); |
| | | }, |
| | | submit() { |
| | | let userTypeInfo = { |
| | | requests: [ |
| | | { |
| | | data: JSON.stringify({ userType: this.data.userTypeActive }), |
| | | requests: [{ |
| | | data: JSON.stringify({ |
| | | userType: this.data.userTypeActive |
| | | }), |
| | | name: '用户类型', |
| | | type: 'userType' |
| | | } |
| | | ] |
| | | }] |
| | | } |
| | | app.MG.identity.setAppUserInfo(userTypeInfo).then((res) => { |
| | | if (res) { |
| | |
| | | this.setData({ |
| | | isWhite: e.detail.scrollTop > 10 ? true : false |
| | | }) |
| | | const { |
| | | scrollTop |
| | | } = e.detail; |
| | | this.setData({ |
| | | scrollTop |
| | | }); |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | |
| | | <view> |
| | | <t-pull-down-refresh value="{{baseRefresh.value}}" loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" bind:refresh="onPullDownRefresh" bind:scroll="onScroll"> |
| | | <t-pull-down-refresh value="{{baseRefresh.value}}" loadingProps="{{loadingProps}}" loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" bind:refresh="onPullDownRefresh" bind:scroll="onScroll"> |
| | | <view style="width: 100%; height: {{barHeight}}px;"></view> |
| | | <view class="background {{ isWhite ? 'white':''}}" style="padding-top: {{barHeight}}px"> |
| | | <text class="text">个人中心</text> |
| | |
| | | <!--pages/retrievalPage/index.wxml--> |
| | | <view class="outsideRetrievalPageBox"> |
| | | |
| | | <view class="retrievalPageBox"> |
| | | <view style="width: 100%; height: {{barHeight}}px; "></view> |
| | | <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> |
| | | <view> |
| | |
| | | <view class="cancellation" bind:tap="onCancellation">取消</view> |
| | | </view> |
| | | |
| | | </view> |
| | | <!--pages/retrievalPage/index.wxml--> |
| | | |
| | | |
| | | |
| | | <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel"> |
| | | |
| | | |
| | | <t-tabs class="tabsBox" defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel"> |
| | | <t-tab-panel label="图书({{bookTotal}})" value="0"> |
| | | <view wx:if="{{bookData.length <= 0}}" class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | |
| | | |
| | | </t-tab-panel> |
| | | </t-tabs> |
| | | </view> |
| | |
| | | .t-tabs__item--evenly { |
| | | flex: 1 0 auto !important; |
| | | } |
| | | |
| | | .outsideRetrievalPageBox { |
| | | position: relative; |
| | | } |
| | | |
| | | .retrievalPageBox { |
| | | position: fixed; |
| | | top: 0px; |
| | | background-color: #fff; |
| | | height: 150px; |
| | | z-index: 999; |
| | | } |
| | | |
| | | .tabsBox { |
| | | margin-top: 300rpx; |
| | | } |