| | |
| | | // pages/bibliographyList/index.js |
| | | import Toast from 'tdesign-miniprogram/toast/index'; |
| | | const app = getApp() |
| | | const config = |
| | | Page({ |
| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | hiddenmodalput: false, |
| | | name: "", |
| | | phoneNum: '', |
| | | input: '', |
| | | dialogKey: '', |
| | | showWithInput: false, |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | |
| | | |
| | | |
| | | this.higherGet() |
| | | this.vocationalGet() |
| | | this.teacherGet() |
| | |
| | | navBarHeight: navBarHeight, |
| | | barHeight: systInfo.statusBarHeight, |
| | | }) |
| | | |
| | | let event = { |
| | | detail: { |
| | | value: "0" |
| | | } |
| | | } |
| | | |
| | | this.onTabsChange(event) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | console.log(this.data.value); |
| | | // console.log(this.data.value); |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | |
| | | //高等教育 |
| | | higherGet(keyword) { |
| | | console.log(keyword, 'keyword'); |
| | | // console.log(keyword, 'keyword'); |
| | | let searchObj = { |
| | | 'Name*': keyword, |
| | | '||author*': keyword, |
| | |
| | | res.datas.forEach(item => { |
| | | item.determine = true |
| | | }) |
| | | console.log(res, 789111); |
| | | // console.log(res, 789111); |
| | | this.setData({ |
| | | higherList: res.datas, |
| | | higherTotal: res.total |
| | | }) |
| | | console.log(this.data.higherList, '5555'); |
| | | // console.log(this.data.higherList, '5555'); |
| | | this.setData({ |
| | | loading: false, //开启骨架屏加载 |
| | | hidden: false, //是否展示内容 |
| | |
| | | |
| | | const item = event.currentTarget.dataset.item |
| | | console.log(item); |
| | | wx.navigateTo({ |
| | | url: "/packageBookService/pages/components/webView/index?md5=" + |
| | | item.freeFile + |
| | | "&fileName=" + |
| | | item.name + |
| | | "&fileType=" + |
| | | item.fileType + "&bookBuy=true" |
| | | // "&freePage=" + |
| | | // this.data.fileInfo.freePage + |
| | | if (item.fileType == "pdf") { |
| | | wx.navigateTo({ |
| | | url: "/packageBookService/pages/components/webView/index?md5=" + |
| | | item.freeFile + |
| | | "&fileName=" + |
| | | item.name + |
| | | "&fileType=" + |
| | | item.fileType + "&bookBuy=true" |
| | | // "&freePage=" + |
| | | // this.data.fileInfo.freePage + |
| | | |
| | | // + |
| | | // "&bookId=" + |
| | | // this.data.bookDetail.id, |
| | | }); |
| | | // + |
| | | // "&bookId=" + |
| | | // this.data.bookDetail.id, |
| | | }); |
| | | } else { |
| | | Toast({ |
| | | context: this, |
| | | selector: '#t-toast', |
| | | message: '此书不能查看', |
| | | theme: 'warning', |
| | | direction: 'column', |
| | | }); |
| | | console.log(456); |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | |
| | | |
| | | |
| | | this.setData({ |
| | | [key]: true, |
| | | dialogKey: key, |
| | | // [key]: true, |
| | | // dialogKey: key, |
| | | hiddenmodalput: true, |
| | | input: '', |
| | | Md5: item.datas.freeFile.FileList[0].Md5 |
| | | |
| | | }); |
| | | |
| | | |
| | |
| | | }); |
| | | 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 |
| | | }) |
| | | }, |
| | | |
| | | |
| | | }) |