From c3086cda662e2b908cf96b6b3ff599713eb924d6 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期一, 02 九月 2024 16:59:16 +0800 Subject: [PATCH] gongneng --- pages/digitalCourses/index.json | 2 pages/digitalTextbooks/index.wxml | 82 ++- pages/digitalTextbooks/index.wxss | 27 pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.wxss | 6 pages/bookExhibitionList/index.js | 5 pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.wxml | 4 static/images/personal/jifen-bg.png | 0 assets/js/middleGround/api/store.js | 18 pages/digitalTextbooks/index.js | 73 ++- pages/digitalCourses/digitalCoursesDetails/index.wxss | 36 + pages/digitalCourses/index.js | 71 ++ pages/personalCenter/index.wxml | 26 - pages/digitalCourses/digitalCoursesDetails/index.wxml | 10 pages/digitalTextbooks/index.json | 2 pages/personalCenter/certificate/index.wxml | 4 packageBookService/pages/bookServices/detail/index.js | 18 pages/digitalTextbooks/digitalTextbooksDetails/index.js | 32 pages/personalCenter/index.js | 2 pages/digitalCourses/digitalCoursesDetails/index.js | 81 +++ pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.json | 4 pages/cart/paymentPage/index.wxml | 72 +-- pages/cart/paymentPage/index.wxss | 40 + pages/personalCenter/myUpload/index.json | 13 pages/personalCenter/myUpload/index.wxml | 43 ++ pages/digitalCourses/index.wxml | 91 ++-- pages/digitalCourses/index.wxss | 24 static/images/bookService/detail/shuzijiaocai.png | 0 pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.js | 86 ++++ app.json | 2 pages/personalCenter/myUpload/index.wxss | 90 ++++ pages/cart/paymentPage/index.json | 3 pages/cart/paymentPage/index.js | 79 +++ pages/digitalTextbooks/digitalTextbooksDetails/index.wxml | 4 pages/personalCenter/myUpload/index.js | 146 +++++++ 34 files changed, 930 insertions(+), 266 deletions(-) diff --git a/app.json b/app.json index 7020a5e..7c9e747 100644 --- a/app.json +++ b/app.json @@ -13,6 +13,7 @@ "pages/personalCenter/feedBackSubmit/index", "pages/personalCenter/certificate/index", "pages/personalCenter/pointsRecord/index", + "pages/personalCenter/myUpload/index", "pages/bookServices/assort/index", "pages/testLogin/index", "pages/bindInfo/index", @@ -22,6 +23,7 @@ "pages/digitalTextbooks/digitalTextbooksDetails/components/webView/index", "pages/digitalCourses/index", "pages/digitalCourses/digitalCoursesDetails/index", + "pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index", "pages/specialDiscussion/index", "pages/specialDiscussion/webView/index", "pages/index/bookDetail", diff --git a/assets/js/middleGround/api/store.js b/assets/js/middleGround/api/store.js index d842309..d73f9e8 100644 --- a/assets/js/middleGround/api/store.js +++ b/assets/js/middleGround/api/store.js @@ -849,7 +849,23 @@ method: 'post', data }) - } + }, + // 绉垎鍏戞崲 + newOrderPay(data) { + return request({ + url: '/store/api/NewOrderPay', + method: 'post', + data + }) + }, + // 鍒犻櫎绉垎璁㈠崟 + delOrderPay(data) { + return request({ + url: '/store/api/DelOrderPay', + method: 'post', + data + }) + }, } export default storeApi \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index bbc3420..a5395e2 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -985,18 +985,16 @@ }) } } - const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 14 ? 8 : 6 + const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 13 ? 8 : 6 const num = query.cmsPath.length + addNum this.getTreeList(res.datas.cmsDatas[0].datas, num, list, '\\', addNum) list = this.ensureTreeConsistency(list) list = this.changeResourceChildren(list) - console.log('淇敼鍚�', list); let result = []; if (type.refCode == "jsek_teachingResources") { this.findChildIds(list, result); - const newUSeList = this.deleteTreeData(list, result) - console.log('鏍戝墧闄�', result, newUSeList); - console.log('鏍戝姞涓�', this.increaseTreeData(list, newUSeList, 16094)); + // const newUSeList = this.deleteTreeData(list, result) + // console.log('鏍戝墧闄�', result, newUSeList); this.setData({ openTeachids: result, @@ -1101,7 +1099,7 @@ let list = [] // 娴嬭瘯 6浣�// 姝e紡 5浣�// 娴嬭瘯璋冪敤浼�20锛屽唴閮�7 姝e紡璋冪敤浼�17 鍐呴儴浼�6 - const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 14 ? 8 : 6 + const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 13 ? 8 : 6 const num = query.cmsPath.length + addNum that.getTreeList(data, num, list, '\\', addNum) list = that.ensureTreeConsistency(list) @@ -2524,9 +2522,11 @@ let resultList = [] for (let index = 0; index < list.length; index++) { const item = list[index]; - for (let cindex = 0; cindex < item.children.length; cindex++) { - const citem = item.children[cindex]; - citem.children = [] + if (item.children.length > 0) { + for (let cindex = 0; cindex < item.children.length; cindex++) { + const citem = item.children[cindex]; + citem.children = [] + } } resultList.push(item) } diff --git a/pages/bookExhibitionList/index.js b/pages/bookExhibitionList/index.js index 1fbd64b..29e5a9a 100644 --- a/pages/bookExhibitionList/index.js +++ b/pages/bookExhibitionList/index.js @@ -69,11 +69,11 @@ }, { value: "timeAsc", - label: "鍒涘缓鏃堕棿姝e簭", + label: "鍑虹増鏃堕棿姝e簭", }, { value: "timeDesc", - label: "鍒涘缓鏃堕棿鍊掑簭", + label: "鍑虹増鏃堕棿鍊掑簭", }, ], }, @@ -420,6 +420,7 @@ this.setData({ "product.value": e.detail.value, }); + this.bookExhibitionGet(); }, onOpend() {}, diff --git a/pages/cart/paymentPage/index.js b/pages/cart/paymentPage/index.js index 9e747a2..2b42ac5 100644 --- a/pages/cart/paymentPage/index.js +++ b/pages/cart/paymentPage/index.js @@ -21,13 +21,20 @@ selectedIds: '', purchasedIds: [], productList: [], + price: '', payPrice: '', orderGoods: '', isPaySuccess: false, isPayComplete: false, type: '', onNorderSaleMethod: '', - ImmediatelyReceive: '' + ImmediatelyReceive: '', + integral: 0, + defaultVal: false, + deductioRate: 0, + currentBalance: 0, + showIntegral: false + }, /** @@ -48,10 +55,22 @@ onNorderSaleMethod: options.onNorderSaleMethod }) console.log(this.data.onNorderSaleMethod, 'options'); + this.getIntegral() this.getOrderByOrderNumData() this.getDataList() }, - + getIntegral() { + app.MG.store + .getUserWallet({ + type: 'integral' + }) + .then((res) => { + this.setData({ + integral: res.balance, + deductioRate: res.exchangeRate + }); + }) + }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 */ @@ -138,16 +157,15 @@ orderGoods: res.orderNumber }) this.setData({ + price: res.payPrice, payPrice: res.payPrice.toFixed(2), ImmediatelyReceive: res.payPrice }) - console.log(this.data.ImmediatelyReceive); res.saleMethodLinks.forEach(item => { const type = item.orderSaleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product'; item.type = type; // 灏唗ype璁剧疆涓篿tem瀵硅薄鐨勫睘鎬э紝鑰屼笉鏄娇鐢╯etData item.paymentIcon = getPublicImage(item.orderSaleMethod.product.icon) item.payPrice = this.numFormat(item.payPrice) - console.log(item, 'item'); }) this.setData({ productList: res.saleMethodLinks, @@ -178,6 +196,59 @@ }) }) }, + + handleChange(e) { + this.setData({ + defaultVal: e.detail.value, + }); + console.log(this.data.defaultVal) + if (this.data.defaultVal) { + let useBalance = Math.floor(this.data.payPrice * this.data.deductioRate); + if (useBalance >= this.data.integral) { + this.setData({ + currentBalance: this.data.integral, + }); + } else { + this.setData({ + currentBalance: useBalance, + }); + } + const data = { + orderNumber: this.data.orderNumber, + payMethod: "Wallet", + type: "integral", + payValue: this.data.currentBalance + } + app.MG.store.newOrderPay(data).then(res => { + if (res) { + this.setData({ + payId: res.payList[0].id, + payPrice: res.payPrice, + deduct: (this.data.price - this.data.payPrice).toFixed(2), + integral: this.data.integral - this.data.currentBalance, + showIntegral: true + }); + } + }) + } else { + const data = { + orderNumber: this.data.orderNumber, + payId: this.data.payId, + } + app.MG.store.delOrderPay(data).then(res => { + console.log(res, "鍙栨秷鐢ㄧН鍒�") + if (res) { + this.setData({ + payPrice: res.payPrice, + showIntegral: false + }); + this.getIntegral() + } + }) + } + }, + + confirmOrderGet() { if (this.data.myOrderOrderNumber.includes(parseInt(this.data.onNorderSaleMethod))) { Toast({ diff --git a/pages/cart/paymentPage/index.json b/pages/cart/paymentPage/index.json index 3ac12df..e3333bf 100644 --- a/pages/cart/paymentPage/index.json +++ b/pages/cart/paymentPage/index.json @@ -4,6 +4,7 @@ "t-icon": "tdesign-miniprogram/icon/icon", "t-button": "tdesign-miniprogram/button/button", "t-dialog": "tdesign-miniprogram/dialog/dialog", - "t-toast": "tdesign-miniprogram/toast/toast" + "t-toast": "tdesign-miniprogram/toast/toast", + "t-switch": "tdesign-miniprogram/switch/switch" } } \ No newline at end of file diff --git a/pages/cart/paymentPage/index.wxml b/pages/cart/paymentPage/index.wxml index 09600ee..b0ceeb3 100644 --- a/pages/cart/paymentPage/index.wxml +++ b/pages/cart/paymentPage/index.wxml @@ -16,25 +16,10 @@ <view class="paymentPageBox"> <view class="content"> <view class="shoppingCartList"> - <view - class="cartList" - wx:for="{{productList}}" - wx:key="index" - wx:for-item="item" - wx:for-index="index" - > + <view class="cartList" wx:for="{{productList}}" wx:key="index" wx:for-item="item" wx:for-index="index"> <view class="imageBox"> - <image - wx:if="{{item.paymentIcon}}" - src="{{item.paymentIcon }}" - mode="aspectFit" - /> - <image - wx:else - src="/static/images/default-book-img.png" - class="imageStyle" - mode="aspectFit" - /> + <image wx:if="{{item.paymentIcon}}" src="{{item.paymentIcon }}" mode="aspectFit" /> + <image wx:else src="/static/images/default-book-img.png" class="imageStyle" mode="aspectFit" /> </view> <view class="cartListContent"> <view class="cartListDetails"> @@ -51,21 +36,34 @@ </view> </view> </view> - <view class="textBox" wx:if="{{item.type == 'product'}}" - >鍥句功鏈嶅姟-鐢靛瓙涔�</view - > - <view class="textBox" wx:if="{{item.type == 'item'}}" - >鍥句功鏈嶅姟-浜戝涔�</view - > - <view class="priceBox">锟{item.payPrice}}</view> + <view class="textBox" wx:if="{{item.type == 'product'}}">鍥句功鏈嶅姟-鐢靛瓙涔�</view> + <view class="textBox" wx:if="{{item.type == 'item'}}">鍥句功鏈嶅姟-浜戝涔�</view> + <view class="priceBox">锟{item.orderSaleMethod.price}}</view> </view> + </view> + </view> + <view class="integralBreakdown"> + <view class="priceBreakdownContent">绉垎鍏戞崲锛�100绉垎鍙厬鎹�1鍏冿級</view> + <view class="integral"> + <view> + 鎴戠殑绉垎锛歿{integral}} + </view> + <t-switch defaultValue="{{defaultVal}}" slot="note" bindchange="handleChange" /> + </view> </view> <view class="priceBreakdown"> <view class="priceBreakdownContent">浠锋牸鏄庣粏</view> <view class="amountMoney"> <view class="commodityBox">鍟嗗搧閲戦</view> - <view class="payPriceBox">锟{payPrice}}</view> + <view class="payPriceBox">锟{price}}</view> + </view> + <view class="integralCon" wx:if="{{showIntegral}}"> + <view class="label">绉垎鎶垫墸</view> + <view class="payBox"> + <view>{{currentBalance}}</view> + <view>锟{deduct}}</view> + </view> </view> <view class="amount"> <view> <text>鍚堣锛� </text> 锟{payPrice}}</view> @@ -74,27 +72,13 @@ </view> <!-- <view class="interval"></view> --> <view class="paymentBox"> - <view class="residue" - >寰呮敮浠橈細<text class="residueTextBox">锟{payPrice}}</text></view - > + <view class="residue">寰呮敮浠橈細<text class="residueTextBox">锟{payPrice}}</text></view> <view> - <t-button - wx:if="{{ImmediatelyReceive === 0}}" - class="buttonBox" - shape="round" - catch:tap="onReceive" - >绔嬪嵆棰嗗彇</t-button - > - <t-button - wx:else - class="buttonBox" - shape="round" - catch:tap="confirmOrderGet" - >寰俊鏀粯</t-button - > + <t-button wx:if="{{ImmediatelyReceive === 0}}" class="buttonBox" shape="round" catch:tap="onReceive">绔嬪嵆棰嗗彇</t-button> + <t-button wx:else class="buttonBox" shape="round" catch:tap="confirmOrderGet">寰俊鏀粯</t-button> </view> </view> </view> <t-toast id="t-toast" /> -</view> +</view> \ No newline at end of file diff --git a/pages/cart/paymentPage/index.wxss b/pages/cart/paymentPage/index.wxss index 10b5428..02da90f 100644 --- a/pages/cart/paymentPage/index.wxss +++ b/pages/cart/paymentPage/index.wxss @@ -92,11 +92,18 @@ margin-bottom: 20rpx; } -.priceBreakdown { - height: 250rpx; +.integralBreakdown { + height: 160rpx; background: #fff; padding: 30rpx; - margin-bottom: 120rpx; + margin-bottom: 20rpx; +} + +.priceBreakdown { + height: 300rpx; + background: #fff; + padding: 30rpx; + margin-bottom: 20rpx; } .priceBreakdownContent { @@ -108,11 +115,21 @@ } +.integral { + display: flex; + justify-content: space-between; + align-items: center; +} + +.t-switch__body--checked { + background-color: #FF6C00 !important; +} + .amountMoney { display: flex; justify-content: space-between; - border-bottom: 2rpx solid #EDEDED; - padding-bottom: 38rpx; + /* border-bottom: 2rpx solid #EDEDED; */ + padding-bottom: 20rpx; } .amount { @@ -190,6 +207,19 @@ } +.label { + font-size: 28rpx; + color: #FF6C00; + margin-bottom: 10rpx; +} + +.payBox { + display: flex; + justify-content: space-between; + align-items: center; + color: #FF6C00; +} + page { background-color: #F2F3F8; position: relative; diff --git a/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.js b/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.js new file mode 100644 index 0000000..dd365bb --- /dev/null +++ b/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.js @@ -0,0 +1,86 @@ +// pages/home/digitalRead/index.js +const app = getApp() +Page({ + + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + src: '', + isTextBookBuy: false, + refCode: "", + probationPage: 0, + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad(options) { + if (options) { + this.setData({ + isTextBookBuy: options.isTextBookBuy, + refCode: options.refCode, + probationPage: options.probationPage + }) + if (this.data.isTextBookBuy) { + this.setData({ + src: app.config.textReaderUrl + '?bookId=' + this.data.refCode + '&token=' + wx.getStorageSync(app.config.tokenKey) + }) + } else { + this.setData({ + src: app.config.textReaderUrl + '?bookId=' + this.data.refCode + '&probationPage=' + this.data.probationPage + '&token=' + wx.getStorageSync(app.config.tokenKey) + }) + } + + } + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 + */ + onReady() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず + */ + onShow() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 + */ + onHide() { + + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 + */ + onUnload() { + + }, + + /** + * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 + */ + onPullDownRefresh() { + + }, + + /** + * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� + */ + onReachBottom() { + + }, + + /** + * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.json b/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.json new file mode 100644 index 0000000..eea244b --- /dev/null +++ b/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "鏁板瓧闃呰", + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.wxml b/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.wxml new file mode 100644 index 0000000..3342966 --- /dev/null +++ b/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.wxml @@ -0,0 +1,4 @@ +<!--pages/home/digitalRead/index.wxml--> +<view class="page-body"> + <web-view bind:message="drawBack" binderror="onError" bindload="onLoadWeb" src="{{src}}"></web-view> +</view> \ No newline at end of file diff --git a/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.wxss b/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.wxss new file mode 100644 index 0000000..2180a27 --- /dev/null +++ b/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index.wxss @@ -0,0 +1,6 @@ +/* pages/home/digitalRead/index.wxss */ +.page-body { + width: 100vw; + height: calc(100vh - env(safe-area-inset-bottom)); + overflow: hidden; +} \ No newline at end of file diff --git a/pages/digitalCourses/digitalCoursesDetails/index.js b/pages/digitalCourses/digitalCoursesDetails/index.js index 5f2bd6e..766d579 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.js +++ b/pages/digitalCourses/digitalCoursesDetails/index.js @@ -60,7 +60,8 @@ testResourceIocn: { name: "/static/images/digitalTextbooks/link-t@3x.png", }, - + relationTextBook: null, + isTextBookBuy: false, dialogBox: false, lecturerList: [], selectActive: 'learn', @@ -349,6 +350,7 @@ console.log(this.data.tabValue); if (this.data.tabValue == 2) { this.getResource() + this.getRelationBook() } if (this.data.tabValue == 3) { this.selectComponent("#note").getNoteList(); @@ -579,7 +581,50 @@ } }, - // 鑾峰彇鐩稿叧鏁欐潗 + //鑾峰彇鍏宠仈瀛愬晢鍝�/鏁板瓧鏁欐潗 + getRelationBook() { + app.MG.store.getProductList({ + path: '*', + storeInfo: app.config.digitalCourses, + mainProductId: this.data.digitalsData.id, + queryType: 'Related', // 鏌ヨ绫诲瀷锛� Related锛氭煡璇㈠叧鑱斿晢鍝侊紱SubProduct: 鏌ヨ瀛愬晢鍝侊紱 + paging: { + start: 0, + size: 1 + }, + fields: { + author: [], + publicationDate: [], + isbn: [], + content: [], + Creator: [], + probationPage: [] + } + }) + .then((res) => { + this.setData({ + relationTextBook: res.datas[0] + }) + if (this.data.relationTextBook.purchasedSaleMethodIdList.includes(this.data.relationTextBook.defaultSaleMethodId)) { + this.setData({ + isTextBookBuy: true + }) + } else { + this.setData({ + isTextBookBuy: false + }) + } + console.log(this.data.relationTextBook, "jc") + }) + }, + + readTextBook() { + wx.navigateTo({ + url: '/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index?refCode=' + this.data.relationTextBook.refCode + '&tryPageCount=' + this.data.relationTextBook.probationPage + '&isTextBookBuy=' + this.data.isTextBookBuy + }) + }, + + // 鑾峰彇鐩稿叧璇剧▼ getAboutBook(path) { let query = { path, @@ -800,14 +845,14 @@ onCertificate() { - // if (!this.data.isBuy) { - // wx.showToast({ - // title: "璇峰厛璐拱锛屼綋楠屽畬鏁存湇鍔�", - // icon: "none", - // duration: 1000, - // }); - // return false - // } + if (!this.data.isBuy) { + wx.showToast({ + title: "璇峰厛璐拱锛屼綋楠屽畬鏁存湇鍔�", + icon: "none", + duration: 1000, + }); + return false + } // if (!this.data.isLearn) { // wx.showToast({ // title: "鎮ㄧ殑瀛︿範浠诲姟杩樻湭瀹屾垚锛屾殏涓嶈兘鐢宠璇佷功锛屽姞娌瑰摝锛�", @@ -816,14 +861,14 @@ // }); // return false // } - // if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { - // wx.showToast({ - // title: "鎮ㄧ敵璇风殑璇佷功姝e湪瀹℃牳涓�", - // icon: "none", - // duration: 1000, - // }); - // return false - // } + if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { + wx.showToast({ + title: "鎮ㄧ敵璇风殑璇佷功姝e湪瀹℃牳涓�", + icon: "none", + duration: 1000, + }); + return false + } var page = getCurrentPages().pop(); // 鑾峰彇褰撳墠椤甸潰瀹炰緥 page.setData({ diff --git a/pages/digitalCourses/digitalCoursesDetails/index.wxml b/pages/digitalCourses/digitalCoursesDetails/index.wxml index 0b30e11..e3355d1 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.wxml +++ b/pages/digitalCourses/digitalCoursesDetails/index.wxml @@ -123,6 +123,16 @@ </view> <view class="list-box"> <view wx:if="{{selectActive == 'learn'}}"> + <view wx:if="{{relationTextBook}}" class="textBook"> + <view class="textTile"> + <image src="/static/images/bookService/detail/shuzijiaocai.png" mode="" class="leftImg" /> + <view>鏁板瓧鏁欐潗</view> + </view> + <view class="reabtn" bind:tap="readTextBook"> + <image src="/static/images/digitalCourses/shidu@2x.png" class="readImage"></image> + <view>{{isTextBookBuy ? '闃呰' : '璇曠湅'}}</view> + </view> + </view> <tree id="test-tree" openIds="{{openTeachids}}" bookInfo="{{digitalsData}}" treeList="{{learnList}}"> </tree> </view> diff --git a/pages/digitalCourses/digitalCoursesDetails/index.wxss b/pages/digitalCourses/digitalCoursesDetails/index.wxss index 1a5122c..2349435 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.wxss +++ b/pages/digitalCourses/digitalCoursesDetails/index.wxss @@ -531,4 +531,40 @@ font-weight: bold; font-size: 25rpx; color: #333333; +} + +.textBook { + background-color: #fff6f0; + display: flex; + justify-content: space-between; + padding: 20rpx 32rpx; + margin-top: 30rpx; + +} + +.textTile { + display: flex; + align-items: center; +} + +.leftImg { + width: 56rpx; + height: 56rpx; + margin-right: 28rpx; +} + +.reabtn { + color: #FF6C00; +} + +.reabtn { + display: flex; + align-items: center; +} + +.readImage { + width: 32rpx; + height: 30rpx; + margin-right: 8rpx; + } \ No newline at end of file diff --git a/pages/digitalCourses/index.js b/pages/digitalCourses/index.js index f80d993..9175e6e 100644 --- a/pages/digitalCourses/index.js +++ b/pages/digitalCourses/index.js @@ -20,7 +20,32 @@ active: 0, activeItem: null, loading: false, - shoppingCartGetId: [] + shoppingCartGetId: [], + sorter: { + value: "*", + options: [{ + value: "*", + label: "榛樿鎺掑簭", + }, + { + value: "nameAsc", + label: "鐐瑰嚮閲忔搴�", + }, + { + value: "nameDesc", + label: "鐐瑰嚮閲忓�掑簭", + }, + { + value: "timeAsc", + label: "鍒涘缓鏃堕棿姝e簭", + }, + { + value: "timeDesc", + label: "鍒涘缓鏃堕棿鍊掑簭", + }, + ], + }, + sortActive: '' }, /** @@ -142,7 +167,7 @@ getCourseList(item) { let searchObj = {} - // let sort = {} + let sort = {} // // 鎼滅储妗� if (this.data.searchValue) { searchObj = { @@ -151,23 +176,24 @@ } } - // if (timeSort.value) { - // sort = { - // CreateDate: timeSort.value || 'Desc' - - // } - // } else { - // sort = { - // ViewCount: nameSort.value || 'Desc' - // } + if (this.data.sortActive == 'nameAsc') { + sort = { + ViewCount: 'Asc' + } + } else if (this.data.sortActive == 'nameDesc') { + sort = { + ViewCount: 'Desc' + } + } else if (this.data.sortActive == 'timeAsc') { + sort = { + CreateDate: 'Asc' + } + } else if (this.data.sortActive == 'timeDesc') { + sort = { + CreateDate: 'Desc' + } + } // // 缁勫悎鐨勫啓娉� 瑕佹煡璇㈢殑瀛楁:鍗囧簭鍜岄檷搴� - - // // Name: "Desc" - // //涓�鑸殑鎺掑簭浼犳硶 - // // type: "Asc", - // // field: "CreateDate", - // } - // courseList.value = []; const obj = { storeInfo: app.config.goodsStore, path: item.pathList + '\\' + item.id, @@ -182,7 +208,7 @@ value: 'Normal', field: 'state' }], - // sort: sort, + sort: sort, fields: { courseLeader: [], affiliatedUnit: [], @@ -206,6 +232,13 @@ searchBook() { this.getCourseList(this.data.activeItem) }, + onSort(e) { + this.setData({ + "sortActive": e.detail.value, + }); + console.log(e) + this.getCourseList(this.data.activeItem); + }, courseDetail(e) { const item = e.currentTarget.dataset.item setNewView('productId', item.id) diff --git a/pages/digitalCourses/index.json b/pages/digitalCourses/index.json index 00b615a..47247d4 100644 --- a/pages/digitalCourses/index.json +++ b/pages/digitalCourses/index.json @@ -5,6 +5,8 @@ "t-empty": "tdesign-miniprogram/empty/empty", "t-tabs": "tdesign-miniprogram/tabs/tabs", "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", + "t-dropdown-menu": "tdesign-miniprogram/dropdown-menu/dropdown-menu", + "t-dropdown-item": "tdesign-miniprogram/dropdown-item/dropdown-item", "empty": "/components/empty/index" }, "navigationStyle": "custom", diff --git a/pages/digitalCourses/index.wxml b/pages/digitalCourses/index.wxml index 1977666..7a1efb3 100644 --- a/pages/digitalCourses/index.wxml +++ b/pages/digitalCourses/index.wxml @@ -8,51 +8,60 @@ </view> <t-search model:value="{{searchValue}}" shape="round" placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" /> </view> - <t-tabs defaultValue="{{active}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel"> - <t-tab-panel wx:for="{{tabList}}" wx:key="index" wx:for-item="item" wx:for-index="index" label="{{item.name}}" value="{{index}}"> - <view class="contentBox"> - <view class="titleBox"> - <view class="frameBox"></view> - <view class="titleTextBox"> - <image src="/static/images/digitalCourses/zhuantitaolun@2x.png" mode="aspectFit" /> + <view class="heardTab"> + <view class="tabBox"> + <t-tabs defaultValue="{{active}}" bind:change="onTabsChange" t-class="custom-tabs"> + <t-tab-panel wx:for="{{tabList}}" wx:key="index" wx:for-item="item" label="{{item.name}}" value="{{index}}"> + </t-tab-panel> + </t-tabs> + </view> + <view class="dropdown"> + <t-dropdown-menu> + <t-dropdown-item options="{{sorter.options}}" default-value="{{sorter.value}}" bindchange="onSort" /> + </t-dropdown-menu> + </view> + </view> + <view class="contentBox"> + <view class="titleBox"> + <view class="frameBox"></view> + <view class="titleTextBox"> + <image src="/static/images/digitalCourses/zhuantitaolun@2x.png" mode="aspectFit" /> + </view> + </view> + <scroll-view scroll-y="{{true}}" class="outsideContentBox" bindscrolltolower="onScrollToLower"> + <view class="ExternalInformationBox"> + <view class="informationBox" wx:for="{{courseList}}" wx:key="index" wx:for-item="item" data-item="{{item}}"> + <view class="book-img" bind:tap="courseDetail" data-item="{{item}}"> + <image src="{{item.icon}}" mode="aspectFit" /> </view> - </view> - <scroll-view scroll-y="{{true}}" class="outsideContentBox" bindscrolltolower="onScrollToLower"> - <view class="ExternalInformationBox"> - <view class="informationBox" wx:for="{{courseList}}" wx:key="index" wx:for-item="item" data-item="{{item}}"> - <view class="book-img" bind:tap="courseDetail" data-item="{{item}}"> - <image src="{{item.icon}}" mode="aspectFit" /> + <view class="book-Info"> + <view class="book-name" bind:tap="courseDetail" data-item="{{item}}"> + {{item.name}} + </view> + <view class="viewCount"> + {{item.viewCount }}娆$偣鍑� + </view> + <view class="author"> + <view> + {{ item.courseLeader}} </view> - <view class="book-Info"> - <view class="book-name" bind:tap="courseDetail" data-item="{{item}}"> - {{item.name}} - </view> - <view class="viewCount"> - {{item.viewCount }}娆$偣鍑� - </view> - <view class="author"> - <view> - {{ item.courseLeader}} - </view> - <view> - {{ item.classHours}}璇炬椂 - </view> - </view> - <view class="money"> - <view wx:if="{{item.price != 0}}">锟{item.price }}</view> - <view wx:else> 鍏嶈垂</view> - <view bind:tap="addCart" data-item="{{item}}"> - <t-icon name="cart" size="16" /> - </view> - </view> + <view> + {{ item.classHours}}璇炬椂 + </view> + </view> + <view class="money"> + <view wx:if="{{item.price != 0}}">锟{item.price }}</view> + <view wx:else> 鍏嶈垂</view> + <view bind:tap="addCart" data-item="{{item}}"> + <t-icon name="cart" size="16" /> </view> </view> </view> - <view wx:if="{{courseList.length <= 0}}" class="noDataBox"> - <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> - </view> - </scroll-view> + </view> </view> - </t-tab-panel> - </t-tabs> + <view wx:if="{{courseList.length <= 0}}" class="noDataBox"> + <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> + </view> + </scroll-view> + </view> </view> \ No newline at end of file diff --git a/pages/digitalCourses/index.wxss b/pages/digitalCourses/index.wxss index 1b15ed5..9795663 100644 --- a/pages/digitalCourses/index.wxss +++ b/pages/digitalCourses/index.wxss @@ -23,15 +23,25 @@ font-size: 38rpx; } - -.custom-tabs { - margin-bottom: 32rpx; +.heardTab { + display: flex; + justify-content: space-between; } -.custom-panel { - /* height: ; */ - height: calc(100vh - 300rpx); - color: var(--td-text-color-primary); +.tabBox { + width: 70vw +} + +.dropdown { + z-index: 1; + width: 29vw; + box-shadow: 0px 3px 10px 1px rgba(0, 0, 0, 0.1); +} + +.t-dropdown-menu__item--active, +.t-radio__icon--checked, +.t-checkbox__icon--checked { + color: #FF6C00 !important } .t-tabs .t-tabs__track { diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/index.js b/pages/digitalTextbooks/digitalTextbooksDetails/index.js index 7bef3b4..01c7c66 100644 --- a/pages/digitalTextbooks/digitalTextbooksDetails/index.js +++ b/pages/digitalTextbooks/digitalTextbooksDetails/index.js @@ -720,14 +720,14 @@ }, onCertificate() { - // if (!this.data.isBuy) { - // wx.showToast({ - // title: "璇峰厛璐拱锛屼綋楠屽畬鏁存湇鍔�", - // icon: "none", - // duration: 1000, - // }); - // return false - // } + if (!this.data.isBuy) { + wx.showToast({ + title: "璇峰厛璐拱锛屼綋楠屽畬鏁存湇鍔�", + icon: "none", + duration: 1000, + }); + return false + } // if (!this.data.isLearn) { // wx.showToast({ // title: "鎮ㄧ殑瀛︿範浠诲姟杩樻湭瀹屾垚锛屾殏涓嶈兘鐢宠璇佷功锛屽姞娌瑰摝锛�", @@ -736,14 +736,14 @@ // }); // return false // } - // if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { - // wx.showToast({ - // title: "鎮ㄧ敵璇风殑璇佷功姝e湪瀹℃牳涓�", - // icon: "none", - // duration: 1000, - // }); - // return false - // } + if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { + wx.showToast({ + title: this.data.isCertificate.state == 'WaitAudit' ? "鎮ㄧ敵璇风殑璇佷功姝e湪瀹℃牳涓�" : this.data.isCertificate.state == 'Normal' ? '鎮ㄥ凡鐢宠璇佷功' : '', + icon: "none", + duration: 1000, + }); + return false + } var page = getCurrentPages().pop(); // 鑾峰彇褰撳墠椤甸潰瀹炰緥 page.setData({ diff --git a/pages/digitalTextbooks/digitalTextbooksDetails/index.wxml b/pages/digitalTextbooks/digitalTextbooksDetails/index.wxml index 0e28e39..47d486e 100644 --- a/pages/digitalTextbooks/digitalTextbooksDetails/index.wxml +++ b/pages/digitalTextbooks/digitalTextbooksDetails/index.wxml @@ -103,10 +103,6 @@ <image src="https://jsek.bnuic.com/home/certificate/jczs.jpg" mode="" /> </view> </view> - <view class="noDataBox"> - <!-- <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> --> - <empty /> - </view> </t-tab-panel> <t-tab-panel icon="{{tabValue == 'jsek_teachingResources' ? teachResourcesClickIcon : teachResourcesIcon}}" value="jsek_teachingResources" label="浣滆�呬俊鎭�" style="{{tabPanelstyle}}"> <view class="rubricBox"> diff --git a/pages/digitalTextbooks/index.js b/pages/digitalTextbooks/index.js index d0101e6..374ff4d 100644 --- a/pages/digitalTextbooks/index.js +++ b/pages/digitalTextbooks/index.js @@ -22,7 +22,32 @@ selectedIndex: 0, digitalTextbooksData: [], path: "jsek_dTHigherEducation", - loading: true + loading: true, + sorter: { + value: "*", + options: [{ + value: "*", + label: "榛樿鎺掑簭", + }, + { + value: "nameAsc", + label: "鐐瑰嚮閲忔搴�", + }, + { + value: "nameDesc", + label: "鐐瑰嚮閲忓�掑簭", + }, + { + value: "timeAsc", + label: "鍒涘缓鏃堕棿姝e簭", + }, + { + value: "timeDesc", + label: "鍒涘缓鏃堕棿鍊掑簭", + }, + ], + }, + sortActive: '' }, @@ -165,13 +190,20 @@ this.bookExhibitionGet() }, + onSort(e) { + this.setData({ + "sortActive": e.detail.value, + }); + console.log(e) + this.bookExhibitionGet() + }, // 鑾峰彇鍥剧墖鏂囧瓧鍒楄〃 bookExhibitionGet(keyword) { // console.log(path.value, '456') // loading.value = true let searchObj = {} - // let sort = {} + let sort = {} // 鎼滅储妗� if (keyword) { searchObj = { @@ -180,22 +212,23 @@ } } - // if (timeSort.value) { - // sort = { - // CreateDate: timeSort.value || 'Desc' - // } - // } else { - // sort = { - // ViewCount: nameSort.value || 'Desc' - - // } - // // 缁勫悎鐨勫啓娉� 瑕佹煡璇㈢殑瀛楁:鍗囧簭鍜岄檷搴� - - // // Name: "Desc" - // //涓�鑸殑鎺掑簭浼犳硶 - // // type: "Asc", - // // field: "CreateDate", - // } + if (this.data.sortActive == 'nameAsc') { + sort = { + ViewCount: 'Asc' + } + } else if (this.data.sortActive == 'nameDesc') { + sort = { + ViewCount: 'Desc' + } + } else if (this.data.sortActive == 'timeAsc') { + sort = { + CreateDate: 'Asc' + } + } else if (this.data.sortActive == 'timeDesc') { + sort = { + CreateDate: 'Desc' + } + } app.MG.store .getProductList({ storeInfo: 'jsek_digitalTextbooks', @@ -205,7 +238,7 @@ start: 0, size: 99 }, - // sort: sort, + sort: sort, fields: { content: [], subtitle: [], @@ -219,8 +252,6 @@ digitalTextbooksData: res.datas, loading: false }) - - console.log(this.data.digitalTextbooksData); }) }, diff --git a/pages/digitalTextbooks/index.json b/pages/digitalTextbooks/index.json index 00b615a..47247d4 100644 --- a/pages/digitalTextbooks/index.json +++ b/pages/digitalTextbooks/index.json @@ -5,6 +5,8 @@ "t-empty": "tdesign-miniprogram/empty/empty", "t-tabs": "tdesign-miniprogram/tabs/tabs", "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", + "t-dropdown-menu": "tdesign-miniprogram/dropdown-menu/dropdown-menu", + "t-dropdown-item": "tdesign-miniprogram/dropdown-item/dropdown-item", "empty": "/components/empty/index" }, "navigationStyle": "custom", diff --git a/pages/digitalTextbooks/index.wxml b/pages/digitalTextbooks/index.wxml index c2aa26a..bb029f5 100644 --- a/pages/digitalTextbooks/index.wxml +++ b/pages/digitalTextbooks/index.wxml @@ -9,44 +9,54 @@ </view> <t-search model:value="{{searchValue}}" shape="round" placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" /> </view> - <t-tabs defaultValue="{{0}}" bind:change="selectTab" t-class="custom-tabs" t-class-content="custom-panel"> - <t-tab-panel wx:for="{{tabList}}" wx:key="index" wx:for-item="item" wx:for-index="index" label="{{item.name}}" value="{{index}}" style="{{tabPanelstyle}}"> - <view class="contentBox"> - <view class="titleBox"> - <view class="frameBox"></view> - <view class="titleTextBox"> - <!-- <image src="/static/images/digitalCourses/zhuantitaolun@2x.png" mode="aspectFit" /> --> - <view>鏁板瓧鏁欐潗鍒楄〃</view> + <view class="heardTab"> + <view class="tabBox"> + <t-tabs defaultValue="{{0}}" bind:change="selectTab" t-class="custom-tabs"> + <t-tab-panel wx:for="{{tabList}}" wx:key="index" wx:for-item="item" label="{{item.name}}" value="{{index}}" style="{{tabPanelstyle}}"> + </t-tab-panel> + </t-tabs> + </view> + <view class="dropdown"> + <t-dropdown-menu> + <t-dropdown-item options="{{sorter.options}}" default-value="{{sorter.value}}" bindchange="onSort" /> + </t-dropdown-menu> + </view> + </view> + <view class="contentBox"> + <view class="titleBox"> + <view class="frameBox"></view> + <view class="titleTextBox"> + <!-- <image src="/static/images/digitalCourses/zhuantitaolun@2x.png" mode="aspectFit" /> --> + <view>鏁板瓧鏁欐潗鍒楄〃</view> + </view> + </view> + <scroll-view scroll-y="{{true}}" class="outsideContentBox" bindscrolltolower="onScrollToLower"> + <view class="bookContentBox"> + <view class="external" wx:for="{{digitalTextbooksData}}" wx:key="index" wx:for-item="item" wx:for-index="index" data-item="{{item}}" bind:tap="jumpDetails"> + <view class="amountClick"> + <t-icon name="browse" size="15" data-name="{{item}}" bind:click="goBack" /> + <view style="margin-left: 5rpx;">{{item.viewCount}}</view> + </view> + <view class="imageBox"> + <image src="{{item.icon ? item.icon : '/static/images/default-book-img.png'}}" mode="" /> + </view> + <view class="bookName">{{item.name}}</view> + <view class="information"> + <view wx:if="{{item.author}}" class="book-author"> + {{ item.author }} + </view> + <view wx:else>-</view> + <view wx:if="{{item.price == 0}}" class="price"> 鍏嶈垂</view> + <view wx:else class="price">锟{ item.price }}</view> </view> </view> - <scroll-view scroll-y="{{true}}" class="outsideContentBox" bindscrolltolower="onScrollToLower"> - <view class="bookContentBox"> - <view class="external" wx:for="{{digitalTextbooksData}}" wx:key="index" wx:for-item="item" wx:for-index="index" data-item="{{item}}" bind:tap="jumpDetails"> - <view class="amountClick"> - <t-icon name="browse" size="15" data-name="{{item}}" bind:click="goBack" /> - <view style="margin-left: 5rpx;">{{item.viewCount}}</view> - </view> - <view class="imageBox"> - <image src="{{item.icon ? item.icon : '/static/images/default-book-img.png'}}" mode="" /> - </view> - <view class="bookName">{{item.name}}</view> - <view class="information"> - <view wx:if="{{item.author}}" class="book-author"> - {{ item.author }} - </view> - <view wx:else>-</view> - <view wx:if="{{item.price == 0}}" class="price"> 鍏嶈垂</view> - <view wx:else class="price">锟{ item.price }}</view> - </view> - </view> - <view wx:if="{{!digitalTextbooksData.length }}" class="noData"> - <!-- <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> --> - <empty /> - </view> - </view> - </scroll-view> + <view wx:if="{{!digitalTextbooksData.length }}" class="noData"> + <!-- <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> --> + <empty /> + </view> </view> - </t-tab-panel> - </t-tabs> + </scroll-view> + </view> + </view> \ No newline at end of file diff --git a/pages/digitalTextbooks/index.wxss b/pages/digitalTextbooks/index.wxss index a8d8c94..bd8a96f 100644 --- a/pages/digitalTextbooks/index.wxss +++ b/pages/digitalTextbooks/index.wxss @@ -26,15 +26,25 @@ font-size: 38rpx; } - -.custom-tabs { - margin-bottom: 32rpx; +.heardTab { + display: flex; + justify-content: space-between; } -.custom-panel { - /* height: ; */ - height: calc(100vh - 300rpx); - color: var(--td-text-color-primary); +.tabBox { + width: 70vw +} + +.dropdown { + z-index: 1; + width: 29vw; + box-shadow: 0px 3px 10px 1px rgba(0, 0, 0, 0.1); +} + +.t-dropdown-menu__item--active, +.t-radio__icon--checked, +.t-checkbox__icon--checked { + color: #FF6C00 !important } .t-tabs__item--active { @@ -65,7 +75,6 @@ .titleBox { display: flex; align-items: center; - margin: 10px; margin-left: 0; padding-top: 30rpx; } @@ -79,7 +88,7 @@ .titleTextBox { margin-left: 15px; - width: 180rpx; + width: 200rpx; height: 36rpx; /*瀹� 3.7 楂�1 */ } diff --git a/pages/personalCenter/certificate/index.wxml b/pages/personalCenter/certificate/index.wxml index f9c2bca..bb4d8ca 100644 --- a/pages/personalCenter/certificate/index.wxml +++ b/pages/personalCenter/certificate/index.wxml @@ -14,8 +14,8 @@ <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> <view class="icon" data-book="{{item}}" bindtap="goBookDetails"> <image src="{{item.productList.certificate}}" mode="aspectFit" class="img" wx:if="{{item.productList.certificate}}" /> - <image src="/static/images/certificate/kczs.jpg" mode="aspectFit" class="img" wx:if="{{!item.productList.certificate && active == 0}}" /> - <image src="/static/images/certificate/jczs.jpg" mode="aspectFit" class="img" wx:if="{{!item.productList.certificate && active == 1}}" /> + <image src="https://jsek.bnuic.com/home/certificate/szkc.jpg" mode="aspectFit" class="img" wx:if="{{!item.productList.certificate && active == 0}}" /> + <image src="https://jsek.bnuic.com/home/certificate/jczs.jpg" mode="aspectFit" class="img" wx:if="{{!item.productList.certificate && active == 1}}" /> </view> <view class="body-info"> <view class="name">{{item.productList.name}}</view> diff --git a/pages/personalCenter/index.js b/pages/personalCenter/index.js index ffbd26b..2820193 100644 --- a/pages/personalCenter/index.js +++ b/pages/personalCenter/index.js @@ -42,7 +42,7 @@ { title: '鎴戠殑涓婁紶', icon: '/static/images/personal/upload.png', - url: '', + url: '/pages/personalCenter/myUpload/index', type: 'upload', }, { diff --git a/pages/personalCenter/index.wxml b/pages/personalCenter/index.wxml index 29395d8..fce2e5b 100644 --- a/pages/personalCenter/index.wxml +++ b/pages/personalCenter/index.wxml @@ -86,32 +86,6 @@ </view> </view> </t-popup> - <t-popup visible="{{visibleIntegral}}" bind:visible-change="onVisibleIntegralChange" placement="center"> - <view class="blockIntegral"> - <scroll-view class="srcolbox" scroll-y scroll-height-animation="true"> - <view class="block-content"> - <view class="tableHeader"> - <view class="lable">绫诲瀷</view> - <view class="value">鏁伴噺</view> - <view class="createDate">鏃堕棿</view> - </view> - <view class="content-item" wx:for="{{recordList}}" wx:for-item="item" wx:for-index="index" wx:key="index"> - <view class="lable">{{item.type}}</view> - <view class="value yes" wx:if="item.value > 0">{{'+' + item.value}}</view> - <view class="value no" wx:else>{{item.value}}</view> - <view class="createDate">{{item.createDate ? item.createDate : '-'}}</view> - </view> - <view class="content-item"> - <view class="lable">鎬昏</view> - <view class="value totle">{{integral}}</view> - <view class="createDate"></view> - </view> - </view> - </scroll-view> - <t-icon t-class="close-btn" name="close-circle" size="64rpx" color="#fff" bind:tap="onClose" /> - </view> - </t-popup> - </view> </t-pull-down-refresh> </view> \ No newline at end of file diff --git a/pages/personalCenter/myUpload/index.js b/pages/personalCenter/myUpload/index.js new file mode 100644 index 0000000..b7b70db --- /dev/null +++ b/pages/personalCenter/myUpload/index.js @@ -0,0 +1,146 @@ +// pages/personalCenter/myUpload/index.js +import moment from 'moment' +const app = getApp(); +Page({ + + /** + * 椤甸潰鐨勫垵濮嬫暟鎹� + */ + data: { + list: [], + //鍒嗛〉 + page: 1, + limit: 10, + pageTotalCount: 0, + bottomLoading: false, + isMoreData: false, + // 杩斿洖椤堕儴 + isBackTop: false, + setScrollValue: 0, + skeletonLoding: true, + }, + + /** + * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 + */ + onLoad(options) { + this.getDataList(false) + }, + + getDataList(isReachBottom) { + app.MG.ugc.getTopicMessageList({ + appRefCode: app.config.appRefCode, + topicIdOrRefCode: 'uploadFiles', + type: 'UserSubmit', + start: this.data.page * this.data.limit - this.data.limit, + size: this.data.limit, + sort: { + type: "Desc", + field: "CreateDate" + } + }) + .then(res => { + try { + if (res.datas.length > 0) { + res.datas.forEach((item) => { + item.createDate = moment(item.createDate).format("YYYY-MM-DD"); + if (item.feedBack) { + item.feedBack = JSON.parse(item.feedBack) + } + if (item.content) { + item.file = JSON.parse(item.content)[0] + } + }); + let dataList = res.datas; + //瑙﹀簳鍔犺浇鏂版暟鎹苟淇濈暀鑰佹暟鎹� + if (isReachBottom) { + dataList = [...this.data.list, ...dataList] //灏嗘柊鏁版嵁鍔犲叆鑰佹暟鎹腑 + } + this.setData({ + list: dataList, + pageTotalCount: res.totalSize, + bottomLoading: false, + isMoreData: dataList.length > 0 ? false : true, + skeletonLoding: false, + }) + } else { + this.setData({ + skeletonLoding: false, + }) + } + } catch (error) { + console.log(error) + } + }) + }, + + toList(e) { + console.log(e) + let file = e.currentTarget.dataset.info.file + + + }, + + /** + * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 + */ + onPullDownRefresh() { + if (this._freshing) return + this.setData({ + page: 1, + limit: 10, + pageTotalCount: 0, + bottomLoading: false, + isMoreData: false + }) + this._freshing = true; + this.setData({ + triggered: false, + }) + this.getDataList(false); + this._freshing = false + }, + + /** + * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� + */ + onReachBottom() { + this.setData({ + bottomLoading: true, + isMoreData: false + }) + let bool = false; + if (this.data.pageTotalCount > this.data.list.length) { + bool = true; + this.setData({ + page: this.data.page + 1, + }) + } else { + setTimeout(() => { + this.setData({ + bottomLoading: false, + isMoreData: true + }) + }, 100) + return false; + } + this.getDataList(bool); + }, + onPageScroll(e) { + if (e && e.scrollTop >= 1000) { + this.setData({ + isBackTop: true + }) + } else { + this.setData({ + isBackTop: false + }) + } + }, + /** + * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/personalCenter/myUpload/index.json b/pages/personalCenter/myUpload/index.json new file mode 100644 index 0000000..f7a3b41 --- /dev/null +++ b/pages/personalCenter/myUpload/index.json @@ -0,0 +1,13 @@ +{ + "navigationBarTitleText": "鎴戠殑涓婁紶", + "usingComponents": { + "t-back-top": "tdesign-miniprogram/back-top/back-top", + "t-image": "tdesign-miniprogram/image/image", + "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh", + "t-loading": "tdesign-miniprogram/loading/loading", + "t-popup": "tdesign-miniprogram/popup/popup", + "t-icon": "tdesign-miniprogram/icon/icon", + "t-empty": "tdesign-miniprogram/empty/empty", + "empty": "/components/empty/index" + } +} \ No newline at end of file diff --git a/pages/personalCenter/myUpload/index.wxml b/pages/personalCenter/myUpload/index.wxml new file mode 100644 index 0000000..72109dc --- /dev/null +++ b/pages/personalCenter/myUpload/index.wxml @@ -0,0 +1,43 @@ +<view class="container" wx:if="{{!skeletonLoding}}"> + <scroll-view class="scroll content" bind:scroll="onPageScroll" model:scroll-top="{{setScrollValue}}" scroll-y refresher-enabled="{{true}}" lower-threshold="{{200}}" refresher-threshold="{{80}}" refresher-default-style="none" refresher-triggered="{{triggered}}" bindrefresherpulling="{{refresh.onPulling}}" bindrefresherrefresh="onPullDownRefresh" bindscrolltolower="onReachBottom"> + <view slot="refresher" class="refresh-container"> + <view class="loading"> + <t-loading theme="circular" size="40rpx" text="姝e湪鍒锋柊..." class="wrapper" /> + </view> + </view> + + <view class="pageInfo" wx:if="{{list.length > 0 && !skeletonLoding}}"> + <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> + <view class="bookName">{{item.name}}</view> + <view class="fileBox"> + <view class="item-con" data-info="{{item}}" bindtap="toList"> + <view class="titleBox"> + <view class="item-title">{{item.file.name}}</view> + </view> + <view class="createDate">{{item.createDate}}</view> + </view> + <view class="stateBox"> + <view class="{{item.state=='Reject' ? 'reject' : item.state=='Normal' ? 'success' : item.state=='WaitAudit' ? 'wait' : ''}}">{{item.state == 'Reject' + ? '鏈�氳繃' + : item.state == 'Normal' + ? '宸查�氳繃' + : item.state == 'WaitAudit' + ? '瀹℃牳涓�' + : '-'}}</view> + </view> + </view> + + </view> + </view> + <view wx:if="{{list.length == 0 && !skeletonLoding}}" class="empyt"> + <empty /> + </view> + <view class="bottom-loading" wx:if="{{bottomLoading}}"> + <t-loading theme="circular" size="40rpx" text="鍔犺浇涓�..." class="wrapper" /> + </view> + <view class="bottom-loading" style="color: #ccc;font-size: 28rpx;" wx:if="{{isMoreData}}"> + <text>娌℃湁鏇村浜�</text> + </view> + </scroll-view> + <t-back-top theme="round" wx:if="{{isBackTop}}" text="椤堕儴" bind:to-top="onToTop"></t-back-top> +</view> \ No newline at end of file diff --git a/pages/personalCenter/myUpload/index.wxss b/pages/personalCenter/myUpload/index.wxss new file mode 100644 index 0000000..5cd0731 --- /dev/null +++ b/pages/personalCenter/myUpload/index.wxss @@ -0,0 +1,90 @@ +.container { + width: 100vw; + height: 100vh; +} + +.content { + height: calc(100vh - env(safe-area-inset-bottom)); + box-sizing: border-box; +} + +.pageInfo { + padding: 40rpx 20rpx; +} + +.content-item { + padding: 20rpx; + background: #fff; + border-radius: 10rpx; + border-bottom: 2rpx solid #EDEDED; +} + +.bookName { + padding: 10rpx 20rpx; + background: #EDEDED +} + +.fileBox { + display: flex; + justify-content: space-between; + align-items: center; + +} + + +.item-con { + margin-left: 30rpx; +} + +.titleBox .item-title { + font-weight: bold; + flex: 1; + height: 40rpx; + line-height: 40rpx; + display: -webkit-box; + margin-top: 20rpx; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + overflow: hidden; + text-overflow: ellipsis; +} + +.createDate { + font-size: 24rpx; + margin: 20rpx 0; +} + +.stateBox { + width: 110rpx; + text-align: right; + font-size: 28rpx; + line-height: 60rpx; +} + +.success { + color: #1FBC1F +} + +.wait { + color: #FF6C00; +} + +.reject { + color: #F03939; + font-weight: bold; +} + +.refresh-container { + margin: 0 auto; +} + +.bottom-loading, +.loading { + padding: 20rpx; + text-align: center; +} + +.body-loading { + padding: 200rpx 0; + text-align: center; +} \ No newline at end of file diff --git a/static/images/bookService/detail/shuzijiaocai.png b/static/images/bookService/detail/shuzijiaocai.png new file mode 100644 index 0000000..d266a38 --- /dev/null +++ b/static/images/bookService/detail/shuzijiaocai.png Binary files differ diff --git a/static/images/personal/jifen-bg.png b/static/images/personal/jifen-bg.png new file mode 100644 index 0000000..1fbda45 --- /dev/null +++ b/static/images/personal/jifen-bg.png Binary files differ -- Gitblit v1.9.1