| | |
| | | "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", |
| | |
| | | "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", |
| | |
| | | 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 |
| | |
| | | }) |
| | | } |
| | | } |
| | | 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, |
| | |
| | | let list = [] |
| | | // 测试 6位// 正式 5位// 测试调用传20,内部7 正式调用传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) |
| | |
| | | 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) |
| | | } |
| | |
| | | }, |
| | | { |
| | | value: "timeAsc", |
| | | label: "创建时间正序", |
| | | label: "出版时间正序", |
| | | }, |
| | | { |
| | | value: "timeDesc", |
| | | label: "创建时间倒序", |
| | | label: "出版时间倒序", |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | this.setData({ |
| | | "product.value": e.detail.value, |
| | | }); |
| | | |
| | | this.bookExhibitionGet(); |
| | | }, |
| | | onOpend() {}, |
| | |
| | | selectedIds: '', |
| | | purchasedIds: [], |
| | | productList: [], |
| | | price: '', |
| | | payPrice: '', |
| | | orderGoods: '', |
| | | isPaySuccess: false, |
| | | isPayComplete: false, |
| | | type: '', |
| | | onNorderSaleMethod: '', |
| | | ImmediatelyReceive: '' |
| | | ImmediatelyReceive: '', |
| | | integral: 0, |
| | | defaultVal: false, |
| | | deductioRate: 0, |
| | | currentBalance: 0, |
| | | showIntegral: false |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | 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 |
| | | }); |
| | | }) |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | |
| | | 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; // 将type设置为item对象的属性,而不是使用setData |
| | | item.paymentIcon = getPublicImage(item.orderSaleMethod.product.icon) |
| | | item.payPrice = this.numFormat(item.payPrice) |
| | | console.log(item, 'item'); |
| | | }) |
| | | this.setData({ |
| | | productList: res.saleMethodLinks, |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | 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({ |
| | |
| | | "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" |
| | | } |
| | | } |
| | |
| | | <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"> |
| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | 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 { |
| | |
| | | |
| | | } |
| | | |
| | | .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 { |
| | |
| | | |
| | | } |
| | | |
| | | .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; |
New file |
| | |
| | | // 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() { |
| | | |
| | | } |
| | | }) |
New file |
| | |
| | | { |
| | | "navigationBarTitleText": "数字阅读", |
| | | "usingComponents": {} |
| | | } |
New file |
| | |
| | | <!--pages/home/digitalRead/index.wxml--> |
| | | <view class="page-body"> |
| | | <web-view bind:message="drawBack" binderror="onError" bindload="onLoadWeb" src="{{src}}"></web-view> |
| | | </view> |
New file |
| | |
| | | /* pages/home/digitalRead/index.wxss */ |
| | | .page-body { |
| | | width: 100vw; |
| | | height: calc(100vh - env(safe-area-inset-bottom)); |
| | | overflow: hidden; |
| | | } |
| | |
| | | testResourceIocn: { |
| | | name: "/static/images/digitalTextbooks/link-t@3x.png", |
| | | }, |
| | | |
| | | relationTextBook: null, |
| | | isTextBookBuy: false, |
| | | dialogBox: false, |
| | | lecturerList: [], |
| | | selectActive: 'learn', |
| | |
| | | console.log(this.data.tabValue); |
| | | if (this.data.tabValue == 2) { |
| | | this.getResource() |
| | | this.getRelationBook() |
| | | } |
| | | if (this.data.tabValue == 3) { |
| | | this.selectComponent("#note").getNoteList(); |
| | |
| | | } |
| | | }, |
| | | |
| | | // 获取相关教材 |
| | | //获取关联子商品/数字教材 |
| | | 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, |
| | |
| | | |
| | | |
| | | 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: "您的学习任务还未完成,暂不能申请证书,加油哦!", |
| | |
| | | // }); |
| | | // return false |
| | | // } |
| | | // if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { |
| | | // wx.showToast({ |
| | | // title: "您申请的证书正在审核中", |
| | | // icon: "none", |
| | | // duration: 1000, |
| | | // }); |
| | | // return false |
| | | // } |
| | | if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { |
| | | wx.showToast({ |
| | | title: "您申请的证书正在审核中", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false |
| | | } |
| | | |
| | | var page = getCurrentPages().pop(); // 获取当前页面实例 |
| | | page.setData({ |
| | |
| | | </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> |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | active: 0, |
| | | activeItem: null, |
| | | loading: false, |
| | | shoppingCartGetId: [] |
| | | shoppingCartGetId: [], |
| | | sorter: { |
| | | value: "*", |
| | | options: [{ |
| | | value: "*", |
| | | label: "默认排序", |
| | | }, |
| | | { |
| | | value: "nameAsc", |
| | | label: "点击量正序", |
| | | }, |
| | | { |
| | | value: "nameDesc", |
| | | label: "点击量倒序", |
| | | }, |
| | | { |
| | | value: "timeAsc", |
| | | label: "创建时间正序", |
| | | }, |
| | | { |
| | | value: "timeDesc", |
| | | label: "创建时间倒序", |
| | | }, |
| | | ], |
| | | }, |
| | | sortActive: '' |
| | | }, |
| | | |
| | | /** |
| | |
| | | |
| | | getCourseList(item) { |
| | | let searchObj = {} |
| | | // let sort = {} |
| | | let sort = {} |
| | | // // 搜索框 |
| | | if (this.data.searchValue) { |
| | | searchObj = { |
| | |
| | | } |
| | | } |
| | | |
| | | // 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, |
| | |
| | | value: 'Normal', |
| | | field: 'state' |
| | | }], |
| | | // sort: sort, |
| | | sort: sort, |
| | | fields: { |
| | | courseLeader: [], |
| | | affiliatedUnit: [], |
| | |
| | | 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) |
| | |
| | | "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", |
| | |
| | | </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> |
| | |
| | | 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 { |
| | |
| | | }, |
| | | |
| | | 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: "您的学习任务还未完成,暂不能申请证书,加油哦!", |
| | |
| | | // }); |
| | | // return false |
| | | // } |
| | | // if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { |
| | | // wx.showToast({ |
| | | // title: "您申请的证书正在审核中", |
| | | // icon: "none", |
| | | // duration: 1000, |
| | | // }); |
| | | // return false |
| | | // } |
| | | if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { |
| | | wx.showToast({ |
| | | title: this.data.isCertificate.state == 'WaitAudit' ? "您申请的证书正在审核中" : this.data.isCertificate.state == 'Normal' ? '您已申请证书' : '', |
| | | icon: "none", |
| | | duration: 1000, |
| | | }); |
| | | return false |
| | | } |
| | | |
| | | var page = getCurrentPages().pop(); // 获取当前页面实例 |
| | | page.setData({ |
| | |
| | | <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"> |
| | |
| | | selectedIndex: 0, |
| | | digitalTextbooksData: [], |
| | | path: "jsek_dTHigherEducation", |
| | | loading: true |
| | | loading: true, |
| | | sorter: { |
| | | value: "*", |
| | | options: [{ |
| | | value: "*", |
| | | label: "默认排序", |
| | | }, |
| | | { |
| | | value: "nameAsc", |
| | | label: "点击量正序", |
| | | }, |
| | | { |
| | | value: "nameDesc", |
| | | label: "点击量倒序", |
| | | }, |
| | | { |
| | | value: "timeAsc", |
| | | label: "创建时间正序", |
| | | }, |
| | | { |
| | | value: "timeDesc", |
| | | label: "创建时间倒序", |
| | | }, |
| | | ], |
| | | }, |
| | | sortActive: '' |
| | | |
| | | }, |
| | | |
| | |
| | | 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 = { |
| | |
| | | } |
| | | } |
| | | |
| | | // 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', |
| | |
| | | start: 0, |
| | | size: 99 |
| | | }, |
| | | // sort: sort, |
| | | sort: sort, |
| | | fields: { |
| | | content: [], |
| | | subtitle: [], |
| | |
| | | digitalTextbooksData: res.datas, |
| | | loading: false |
| | | }) |
| | | |
| | | |
| | | console.log(this.data.digitalTextbooksData); |
| | | }) |
| | | }, |
| | |
| | | "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", |
| | |
| | | </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> |
| | |
| | | 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 { |
| | |
| | | .titleBox { |
| | | display: flex; |
| | | align-items: center; |
| | | margin: 10px; |
| | | margin-left: 0; |
| | | padding-top: 30rpx; |
| | | } |
| | |
| | | |
| | | .titleTextBox { |
| | | margin-left: 15px; |
| | | width: 180rpx; |
| | | width: 200rpx; |
| | | height: 36rpx; |
| | | /*宽 3.7 高1 */ |
| | | } |
| | |
| | | <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> |
| | |
| | | { |
| | | title: '我的上传', |
| | | icon: '/static/images/personal/upload.png', |
| | | url: '', |
| | | url: '/pages/personalCenter/myUpload/index', |
| | | type: 'upload', |
| | | }, |
| | | { |
| | |
| | | </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> |
New file |
| | |
| | | // 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() { |
| | | |
| | | } |
| | | }) |
New file |
| | |
| | | { |
| | | "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" |
| | | } |
| | | } |
New file |
| | |
| | | <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="正在刷新..." 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> |
New file |
| | |
| | | .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; |
| | | } |