| | |
| | | }, |
| | | "[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; // 请求超时时间 |
| | |
| | | export const goodsStore = `defaultGoodsStore${appId}`; // 默认商品库(书城) |
| | | export const publicStore = `defaultPublicStore${appId}`; // 默认资源开放仓储 |
| | | export const publicRepository = `defaultPublicRepository${appId}`; // 默认资源开放库 |
| | | export const digitalCourses = "jsek_digitalCourses";//数字课程 |
| | | export const digitalTextbooks = "jsek_digitalTextbooks";//数字教材 |
| | | export const seminar = "jsek_seminar";//专题研讨 |
| | | export const digitalCourses = "jsek_digitalCourses"; //数字课程 |
| | | export const digitalTextbooks = "jsek_digitalTextbooks"; //数字教材 |
| | | export const seminar = "jsek_seminar"; //专题研讨 |
| | | // export const seminar ="jsek_seminar";//书展 |
| | | |
| | | export const reg_tel = |
| | |
| | | reg_telphone, |
| | | epubUrl |
| | | }; |
| | | export default config; |
| | | export default config; |
| | |
| | | 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) : '' |
| | | 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, |
| | | }); |
| | |
| | | // }, |
| | | }; |
| | | |
| | | export default ugcApi; |
| | | export default ugcApi; |
| | |
| | | openTeachids: [], |
| | | openLearnids: [], |
| | | openTestids: [], |
| | | applyResourceState: false, // 申请教学资源按钮防抖 |
| | | applyResourceState: false, // 申请教学资源按钮防抖 |
| | | resourceClassList: [], // 资源所属分类 |
| | | applyState: "", // 教学资源申请状态 |
| | | deadline: "", // 教学资源申请有效日期 |
| | | rejectCause: "", // 下载拒绝原因 |
| | | applyState: "", // 教学资源申请状态 |
| | | deadline: "", // 教学资源申请有效日期 |
| | | rejectCause: "", // 下载拒绝原因 |
| | | buyIdList: [], |
| | | shoppingCartGetId: [], // 已购买id列表 |
| | | shoppingList: [], |
| | | loading: false, |
| | | isShowTeachDownload: false, // 提示PC下载弹窗状态 |
| | | confirmBtn: { content: '我知道了', variant: 'base' }, |
| | | isShowTeachDownload: false, // 提示PC下载弹窗状态 |
| | | confirmBtn: { |
| | | content: '我知道了', |
| | | variant: 'base' |
| | | }, |
| | | mockData: { |
| | | id: 0, // 销售id |
| | | price: 0, // 售价 |
| | |
| | | }, |
| | | flag: true, |
| | | noResources: false, |
| | | selectedIds: "",//商品或子商品销售方式 |
| | | selectedIds: "", //商品或子商品销售方式 |
| | | bookBuy: false, //商品或子商品是否购买 |
| | | expire: false,//商品或子商品销售方式是否过期 |
| | | expire: false, //商品或子商品销售方式是否过期 |
| | | noFile: false, //商品或子商有无电子书文件 |
| | | num: 0, //样书申请单数量 |
| | | alreadyPaperBookList: [], //已申请纸质样书 |
| | |
| | | fileType: "", |
| | | md5: "", |
| | | freePage: "" |
| | | }, //阅读器数据 |
| | | }, //阅读器数据 |
| | | buyResourceData: { |
| | | productLinkPath: '', |
| | | refCode: '', |
| | |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | if (wx.getStorageSync("paperBookList")) { |
| | | this.setData({ |
| | | paperBookList: wx.getStorageSync("paperBookList"), |
| | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { }, |
| | | onHide() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() { }, |
| | | onUnload() {}, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() { }, |
| | | onShareAppMessage() {}, |
| | | // 格式化日期 |
| | | formatDate(dateString) { |
| | | if (!dateString) { |
| | |
| | | }, |
| | | // 跳转网店 |
| | | 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: [ |
| | | { |
| | | saleMethodId: this.data.selectedIds, |
| | | storeEventId: null, |
| | | agentCode: '电子书' |
| | | } |
| | | ] |
| | | requests: [{ |
| | | saleMethodId: this.data.selectedIds, |
| | | storeEventId: null, |
| | | agentCode: '电子书' |
| | | }] |
| | | } |
| | | const addRes = app.MG.store.addShoppingCart(query) |
| | | this.showSuccessToast() |
| | |
| | | let bookOrdersId = '' |
| | | let query = { |
| | | remarks: '电子书', |
| | | requests: [ |
| | | { |
| | | saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ? this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId, |
| | | count: 1 |
| | | } |
| | | ] |
| | | 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([ |
| | | { |
| | | name: this.data.bookDetail.name, |
| | | id: this.data.bookDetail.id, |
| | | // defaultSaleMethodId: bookData.value.defaultSaleMethodId, |
| | | icon: this.data.bookDetail.icon |
| | | } |
| | | ]) |
| | | 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: [ |
| | | { |
| | | saleMethodId: this.data.mockData.id, |
| | | count: 1 |
| | | } |
| | | ] |
| | | 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: [ |
| | | { |
| | | domain: 'mockData', |
| | | key: this.data.bookDetail.id + '', |
| | | value: JSON.stringify(this.data.mockData.mockList) |
| | | } |
| | | ] |
| | | setKeyRequests: [{ |
| | | domain: 'mockData', |
| | | key: this.data.bookDetail.id + '', |
| | | value: JSON.stringify(this.data.mockData.mockList) |
| | | }] |
| | | }) |
| | | }, |
| | | // 底部购买按钮 |
| | | buyBtn() { |
| | | if (this.data.tabValue == 'brief' && !this.data.bookBuy) { |
| | | this.buyBook() |
| | | } |
| | | else if (this.data.tabValue == 'jsek_cloudLearning') { |
| | | } else if (this.data.tabValue == 'jsek_cloudLearning') { |
| | | const tree = this.selectComponent('#tree') |
| | | tree.onCloudShoppingCart() |
| | | } else if (this.data.tabValue == 'questionBank') { |
| | |
| | | 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) {} |
| | | } |
| | | }) |
| | | } |
| | |
| | | teach: tree |
| | | }) |
| | | }, |
| | | }) |
| | | }) |
| | |
| | | const app = getApp(); |
| | | import { loginInfo } from '../../../../assets/js/login'; |
| | | import { |
| | | loginInfo |
| | | } from '../../../../assets/js/login'; |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | |
| | | bookList: [], |
| | | stairList: { |
| | | value: '', |
| | | options: [ |
| | | { |
| | | value: '', |
| | | label: '一级', |
| | | }, |
| | | ], |
| | | 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() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { }, |
| | | onHide() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() { }, |
| | | onUnload() {}, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() { }, |
| | | onShareAppMessage() {}, |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | |
| | | 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 = [ |
| | | { |
| | | value: '', |
| | | label: '一级', |
| | | }, |
| | | ]; |
| | | 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: [ |
| | | { |
| | | value: 'Normal', |
| | | field: 'state', |
| | | }, |
| | | ], |
| | | 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) |
| | | }, |
| | | }); |
| | | }); |
| | |
| | | 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, |
| | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad() { }, |
| | | onLoad() {}, |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | if (wx.getStorageSync(app.config.userInfoKey)) { |
| | | this.setData({ |
| | |
| | | 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, |
| | |
| | | app.MG.resource.getCmsTypeByRefCode({ |
| | | refCodes: ['jsek_paperVersionSampleBook'] |
| | | }). |
| | | then((res) => { |
| | | if (res && res.length > 0) { |
| | | this.setData({ |
| | | description: res[0].description, |
| | | 'teacherInfo.workInfo': res[0].cmsTypeLinks[0].children, |
| | | }) |
| | | } |
| | | }) |
| | | then((res) => { |
| | | if (res && res.length > 0) { |
| | | this.setData({ |
| | | description: res[0].description, |
| | | 'teacherInfo.workInfo': res[0].cmsTypeLinks[0].children, |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | //获取当前已申请次数(电子) |
| | | getSelectBookCount() { |
| | | let that = this; |
| | | app.MG.app.getTicketResult({ |
| | | ticketRefCodeOrGuid: 'electronicSampleBookapplyNum', |
| | | roleId: that.data.userInfo.roleId |
| | | }) |
| | | ticketRefCodeOrGuid: 'electronicSampleBookapplyNum', |
| | | roleId: that.data.userInfo.roleId |
| | | }) |
| | | .then((res) => { |
| | | let num = res.totalCount - res.usedCount; |
| | | that.setData({ |
| | |
| | | getSelectPaperBookCount() { |
| | | let that = this; |
| | | app.MG.app.getTicketResult({ |
| | | ticketRefCodeOrGuid: 'paperSampleBookapplyNum', |
| | | roleId: that.data.userInfo.roleId |
| | | }) |
| | | ticketRefCodeOrGuid: 'paperSampleBookapplyNum', |
| | | roleId: that.data.userInfo.roleId |
| | | }) |
| | | .then((res) => { |
| | | let count = res.totalCount - res.usedCount; |
| | | that.setData({ |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | //姓名 |
| | | 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="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> |
| | |
| | | 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.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.getBookList(false); |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | 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: [ |
| | | { |
| | | value: 'Normal', |
| | | field: 'state' |
| | | } |
| | | ], |
| | | 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 = []; |
| | | if (res.datas.length > 0) ( |
| | | if (res.datas.length > 0)( |
| | | res.datas.forEach((item) => { |
| | | item.value = item.refCode; |
| | | item.label = item.name; |
| | |
| | | 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: [ |
| | | { |
| | | value: 'Normal', |
| | | field: 'state', |
| | | }, |
| | | ], |
| | | 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) { |
| | | wx.showToast({ |
| | | title: "该样书已申请", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | if (role && role == 'Teacher') { |
| | | // 是教师 |
| | | if (e.detail.checked) { |
| | | // 点击选中 |
| | | if (this.data.paperBookCount == 0) { |
| | | wx.showToast({ |
| | | title: "您的纸质样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | return false; |
| | | } |
| | | 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 |
| | | }) |
| | | return |
| | | } |
| | | if (item.paperChecked) { |
| | | } 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: '请先进行教师认证?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | 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') |
| | | wx.showModal({ |
| | | title: '尊敬的用户,您好!', //提示的标题 |
| | | content: '请先进行教师认证?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | //选择电子样书 |
| | | onChangeElectron(e) { |
| | | const item = e.currentTarget.dataset.book; |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null; |
| | | if (role) { |
| | | if (item.electronDisabled) { |
| | | wx.showToast({ |
| | | title: "该样书已申请", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | 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", |
| | | duration: 1000, |
| | | }) |
| | | return false; |
| | | } |
| | | 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 |
| | | }) |
| | | return |
| | | } |
| | | if (item.electronChecked) { |
| | | } 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; |
| | | } |
| | | }) |
| | | } |
| | | item.electronChecked = false; |
| | | this.setData({ |
| | | electronicBookList: eList, |
| | | num: this.data.num - 1, |
| | | ["bookList[" + index + "].electronChecked"]: e.detail.checked |
| | | }) |
| | | 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: '请先进行教师认证?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | 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') |
| | | wx.showModal({ |
| | | title: '尊敬的用户,您好!', //提示的标题 |
| | | content: '请先进行教师认证?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/packageDomain/pages/teacherCertification/index", |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | 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, |
| | | }) |
| | | 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]], |
| | | }) |
| | | 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, |
| | | }) |
| | | } |
| | | eList.push(itemAttr) |
| | | this.setData({ |
| | | electronicBookList: eList, |
| | | }) |
| | | wx.setStorageSync("electronicBookList", eList); |
| | | } 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, |
| | | }) |
| | | } |
| | | pList.push(itemAttr) |
| | | this.setData({ |
| | | paperBookList: pList, |
| | | }) |
| | | wx.setStorageSync("paperBookList", pList); |
| | | } |
| | | this.setData({ |
| | | num: this.data.num + 1 |
| | | }) |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | }, |
| | | //去样书申请单 |
| | | goApply() { |
| | |
| | | <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> |
| | |
| | | |
| | | .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: [ |
| | | { |
| | | data: JSON.stringify(basicInfo), |
| | | name: that.data.teacherInfo.fullName + '', |
| | | type: 'newTeacherInfo' |
| | | } |
| | | ] |
| | | 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: [ |
| | | { |
| | | data: JSON.stringify(basicInfo), |
| | | name: that.data.teacherInfo.fullName + '', |
| | | type: 'teacherInfo' |
| | | } |
| | | ] |
| | | 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() {}, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | |
| | | |
| | | /* 上传图片样式 */ |
| | | .weui-uploader { |
| | | height: 152rpx; |
| | | /* height: 152rpx; */ |
| | | } |
| | | |
| | | .tp_add { |
| | |
| | | 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}}" /> |
| | |
| | | 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: { |
| | |
| | | isWhite: false, |
| | | userInfo: {}, |
| | | tabList: [], //目录 |
| | | current: 1,//轮播图参数 |
| | | current: 1, //轮播图参数 |
| | | autoplay: true, //轮播图参数 |
| | | duration: '500',//轮播图参数 |
| | | interval: 5000,//轮播图参数 |
| | | navigation: { type: 'dots' },//轮播图参数 |
| | | duration: '500', //轮播图参数 |
| | | interval: 5000, //轮播图参数 |
| | | navigation: { |
| | | type: 'dots' |
| | | }, //轮播图参数 |
| | | bannerList: [], //轮播图列表 |
| | | specialSubjectList: [],//专题讨论 |
| | | activeItem: 0,//精选课程默认选中 |
| | | courseTypeList: [],//精选课程分类 |
| | | specialSubjectList: [], //专题讨论 |
| | | activeItem: 0, //精选课程默认选中 |
| | | courseTypeList: [], //精选课程分类 |
| | | courseList: [], |
| | | bookTypeList: [],//图书类型 |
| | | bookTypeList: [], //图书类型 |
| | | activeItem1: 0, |
| | | bookTypeData: {}, |
| | | booksList: [], |
| | | readBookList: [], //数字阅读 |
| | | textbookList: [], //数字教材 |
| | | rankingList: [],//排行榜 |
| | | rankingList: [], //排行榜 |
| | | shoppingCartGetId: [], |
| | | baseRefresh: { |
| | | value: false |
| | |
| | | |
| | | 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: [ |
| | | { |
| | | value: 'Normal', |
| | | field: 'state' |
| | | } |
| | | ], |
| | | 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: [ |
| | | { |
| | | saleMethodId: info.defaultSaleMethodId, |
| | | storeEventId: null, |
| | | agentCode: '电子书' |
| | | } |
| | | ] |
| | | requests: [{ |
| | | saleMethodId: info.defaultSaleMethodId, |
| | | storeEventId: null, |
| | | agentCode: '电子书' |
| | | }] |
| | | } |
| | | const addRes = app.MG.store.addShoppingCart(query) |
| | | if (addRes) { |
| | |
| | | url: '/pages/retrievalPage/index?searchVal=' + this.data.searchVal |
| | | }) |
| | | }, |
| | | }); |
| | | }); |
| | |
| | | this.data.lock = false; |
| | | if (this.data.userName.replace(/^\s*|\s*$/g, "")) { |
| | | if (this.data.mannder.replace(/^\s*|\s*$/g, "")) { |
| | | if (this.data.content.replace(/^\s*|\s*$/g, "")) { |
| | | let submitData = { |
| | | content: this.data.content.replace(/^\s*|\s*$/g, ""), |
| | | name: this.data.userName.replace(/^\s*|\s*$/g, ""), |
| | | email: "", |
| | | phone: this.data.mannder.replace(/^\s*|\s*$/g, "") |
| | | }; |
| | | var data = { |
| | | topicIdOrRefCode: "feedback", |
| | | name: "意见反馈", |
| | | content: JSON.stringify(submitData), |
| | | type: "opinionFeedback", |
| | | state: "WaitAudit", |
| | | cmsTypeRefCode: "", |
| | | newDataListRequest: [] |
| | | }; |
| | | app.MG.ugc.newTopicMessage(data).then(res => { |
| | | if (!this.data.phoneError) { |
| | | if (this.data.content.replace(/^\s*|\s*$/g, "")) { |
| | | let submitData = { |
| | | content: this.data.content.replace(/^\s*|\s*$/g, ""), |
| | | name: this.data.userName.replace(/^\s*|\s*$/g, ""), |
| | | email: "", |
| | | phone: this.data.mannder.replace(/^\s*|\s*$/g, "") |
| | | }; |
| | | var data = { |
| | | topicIdOrRefCode: "feedback", |
| | | name: "意见反馈", |
| | | content: JSON.stringify(submitData), |
| | | type: "opinionFeedback", |
| | | state: "WaitAudit", |
| | | cmsTypeRefCode: "", |
| | | newDataListRequest: [] |
| | | }; |
| | | app.MG.ugc.newTopicMessage(data).then(res => { |
| | | this.data.lock = true; |
| | | if (res) { |
| | | wx.showToast({ |
| | | title: "提交成功", |
| | | icon: 'success', |
| | | duration: 1000, |
| | | success: function () { |
| | | setTimeout(function () { |
| | | wx.navigateBack(); |
| | | }, 1000) //延迟时间 |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } else { |
| | | this.data.lock = true; |
| | | if (res) { |
| | | wx.showToast({ |
| | | title: "提交成功", |
| | | icon: 'success', |
| | | duration: 1000, |
| | | success: function () { |
| | | setTimeout(function () { |
| | | wx.navigateBack(); |
| | | }, 1000) //延迟时间 |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | wx.showToast({ |
| | | title: "反馈内容不能为空", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | } |
| | | } else { |
| | | this.data.lock = true; |
| | | wx.showToast({ |
| | | title: "反馈内容不能为空", |
| | | 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"> |