| | |
| | | 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) { |
| | | if (e.detail.value) { |
| | | 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, |
| | | }); |
| | | } |
| | | } else { |
| | | this.setData({ |
| | | phoneError: !isPhoneNumber, |
| | | "contactInfo.phone": e.detail.value, |
| | | phoneError: false, |
| | | }); |
| | | } |
| | | }, |
| | |
| | | electronicBookList: [], |
| | | bookList: [], |
| | | }) |
| | | wx.setStorageSync("electronicBookList", []); |
| | | wx.removeStorageSync("electronicBookList") |
| | | } else { |
| | | that.setData({ |
| | | paperBookList: [], |
| | | bookList: [], |
| | | }) |
| | | wx.setStorageSync("paperBookList", []); |
| | | wx.removeStorageSync("paperBookList") |
| | | } |
| | | wx.showModal({ |
| | | title: '提示!', //提示的标题 |
| | |
| | | <view class="item"> |
| | | <text class="label">姓名:</text> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入真实姓名" borderless adjust-position="false" value="{{contactInfo.fullName}}" bindchange="onFullNameInput" /> |
| | | <t-input placeholder="请输入真实姓名" borderless value="{{contactInfo.fullName}}" bindchange="onFullNameInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="item"> |
| | | <text class="label">联系电话:</text> |
| | | <view class="item-content"> |
| | | <t-input placeholder="输入联系电话" borderless adjust-position="false" value="{{contactInfo.phone}}" type="number" tips="{{phoneError ? '手机号输入不正确' : ''}}" bindchange="onPhoneInput" /> |
| | | <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"> |
| | | <t-input placeholder="请输入详细地址" borderless adjust-position="false" value="{{contactInfo.detailedAddress}}" bindchange="onAddressInput" /> |
| | | <t-input placeholder="请输入详细地址" borderless value="{{contactInfo.detailedAddress}}" bindchange="onAddressInput" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | } |
| | | |
| | | .btn-area { |
| | | margin: 40rpx 0; |
| | | margin: 40rpx; |
| | | padding: 0 40rpx; |
| | | padding-bottom: 60rpx; |
| | | } |
| | | |
| | | .submit { |
| | |
| | | this.setData({ |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | | this.getAlreadyPBookList() |
| | | this.getAlreadyEBookList() |
| | | // 获取申请次数 |
| | | this.getSelectPaperBookCount() |
| | | this.getSelectBookCount() |
| | | |
| | | } |
| | | }, |
| | | |
| | |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | if (wx.getStorageSync("paperBookList")) { |
| | | this.setData({ |
| | | paperBookList: wx.getStorageSync("paperBookList"), |
| | | }) |
| | | } |
| | | if (wx.getStorageSync("electronicBookList")) { |
| | | this.setData({ |
| | | electronicBookList: wx.getStorageSync("electronicBookList"), |
| | | }) |
| | | } |
| | | this.setData({ |
| | | num: this.data.paperBookList.length + this.data.electronicBookList.length |
| | | page: 1, |
| | | paperBookList: [], |
| | | electronicBookList: [] |
| | | }) |
| | | this.getAlreadyPBookList() |
| | | this.getAlreadyEBookList() |
| | | // 获取申请次数 |
| | | this.getSelectPaperBookCount() |
| | | this.getSelectBookCount() |
| | | console.log(this.data.electronicBookList.length, this.data.paperBookList.length, 1) |
| | | if (wx.getStorageSync("paperBookList") || wx.getStorageSync("electronicBookList")) { |
| | | if (wx.getStorageSync("paperBookList")) { |
| | | this.setData({ |
| | | paperBookList: wx.getStorageSync("paperBookList"), |
| | | }) |
| | | } |
| | | if (wx.getStorageSync("electronicBookList")) { |
| | | this.setData({ |
| | | electronicBookList: wx.getStorageSync("electronicBookList"), |
| | | }) |
| | | } |
| | | this.setData({ |
| | | num: this.data.paperBookList.length + this.data.electronicBookList.length |
| | | }) |
| | | } |
| | | this.getBookList(false); |
| | | }, |
| | | goBack() { |
| | |
| | | }, |
| | | |
| | | // 获取纸质书剩余次数 |
| | | getSelectPaperBookCount(item) { |
| | | getSelectPaperBookCount() { |
| | | app.MG.app |
| | | .getTicketResult({ |
| | | ticketRefCodeOrGuid: 'paperSampleBookapplyNum', |
| | |
| | | }) |
| | | }, |
| | | // 获取电子书剩余次数 |
| | | getSelectBookCount(item) { |
| | | getSelectBookCount() { |
| | | app.MG.app |
| | | .getTicketResult({ |
| | | ticketRefCodeOrGuid: 'electronicSampleBookapplyNum', |
| | |
| | | } |
| | | if (that.data.alreadyPaperBookList.length > 0) { |
| | | that.data.alreadyPaperBookList.forEach((pBook) => { |
| | | pBook.content.forEach((pBookItem) => { |
| | | if (pBookItem.id === item.id && pBook.state == 'WaitAudit') { |
| | | item.paperDisabled = true |
| | | item.paperChecked = true |
| | | } |
| | | if (pBookItem.id === item.id && pBook.state == 'Normal') { |
| | | item.paperDisabled = false |
| | | } |
| | | }) |
| | | if (pBook.content.length > 0) { |
| | | pBook.content.forEach((pBookItem) => { |
| | | if (pBookItem.id === item.id && pBook.state == 'WaitAudit') { |
| | | item.paperDisabled = true |
| | | item.paperChecked = true |
| | | } |
| | | if (pBookItem.id === item.id && pBook.state == 'Normal') { |
| | | item.paperDisabled = false |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (that.data.alreadyElectronicBookList.length > 0) { |
| | | that.data.alreadyElectronicBookList.forEach((eBook) => { |
| | | eBook.content.forEach((eBookItem) => { |
| | | if (eBookItem.id === item.id && !eBook.isExpiry && eBook.state != 'Reject') { |
| | | item.electronDisabled = true |
| | | item.electronChecked = true |
| | | } |
| | | }) |
| | | if (eBook.content.length > 0) { |
| | | eBook.content.forEach((eBookItem) => { |
| | | if (eBookItem.id === item.id && !eBook.isExpiry && eBook.state != 'Reject') { |
| | | item.electronDisabled = true |
| | | item.electronChecked = true |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | if (that.data.paperBookList.length > 0) { |
| | |
| | | defaultUser = { |
| | | ...teacherInfos, |
| | | nickName: nickNameData && JSON.parse(nickNameData.data).nickName ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, |
| | | icon: nickNameData && JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | icon: nickNameData && JSON.parse(nickNameData.data).icon != "" ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | userId: res.userId, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id, |
| | |
| | | defaultUser = { |
| | | ...WeChatInfo, |
| | | nickName: nickNameData && JSON.parse(nickNameData.data).nickName ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, |
| | | icon: nickNameData && JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | icon: nickNameData && JSON.parse(nickNameData.data).icon != "" ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | userId: res.userId, |
| | | } |
| | | } |
| | |
| | | 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) { |
| | | if (e.detail.value) { |
| | | 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, |
| | | "teacherInfo.phone": e.detail.value, |
| | | }); |
| | | } |
| | | } else { |
| | | this.setData({ |
| | | phoneError: !isPhoneNumber, |
| | | "teacherInfo.phone": e.detail.value, |
| | | phoneError: false, |
| | | }); |
| | | } |
| | | }, |
| | |
| | | const { |
| | | telphoneError |
| | | } = this.data; |
| | | const isPhoneNumber = /^0\d{2}-\d{8}$|^0\d{3}-\d{7}$/.test(e.detail.value); |
| | | if (telphoneError === isPhoneNumber) { |
| | | if (e.detail.value) { |
| | | const isPhoneNumber = /^0\d{2}-\d{8}$|^0\d{3}-\d{7}$/.test(e.detail.value); |
| | | if (telphoneError === isPhoneNumber) { |
| | | this.setData({ |
| | | telphoneError: !isPhoneNumber, |
| | | "teacherInfo.telphone": e.detail.value, |
| | | }); |
| | | } |
| | | } else { |
| | | this.setData({ |
| | | telphoneError: !isPhoneNumber, |
| | | "teacherInfo.telphone": e.detail.value, |
| | | telphoneError: false, |
| | | }); |
| | | } |
| | | }, |
| | |
| | | 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) { |
| | | if (e.detail.value) { |
| | | 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({ |
| | | emailError: !isPhoneNumber, |
| | | "teacherInfo.email": e.detail.value, |
| | | }); |
| | | } |
| | | } else { |
| | | this.setData({ |
| | | emailError: !isPhoneNumber, |
| | | "teacherInfo.email": e.detail.value, |
| | | emailError: false, |
| | | }); |
| | | } |
| | | }, |
| | |
| | | <view class="from-item"> |
| | | <view class="label"> 学校: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入学校" borderless adjust-position="false" value="{{teacherInfo.schoolName}}" disabled="{{!editState}}" bindchange="onSchoolNameInput" /> |
| | | <t-input placeholder="请输入学校" borderless value="{{teacherInfo.schoolName}}" disabled="{{!editState}}" bindchange="onSchoolNameInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 真实姓名: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入真实姓名" borderless adjust-position="false" value="{{teacherInfo.fullName}}" disabled="{{!editState}}" bindchange="onFullNameInput" /> |
| | | <t-input placeholder="请输入真实姓名" borderless value="{{teacherInfo.fullName}}" disabled="{{!editState}}" bindchange="onFullNameInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | |
| | | <view class="from-item"> |
| | | <view class="label"> 任教课程: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入任教课程" borderless adjust-position="false" value="{{teacherInfo.courseName}}" bindchange="onCourseNameInput" disabled="{{!editState}}" /> |
| | | <t-input placeholder="请输入任教课程" borderless value="{{teacherInfo.courseName}}" bindchange="onCourseNameInput" disabled="{{!editState}}" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 手机号: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="输入手机号码" borderless adjust-position="false" value="{{teacherInfo.phone}}" type="number" tips="{{phoneError ? '手机号输入不正确' : ''}}" bindchange="onPhoneInput" disabled="{{!editState}}" /> |
| | | <t-input placeholder="输入手机号码" borderless value="{{teacherInfo.phone}}" type="number" tips="{{phoneError ? '手机号输入不正确' : ''}}" bindchange="onPhoneInput" disabled="{{!editState}}" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 座机: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="输入座机号" borderless value="{{teacherInfo.telphone}}" adjust-position="false" tips="{{telphoneError ? '座机号输入不正确' : ''}}" bindchange="onTelphoneInput" disabled="{{!editState}}" /> |
| | | <t-input placeholder="输入座机号" borderless value="{{teacherInfo.telphone}}" tips="{{telphoneError ? '座机号输入不正确' : ''}}" bindchange="onTelphoneInput" disabled="{{!editState}}" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 邮箱: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="输入邮箱" borderless adjust-position="false" value="{{teacherInfo.email}}" tips="{{emailError ? '邮箱输入不正确' : ''}}" bindchange="onEmailInput" disabled="{{!editState}}" /> |
| | | <t-input placeholder="输入邮箱" borderless value="{{teacherInfo.email}}" tips="{{emailError ? '邮箱输入不正确' : ''}}" bindchange="onEmailInput" disabled="{{!editState}}" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> 详细地址: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入详细地址" borderless adjust-position="false" value="{{teacherInfo.detailedAddress}}" bindchange="onAddressInput" disabled="{{!editState}}" /> |
| | | <t-input placeholder="请输入详细地址" borderless value="{{teacherInfo.detailedAddress}}" bindchange="onAddressInput" disabled="{{!editState}}" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | .block { |
| | | position: relative; |
| | | width: 600rpx; |
| | | height: 600rpx; |
| | | height: 820rpx; |
| | | padding: 20rpx 0; |
| | | background: #fff; |
| | | border-radius: 16rpx; |
| | |
| | | if (teacherRole && teacherInfos) { |
| | | defaultUser = { |
| | | ...teacherInfos, |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : teacherInfos.name, |
| | | icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : WeChatInfo ? WeChatInfo.name : '', |
| | | icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo ? WeChatInfo.icon : '', |
| | | userId: res.userId, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id, |
| | |
| | | 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) { |
| | | if (e.detail.value) { |
| | | 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, |
| | | "userInfoForm.phone": e.detail.value, |
| | | }); |
| | | } |
| | | } else { |
| | | this.setData({ |
| | | phoneError: !isPhoneNumber, |
| | | "userInfoForm.phone": e.detail.value, |
| | | phoneError: false, |
| | | }); |
| | | } |
| | | }, |
| | |
| | | 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) { |
| | | if (e.detail.value) { |
| | | 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({ |
| | | emailError: !isPhoneNumber, |
| | | "userInfoForm.email": e.detail.value, |
| | | }); |
| | | } |
| | | } else { |
| | | this.setData({ |
| | | emailError: !isPhoneNumber, |
| | | "userInfoForm.email": e.detail.value, |
| | | emailError: false, |
| | | }); |
| | | } |
| | | }, |
| | |
| | | } |
| | | |
| | | .inputBox1 { |
| | | height: 72rpx; |
| | | border: 2rpx solid #D9D9D9; |
| | | flex: 1; |
| | | } |
| | | |
| | | .inputBox1 .t-input { |
| | | width: 380rpx !important; |
| | | } |
| | | |
| | | |
| | | .block { |
| | | position: relative; |
| | |
| | | |
| | | .block .body .inputBox { |
| | | width: 300rpx; |
| | | height: 72rpx; |
| | | border: 2rpx solid #D9D9D9; |
| | | } |
| | | |
| | |
| | | }) |
| | | |
| | | res.datas.forEach(item => { |
| | | console.log(item, 'item456'); |
| | | item.imgUrl = getPublicImage(item.productMonWithLinkDto.product.icon, '', '160'); |
| | | |
| | | // this.setData({ |
| | | // type: item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product' |
| | | // }) |
| | | const type = item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product'; |
| | | item.type = type; // 将type设置为item对象的属性,而不是使用setData |
| | | |
| | | // debugger |
| | | |
| | | }); |
| | |
| | | |
| | | |
| | | if (this.data.shoppingCartData.length === 0) { |
| | | console.log(11111); |
| | | this.setData({ |
| | | onDisabled: true |
| | | }) |
| | |
| | | if (teacherRole && teacherInfos) { |
| | | defaultUser = { |
| | | ...teacherInfos, |
| | | nickName: nickNameData && JSON.parse(nickNameData.data).nickName ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, |
| | | icon: nickNameData && JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | nickName: nickNameData && JSON.parse(nickNameData.data).nickName ? JSON.parse(nickNameData.data).nickName : WeChatInfo ? WeChatInfo.name : '', |
| | | icon: nickNameData && JSON.parse(nickNameData.data).icon != "" ? JSON.parse(nickNameData.data).icon : WeChatInfo ? WeChatInfo.icon : '', |
| | | userId: res.userId, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id, |
| | |
| | | defaultUser = { |
| | | ...WeChatInfo, |
| | | nickName: nickNameData && JSON.parse(nickNameData.data).nickName ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, |
| | | icon: nickNameData && JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | icon: nickNameData && JSON.parse(nickNameData.data).icon != "" ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, |
| | | userId: res.userId, |
| | | userType: type, |
| | | role: 'Student', |