| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | |
| | | |
| | | |
| | | this.higherGet() |
| | | this.vocationalGet() |
| | | this.teacherGet() |
| | | |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | |
| | | |
| | | }, |
| | | onTabsChange(event) { |
| | | |
| | | const value = event.detail.value |
| | | |
| | | if (value === '0') { |
| | | console.log(value); |
| | | this.setData({ |
| | |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | |
| | | //高等教育 |
| | | higherGet(keyword) { |
| | | // console.log(keyword, 'keyword'); |
| | |
| | | 'Name*': keyword, |
| | | '||author*': keyword, |
| | | '||isbn*': keyword |
| | | |
| | | } |
| | | |
| | | app.MG.resource.getItem({ |
| | | path: 'jsek_biblioClassification\\jsek_bCHigherEducation', |
| | | queryType: '*', |
| | |
| | | res.datas.forEach(item => { |
| | | item.determine = true |
| | | }) |
| | | // console.log(res, 789111); |
| | | this.setData({ |
| | | higherList: res.datas, |
| | | higherTotal: res.total |
| | | }) |
| | | // console.log(this.data.higherList, '5555'); |
| | | this.setData({ |
| | | loading: false, //开启骨架屏加载 |
| | | hidden: false, //是否展示内容 |
| | | }) |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | |
| | | |
| | | }, |
| | | |
| | | //教师教育 |
| | |
| | | 'Name*': keyword, |
| | | '||author*': keyword, |
| | | '||isbn*': keyword |
| | | |
| | | } |
| | | app.MG.resource.getItem({ |
| | | path: 'jsek_biblioClassification\\jsek_bCVocationalEducation', |
| | |
| | | vocationalList: res.datas, |
| | | vocationalTotal: res.total |
| | | }) |
| | | |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | |
| | | 'Name*': keyword, |
| | | '||author*': keyword, |
| | | '||isbn*': keyword |
| | | |
| | | } |
| | | app.MG.resource.getItem({ |
| | | path: 'jsek_biblioClassification\\jsek_bCTeacherEducation', |
| | |
| | | // }, 2000); |
| | | // }, |
| | | downloadData(event) { |
| | | |
| | | const item = event.currentTarget.dataset.item |
| | | console.log(item); |
| | | if (item.fileType == "pdf") { |
| | | |
| | | wx.navigateTo({ |
| | | url: "/packageBookService/pages/components/webView/index?md5=" + |
| | | item.freeFile + |
| | |
| | | theme: 'warning', |
| | | direction: 'column', |
| | | }); |
| | | console.log(456); |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | onSearchSubmit: function (e) { |
| | | const keyword = e.detail.value; |
| | |
| | | this.vocationalGet(keyword) |
| | | this.teacherGet(keyword) |
| | | }, |
| | | |
| | | |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | onReachBottom(e) { |
| | | if (this.data.tabValue == 0) { |
| | | console.log(0); |
| | | if (this.data.higherList.length < this.data.higherTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | |
| | | } else if (this.data.tabValue == 2) { |
| | | |
| | | if (this.data.teacherList.length < this.data.teacherTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | |
| | | } else if (this.data.tabValue == 1) { |
| | | |
| | | console.log(this.data.vocationalList.length); |
| | | console.log(this.data.vocationalTotal); |
| | | if (this.data.vocationalList.length < this.data.vocationalTotal) { |
| | |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | console.log(2); |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | |
| | | onPullDownRefresh() { |
| | |
| | | mailbox(e) { |
| | | const key = e.currentTarget.dataset.key; |
| | | const item = e.currentTarget.dataset.item; |
| | | |
| | | |
| | | |
| | | this.setData({ |
| | | // [key]: true, |
| | | // dialogKey: key, |
| | | hiddenmodalput: true, |
| | | input: '', |
| | | Md5: item.datas.freeFile.FileList[0].Md5 |
| | | |
| | | }); |
| | | |
| | | |
| | | |
| | | }, |
| | | |
| | | onEmailInput(e) { |
| | | const isEmailValid = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(e.detail.value); |
| | | }) |
| | | wx.showModal({ |
| | | title: '请输入邮箱', |
| | | content: '', |
| | | confirmColor: '#ff6c00', |
| | | cancelColor: '#949494', |
| | | placeholderText: '请输入邮箱号', |
| | | editable: true, |
| | | complete: (res) => { |
| | | if (res.cancel) { |
| | | console.log('取消'); |
| | | } |
| | | if (res.confirm) { |
| | | this.setData({ |
| | | emailError: !isEmailValid, |
| | | "input": e.detail.value, |
| | | }); |
| | | input: res.content |
| | | }) |
| | | this.confirmM() |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | //弹窗确认 |
| | | onConfirm() { |
| | | if (!this.data.emailError && this.data.input) { |
| | | const { |
| | | dialogKey |
| | | } = this.data; |
| | | this.setData({ |
| | | [dialogKey]: false |
| | | }); |
| | | |
| | | |
| | | console.log(this.data.input); |
| | | console.log(this.data.Md5); |
| | | if (this.data.input) { |
| | | //提交 |
| | | confirmM(e) { |
| | | const isEmailValid = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(this.data.input); |
| | | if (isEmailValid && this.data.input) { |
| | | let query = { |
| | | eMail: this.data.input, |
| | | md5s: [this.data.Md5] |
| | | } |
| | | app.MG.file.sendFileWithEmail(query).then(res => { |
| | | console.log(res); |
| | | if (res) { |
| | | wx.showToast({ |
| | | icon: 'success', |
| | | title: '邮件已发送', |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | // 校验不通过,给出错误提示 |
| | | wx.showToast({ |
| | |
| | | icon: 'none', |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | // 弹窗取消 |
| | | closeDialog() { |
| | | const { |
| | | dialogKey |
| | | } = this.data; |
| | | this.setData({ |
| | | [dialogKey]: false |
| | | }); |
| | | console.log(111); |
| | | }, |
| | | //取消弹框 |
| | | cancelM: function (e) { |
| | | this.setData({ |
| | | hiddenmodalput: false, |
| | | }) |
| | | }, |
| | | //提交 |
| | | confirmM: function (e) { |
| | | console.log("姓名:" + this.data.name + " 电话:" + this.data.phoneNum); |
| | | if (!this.data.emailError && this.data.name) { |
| | | |
| | | |
| | | |
| | | |
| | | if (this.data.name) { |
| | | let query = { |
| | | eMail: this.data.name, |
| | | md5s: [this.data.Md5] |
| | | } |
| | | app.MG.file.sendFileWithEmail(query).then(res => { |
| | | console.log(res); |
| | | this.setData({ |
| | | hiddenmodalput: false, |
| | | }) |
| | | }) |
| | | } |
| | | } else { |
| | | // 校验不通过,给出错误提示 |
| | | wx.showToast({ |
| | | title: '邮箱格式不正确', |
| | | icon: 'none', |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | |
| | | iName: function (e) { |
| | | this.setData({ |
| | | name: e.detail.value |
| | | }) |
| | | // console.log(this.data.name); |
| | | }, |
| | | iPhoneNum: function (e) { |
| | | this.setData({ |
| | | phoneNum: e.detail.value |
| | | }) |
| | | }, |
| | | |
| | | |
| | | }) |