From 9b95dadd2e9dc16c2f03468333d1a4df72740526 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期日, 07 四月 2024 15:11:12 +0800 Subject: [PATCH] 个人中心 --- packagePersonal/pages/userSetting/index.wxml | 2 pages/home/home.js | 4 + assets/js/config.js | 12 +++--- packageBookService/pages/bookServices/detail/index.js | 42 ++++++++++---------- pages/home/home.wxml | 2 packagePersonal/pages/userSetting/index.js | 52 ++++++++++++++++++++++++- 6 files changed, 81 insertions(+), 33 deletions(-) diff --git a/assets/js/config.js b/assets/js/config.js index e24b5cb..924f932 100644 --- a/assets/js/config.js +++ b/assets/js/config.js @@ -1,9 +1,9 @@ -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 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 pdfUrl = "http://182.92.203.7:3007/pdfRead/" export const requestTimeOut = 300000; // 璇锋眰瓒呮椂鏃堕棿 export const tokenKey = "jsek-token"; diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index 3a04430..1240104 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -954,8 +954,7 @@ remarks: "鐢靛瓙涔�", requests: [{ saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ? - this.data.bookItemDetail.defaultSaleMethodId : - this.data.bookDetail.defaultSaleMethodId, + this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId, count: 1, }, ], }; @@ -1848,14 +1847,7 @@ }); return false; } - if (this.data.electronicBookList.length >= 2) { - wx.showToast({ - title: "姣忔鏈�澶氬彧鍙敵璇�2鏈牱涔�", - icon: "none", - duration: 1000, - }); - return false; - } + let isHas = this.data.electronicBookList.find( (eitem) => eitem.id == this.data.bookDetail.id ); @@ -1873,6 +1865,14 @@ if (isApply) { wx.showToast({ title: "璇ヤ功宸茬敵璇凤紒", + icon: "none", + duration: 1000, + }); + return false; + } + if (this.data.electronicBookList.length >= 2) { + wx.showToast({ + title: "姣忔鏈�澶氬彧鍙敵璇�2鏈牱涔�", icon: "none", duration: 1000, }); @@ -1917,6 +1917,17 @@ }); return false; } + let isApply = this.data.alreadyPaperBookList.find( + (pitem) => pitem.id == this.data.bookDetail.id + ); + if (isApply) { + wx.showToast({ + title: "璇ヤ功宸茬敵璇凤紒", + icon: "none", + duration: 1000, + }); + return false; + } if (this.data.paperBookList.length >= 2) { wx.showToast({ title: "姣忔鏈�澶氬彧鍙敵璇�2鏈牱涔�", @@ -1931,17 +1942,6 @@ if (isHas) { wx.showToast({ title: "璇ヤ功宸插湪娓呭崟鍒楄〃涓�", - icon: "none", - duration: 1000, - }); - return false; - } - let isApply = this.data.alreadyPaperBookList.find( - (pitem) => pitem.id == this.data.bookDetail.id - ); - if (isApply) { - wx.showToast({ - title: "璇ヤ功宸茬敵璇凤紒", icon: "none", duration: 1000, }); diff --git a/packagePersonal/pages/userSetting/index.js b/packagePersonal/pages/userSetting/index.js index fee72d8..5a6bcc3 100644 --- a/packagePersonal/pages/userSetting/index.js +++ b/packagePersonal/pages/userSetting/index.js @@ -231,9 +231,11 @@ if (emailError === isPhoneNumber) { this.setData({ emailError: !isPhoneNumber, - "userInfoForm.email": e.detail.value, }); } + this.setData({ + "userInfoForm.email": e.detail.value, + }); } else { this.setData({ emailError: false, @@ -331,8 +333,6 @@ icon: 'none', duration: 1000 }) - // 寮�鍚煭淇¢獙璇佸�掕鏃� - this.getSecond(60) } else { wx.showToast({ title: '閭楠岃瘉鐮佸彂閫佸け璐�', @@ -353,6 +353,14 @@ confirmInfo() { if (this.data.editType == 'nickName') { + if (!this.data.userInfoForm.nickName) { + wx.showToast({ + title: '璇疯緭鍏ユ樀绉�', + icon: 'none', + duration: 1000 + }) + return false; + } let userTypeInfo = { "requests": [{ data: JSON.stringify({ @@ -378,6 +386,22 @@ }) } else if (this.data.editType == 'phone') { + if (!this.data.userInfoForm.phone) { + wx.showToast({ + title: '璇疯緭鍏ユ墜鏈哄彿', + icon: 'none', + duration: 1000 + }) + return false; + } + if (!this.data.userInfoForm.code) { + wx.showToast({ + title: '璇疯緭鍏ラ獙璇佺爜', + icon: 'none', + duration: 1000 + }) + return false; + } let query = { phoneNumber: this.data.userInfoForm.phone, phoneCaptcha: this.data.userInfoForm.code @@ -389,12 +413,18 @@ icon: 'none', duration: 1000 }) + this.setData({ + countDown: 0, + }); } else if (res == '姝ゆ墜鏈哄彿鐮佸凡琚叾瀹冭处鍙风粦瀹�') { wx.showToast({ title: res + ',璇锋洿鎹㈠叾浠栨墜鏈哄彿銆�', icon: 'none', duration: 1000 }) + this.setData({ + countDown: 0, + }); } else { wx.showToast({ title: res, @@ -409,6 +439,22 @@ } }) } else if (this.data.editType == 'email') { + if (!this.data.userInfoForm.email) { + wx.showToast({ + title: '璇疯緭鍏ラ偖绠�', + icon: 'none', + duration: 1000 + }) + return false; + } + if (!this.data.userInfoForm.code) { + wx.showToast({ + title: '璇疯緭鍏ラ獙璇佺爜', + icon: 'none', + duration: 1000 + }) + return false; + } let query = { eMail: this.data.userInfoForm.email, captcha: this.data.userInfoForm.code diff --git a/packagePersonal/pages/userSetting/index.wxml b/packagePersonal/pages/userSetting/index.wxml index 737d57a..9a4fe31 100644 --- a/packagePersonal/pages/userSetting/index.wxml +++ b/packagePersonal/pages/userSetting/index.wxml @@ -69,7 +69,7 @@ <t-input placeholder="杈撳叆鐭俊楠岃瘉鐮�" borderless value="{{userInfoForm.code}}" type="number" bindchange="onCodeInput" /> </view> <view class="code"> - <button class="btn" bindtap="getPhoneCode">{{countDown > 0 ? countDown : '鑾峰彇鐭俊楠岃瘉鐮�'}}</button> + <button class="btn" bindtap="getPhoneCode">{{countDown > 0 ? '楠岃瘉鐮�(' + countDown + 's)' : '鑾峰彇鐭俊楠岃瘉鐮�'}}</button> </view> </view> </view> diff --git a/pages/home/home.js b/pages/home/home.js index b7e213f..cac6afc 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -75,7 +75,9 @@ onPullDownRefresh() { this.setData({ 'baseRefresh.value': true, + isWhite: false }) + this.getBannerList(); this.init(); }, init() { @@ -567,11 +569,11 @@ }, onScrollToTop(e) { - this.setData({ isWhite: e.detail.scrollTop > 50 ? true : false }) }, + onRetrievalPage() { // 棣栭〉娴嬭瘯鐧诲綍鍔熻兘锛屽悗缁敞閲� diff --git a/pages/home/home.wxml b/pages/home/home.wxml index cc37881..9678950 100644 --- a/pages/home/home.wxml +++ b/pages/home/home.wxml @@ -121,7 +121,7 @@ <view wx:for="{{booksList}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="booksListItemBox"> <view class="listItem" bind:tap="goDetail" data-book="{{item}}"> <view class="specialSubject-img"> - <image src="{{item.icon}}" mode="aspectFit" class="img" /> + <image src="{{item.icon ? item.icon : '/static/images/default-book-img.png'}}" mode="aspectFit" class="img" aria-label="{{item.name}}" /> </view> <view class="body-info"> <view class="name">{{item.name}}</view> -- Gitblit v1.9.1