| | |
| | | { |
| | | "pages": [ |
| | | "pages/home/home", |
| | | "pages/resourceDetails/myAudio/index", |
| | | "pages/resourceDetails/myVideo/index", |
| | | "pages/resourceDetails/document/index", |
| | | "pages/retrievalPage/index", |
| | | "pages/cart/paymentPage/index", |
| | | "pages/cart/index", |
| | | "pages/home/home", |
| | | "pages/aboutUs/index", |
| | | "pages/bookServices/assort/index", |
| | | "pages/bookServices/detail/index", |
| | |
| | | "pages/order/invoice/index", |
| | | "pages/usercenter/name-edit/index", |
| | | "pages/teacherCertification/index", |
| | | "pages/sampleBookList/index", |
| | | "pages/sampleBookList/applicationForm/index", |
| | | "pages/personalCenter/index", |
| | | "pages/personalCenter/myOrder/index", |
| | | "pages/personalCenter/myCollection/index", |
| | |
| | | @import 'style/iconfont.wxss'; |
| | | |
| | | @import 'style/theme.wxss'; |
| | | |
| | | page { |
| | | width: 100%; |
| | | height: 100%; |
| | | box-sizing: border-box; |
| | | padding-bottom: constant(safe-area-inset-bottom); |
| | | padding-bottom: env(safe-area-inset-bottom); |
| | | } |
| | |
| | | <!-- 图书服务-列表 --> |
| | | <view style="width: 100%; height: {{barHeight}}px;"></view> |
| | | |
| | | <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> |
| | | <view> |
| | | <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="home-page-tabs"> |
| | | <t-tabs t-class="t-tabs" t-class-active="tabs-external__active" t-class-item="tabs-external__item" defaultValue="{{activeItem}}" space-evenly="{{false}}" bind:change="tabChangeHandle"> |
| | | <t-tabs t-class="t-tabs" split="{{false}}" defaultValue="{{activeItem}}" bind:change="tabChangeHandle"> |
| | | <t-tab-panel wx:for="{{courseTypeList}}" wx:for-index="index" wx:key="index" label="{{item.name}}" value="{{index}}" /> |
| | | </t-tabs> |
| | | </view> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="home-page-tabs"> |
| | | <t-tabs t-class="t-tabs" t-class-active="tabs-external__active" t-class-item="tabs-external__item" defaultValue="{{activeItem1}}" space-evenly="{{false}}" bind:change="tabBookClick"> |
| | | <t-tabs t-class="t-tabs" split="{{false}}" defaultValue="{{activeItem1}}" bind:change="tabBookClick"> |
| | | <t-tab-panel wx:for="{{bookTypeList}}" wx:for-index="index" wx:key="index" label="{{item.name}}" value="{{index}}" /> |
| | | </t-tabs> |
| | | </view> |
| | |
| | | } |
| | | |
| | | .body-info .name { |
| | | font-size: 32rpx; |
| | | font-size: 30rpx; |
| | | height: 88rpx; |
| | | color: #333333; |
| | | font-weight: bold; |
| | | line-height: 44rpx; |
| | | line-height: 40rpx; |
| | | display: -webkit-box; |
| | | margin-bottom: 10rpx; |
| | | -webkit-box-orient: vertical; |
| | |
| | | } |
| | | |
| | | .listBox2 .author { |
| | | height: 30rpx; |
| | | height: 28rpx; |
| | | color: #333333; |
| | | font-weight: bold; |
| | | line-height: 30rpx; |
| | |
| | | } |
| | | |
| | | .listBox3 .name { |
| | | font-size: 32rpx; |
| | | font-size: 30rpx; |
| | | height: 44rpx; |
| | | color: #333333; |
| | | font-weight: bold; |
| | |
| | | // pages/personalCenter/activateProduct/index.js |
| | | const app = getApp(); |
| | | import moment from 'moment' |
| | | import tool2 from "../../../assets/js/toolClass.js" |
| | | import { getPublicImage } from "../../../assets/js/middleGround/tool.js"; |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | |
| | | code: "", |
| | | list: [], |
| | | //分页 |
| | | page: 1, |
| | | limit: 4, |
| | | pageTotalCount: 0, |
| | | bottomLoading: false, |
| | | isMoreData: false, |
| | | // 返回顶部 |
| | | isBackTop: false, |
| | | setScrollValue: 0, |
| | | skeletonLoding: true, |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options); |
| | | this.getDataList(false) |
| | | }, |
| | | bindTnputBlur: function (e) { |
| | | this.setData({ |
| | | code: e.detail.value, |
| | | }); |
| | | console.log(this.data.code) |
| | | }, |
| | | //激活 |
| | | onActivation() { |
| | | var that = this; |
| | | let lock = true; |
| | | if (that.data.code == "") { |
| | | wx.showToast({ |
| | | title: "请输入激活码!", |
| | | icon: 'error', |
| | | duration: 1000, |
| | | }) |
| | | } else { |
| | | if (lock) { |
| | | lock = false; |
| | | app.MG.store |
| | | .userActiveCode({ |
| | | code: that.data.code, |
| | | }) |
| | | .then((res) => { |
| | | wx.showToast({ |
| | | title: res, |
| | | icon: 'none', |
| | | duration: 1000, |
| | | success: function () { |
| | | setTimeout(function () { |
| | | that.getDataList(false); |
| | | that.setData({ |
| | | list: [], |
| | | code: "" |
| | | }) |
| | | lock = true; |
| | | }, 1000) //延迟时间 |
| | | } |
| | | }) |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | }, |
| | | //商品列表 |
| | | getDataList(isReachBottom) { |
| | | app.MG.store.userActiveCodeList({ |
| | | 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, index) => { |
| | | item.createDate = moment(item.createDate).format("YYYY-MM-DD HH:mm:ss"); |
| | | let oldlist = []; |
| | | oldlist = item.productList |
| | | oldlist.forEach(istrue => { |
| | | istrue.icon = getPublicImage(istrue.icon, "", 400) |
| | | }) |
| | | }) |
| | | 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, |
| | | loading: false |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |
| | | } |
| | | } catch (error) { |
| | | console.log(error) |
| | | } |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() { |
| | | |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() { |
| | | |
| | | if (this._freshing) return |
| | | this.setData({ |
| | | // list: [], |
| | | page: 1, |
| | | limit: 4, |
| | | 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); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "navigationBarTitleText": "激活商品", |
| | | "usingComponents": {} |
| | | "usingComponents": { |
| | | "t-back-top": "tdesign-miniprogram/back-top/back-top", |
| | | "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-image": "tdesign-miniprogram/image/image", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | } |
| | | } |
| | |
| | | <!--pages/personalCenter/activateProduct/index.wxml--> |
| | | <text>pages/personalCenter/activateProduct/index.wxml</text> |
| | | <view class="container"> |
| | | <view class="activation"> |
| | | <view class="title"> |
| | | <view class="line"></view> |
| | | <view>激活码</view> |
| | | </view> |
| | | <view class="contentBox"> |
| | | <view class="inputBox"> |
| | | <input class="weui-input" name="code" auto-focus="true" adjust-position="true" value="{{code}}" placeholder="请输入激活码" bindinput="bindTnputBlur" /> |
| | | <button class="button" bindtap="onActivation">激活商品</button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="page-content"> |
| | | <view class="title"> |
| | | <view class="line"></view> |
| | | <view>已激活商品</view> |
| | | </view> |
| | | <view class="contentBox"> |
| | | <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="list" wx:if="{{list.length > 0}}"> |
| | | <view class="content-item" wx:for="{{list}}" wx:for-item="items" wx:for-index="index" wx:key="index"> |
| | | <view class="codeInfoBox"> |
| | | <view>激活码:{{items.code}}</view> |
| | | <view>激活时间:{{items.createDate}}</view> |
| | | </view> |
| | | <view class="listBox"> |
| | | <scroll-view class="srcolbox" scroll-x scroll-with-animation='true'> |
| | | <view class="order-centent"> |
| | | <view class="bookBox" wx:for="{{items.productList}}" wx:for-item="itemes" wx:for-index="idx" wx:key="idx" bindtap="onOrderDetail" data-info="{{itemes}}"> |
| | | <view class="leftCon"> |
| | | <!-- 获取图片 --> |
| | | <image class="purchasedIcon" wx:if="{{itemes.icon}}" src="{{itemes.icon}}" mode="aspectFit" /> |
| | | <image class="purchasedIcon" wx:else src="/static/images/default-book-img.png" mode="aspectFit" /> |
| | | </view> |
| | | <!-- 获取名称 --> |
| | | <view class="rightCon"> |
| | | <view class="productTitle">{{itemes.name}}</view> |
| | | <view class="typeBox"> |
| | | <text class="typeCon">{{ |
| | | itemes.orderSaleMethod.type == 'defaultSaleMethod' |
| | | ? '电子书' |
| | | : itemes.orderSaleMethod.type == 'createProductSaleMethod' && itemes.orderSaleMethod.cmsItemList == 0 ? '组卷' : '云学习' |
| | | }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{list.length == 0}}" class="empyt"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </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> |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | |
| | | /* pages/personalCenter/activateProduct/index.wxss */ |
| | | page { |
| | | width: 100vw; |
| | | height: 100%; |
| | | background: #F2F3F8; |
| | | } |
| | | |
| | | .refresh-container { |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .bottom-loading, |
| | | .loading { |
| | | padding: 20rpx; |
| | | text-align: center; |
| | | } |
| | | |
| | | .container { |
| | | padding: 40rpx 24rpx; |
| | | } |
| | | |
| | | .activation { |
| | | height: 160rpx; |
| | | background: #fff; |
| | | border-radius: 18rpx; |
| | | padding: 30rpx 0; |
| | | |
| | | } |
| | | |
| | | .title { |
| | | display: flex; |
| | | line-height: 54rpx; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .title .line { |
| | | border-left: 8rpx solid #FF6C00; |
| | | border-radius: 0 8rpx 8rpx 0; |
| | | margin-right: 20rpx; |
| | | } |
| | | |
| | | |
| | | .contentBox { |
| | | margin-top: 20rpx; |
| | | } |
| | | |
| | | .inputBox { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 30rpx; |
| | | } |
| | | |
| | | .inputBox .weui-input { |
| | | border: 2rpx solid #D9D9D9; |
| | | border-radius: 10rpx; |
| | | height: 60rpx; |
| | | padding: 6rpx 10rpx; |
| | | } |
| | | |
| | | .button { |
| | | margin: 0; |
| | | height: 74rpx; |
| | | line-height: 74rpx; |
| | | font-size: 28rpx; |
| | | background: #FF6C00; |
| | | color: #fff; |
| | | margin-left: 10rpx; |
| | | border-color: #FF6C00; |
| | | } |
| | | |
| | | .page-content { |
| | | margin-top: 40rpx; |
| | | background: #fff; |
| | | border-radius: 18rpx; |
| | | padding: 30rpx 0; |
| | | } |
| | | |
| | | .list { |
| | | padding: 20rpx 30rpx; |
| | | } |
| | | |
| | | .content-item { |
| | | margin-bottom: 40rpx; |
| | | } |
| | | |
| | | .codeInfoBox { |
| | | border: 2rpx solid #EDECEC; |
| | | border-radius: 10rpx; |
| | | background: #f3f3f3; |
| | | padding: 20rpx; |
| | | font-size: 28rpx; |
| | | line-height: 56rpx; |
| | | } |
| | | |
| | | .order-centent { |
| | | display: flex; |
| | | } |
| | | |
| | | .bookBox { |
| | | padding: 20rpx 0; |
| | | width: 200rpx; |
| | | padding-right: 20rpx; |
| | | } |
| | | |
| | | .bookBox .leftCon { |
| | | width: 180rpx; |
| | | height: 240rpx; |
| | | box-shadow: 0px 0px 20rpx 2px #f1f1f1; |
| | | } |
| | | |
| | | .bookBox .leftCon .purchasedIcon { |
| | | width: 100%; |
| | | height: 100%; |
| | | object-fit: contain; |
| | | } |
| | | |
| | | .rightCon { |
| | | margin-top: 10rpx; |
| | | } |
| | | |
| | | .productTitle { |
| | | font-size: 28rpx; |
| | | height: 88rpx; |
| | | color: #333333; |
| | | line-height: 44rpx; |
| | | display: -webkit-box; |
| | | margin-bottom: 20rpx; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .typeBox { |
| | | line-height: 60rpx; |
| | | } |
| | | |
| | | .typeCon { |
| | | background: rgba(255, 108, 0, 0.24); |
| | | border-radius: 9rpx 9rpx 9rpx 9rpx; |
| | | padding: 8rpx 20rpx; |
| | | color: #FF6C00; |
| | | font-size: 24rpx; |
| | | } |
| | | |
| | | .empyt { |
| | | padding: 100rpx 0; |
| | | background: #fff; |
| | | } |
| | |
| | | // pages/personalCenter/downloads/index.js |
| | | const app = getApp(); |
| | | import moment from 'moment' |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | |
| | | list: [], |
| | | //分页 |
| | | page: 1, |
| | | limit: 10, |
| | | pageTotalCount: 0, |
| | | bottomLoading: false, |
| | | isMoreData: false, |
| | | // 返回顶部 |
| | | isBackTop: false, |
| | | setScrollValue: 0, |
| | | skeletonLoding: true, |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options); |
| | | this.getDataList(false); |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | getDataList(isReachBottom) { |
| | | app.MG.ugc.getTopicMessageList({ |
| | | appRefCode: app.config.appRefCode, |
| | | topicIdOrRefCode: "productDownLoad", |
| | | 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 HH:mm:ss"); |
| | | item.updateDate = moment(item.updateDate).format("YYYY-MM-DD HH:mm:ss"); |
| | | if (item.feedBack) { |
| | | item.feedBack = JSON.parse(item.feedBack); |
| | | } |
| | | if (item.content) { |
| | | item.product = 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) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() { |
| | | |
| | | goBookDetails(e) { |
| | | const { book } = e.currentTarget.dataset; |
| | | wx.navigateTo({ |
| | | url: `/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | 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 |
| | | }) |
| | | } |
| | | }, |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | |
| | | { |
| | | "navigationBarTitleText": "我的下载", |
| | | "usingComponents": {} |
| | | "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-empty": "tdesign-miniprogram/empty/empty" |
| | | } |
| | | } |
| | |
| | | <!--pages/personalCenter/downloads/index.wxml--> |
| | | <text>pages/personalCenter/downloads/index.wxml</text> |
| | | <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}}"> |
| | | <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| | | <view class="item-con" data-info="{{item}}" bindtap="toList"> |
| | | <view class="icon"> |
| | | <t-image src="{{item.product.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="titleBox"> |
| | | <view class="item-title">{{item.name}}</view> |
| | | <view class="createDate" wx:if="{{item.state !== 'Reject'}}">申请时间:{{item.createDate}}</view> |
| | | <view class="createDate reason" wx:if="{{item.state == 'Reject'}}">原因: {{item.feedBack.reason}}</view> |
| | | <view class="createDate" wx:if="{{item.state != 'WaitAudit'}}">审核时间:{{item.updateDate}}</view> |
| | | </view> |
| | | </view> |
| | | <view class="stateBox"> |
| | | <text wx:if="{{item.state =='Normal'}}" class="success">已通过</text> |
| | | <text wx:if="{{item.state =='WaitAudit'}}" class="wait">审核中</text> |
| | | <text wx:if="{{item.state =='Reject'}}" class="reject">未通过</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{list.length == 0}}" class="empyt"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </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> |
| | |
| | | /* pages/personalCenter/downloads/index.wxss */ |
| | | .container { |
| | | padding: 40rpx 30rpx; |
| | | } |
| | | |
| | | .content-item { |
| | | padding: 40rpx 0; |
| | | border-bottom: 1px solid #EDEDED; |
| | | display: flex; |
| | | } |
| | | |
| | | .content-item .icon { |
| | | width: 150rpx; |
| | | height: 200rpx; |
| | | } |
| | | |
| | | .content-item .icon .img { |
| | | width: 100%; |
| | | height: 100%; |
| | | object-fit: contain; |
| | | } |
| | | |
| | | .item-con { |
| | | display: flex; |
| | | flex: 1; |
| | | } |
| | | |
| | | .titleBox { |
| | | margin-left: 20rpx; |
| | | } |
| | | |
| | | .titleBox .item-title { |
| | | font-weight: bold; |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | .createDate { |
| | | font-size: 28rpx; |
| | | color: #949494; |
| | | line-height: 54rpx; |
| | | } |
| | | |
| | | .reason { |
| | | width: 400rpx; |
| | | line-height: 44rpx; |
| | | font-size: 28rpx; |
| | | word-break: break-all; |
| | | display: -webkit-box; |
| | | -webkit-line-clamp: 2; |
| | | -webkit-box-orient: vertical; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .stateBox { |
| | | width: 120rpx; |
| | | 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; |
| | | } |
| | |
| | | */ |
| | | data: { |
| | | active: 0, |
| | | activeName: "proposition", |
| | | activeName: "bookOpinion", |
| | | tabList: [ |
| | | { |
| | | label: '图书建议', |
| | | key: 0, |
| | | value: 'proposition' |
| | | value: 'bookOpinion' |
| | | }, |
| | | { |
| | | label: '意见反馈', |
| | |
| | | value: "feedback" |
| | | } |
| | | ], |
| | | list: [ |
| | | { |
| | | name: "ceshi", |
| | | } |
| | | ], |
| | | list: [], |
| | | //分页 |
| | | page: 1, |
| | | limit: 10, |
| | |
| | | isBackTop: false, |
| | | setScrollValue: 0, |
| | | skeletonLoding: true, |
| | | |
| | | topicIdOrRefCode: 'bookOpinion' |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options); |
| | | // if (this.data.activeName == "proposition") { |
| | | // this.getDataList("bookOpinion", false); |
| | | // } else { |
| | | // this.getDataList("feedback", false); |
| | | // } |
| | | this.getDataList(false); |
| | | }, |
| | | |
| | | /** |
| | |
| | | skeletonLoding: true, |
| | | active: item.detail.value, |
| | | activeName: info.value, |
| | | topicIdOrRefCode: info.value, |
| | | list: [], |
| | | page: 1, |
| | | bottomLoading: false, |
| | | isMoreData: false, |
| | | }) |
| | | if (info.value == "proposition") { |
| | | that.getDataList("bookOpinion", false); |
| | | } else { |
| | | that.getDataList("feedback", false); |
| | | } |
| | | that.getDataList(false); |
| | | }, |
| | | |
| | | getDataList(code, isReachBottom) { |
| | | getDataList(isReachBottom) { |
| | | app.MG.ugc.getTopicMessageList({ |
| | | appRefCode: app.config.appRefCode, |
| | | topicIdOrRefCode: code, |
| | | topicIdOrRefCode: this.data.topicIdOrRefCode, |
| | | start: this.data.page * this.data.limit - this.data.limit, |
| | | size: this.data.limit, |
| | | sort: { |
| | |
| | | .then(res => { |
| | | try { |
| | | if (res.datas.length > 0) { |
| | | // res.datas.forEach((item) => { |
| | | // item.title = JSON.parse(item.content).content; |
| | | // item.createDate = moment(item.createDate).format("YYYY-MM-DD"); |
| | | // item.updateDate = moment(item.updateDate).format("YYYY-MM-DD");; |
| | | // item.feedBack = item.feedBack ? item.feedBack : "-"; |
| | | // }); |
| | | res.datas.forEach((item) => { |
| | | item.content = JSON.parse(item.content); |
| | | item.createDate = moment(item.createDate).format("YYYY-MM-DD"); |
| | | item.updateDate = moment(item.updateDate).format("YYYY-MM-DD"); |
| | | item.feedBack = item.feedBack ? item.feedBack : "-"; |
| | | }); |
| | | let dataList = res.datas; |
| | | //触底加载新数据并保留老数据 |
| | | if (isReachBottom) { |
| | |
| | | isMoreData: dataList.length > 0 ? false : true, |
| | | skeletonLoding: false, |
| | | }) |
| | | console.log(this.data.list, 333) |
| | | console.log(this.data.list, 123) |
| | | } else { |
| | | this.setData({ |
| | | skeletonLoding: false, |
| | |
| | | this.setData({ |
| | | triggered: false, |
| | | }) |
| | | if (this.data.activeName == "proposition") { |
| | | this.getDataList("bookOpinion", false); |
| | | } else { |
| | | this.getDataList("feedback", false); |
| | | } |
| | | this.getDataList(false); |
| | | this._freshing = false |
| | | }, |
| | | |
| | |
| | | }, 100) |
| | | return false; |
| | | } |
| | | if (this.data.activeName == "proposition") { |
| | | this.getDataList("bookOpinion", bool); |
| | | } else { |
| | | this.getDataList("feedback", bool); |
| | | } |
| | | this.getDataList(bool); |
| | | }, |
| | | |
| | | // 监听滚动距离 |
| | |
| | | <view class="container"> |
| | | <t-tabs t-class="t-tabs" t-class-active="tabs-external__active" t-class-item="tabs-external__item" defaultValue="{{active}}" space-evenly="{{false}}" bind:change="tabBookClick"> |
| | | <t-tabs t-class="t-tabs" split="{{false}}" defaultValue="{{active}}" bind:change="tabBookClick"> |
| | | <t-tab-panel wx:for="{{tabList}}" wx:for-index="index" wx:key="index" label="{{item.label}}" value="{{index}}"> |
| | | </t-tab-panel> |
| | | </t-tabs> |
| | | <view class="pageInfo"> |
| | | <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"> |
| | |
| | | <t-loading theme="circular" size="40rpx" text="正在刷新..." class="wrapper" /> |
| | | </view> |
| | | </view> |
| | | {{list}} |
| | | <view class="list"> |
| | | <view class="list" wx:if="{{list.length > 0}}"> |
| | | <view wx:if="{{activeName == 'bookOpinion'}}" class="listBox"> |
| | | <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| | | <view class="icon"> |
| | | <t-image src="{{item.icon}}" mode="heightFix" class="img" /> |
| | | <t-image src="{{item.content.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="item-con"> |
| | | <view class="titleBox"> |
| | | <view class="item-title">{{item.name}}</view> |
| | | </view> |
| | | <view class="name">建议:{{item.content.content}}</view> |
| | | <view class="feedBack">反馈:{{item.feedBack}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- <view wx:if="{{activeName == 'feedback'}}"> |
| | | <view wx:if="{{activeName == 'feedback'}}" class="backBox"> |
| | | <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| | | <view class="item-con"> |
| | | <view class="titleBox"> |
| | | <view class="item-title">{{item.name}}</view> |
| | | <view class="backCon"> |
| | | <view> |
| | | 回复:{{item.feedBack}} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> --> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{list.length == 0}}" class="empyt"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | </t-tab-panel> |
| | | </t-tabs> |
| | | |
| | | <view class="submitBox" bindtap="goSubmit" wx:if="{{activeName == 'feedback'}}"> |
| | | <view class="box"> |
| | | <t-image src="/static/images/personal/suggestion.png" mode="heightFix" class="img" /> |
| | |
| | | padding: 0 24rpx; |
| | | } |
| | | |
| | | .page-header { |
| | | background-color: #F2F3F8; |
| | | width: 100%; |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | z-index: 1 |
| | | } |
| | | |
| | | .t-tabs__track { |
| | | display: none; |
| | | } |
| | |
| | | text-align: center; |
| | | } |
| | | |
| | | .content { |
| | | .container { |
| | | height: calc(100vh - env(safe-area-inset-bottom)); |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .content-item { |
| | | background: #fff; |
| | | .pageInfo { |
| | | margin-top: -30rpx; |
| | | } |
| | | |
| | | .listBox:nth-child(1) { |
| | | margin-top: -30rpx; |
| | | padding-top: 30rpx; |
| | | .content-item { |
| | | background: #fff; |
| | | display: flex; |
| | | margin-bottom: 30rpx; |
| | | border-radius: 10rpx; |
| | | padding: 40rpx 30rpx; |
| | | } |
| | | |
| | | .content-item:nth-child(1) { |
| | | padding-top: 70rpx; |
| | | } |
| | | |
| | | .listBox .icon { |
| | | width: 150rpx; |
| | | height: 200rpx; |
| | | } |
| | | |
| | | .listBox .icon .img { |
| | | width: 100%; |
| | | height: 100%; |
| | | object-fit: contain; |
| | | } |
| | | |
| | | .listBox .item-con { |
| | | flex: 1; |
| | | margin-left: 20rpx; |
| | | } |
| | | |
| | | .listBox .titleBox { |
| | | font-size: 28rpx; |
| | | font-weight: bold; |
| | | border-bottom: 2rpx solid #EDEDED; |
| | | line-height: 80rpx; |
| | | word-break: break-all; |
| | | display: -webkit-box; |
| | | -webkit-line-clamp: 1; |
| | | -webkit-box-orient: vertical; |
| | | overflow: hidden; |
| | | padding-bottom: 10rpx; |
| | | } |
| | | |
| | | .name { |
| | | font-size: 26rpx; |
| | | color: #9D9D9D; |
| | | line-height: 70rpx; |
| | | } |
| | | |
| | | .feedBack { |
| | | font-size: 26rpx; |
| | | color: #FF6C00; |
| | | } |
| | | |
| | | .backBox .content-item { |
| | | display: block; |
| | | } |
| | | |
| | | .backBox .item-title { |
| | | font-size: 28rpx; |
| | | font-weight: bold; |
| | | line-height: 80rpx; |
| | | word-break: break-all; |
| | | display: -webkit-box; |
| | | -webkit-line-clamp: 1; |
| | | -webkit-box-orient: vertical; |
| | | overflow: hidden; |
| | | padding-bottom: 10rpx; |
| | | } |
| | | |
| | | .backCon { |
| | | background: #FAFAFA; |
| | | border-radius: 5rpx; |
| | | padding: 10rpx 20rpx; |
| | | font-size: 28rpx; |
| | | line-height: 60rpx; |
| | | } |
| | | |
| | | .submitBox { |
| | |
| | | } |
| | | |
| | | .empyt { |
| | | background: #fff; |
| | | padding: 200rpx 0; |
| | | } |
| | |
| | | { |
| | | title: '我的证书', |
| | | icon: '/static/images/personal/certificate.png', |
| | | url: '/pages/personalCenter/certificate/index', |
| | | url: '', |
| | | type: 'certificate', |
| | | }, |
| | | { |
| | |
| | | type: 'sampleBook', |
| | | }, |
| | | { |
| | | title: '出书申请', |
| | | icon: '/static/images/personal/chushu.png', |
| | | url: '/pages/personalCenter/publishBooks/index', |
| | | type: 'publishBooks', |
| | | }, |
| | | { |
| | | title: '我的上传', |
| | | icon: '/static/images/personal/upload.png', |
| | | url: '', |
| | | type: 'upload', |
| | | }, |
| | | { |
| | | title: '出书申请', |
| | | icon: '/static/images/personal/chushu.png', |
| | | url: '/pages/personalCenter/publishBooks/index', |
| | | type: 'publishBooks', |
| | | } |
| | | ]; |
| | | const moreMenu = [ |
| | |
| | | } |
| | | }) |
| | | }, |
| | | //教师认证 |
| | | toCertification() { |
| | | wx.navigateTo({ |
| | | url: "/pages/teacherCertification/index", |
| | | }); |
| | | }, |
| | | |
| | | //点击目录 |
| | | toPages(item) { |
| | |
| | | <view class="bg"> |
| | | <image src="/static/images/personal/my-bg.png" mode="heightFix" class="image" /> |
| | | </view> |
| | | <image class="background" src="/static/images/personal/my-bg.png" mode="heightFix" /> |
| | | <!-- <image class="background" src="/static/images/personal/my-bg.png" mode="heightFix" /> --> |
| | | <t-user-center-card userInfo="{{userInfo}}" isPhoneHide="{{true}}" name-class="custom-name-class" phone-class="custom-phone-class" avatar-class="customer-avatar-class" currAuthStep="{{currAuthStep}}" bind:gotoUserEditPage="gotoUserEditPage" /> |
| | | <view class="content-wrapper"> |
| | | <view class="topBox"> |
| | |
| | | <view class="no" wx:if="{{teacherState.state == 'Reject'}}">已驳回</view> |
| | | <view class="wait" wx:if="{{teacherState.state == ''}}">待认证</view> |
| | | <view class="title"><text>教师认证</text> |
| | | <text class="change-info" wx:if="{{teacherState.state == ''}}">认证</text> |
| | | <text class="change-info" wx:if="{{teacherState.state == 'Normal' || teacherState.state == 'Reject'}}">修改</text> |
| | | <text class="change-info" wx:if="{{teacherState.state == ''}}" bindtap="toCertification">认证</text> |
| | | <text class="change-info" wx:if="{{teacherState.state == 'Normal' || teacherState.state == 'Reject'}}" bindtap="toCertification">修改</text> |
| | | </view> |
| | | </view> |
| | | <view> |
| | |
| | | list: [], |
| | | //分页 |
| | | page: 1, |
| | | limit: 12, |
| | | limit: 18, |
| | | pageTotalCount: 0, |
| | | bottomLoading: false, |
| | | isMoreData: false, |
| | |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options); |
| | | this.getDataList(); |
| | | this.getDataList(false); |
| | | }, |
| | | |
| | | /** |
| | |
| | | } |
| | | }) |
| | | }, |
| | | goBookDetails(itemData) { |
| | | let info = itemData.currentTarget.dataset.info; |
| | | // wx.navigateTo({ |
| | | // url: "/pages/personalCenter/myMassage/massageDetail/index?id=" + info.id, |
| | | // }); |
| | | goBookDetails(e) { |
| | | const { book } = e.currentTarget.dataset; |
| | | wx.navigateTo({ |
| | | url: `/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, |
| | | }); |
| | | }, |
| | | |
| | | |
| | |
| | | <view class="container"> |
| | | <t-tabs t-class="t-tabs" t-class-active="tabs-external__active" t-class-item="tabs-external__item" defaultValue="{{active}}" space-evenly="{{false}}" bind:change="tabBookClick"> |
| | | <t-tabs t-class="t-tabs" defaultValue="{{active}}" split="{{false}}" bind:change="tabBookClick"> |
| | | <t-tab-panel wx:for="{{tabList}}" wx:for-index="index" wx:key="index" label="{{item.label}}" value="{{index}}"> |
| | | <view class="pageInfo"> |
| | | <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 class="list" wx:if="{{list.length > 0}}"> |
| | | <view wx:if="{{activeName == 'FavoriteBookCity'}}" class="listBox"> |
| | | <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| | | <view class="icon" data-info="{{item}}" bindtap="goBookDetails"> |
| | | <view class="icon" data-book="{{item}}" bindtap="goBookDetails"> |
| | | <t-image src="{{item.icon}}" mode="" class="img" /> |
| | | </view> |
| | | <view class="body-info" data-info="{{item}}" bindtap="goBookDetails"> |
| | | <view class="body-info" data-book="{{item}}" bindtap="goBookDetails"> |
| | | <view class="name">{{item.name}}</view> |
| | | <view class="author">{{item.author}}</view> |
| | | </view> |
| | |
| | | */ |
| | | data: { |
| | | active: 0, |
| | | activeName: "FavoriteBookCity", |
| | | tabList: [ |
| | | { |
| | | label: '全部', |
| | | key: 0, |
| | | value: 'all', |
| | | }, |
| | | { |
| | | label: '待支付', |
| | | key: 1, |
| | | value: 'WaitPay', |
| | | }, |
| | | { |
| | | label: '已完成', |
| | | key: 1, |
| | | value: 'Success', |
| | | }, |
| | | { |
| | | label: '已取消', |
| | | key: 1, |
| | | value: 'Cancel', |
| | | } |
| | | ], |
| | |
| | | that.setData({ |
| | | skeletonLoding: true, |
| | | active: item.detail.value, |
| | | activeName: info.value, |
| | | queryFilter: info.value == 'all' ? [] : [{ field: 'State', value: info.value }], |
| | | list: [], |
| | | page: 1, |
| | |
| | | } |
| | | this.setData({ |
| | | list: dataList, |
| | | pageTotalCount: res.total, |
| | | pageTotalCount: res.totalSize, |
| | | bottomLoading: false, |
| | | isMoreData: dataList.length > 0 ? false : true, |
| | | skeletonLoding: false, |
| | |
| | | this.setData({ |
| | | // list: [], |
| | | page: 1, |
| | | limit: 18, |
| | | limit: 12, |
| | | pageTotalCount: 0, |
| | | bottomLoading: false, |
| | | isMoreData: false |
| | |
| | | this.getDataList(bool); |
| | | }, |
| | | |
| | | onCancel(e) { |
| | | let { orderNum } = e.currentTarget.dataset |
| | | console.log(orderNum, 12) |
| | | wx.showModal({ |
| | | title: '提示', //提示的标题 |
| | | content: '确定要取消订单?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | app.MG.store.cancelOrder({ orderNum: orderNum }).then(() => { |
| | | wx.showToast({ |
| | | title: "订单已取消", |
| | | icon: 'success', |
| | | duration: 1000 |
| | | }) |
| | | this.getDataList(false) |
| | | }) |
| | | } else if (res.cancel) { |
| | | console.log('用户点击了取消') |
| | | } |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | //立即支付、再次购买 |
| | | onPayment(e) { |
| | | var that = this; |
| | | const { |
| | | orderNum |
| | | } = e.currentTarget.dataset |
| | | const data = { |
| | | orderNum: orderNum, |
| | | }; |
| | | app.MG.store.getOrderByOrderNum(data).then(res => { |
| | | if (res && res.state != "WaitPay") { |
| | | app.MG.store.confirmOrder(data).then(conRes => { |
| | | if (conRes.orderNumber) { |
| | | const resOrderNum = { |
| | | orderNum: conRes.orderNumber, |
| | | }; |
| | | if (conRes.payPrice != 0) { |
| | | app.MG.store.makeWeChatPay(resOrderNum).then(payRes => { |
| | | const payVal = JSON.parse(payRes); |
| | | wx.requestPayment({ |
| | | "appId": payVal.appId, |
| | | "timeStamp": payVal.timeStamp, |
| | | "nonceStr": payVal.nonceStr, |
| | | "package": payVal.package, |
| | | "signType": payVal.signType, |
| | | "paySign": payVal.paySign, |
| | | "success": function (res) { |
| | | if (res.errMsg == 'requestPayment:ok') { |
| | | that.setData({ |
| | | isPaySuccess: true |
| | | }) |
| | | } |
| | | console.log(res, "成功") |
| | | }, |
| | | "fail": function (res) { |
| | | console.log(res, "失败") |
| | | }, |
| | | "complete": function (res) { |
| | | if (res.errMsg == 'requestPayment:ok') { |
| | | that.setData({ |
| | | isPayComplete: true |
| | | }) |
| | | } |
| | | if (that.data.isPaySuccess && that.data.isPayComplete) { |
| | | that.navToBack() |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } else { |
| | | wx.showToast({ |
| | | title: '领取成功', |
| | | }) |
| | | // 可添加返回上级 |
| | | setTimeout(() => { |
| | | that.navToBack() |
| | | }, 2000); |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | app.MG.store |
| | | .makeWeChatPay({ |
| | | orderNum: orderNum |
| | | }) |
| | | .then(payRes => { |
| | | const payVal = JSON.parse(payRes); |
| | | wx.requestPayment({ |
| | | "appId": payVal.appId, |
| | | "timeStamp": payVal.timeStamp, |
| | | "nonceStr": payVal.nonceStr, |
| | | "package": payVal.package, |
| | | "signType": payVal.signType, |
| | | "paySign": payVal.paySign, |
| | | "success": function (res) { |
| | | if (res.errMsg == 'requestPayment:ok') { |
| | | that.setData({ |
| | | isPaySuccess: true |
| | | }) |
| | | } |
| | | }, |
| | | "fail": function (res) { |
| | | console.log(res, "失败") |
| | | }, |
| | | "complete": function (res) { |
| | | if (res.errMsg == 'requestPayment:ok') { |
| | | that.setData({ |
| | | isPayComplete: true |
| | | }) |
| | | } |
| | | if (that.data.isPaySuccess && that.data.isPayComplete) { |
| | | that.navToBack() |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | }, |
| | | |
| | | //删除订单 |
| | | onDel(e) { |
| | | const { |
| | | orderNum |
| | | } = e.currentTarget.dataset |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | |
| | | <view class="container"> |
| | | <view class="page-header"> |
| | | <view class="search"> |
| | | <t-search t-class-input="t-search__input" t-class-input-container="t-search__input-container" placeholder="请输入订单编号" leftIcon=""> |
| | | <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" bind:tap="navToSearchPage" /> |
| | | </t-search> |
| | | </view> |
| | | <t-tabs t-class="t-tabs" t-class-active="tabs-external__active" t-class-item="tabs-external__item" defaultValue="{{active}}" space-evenly="{{false}}" bind:change="tabBookClick"> |
| | | <t-tab-panel wx:for="{{tabList}}" wx:for-index="index" wx:key="index" label="{{item.label}}" value="{{index}}"> |
| | | <t-tabs t-class="t-tabs" defaultValue="{{active}}" split="{{false}}" bind:change="tabBookClick"> |
| | | <t-tab-panel wx:for="{{tabList}}" wx:for-index="index" wx:key="index" label="{{item.label}}" value="{{index}}" /> |
| | | </t-tabs> |
| | | </view> |
| | | <view class="pageInfo"> |
| | | <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"> |
| | |
| | | <text class="right {{items.colorName}}">{{items.CustomState}}</text> |
| | | </view> |
| | | <view class="order-centent"> |
| | | <scroll-view class="srcolbox" scroll-x scroll-with-animation='true'> |
| | | <view class="bookBox {{items.saleMethodLinks.length == 1 ? 'flex' : ''}}" wx:for="{{items.saleMethodLinks}}" wx:for-item="itemes" wx:for-index="idx" wx:key="idx" bindtap="onOrderDetail" data-info="{{itemes}}"> |
| | | <view class="leftCon {{items.saleMethodLinks.length == 1 ? 'fl' : ''}}"> |
| | | <!-- 获取图片 --> |
| | |
| | | <!-- 获取名称 --> |
| | | <view class="rightCon"> |
| | | <view class="productTitle">{{itemes.name}}</view> |
| | | <view> |
| | | <view class="cmsName" wx:if="{{itemes.orderSaleMethod.type != 'defaultSaleMethod'}}">{{itemes.orderSaleMethod.cmsItemList[0].name}}</view> |
| | | <view class="{{items.saleMethodLinks.length == 1 ? 'top' : ''}}"> |
| | | <text class="typeBox">{{ |
| | | itemes.orderSaleMethod.type == 'defaultSaleMethod' |
| | | ? '图书服务-电子书' |
| | | : itemes.orderSaleMethod.type == 'createProductSaleMethod' && itemes.orderSaleMethod.cmsItemList == 0 ? '图书服务-组卷' : '图书服务-云学习' |
| | | }}</text> |
| | | </view> |
| | | <!-- <text wx:if="{{itemes.payPrice >0}}" class="price">¥{{itemes.payPrice}}<text wx:if="{{itemes.oldPrice >0}}" class="oldPrice">(原定价:¥{{items.oldPrice}})</text></text> |
| | | <text wx:else class="freePrice">免费</text> --> |
| | | <!-- <text class="productTop"><text>创建时间</text>:{{items.createDate}}</text> --> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | <view class="count"> |
| | | <text wx:if="{{items.saleMethodLinks.length > 1 }}">共{{items.saleMethodLinks.length}}件</text> |
| | | <text wx:if="{{items.saleMethodLinks.length == 1 }}">¥{{items.payPrice}}</text> |
| | |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | </t-tab-panel> |
| | | </t-tabs> |
| | | <t-back-top theme="round" wx:if="{{isBackTop}}" text="顶部" bind:to-top="onToTop"></t-back-top> |
| | | </view> |
| | |
| | | page { |
| | | width: 100vw; |
| | | height: 100%; |
| | | } |
| | | |
| | | .page-header { |
| | | background: #fff; |
| | | width: 100%; |
| | | position: fixed; |
| | | top: 0rpx; |
| | | left: 0; |
| | | padding-top: 20rpx; |
| | | z-index: 1 |
| | | } |
| | | |
| | | .refresh-container { |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .bottom-loading, |
| | | .loading { |
| | | padding: 20rpx; |
| | | text-align: center; |
| | | } |
| | | |
| | | .t-search__input { |
| | | font-size: 28rpx !important; |
| | | color: rgb(116, 116, 116) !important; |
| | |
| | | } |
| | | |
| | | .t-tabs__track { |
| | | /* left: 28rpx !important; */ |
| | | background-color: #FF6C00 !important; |
| | | width: 80rpx !important; |
| | | } |
| | | |
| | | .t-tabs__item--active { |
| | |
| | | |
| | | .pageInfo { |
| | | background: #F2F3F8; |
| | | padding-top: 200rpx; |
| | | height: calc(100% - 200rpx) |
| | | } |
| | | |
| | | .list { |
| | |
| | | |
| | | .order-cent { |
| | | padding: 10rpx 0; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .right { |
| | |
| | | .order-centent { |
| | | display: flex; |
| | | border-bottom: 2rpx solid #EFF0F1; |
| | | padding: 20rpx 0; |
| | | } |
| | | |
| | | |
| | | |
| | | .srcolbox { |
| | | flex: 1; |
| | | width: 80%; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .srcolbox .bookBox { |
| | | display: inline-block; |
| | | width: 240rpx; |
| | | margin-right: 10rpx; |
| | | margin-left: 10rpx; |
| | | /* box-shadow: 0rpx 0rpx 18rpx 2rpx rgba(0, 0, 0, 0.08); */ |
| | | |
| | | } |
| | | |
| | | |
| | | .bookBox { |
| | | flex: 1; |
| | | padding: 30rpx 0; |
| | | padding: 20rpx 0; |
| | | margin: 20rpx 0; |
| | | text-align: center; |
| | | } |
| | | |
| | | .order-centent .flex { |
| | | width: 100%; |
| | | box-shadow: none; |
| | | text-align: left; |
| | | margin-right: 0; |
| | | } |
| | | |
| | | |
| | | .bookBox .leftCon { |
| | | width: 150rpx; |
| | | /* width: 150rpx; */ |
| | | width: 240rpx; |
| | | height: 210rpx; |
| | | box-shadow: 0px 0px 20rpx 2px #f1f1f1; |
| | | /* box-shadow: 0px 0px 20rpx 2px #f1f1f1; */ |
| | | border: 2rpx solid #E9e9e9; |
| | | margin: 0 auto; |
| | | padding: 20rpx 0; |
| | | } |
| | | |
| | | .fl { |
| | | width: 150rpx !important; |
| | | float: left; |
| | | margin-right: 20rpx; |
| | | margin-left: 20rpx !important; |
| | | padding: 0 !important; |
| | | } |
| | | |
| | | .bookBox .leftCon .purchasedIcon { |
| | |
| | | } |
| | | |
| | | .productTitle { |
| | | font-size: 32rpx; |
| | | height: 88rpx; |
| | | font-size: 30rpx; |
| | | color: #333333; |
| | | font-weight: bold; |
| | | line-height: 44rpx; |
| | | display: -webkit-box; |
| | | margin-bottom: 30rpx; |
| | | line-height: 38rpx; |
| | | margin-bottom: 10rpx; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .cmsName { |
| | | color: #949494; |
| | | font-size: 24rpx; |
| | | line-height: 24rpx; |
| | | margin-bottom: 20rpx; |
| | | -webkit-box-orient: vertical; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .flex .rightCon { |
| | | margin-left: 160rpx; |
| | | margin-left: 200rpx; |
| | | } |
| | | |
| | | .rightCon { |
| | | margin-top: 10rpx; |
| | | margin-right: 20rpx; |
| | | padding: 20rpx 10rpx; |
| | | } |
| | | |
| | | .top { |
| | | margin-top: 30rpx; |
| | | } |
| | | |
| | | .count { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-left: 30rpx; |
| | | margin-left: 10rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .typeBox { |
| | | background: rgba(255, 108, 0, 0.24); |
| | | border-radius: 9rpx 9rpx 9rpx 9rpx; |
| | | padding: 8rpx 20rpx; |
| | | border-radius: 10rpx; |
| | | padding: 8rpx 16rpx; |
| | | color: #FF6C00; |
| | | |
| | | font-size: 24rpx; |
| | | } |
| | | |
| | | .order-top { |
| | |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .button-example { |
| | |
| | | // pages/personalCenter/sampleBooks/index.js |
| | | const app = getApp(); |
| | | import moment from 'moment' |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | |
| | | active: 0, |
| | | topicIdOrRefCode: "applyEntityBook", |
| | | active1: 0, |
| | | tabList: [ |
| | | { |
| | | label: '全部', |
| | | value: 'all', |
| | | }, |
| | | { |
| | | label: '审核中', |
| | | value: 'waitAudit', |
| | | }, |
| | | { |
| | | label: '已通过', |
| | | value: 'Normal', |
| | | }, |
| | | { |
| | | label: '未通过', |
| | | value: 'Reject', |
| | | } |
| | | ], |
| | | list: [], |
| | | //分页 |
| | | page: 1, |
| | | limit: 10, |
| | | pageTotalCount: 0, |
| | | bottomLoading: false, |
| | | isMoreData: false, |
| | | // 返回顶部 |
| | | isBackTop: false, |
| | | setScrollValue: 0, |
| | | skeletonLoding: true, |
| | | queryFilter: [] |
| | | }, |
| | | |
| | | /** |
| | |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options); |
| | | this.getDataList(false); |
| | | }, |
| | | tabClick(item) { |
| | | let that = this; |
| | | if (item.detail.value == '1') { |
| | | that.setData({ |
| | | active: item.detail.value, |
| | | topicIdOrRefCode: 'applyBook', |
| | | }) |
| | | } else { |
| | | that.setData({ |
| | | active: item.detail.value, |
| | | topicIdOrRefCode: 'applyEntityBook', |
| | | }) |
| | | } |
| | | that.setData({ |
| | | active1: 0, |
| | | queryFilter: [], |
| | | skeletonLoding: true, |
| | | list: [], |
| | | page: 1, |
| | | bottomLoading: false, |
| | | isMoreData: false, |
| | | }) |
| | | that.getDataList(false); |
| | | }, |
| | | tabBookClick(item) { |
| | | let that = this; |
| | | let info = this.data.tabList[item.detail.value] |
| | | that.setData({ |
| | | skeletonLoding: true, |
| | | active1: item.detail.value, |
| | | queryFilter: info.value == 'all' ? [] : [{ field: 'State', value: info.value }], |
| | | list: [], |
| | | page: 1, |
| | | bottomLoading: false, |
| | | isMoreData: false, |
| | | }) |
| | | that.getDataList(false); |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() { |
| | | |
| | | getDataList(isReachBottom) { |
| | | app.MG.ugc.getTopicMessageList({ |
| | | start: this.data.page * this.data.limit - this.data.limit, |
| | | size: this.data.limit, |
| | | topicIdOrRefCode: this.data.topicIdOrRefCode, |
| | | appRefCode: app.config.appRefCode, |
| | | filterList: this.data.queryFilter, |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | } |
| | | }).then((res) => { |
| | | try { |
| | | if (res.datas.length > 0) { |
| | | res.datas.forEach((item) => { |
| | | item.updateDate = moment(item.updateDate).format("YYYY-MM-DD"); |
| | | if (item.feedBack) { |
| | | item.feedBack = JSON.parse(item.feedBack) |
| | | } |
| | | if (item.content) { |
| | | item.productList = JSON.parse(item.content) |
| | | } |
| | | }) |
| | | 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, |
| | | loading: false |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |
| | | } |
| | | } catch (error) { |
| | | console.log(error) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() { |
| | | |
| | | if (this._freshing) return |
| | | this.setData({ |
| | | // list: [], |
| | | 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); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "navigationBarTitleText": "样书申请", |
| | | "usingComponents": {} |
| | | "usingComponents": { |
| | | "t-tabs": "tdesign-miniprogram/tabs/tabs", |
| | | "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", |
| | | "t-back-top": "tdesign-miniprogram/back-top/back-top", |
| | | "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-image": "tdesign-miniprogram/image/image", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | } |
| | | } |
| | |
| | | <!--pages/personalCenter/sampleBooks/index.wxml--> |
| | | <text>pages/personalCenter/sampleBooks/index.wxml</text> |
| | | <view class="page-header"> |
| | | <view class="tabOne"> |
| | | <t-tabs t-class="t-tabs" defaultValue="{{active}}" split="{{false}}" bind:change="tabClick"> |
| | | <t-tab-panel label="纸质样书" value="0" /> |
| | | <t-tab-panel label="电子样书" value="1" /> |
| | | </t-tabs> |
| | | </view> |
| | | <view class="tabTwo"> |
| | | <t-tabs t-class="custom-tabs" value="{{active1}}" split="{{false}}" bind:change="tabBookClick"> |
| | | <t-tab-panel wx:for="{{tabList}}" wx:for-index="index" wx:key="index" label="{{item.label}}" value="{{index}}" /> |
| | | </t-tabs> |
| | | </view> |
| | | </view> |
| | | <view class="pageInfo"> |
| | | <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="list" wx:if="{{list.length > 0}}"> |
| | | <view class="content-item" wx:for="{{list}}" wx:for-item="items" wx:for-index="index" wx:key="index"> |
| | | <view class="codeInfoBox"> |
| | | <view class="top"> |
| | | <view class="stateBox">状态: |
| | | <text wx:if="{{items.state =='Normal'}}" class="success">已通过</text> |
| | | <text wx:if="{{items.state =='WaitAudit'}}" class="wait">审核中</text> |
| | | <text wx:if="{{items.state =='Reject'}}" class="reject">未通过</text> |
| | | </view> |
| | | <view>申请日期:{{items.updateDate ? items.updateDate : '-'}}</view> |
| | | </view> |
| | | <view class="down"> |
| | | <text wx:if="{{active == '1' && items.state =='Normal'}}">有效期至:{{items.feedBack ? items.feedBack.endDate : '-'}}</text> |
| | | <text wx:if="{{items.state =='Reject'}}">原因:{{items.feedBack.reason}}</text> |
| | | <view wx:if="{{active == '0' && items.state =='Normal'}}" class="mailInfo"> |
| | | <text class="mailNum">快递单号:{{items.feedBack && items.feedBack.mailNum ? items.feedBack.mailNum : '-'}}</text> |
| | | <text>快递公司:{{items.feedBack.mailName ? items.feedBack.mailName : '-'}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="listBox"> |
| | | <scroll-view class="srcolbox" scroll-x scroll-with-animation='true'> |
| | | <view class="order-centent"> |
| | | <view class="bookBox" wx:for="{{items.productList}}" wx:for-item="itemes" wx:for-index="idx" wx:key="idx" bindtap="onOrderDetail" data-info="{{itemes}}"> |
| | | <view class="leftCon"> |
| | | <!-- 获取图片 --> |
| | | <image class="purchasedIcon" wx:if="{{itemes.icon}}" src="{{itemes.icon}}" mode="aspectFit" /> |
| | | <image class="purchasedIcon" wx:else src="/static/images/default-book-img.png" mode="aspectFit" /> |
| | | </view> |
| | | <!-- 获取名称 --> |
| | | <view class="rightCon"> |
| | | <view class="productTitle">{{itemes.title}}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{list.length == 0}}" class="empyt"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </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> |
| | | </view> |
| | | <t-back-top theme="round" wx:if="{{isBackTop}}" text="顶部" bind:to-top="onToTop"></t-back-top> |
| | |
| | | /* pages/personalCenter/sampleBooks/index.wxss */ |
| | | page { |
| | | background-color: #F2F3F8; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .page-header { |
| | | background-color: #F2F3F8; |
| | | width: 100%; |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | z-index: 1 |
| | | } |
| | | |
| | | .tabOne .t-tabs__track { |
| | | display: none; |
| | | |
| | | } |
| | | |
| | | .tabOne .t-tabs { |
| | | margin-top: 20rpx; |
| | | background: none !important; |
| | | } |
| | | |
| | | .tabOne .t-tabs__wrapper { |
| | | background: none !important; |
| | | } |
| | | |
| | | .tabOne .t-tabs__nav :nth-child(1) { |
| | | border-radius: 30rpx 30rpx 0 0rpx; |
| | | } |
| | | |
| | | .tabOne .t-tabs__nav :nth-child(2) { |
| | | border-radius: 0rpx 30rpx 0 30rpx; |
| | | } |
| | | |
| | | .tabOne .t-tabs__item { |
| | | flex: 1 !important; |
| | | background: #E6E8F1; |
| | | height: 76rpx !important; |
| | | margin-top: 16rpx; |
| | | border-radius: 30rpx 0 30rpx 0rpx !important; |
| | | } |
| | | |
| | | .tabOne .t-tabs__item--active { |
| | | color: #333 !important; |
| | | background: #fff; |
| | | height: 96rpx; |
| | | font-size: 32rpx; |
| | | margin-top: 0; |
| | | height: 96rpx !important; |
| | | border-radius: 30rpx 30rpx 0 0rpx !important; |
| | | } |
| | | |
| | | .tabOne .t-tabs__item--active+.t-tabs__item { |
| | | border-radius: 0 30rpx 0 30rpx !important; |
| | | } |
| | | |
| | | .tabTwo { |
| | | background: #fff; |
| | | padding-top: 50rpx; |
| | | margin-top: -30rpx; |
| | | |
| | | } |
| | | |
| | | .tabTwo .t-tabs__item { |
| | | flex: 1 !important; |
| | | } |
| | | |
| | | .tabTwo .t-tabs__track { |
| | | background-color: #FF6C00 !important; |
| | | width: 80rpx !important; |
| | | } |
| | | |
| | | .tabTwo .t-tabs__item--active { |
| | | font-size: 30rpx; |
| | | color: #FF6C00 !important; |
| | | } |
| | | |
| | | .refresh-container { |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .bottom-loading, |
| | | .loading { |
| | | padding: 20rpx; |
| | | text-align: center; |
| | | } |
| | | |
| | | .empyt { |
| | | padding: 100rpx 0; |
| | | } |
| | | |
| | | .pageInfo { |
| | | margin-top: 230rpx; |
| | | } |
| | | |
| | | .content-item { |
| | | margin-bottom: 30rpx; |
| | | padding: 30rpx; |
| | | background: #fff; |
| | | border-radius: 10rpx; |
| | | } |
| | | |
| | | .codeInfoBox { |
| | | border: 2rpx solid #EDECEC; |
| | | border-radius: 10rpx; |
| | | background: #f3f3f3; |
| | | padding: 20rpx; |
| | | font-size: 28rpx; |
| | | line-height: 56rpx; |
| | | } |
| | | |
| | | .top, |
| | | .mailInfo { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .mailNum { |
| | | display: inline-block; |
| | | overflow: hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | max-width: 440rpx; |
| | | } |
| | | |
| | | .success { |
| | | color: #1FBC1F |
| | | } |
| | | |
| | | .wait { |
| | | color: #FF6C00; |
| | | } |
| | | |
| | | .reject { |
| | | color: #F03939; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | |
| | | .order-centent { |
| | | display: flex; |
| | | } |
| | | |
| | | .bookBox { |
| | | padding: 30rpx 40rpx 0 20rpx; |
| | | width: 200rpx; |
| | | } |
| | | |
| | | .bookBox .leftCon { |
| | | width: 180rpx; |
| | | height: 240rpx; |
| | | box-shadow: 0px 0px 20rpx 2px #f1f1f1; |
| | | } |
| | | |
| | | .bookBox .leftCon .purchasedIcon { |
| | | width: 100%; |
| | | height: 100%; |
| | | object-fit: contain; |
| | | } |
| | | |
| | | .rightCon { |
| | | margin-top: 10rpx; |
| | | } |
| | | |
| | | .productTitle { |
| | | font-size: 28rpx; |
| | | height: 88rpx; |
| | | color: #333333; |
| | | line-height: 44rpx; |
| | | display: -webkit-box; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
New file |
| | |
| | | import { worksDataBytool } from "../../../assets/js/toolClass.js"; |
| | | const app = getApp(); |
| | | Page({ |
| | | data: { |
| | | userInfo: null, |
| | | active: 0, |
| | | description: "", //申请规则 |
| | | teacherInfo: { |
| | | workInfo: null, |
| | | schoolName: "", |
| | | courseName: "", |
| | | }, |
| | | contactInfo: { |
| | | fullName: "", |
| | | phone: "", |
| | | detailedAddress: "" |
| | | }, |
| | | paperBookList: [], //样书单纸质书 |
| | | electronicBookList: [], //样书单电子书 |
| | | ebookCount: 0, |
| | | paperBookCount: 0, |
| | | bookList: [], |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad() { }, |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | if (wx.getStorageSync(app.config.userInfoKey)) { |
| | | this.setData({ |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | | if (this.data.userInfo.role == 'Teacher') { |
| | | this.setData({ |
| | | teacherInfo: { |
| | | schoolName: JSON.parse(this.data.userInfo.data).schoolName, |
| | | courseName: JSON.parse(this.data.userInfo.data).courseName, |
| | | }, |
| | | contactInfo: { |
| | | fullName: JSON.parse(this.data.userInfo.data).fullName, |
| | | phone: JSON.parse(this.data.userInfo.data).phone, |
| | | detailedAddress: JSON.parse(this.data.userInfo.data).detailedAddress |
| | | } |
| | | }) |
| | | } |
| | | if (wx.getStorageSync("paperBookList")) { |
| | | this.setData({ |
| | | paperBookList: JSON.parse(wx.getStorageSync("paperBookList")), |
| | | bookList: JSON.parse(wx.getStorageSync("paperBookList")) |
| | | }) |
| | | } |
| | | if (wx.getStorageSync("electronicBookList")) { |
| | | this.setData({ |
| | | electronicBookList: JSON.parse(wx.getStorageSync("electronicBookList")) |
| | | }) |
| | | } |
| | | this.getSelectBookCount(); |
| | | this.getSelectPaperBookCount(); |
| | | this.getPaperType(); |
| | | } else { |
| | | wx.navigateTo({ |
| | | url: "/pages/testLogin/index", |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | |
| | | tabClick(item) { |
| | | let that = this; |
| | | if (item.detail.value == '1') { |
| | | that.setData({ |
| | | active: item.detail.value, |
| | | bookList: this.data.electronicBookList |
| | | }) |
| | | this.getElectronType(); |
| | | } else { |
| | | that.setData({ |
| | | active: item.detail.value, |
| | | bookList: this.data.paperBookList |
| | | }) |
| | | this.getPaperType(); |
| | | } |
| | | }, |
| | | |
| | | getElectronType() { |
| | | app.MG.resource.getCmsTypeByRefCode({ refCodes: ['jsek_electronicSampleBook'] }).then((res) => { |
| | | this.setData({ |
| | | description: res[0].description, |
| | | teacherInfo: { |
| | | workInfo: res[0].cmsTypeLinks[0].children |
| | | }, |
| | | }) |
| | | }) |
| | | }, |
| | | getPaperType() { |
| | | app.MG.resource.getCmsTypeByRefCode({ |
| | | refCodes: ['jsek_paperVersionSampleBook'] |
| | | }). |
| | | then((res) => { |
| | | if (res && res.length > 0) { |
| | | this.setData({ |
| | | description: res[0].description, |
| | | teacherInfo: { |
| | | workInfo: res[0].cmsTypeLinks[0].children |
| | | }, |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | //获取当前已申请次数(电子) |
| | | getSelectBookCount() { |
| | | let that = this; |
| | | app.MG.app.getTicketResult({ |
| | | ticketRefCodeOrGuid: 'electronicSampleBookapplyNum', |
| | | roleId: that.data.userInfo.roleId |
| | | }) |
| | | .then((res) => { |
| | | let num = res.totalCount - res.usedCount; |
| | | that.setData({ |
| | | ebookCount: num |
| | | }) |
| | | }) |
| | | }, |
| | | //获取当前已申请次数(纸质) |
| | | getSelectPaperBookCount() { |
| | | let that = this; |
| | | app.MG.app.getTicketResult({ |
| | | ticketRefCodeOrGuid: 'paperSampleBookapplyNum', |
| | | roleId: that.data.userInfo.roleId |
| | | }) |
| | | .then((res) => { |
| | | let count = res.totalCount - res.usedCount; |
| | | that.setData({ |
| | | paperBookCount: count, |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | submit() { |
| | | let that = this; |
| | | if (that.data.bookList.length > 0) { |
| | | if (that.data.active == '1' && that.data.ebookCount == 0) { |
| | | wx.showToast({ |
| | | title: "您的电子样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return |
| | | } |
| | | if (that.data.active == '0' && that.data.paperBookCount == 0) { |
| | | wx.showToast({ |
| | | title: "您的纸质样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return |
| | | } |
| | | let data = {} |
| | | let applyInfo = {} |
| | | if (that.data.active == '1') { |
| | | data = { |
| | | topicIdOrRefCode: 'applyBook', |
| | | name: that.data.userInfo.name || '', |
| | | content: JSON.stringify(that.data.bookList), |
| | | state: 'WaitAudit', |
| | | type: 'applyForEbook', |
| | | cmsTypeRefCode: 'jsek_electronicSampleBook', |
| | | newDataListRequest: worksDataBytool(that.data.teacherInfo.workInfo, that.data.teacherInfo) |
| | | } |
| | | applyInfo = { |
| | | ticketRefCodeOrGuid: 'electronicSampleBookapplyNum', |
| | | roleId: userStore.userInfo.roleId, |
| | | refType: 'applyBook' |
| | | } |
| | | } else { |
| | | if (!(that.data.contactInfo.fullName && that.data.contactInfo.phone && that.data.contactInfo.detailedAddress)) { |
| | | wx.showToast({ |
| | | title: "请将收货人信息填写完整!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return |
| | | } |
| | | const mailAddress = JSON.stringify(that.data.contactInfo) |
| | | that.setData({ |
| | | teacherInfo: { |
| | | detailedAddress: mailAddress, |
| | | } |
| | | }) |
| | | data = { |
| | | topicIdOrRefCode: 'applyEntityBook', |
| | | name: that.data.userInfo.name || '', |
| | | content: JSON.stringify(that.data.bookList), |
| | | state: 'WaitAudit', |
| | | type: 'applyForPbook', |
| | | cmsTypeRefCode: 'jsek_paperVersionSampleBook', |
| | | newDataListRequest: worksDataBytool(that.data.teacherInfo.workInfo, that.data.teacherInfo) |
| | | } |
| | | applyInfo = { |
| | | ticketRefCodeOrGuid: 'paperSampleBookapplyNum', |
| | | roleId: that.data.userInfo.roleId, |
| | | refType: 'applyEntityBook' |
| | | } |
| | | } |
| | | app.MG.ugc.newTopicMessage(data).then((res) => { |
| | | if (res) { |
| | | app.MG.app.useTicket(applyInfo).then(() => { |
| | | if (that.data.active == '1') { |
| | | that.setData({ |
| | | electronicBookList: [], |
| | | bookList: [], |
| | | }) |
| | | wx.setStorageSync("electronicBookList", that.data.electronicBookList); |
| | | } else { |
| | | that.setData({ |
| | | paperBookList: [], |
| | | bookList: [], |
| | | }) |
| | | wx.setStorageSync("paperBookList", that.data.paperBookList); |
| | | } |
| | | |
| | | wx.showModal({ |
| | | title: '提示!', //提示的标题 |
| | | content: '您的样书申请已提交,管理员审核中!申请状态在【个人中心—样书申请】中查询。', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/pages/personalCenter/sampleBooks/index", |
| | | }); |
| | | } else if (res.cancel) { |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | wx.showToast({ |
| | | title: "您还未选择图书加入申请单!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | |
| | | onDelete(e) { |
| | | let that = this; |
| | | const item = e.currentTarget.dataset.book; |
| | | wx.showModal({ |
| | | title: '提示!', //提示的标题 |
| | | content: '确定要删除该书吗?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | if (that.data.active == '1') { |
| | | that.data.electronicBookList.forEach((obj, index) => { |
| | | if (obj.id == item.id) { |
| | | that.data.electronicBookList.splice(index, 1); |
| | | } |
| | | }) |
| | | that.setData({ |
| | | bookList: that.data.electronicBookList |
| | | }) |
| | | wx.setStorageSync("electronicBookList", that.data.electronicBookList); |
| | | } else { |
| | | that.data.paperBookList.forEach((obj, index) => { |
| | | if (obj.id == item.id) { |
| | | that.data.paperBookList.splice(index, 1); |
| | | } |
| | | }) |
| | | that.setData({ |
| | | bookList: this.data.paperBookList |
| | | }) |
| | | wx.setStorageSync("paperBookList", that.data.paperBookList); |
| | | } |
| | | } else if (res.cancel) { |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | } |
| | | }) |
New file |
| | |
| | | { |
| | | "navigationBarTitleText": "样书申请单", |
| | | "usingComponents": { |
| | | "t-tabs": "tdesign-miniprogram/tabs/tabs", |
| | | "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", |
| | | "t-cascader": "tdesign-miniprogram/cascader/cascader", |
| | | "t-swipe-cell": "tdesign-miniprogram/swipe-cell/swipe-cell", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | } |
| | | } |
New file |
| | |
| | | <view class="page-header"> |
| | | <t-tabs t-class="t-tabs" defaultValue="{{active}}" split="{{false}}" bind:change="tabClick"> |
| | | <t-tab-panel label="纸质样书" value="0" /> |
| | | <t-tab-panel label="电子样书" value="1" /> |
| | | </t-tabs> |
| | | </view> |
| | | <view class="page-content"> |
| | | <view class="bookListBox"> |
| | | <view class="tips"> |
| | | <rich-text space="emsp" nodes="{{description}}" class="content" /> |
| | | </view> |
| | | <view class="bookList"> |
| | | <view wx:if="{{bookList.length > 0}}"> |
| | | <view wx:for="{{bookList}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="textbooksItemBox"> |
| | | <t-swipe-cell> |
| | | <t-cell title="左滑单操作" note="辅助信息" bordered="{{false}}"> |
| | | <view class="listItem flex"> |
| | | <view class="specialSubject-img"> |
| | | <image src="{{item.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="body-info"> |
| | | <view class="name">{{item.name}}</view> |
| | | <view class="author">作者:{{item.author}}</view> |
| | | <view class="author">ISBN:{{item.isbn}}</view> |
| | | <view class="author">出版时间:{{item.publicationDate}}</view> |
| | | </view> |
| | | </view> |
| | | </t-cell> |
| | | <view slot="right" class="btn delete-btn" bind:tap="onDelete" data-book="{{item}}">删除</view> |
| | | </t-swipe-cell> |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{bookList.length == 0}}" class="empyt"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="formBox"> |
| | | <view class="title"> |
| | | 授课情况 |
| | | </view> |
| | | <view class="teachingInfo"> |
| | | <view class="item"> |
| | | <text class="label">学校:</text> |
| | | <text>{{teacherInfo.schoolName}}</text> |
| | | </view> |
| | | <view class="item"> |
| | | <text class="label">任教课程:</text> |
| | | <text>{{teacherInfo.courseName}}</text> |
| | | </view> |
| | | </view> |
| | | <view class="title" wx:if="{{active =='0'}}"> |
| | | 收货人情况 |
| | | </view> |
| | | <view class="receiverInfo" wx:if="{{active =='0'}}"> |
| | | <view class="item"> |
| | | <text class="label">姓名:</text> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="userName" auto-focus="true" adjust-position="true" value="{{contactInfo.fullName}}" placeholder="请输入姓名" bindinput="bindTnputBlur" /> |
| | | </view> |
| | | </view> |
| | | <view class="item"> |
| | | <text class="label">联系电话:</text> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="userName" auto-focus="true" adjust-position="true" value="{{contactInfo.phone}}" placeholder="请输入联系电话" bindinput="bindTnputBlur" /> |
| | | </view> |
| | | </view> |
| | | <view class="item"> |
| | | <text class="label">详细地址:</text> |
| | | <view class="item-content"> |
| | | <input class="weui-input" name="userName" auto-focus="true" adjust-position="true" value="{{contactInfo.detailedAddress}}" placeholder="请输入详细地址" bindinput="bindTnputBlur" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="btn-area"> |
| | | <button class="submit" bindtap="submit">提交</button> |
| | | </view> |
| | | |
| | | </view> |
New file |
| | |
| | | page { |
| | | background-color: #F2F3F8; |
| | | } |
| | | |
| | | .page-header { |
| | | width: 100%; |
| | | } |
| | | |
| | | .t-tabs__track { |
| | | display: none; |
| | | |
| | | } |
| | | |
| | | .t-tabs { |
| | | margin-top: 20rpx; |
| | | background: none !important; |
| | | } |
| | | |
| | | .t-tabs__wrapper { |
| | | background: none !important; |
| | | } |
| | | |
| | | .t-tabs__nav :nth-child(1) { |
| | | border-radius: 30rpx 30rpx 0 0rpx; |
| | | } |
| | | |
| | | .t-tabs__nav :nth-child(2) { |
| | | border-radius: 0rpx 30rpx 0 30rpx; |
| | | } |
| | | |
| | | .t-tabs__item { |
| | | flex: 1 !important; |
| | | background: #E6E8F1; |
| | | height: 76rpx !important; |
| | | margin-top: 16rpx; |
| | | border-radius: 30rpx 0 30rpx 0rpx !important; |
| | | } |
| | | |
| | | .t-tabs__item--active { |
| | | color: #333 !important; |
| | | background: #fff; |
| | | height: 96rpx; |
| | | font-size: 32rpx; |
| | | margin-top: 0; |
| | | height: 96rpx !important; |
| | | border-radius: 30rpx 30rpx 0 0rpx !important; |
| | | } |
| | | |
| | | .t-tabs__item--active+.t-tabs__item { |
| | | border-radius: 0 30rpx 0 30rpx !important; |
| | | } |
| | | |
| | | |
| | | .bookListBox { |
| | | background: #fff; |
| | | min-height: 200rpx; |
| | | border-radius: 10rpx; |
| | | margin-top: -30rpx; |
| | | padding: 60rpx 40rpx 40rpx 40rpx; |
| | | } |
| | | |
| | | .tips { |
| | | font-size: 28rpx; |
| | | color: #ff6c00; |
| | | } |
| | | |
| | | .bookList { |
| | | margin-top: 20rpx; |
| | | } |
| | | |
| | | .textbooksItemBox { |
| | | padding: 30rpx 0; |
| | | } |
| | | |
| | | .textbooksItemBox:nth-child(1) { |
| | | border-bottom: 2rpx solid #EDEDED; |
| | | } |
| | | |
| | | .listItem { |
| | | display: flex; |
| | | } |
| | | |
| | | .specialSubject-img { |
| | | width: 200rpx; |
| | | height: 300rpx; |
| | | } |
| | | |
| | | .specialSubject-img .img { |
| | | width: 100%; |
| | | height: 100%; |
| | | object-fit: contain; |
| | | } |
| | | |
| | | .body-info { |
| | | flex: 1; |
| | | margin-left: 20rpx; |
| | | line-height: 54rpx; |
| | | } |
| | | |
| | | .name { |
| | | font-size: 32rpx; |
| | | font-weight: bold; |
| | | margin-bottom: 20rpx; |
| | | height: 96rpx; |
| | | margin-top: 20rpx; |
| | | width: 100%; |
| | | word-break: break-all; |
| | | display: -webkit-box; |
| | | -webkit-line-clamp: 2; |
| | | -webkit-box-orient: vertical; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .author { |
| | | font-size: 30rpx; |
| | | } |
| | | |
| | | .t-swipe-cell__right { |
| | | width: 120rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | background-color: #ff6c00; |
| | | color: #fff; |
| | | } |
| | | |
| | | .delete-btn { |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .formBox { |
| | | background: #fff; |
| | | border-radius: 10rpx; |
| | | padding: 40rpx; |
| | | margin-top: 30rpx; |
| | | |
| | | } |
| | | |
| | | .formBox .title { |
| | | font-size: 32rpx; |
| | | font-weight: bold; |
| | | border-bottom: 2rpx solid #f4f4f4; |
| | | padding-bottom: 40rpx; |
| | | } |
| | | |
| | | .teachingInfo, |
| | | .receiverInfo { |
| | | padding: 40rpx 0; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .item { |
| | | display: flex; |
| | | margin-bottom: 30rpx; |
| | | align-items: center; |
| | | } |
| | | |
| | | .item .label { |
| | | width: 200rpx; |
| | | } |
| | | |
| | | .item-content { |
| | | border: 2rpx solid #D9D9D9; |
| | | padding: 10rpx; |
| | | flex: 1; |
| | | } |
| | | |
| | | .weui-input { |
| | | height: 60rpx; |
| | | } |
| | | |
| | | .btn-area { |
| | | margin-top: 40rpx; |
| | | padding: 0 40rpx; |
| | | } |
| | | |
| | | .submit { |
| | | background: #ff6c00; |
| | | color: #fff; |
| | | border-radius: 50rpx; |
| | | } |
New file |
| | |
| | | const app = getApp(); |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | barHeight: '', |
| | | navBarHeight: '', |
| | | searchValue: '', |
| | | userInfo: null, |
| | | path: '*', |
| | | pathList: [], |
| | | |
| | | bookList: [], |
| | | //高级分类 |
| | | iconList: { |
| | | value: "", |
| | | options: [], |
| | | }, |
| | | //一级分类 |
| | | stairList: { |
| | | value: '', |
| | | options: [], |
| | | }, |
| | | //二级分类 |
| | | secondList: { |
| | | value: [], |
| | | options: [], |
| | | }, |
| | | //重点项目 |
| | | majorProjectList: { |
| | | value: [], |
| | | options: [], |
| | | }, |
| | | //新形态教材 |
| | | newTextBook: { |
| | | value: [], |
| | | options: [], |
| | | }, |
| | | //高级分类选中 |
| | | assortCheck: { |
| | | name: '', |
| | | code: '', |
| | | }, |
| | | |
| | | stairCode: '', // 一级分类选中项 |
| | | secondCode: '', // 二级分类选中项 |
| | | sort: '', // 排序 |
| | | //分页 |
| | | page: 1, |
| | | limit: 10, |
| | | pageTotalCount: 0, |
| | | bottomLoading: false, |
| | | isMoreData: false, |
| | | // 返回顶部 |
| | | isBackTop: false, |
| | | setScrollValue: 0, |
| | | skeletonLoding: true, |
| | | alreadyPaperBookList: [], //已申请纸质样书 |
| | | alreadyElectronicBookList: [], //已申请电子样书 |
| | | paperBookList: [], //样书单纸质书 |
| | | electronicBookList: [], //样书单电子书 |
| | | paperBookCount: 0, //纸质书剩余次数 |
| | | ebookCount: 0, //电子书剩余次数 |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | this.setData({ |
| | | barHeight: systInfo.statusBarHeight, |
| | | navBarHeight: navBarHeight, |
| | | }); |
| | | // 搜索赋值 |
| | | if (options && options.searchValue) { |
| | | this.setData({ |
| | | searchValue: options.searchValue, |
| | | }); |
| | | } |
| | | // 高级分类赋值 |
| | | if (options && options.assortCode) { |
| | | this.setData({ |
| | | assortCheck: { |
| | | name: options.assorName, |
| | | code: options.assortCode, |
| | | 'iconList.value': options.assortCode |
| | | }, |
| | | }); |
| | | } |
| | | if (this.data.assortCheck.code) { |
| | | // 获取一级分类 |
| | | this.getStairList(this.data.assortCheck.code); |
| | | } |
| | | // 一级分类和path赋值 |
| | | if (options && options.assortCode && options.stairCode) { |
| | | this.setData({ |
| | | 'stairList.value': options.stairCode, |
| | | stairCode: options.stairCode, |
| | | path: `${options.assortCode}\\${options.stairCode}`, |
| | | }); |
| | | } |
| | | // 二级分类赋值 |
| | | if (options && options.secondCode) { |
| | | this.setData({ |
| | | secondCode: options.secondCode, |
| | | pathList: [{ |
| | | Path: options.secondCode, |
| | | Type: '*', |
| | | StoreRefCode: app.config.goodsStore, |
| | | } |
| | | ], |
| | | }) |
| | | } |
| | | this.getIconTypeList(); |
| | | this.getBookList(false); |
| | | // 获取重点项目 |
| | | this.getProjectList('bookClassification'); |
| | | //新形态教材 |
| | | this.getProjectList('newFormsTextbooks'); |
| | | if (wx.getStorageSync(app.config.tokenKey)) { |
| | | this.getAlreadyPBookList() |
| | | this.getAlreadyEBookList() |
| | | } |
| | | if (wx.getStorageSync(app.config.userInfoKey)) { |
| | | this.setData({ |
| | | userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | }) |
| | | } |
| | | if (wx.getStorageSync("paperBookList")) { |
| | | this.setData({ |
| | | paperBookList: wx.getStorageSync("paperBookList") |
| | | }) |
| | | } |
| | | if (wx.getStorageSync("electronicBookList")) { |
| | | this.setData({ |
| | | electronicBookList: wx.getStorageSync("electronicBookList") |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | |
| | | }, |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | //获取高级分类 |
| | | getIconTypeList() { |
| | | let query = { |
| | | path: '*', |
| | | filterList: [ |
| | | { |
| | | value: 'Normal', |
| | | field: 'state' |
| | | } |
| | | ], |
| | | queryType: '\\', |
| | | searchList: [], |
| | | size: '5', |
| | | start: '0', |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' } |
| | | } |
| | | app.MG.store.getStoreChannelList(query).then((res) => { |
| | | let list = []; |
| | | if (res.datas.length > 0) ( |
| | | res.datas.forEach((item) => { |
| | | item.value = item.refCode; |
| | | item.label = item.name; |
| | | if (item.refCode == 'jsek_higherEducation') { |
| | | list.push(item) |
| | | } |
| | | if (item.refCode == 'jsek_vocationalEducation') { |
| | | list.push(item) |
| | | } |
| | | |
| | | }) |
| | | ) |
| | | this.setData({ |
| | | 'iconList.options': list, |
| | | 'iconList.value': this.data.assortCode, |
| | | }); |
| | | }) |
| | | }, |
| | | // 获取一级列表 |
| | | getStairList(path) { |
| | | const query = { |
| | | path, |
| | | filterList: [], |
| | | queryType: '\\', |
| | | searchList: [], |
| | | size: '30', |
| | | start: '0', |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' }, |
| | | }; |
| | | app.MG.store.getStoreChannelList(query).then(async (res) => { |
| | | let options = []; |
| | | if (res.datas.length > 0) { |
| | | for (let index = 0; index < res.datas.length; index++) { |
| | | let item = res.datas[index]; |
| | | options.push({ |
| | | value: item.refCode, |
| | | label: item.name, |
| | | }); |
| | | } |
| | | } |
| | | this.setData({ |
| | | 'stairList.options': options, |
| | | 'stairList.value': this.data.stairCode, |
| | | }); |
| | | }); |
| | | }, |
| | | // 获取一级分类下二级分类 |
| | | getSecondList(path) { |
| | | let options = []; |
| | | let query = { |
| | | path, |
| | | filterList: [], |
| | | queryType: '\\', |
| | | searchList: [], |
| | | size: '30', |
| | | start: '0', |
| | | storeRefCode: app.config.goodsStore, |
| | | sort: { type: 'Asc', field: 'LinkOrder' }, |
| | | }; |
| | | app.MG.store.getStoreChannelList(query).then((res) => { |
| | | if (res.datas.length > 0) { |
| | | for (let index = 0; index < res.datas.length; index++) { |
| | | const item = res.datas[index]; |
| | | options.push({ |
| | | value: `${item.pathLinks[0].linkPath}\\${item.id}`, |
| | | label: item.name, |
| | | }); |
| | | } |
| | | } |
| | | this.setData({ |
| | | 'secondList.options': options, |
| | | }); |
| | | const second = [this.data.secondCode] |
| | | this.setData({ |
| | | 'secondList.value': second |
| | | }) |
| | | }); |
| | | }, |
| | | // 获取重点项目 |
| | | getProjectList(type) { |
| | | const options = []; |
| | | const arr = []; |
| | | let array = []; |
| | | const query = { |
| | | refCodes: [type], |
| | | }; |
| | | app.MG.store.getProductTypeField(query).then((res) => { |
| | | array = JSON.parse(res[0].config).option; |
| | | for (let index = 0; index < array.length; index++) { |
| | | const element = array[index]; |
| | | if (element.child) { |
| | | for (let index = 0; index < element.child.length; index++) { |
| | | const item = element.child[index]; |
| | | arr.push(item); |
| | | } |
| | | } |
| | | } |
| | | if (type == 'bookClassification') { |
| | | for (let index = 0; index < arr.length; index++) { |
| | | const element = arr[index]; |
| | | options.push({ |
| | | value: element.value, |
| | | label: element.name, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | 'majorProjectList.options': options, |
| | | }); |
| | | } else if (type == 'newFormsTextbooks') { |
| | | for (let index = 0; index < arr.length; index++) { |
| | | const element = arr[index]; |
| | | options.push({ |
| | | value: element.value, |
| | | label: element.name, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | 'newTextBook.options': options, |
| | | }); |
| | | console.log('重点项目', this.data.newTextBook); |
| | | } |
| | | }); |
| | | }, |
| | | // 获取图书列表 |
| | | getBookList(isReachBottom) { |
| | | let that = this; |
| | | let sort; |
| | | let pathObj = {}; |
| | | if (that.data.pathList.length) { |
| | | pathObj = { |
| | | subAccess: this.data.pathList, |
| | | }; |
| | | } else { |
| | | pathObj = { |
| | | path: that.data.path, |
| | | queryType: '*', |
| | | }; |
| | | } |
| | | if (that.data.sort) { |
| | | sort = { |
| | | Name: that.data.sort, |
| | | BaseType: '', |
| | | }; |
| | | } else { |
| | | sort = { |
| | | type: 'Desc', |
| | | field: 'ViewCount', |
| | | }; |
| | | } |
| | | // 搜索 |
| | | let searchObj = {}; |
| | | if (that.data.searchValue) { |
| | | searchObj = { |
| | | 'Name*': that.data.searchValue, |
| | | '||author*': that.data.searchValue, |
| | | '||isbn*': that.data.searchValue, |
| | | '||seriesName*': that.data.searchValue, |
| | | }; |
| | | } |
| | | const query = { |
| | | ...pathObj, |
| | | filterList: [ |
| | | { |
| | | value: 'Normal', |
| | | field: 'state', |
| | | }, |
| | | ], |
| | | sort, |
| | | coverSize: { |
| | | height: 145, |
| | | }, |
| | | paging: { |
| | | start: that.data.page * that.data.limit - that.data.limit, |
| | | size: that.data.limit |
| | | }, |
| | | fields: { |
| | | author: [], |
| | | isbn: [], |
| | | publicationDate: [], |
| | | isApplyBook: [], |
| | | 'isApplyBook>': ['1'], |
| | | ...searchObj, |
| | | }, |
| | | }; |
| | | app.MG.store.getProductList(query).then((res) => { |
| | | try { |
| | | if (res.datas.length > 0) { |
| | | res.datas.forEach((item) => { |
| | | item.paperDisabled = false |
| | | item.paperChecked = false |
| | | item.electronDisabled = false |
| | | item.electronChecked = false |
| | | if (item.purchasedSaleMethodIdList.indexOf(item.defaultSaleMethodId) > -1) { |
| | | item.electronDisabled = true |
| | | item.electronChecked = true |
| | | } |
| | | if (that.data.alreadyPaperBookList.length > 0) { |
| | | that.data.alreadyPaperBookList.forEach((pBook) => { |
| | | pBook.content.forEach((pBookItem) => { |
| | | if (pBookItem.id === item.id && pBook.state == 'WaitAudit') { |
| | | item.paperDisabled = true |
| | | item.paperChecked = true |
| | | } |
| | | if (pBookItem.id === item.id && pBook.state == 'Normal') { |
| | | item.paperDisabled = false |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | if (that.data.alreadyElectronicBookList.length > 0) { |
| | | that.data.alreadyElectronicBookList.forEach((eBook) => { |
| | | eBook.content.forEach((eBookItem) => { |
| | | if (eBookItem.id === item.id && !eBook.isExpiry && eBook.state != 'Reject') { |
| | | item.electronDisabled = true |
| | | item.electronChecked = true |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | if (that.data.paperBookList.length > 0) { |
| | | for (let i = 0; i < that.data.paperBookList.length; i++) { |
| | | if (that.data.paperBookList[i].id == item.id) { |
| | | item.paperChecked = true |
| | | } |
| | | } |
| | | } |
| | | if (that.data.electronicBookList.length > 0) { |
| | | for (let i = 0; i < that.data.electronicBookList.length; i++) { |
| | | if (that.data.electronicBookList[i].id == item.id) { |
| | | item.electronChecked = true |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | let list = res.datas; |
| | | //触底加载新数据并保留老数据 |
| | | if (isReachBottom) { |
| | | list = [...this.data.bookList, ...list] //将新数据加入老数据中 |
| | | } |
| | | that.setData({ |
| | | bookList: list, |
| | | pageTotalCount: res.total, |
| | | bottomLoading: false, |
| | | isMoreData: list.length > 0 ? false : true, |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |
| | | } else { |
| | | that.setData({ |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |
| | | } |
| | | } catch (error) { |
| | | console.log(error) |
| | | } |
| | | }); |
| | | }, |
| | | //高级分类选择 |
| | | onChangeIcon(e) { |
| | | this.setData({ |
| | | assortCheck: { |
| | | code: e.detail.value, |
| | | }, |
| | | stairCode: '', |
| | | secondCode: '', |
| | | path: `${e.detail.value}`, |
| | | 'iconList.value': e.detail.value, |
| | | }); |
| | | this.getBookList(false); |
| | | this.getStairList(this.data.assortCheck.code); |
| | | |
| | | }, |
| | | // 一级分类切换 |
| | | onChangeStair(e) { |
| | | const path = e.detail.value.length |
| | | ? `${this.data.assortCheck.code}\\${e.detail.value}` |
| | | : this.data.assortCheck.code; |
| | | this.setData({ |
| | | pathList: [], |
| | | stairCode: e.detail.value, |
| | | secondCode: '', |
| | | path: path, |
| | | 'stairList.value': e.detail.value, |
| | | }); |
| | | this.getBookList(false); |
| | | this.getSecondList(path); |
| | | }, |
| | | // 二级分类切换 |
| | | onChangeSecond(e) { |
| | | const pathList = []; |
| | | for (let index = 0; index < e.detail.value.length; index++) { |
| | | const element = e.detail.value[index]; |
| | | pathList.push({ |
| | | Path: element, |
| | | Type: '*', |
| | | StoreRefCode: app.config.goodsStore, |
| | | }); |
| | | } |
| | | this.setData({ |
| | | pathList: pathList, |
| | | 'secondList.value': e.detail.value, |
| | | }); |
| | | |
| | | }, |
| | | // |
| | | onConfirmSecond() { |
| | | this.getBookList(false); |
| | | }, |
| | | // 重点项目改变 |
| | | changeMajorProject(e) { |
| | | this.setData({ |
| | | 'majorProjectList.value': e.detail.value, |
| | | }); |
| | | this.getBookList(false); |
| | | }, |
| | | // 重点项目重置 |
| | | resetMajorProject() { |
| | | this.setData({ |
| | | 'majorProjectList.value': [], |
| | | }); |
| | | this.getBookList(false); |
| | | }, |
| | | changeNewText(e) { |
| | | this.setData({ |
| | | 'newTextBook.value': e.detail.value, |
| | | }); |
| | | this.getBookList(false); |
| | | }, |
| | | resetNewText() { |
| | | this.setData({ |
| | | 'newTextBook.value': [], |
| | | }); |
| | | this.getBookList(false); |
| | | }, |
| | | // 排序按钮 |
| | | sortClick() { |
| | | if (!this.data.sort.length) { |
| | | this.setData({ |
| | | sort: 'Desc', |
| | | }); |
| | | } else if (this.data.sort == 'Desc') { |
| | | this.setData({ |
| | | sort: 'Asc', |
| | | }); |
| | | } else if (this.data.sort == 'Asc') { |
| | | this.setData({ |
| | | sort: '', |
| | | }); |
| | | } |
| | | let path; |
| | | if (this.data.secondCode) { |
| | | path = this.data.secondCode; |
| | | } else if (this.data.stairCode) { |
| | | path = `${this.data.assortCheck.code |
| | | }\\${this.data.stairCode}`; |
| | | } else { |
| | | path = this.data.assortCheck.code; |
| | | } |
| | | this.setData({ |
| | | path: path, |
| | | }); |
| | | this.getBookList(false); |
| | | }, |
| | | // 搜索图书 |
| | | searchBook(e) { |
| | | console.log(e.detail.value); |
| | | this.setData({ |
| | | searchValue: e.detail.value, |
| | | }); |
| | | this.getBookList(false); |
| | | }, |
| | | // 跳转图书详情 |
| | | goDetail(e) { |
| | | const { book } = e.currentTarget.dataset; |
| | | wx.navigateTo({ |
| | | url: `/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, |
| | | }); |
| | | }, |
| | | //获取已申请纸质样书 |
| | | getAlreadyPBookList() { |
| | | const data = { |
| | | start: 0, |
| | | size: 9999, |
| | | topicIdOrRefCode: 'applyEntityBook', |
| | | appRefCode: app.config.appRefCode, |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | } |
| | | } |
| | | app.MG.ugc.getTopicMessageList(data).then((res) => { |
| | | res.datas.map((item) => { |
| | | if (item.content) { |
| | | item.content = JSON.parse(item.content) |
| | | } |
| | | }) |
| | | this.setData({ |
| | | alreadyPaperBookList: res.datas, |
| | | }); |
| | | }) |
| | | }, |
| | | //获取已申请电子样书 |
| | | getAlreadyEBookList() { |
| | | const data = { |
| | | start: 0, |
| | | size: 9999, |
| | | topicIdOrRefCode: 'applyBook', |
| | | appRefCode: app.config.appRefCode, |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | } |
| | | } |
| | | app.MG.ugc.getTopicMessageList(data).then((res) => { |
| | | let list = [] |
| | | res.datas.map((item) => { |
| | | if (item.feedBack) { |
| | | item.feedBack = JSON.parse(item.feedBack) |
| | | if (item.feedBack.endDate) { |
| | | let times = new Date(item.feedBack.endDate + ' 23:59:59').getTime() |
| | | let currentDate = new Date().getTime() |
| | | if (times < currentDate) { |
| | | item.isExpiry = true |
| | | } |
| | | } |
| | | } |
| | | if (item.content) { |
| | | item.content = JSON.parse(item.content) |
| | | } |
| | | if (item.state != 'Reject') { |
| | | list.push(item) |
| | | } |
| | | }) |
| | | this.setData({ |
| | | alreadyElectronicBookList: list, |
| | | }); |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | 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.getBookList(false); |
| | | this._freshing = false |
| | | }, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() { |
| | | this.setData({ |
| | | bottomLoading: true, |
| | | isMoreData: false |
| | | }) |
| | | let bool = false; |
| | | if (this.data.pageTotalCount > this.data.bookList.length) { |
| | | bool = true; |
| | | this.setData({ |
| | | page: this.data.page + 1, |
| | | }) |
| | | |
| | | } else { |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | bottomLoading: false, |
| | | isMoreData: true |
| | | }) |
| | | }, 100) |
| | | return false; |
| | | } |
| | | this.getBookList(bool); |
| | | }, |
| | | //纸质样书 |
| | | onChangePaper(e) { |
| | | const item = e.currentTarget.dataset.book; |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null |
| | | if (role) { |
| | | if (item.paperDisabled) { |
| | | wx.showToast({ |
| | | title: "该样书已申请", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (item.paperChecked) { |
| | | if (this.data.paperBookList.length > 0) { |
| | | this.data.paperBookList.forEach((obj, index) => { |
| | | if (obj.id == item.id) { |
| | | this.data.paperBookList.splice(index, 1); |
| | | } |
| | | }) |
| | | } |
| | | item.paperChecked = false; |
| | | if (this.data.bookList.length > 0) { |
| | | this.data.bookList.forEach(i => { |
| | | if (i.id == item.id) { |
| | | i.paperChecked = false; |
| | | } |
| | | }) |
| | | } |
| | | wx.showToast({ |
| | | title: "已从样书申请单移除", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | wx.setStorageSync("paperBookList", JSON.stringify(this.data.paperBookList)); |
| | | return |
| | | } |
| | | if (role == 'Teacher') { |
| | | this.getSelectPaperBookCount(item) |
| | | } else { |
| | | item.paperChecked = false |
| | | wx.showModal({ |
| | | title: '尊敬的用户,您好!', //提示的标题 |
| | | content: '请先进行教师认证?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) { |
| | | item.paperChecked = false |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | item.paperChecked = false |
| | | } |
| | | }, |
| | | getSelectPaperBookCount(item) { |
| | | app.MG.app |
| | | .getTicketResult({ |
| | | ticketRefCodeOrGuid: 'paperSampleBookapplyNum', |
| | | roleId: this.data.userInfo.roleId |
| | | }) |
| | | .then((res) => { |
| | | this.setData({ |
| | | paperBookCount: res.totalCount - res.usedCount |
| | | }) |
| | | if (!item.paperDisabled) { |
| | | this.getAlreadyBookList(item, 'pBook') |
| | | } |
| | | }) |
| | | }, |
| | | //选择电子样书 |
| | | onChangeElectron(e) { |
| | | const item = e.currentTarget.dataset.book; |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null; |
| | | if (role) { |
| | | if (item.electronDisabled) { |
| | | wx.showToast({ |
| | | title: "该样书已申请", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return |
| | | } |
| | | if (item.electronChecked) { |
| | | if (this.data.electronicBookList) { |
| | | this.data.electronicBookList.forEach((obj, index) => { |
| | | if (obj.id == item.id) { |
| | | this.data.electronicBookList.splice(index, 1); |
| | | } |
| | | }) |
| | | } |
| | | if (this.data.bookList.length > 0) { |
| | | this.data.bookList.forEach(i => { |
| | | if (i.id == item.id) { |
| | | i.electronChecked = false; |
| | | } |
| | | }) |
| | | } |
| | | item.electronChecked = false; |
| | | wx.showToast({ |
| | | title: "已从样书申请单移除", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | wx.setStorageSync("electronicBookList", JSON.stringify(this.data.electronicBookList)); |
| | | return |
| | | } |
| | | if (role == 'Teacher') { |
| | | //有无子商品,子商品有无电子书文件 |
| | | const obj = { |
| | | path: '*', |
| | | queryType: 'SubProduct', |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 6 |
| | | }, |
| | | mainProductId: item.id, |
| | | fields: { |
| | | bookshelf_pdf: [], |
| | | bookshelf_protectedEpub: [], |
| | | } |
| | | } |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | if (res.datas.length > 0) { |
| | | if (res.datas[0].bookshelf_pdf || res.datas[0].bookshelf_protectedEpub) { |
| | | this.getSelectBookCount(item) |
| | | } else { |
| | | wx.showToast({ |
| | | title: "暂无电子书文件,请联系管理员!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } else { |
| | | this.getSelectBookCount(item) |
| | | } |
| | | }) |
| | | } else { |
| | | item.electronChecked = false |
| | | wx.showModal({ |
| | | title: '尊敬的用户,您好!', //提示的标题 |
| | | content: '请先进行教师认证?', //提示的内容 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: "/pages/teacherCertification/index", |
| | | }); |
| | | } else if (res.cancel) { |
| | | item.electronChecked = false |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | getSelectBookCount(item) { |
| | | app.MG.app |
| | | .getTicketResult({ |
| | | ticketRefCodeOrGuid: 'electronicSampleBookapplyNum', |
| | | roleId: this.data.userInfo.roleId |
| | | }) |
| | | .then((res) => { |
| | | this.setData({ |
| | | ebookCount: res.totalCount - res.usedCount |
| | | }) |
| | | if (!item.electronDisabled) { |
| | | this.getAlreadyBookList(item, 'eBook') |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | getAlreadyBookList(item, type) { |
| | | let itemAttr = null |
| | | let isHas = false |
| | | itemAttr = { |
| | | id: item.id, |
| | | title: item.name || '-', |
| | | icon: item.icon, |
| | | checked: false, |
| | | defaultSaleMethodId: item.defaultSaleMethodId, |
| | | md5: item.datas.Icon, |
| | | author: item.author || '-', |
| | | price: item.price || '-', |
| | | isbn: item.isbn || '-', |
| | | publicationDate: item.publicationDate |
| | | } |
| | | |
| | | if (type == 'eBook') { |
| | | if (this.data.ebookCount > 0) { |
| | | const eBookData = this.data.electronicBookList |
| | | if (eBookData.length == 2) { |
| | | item.electronChecked = false |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return false |
| | | } |
| | | if (eBookData.length > 0) { |
| | | for (let i = 0; i < eBookData.length; i++) { |
| | | if (eBookData[i].id == item.id) { |
| | | isHas = true |
| | | } |
| | | } |
| | | if (!isHas) { |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | electronicBookList: [...this.data.electronicBookList, ...[item]] |
| | | }) |
| | | wx.setStorageSync("electronicBookList", JSON.stringify(this.data.electronicBookList)); |
| | | } else { |
| | | item.electronChecked = false |
| | | wx.showToast({ |
| | | title: "该书已在清单列表中", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | electronicBookList: [...this.data.electronicBookList, ...[item]] |
| | | }) |
| | | wx.setStorageSync("electronicBookList", JSON.stringify(this.data.electronicBookList)); |
| | | } |
| | | } else { |
| | | item.electronChecked = false |
| | | wx.showToast({ |
| | | title: "您的电子样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: "none", |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } else { |
| | | if (this.data.paperBookCount > 0) { |
| | | const pBookData = this.data.paperBookList |
| | | if (pBookData.length == 2) { |
| | | item.paperChecked = false |
| | | wx.showToast({ |
| | | title: "每次最多只可申请2本样书", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | return false |
| | | } |
| | | if (pBookData.length > 0) { |
| | | for (let i = 0; i < pBookData.length; i++) { |
| | | if (pBookData[i].id == item.id) { |
| | | isHas = true |
| | | } |
| | | } |
| | | if (!isHas) { |
| | | item.paperChecked = true |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | paperBookList: [...this.data.paperBookList, ...[item]] |
| | | }) |
| | | wx.setStorageSync("paperBookList", JSON.stringify(this.data.paperBookList)); |
| | | console.log(this.data.paperBookList, "3") |
| | | } else { |
| | | item.paperChecked = false |
| | | wx.showToast({ |
| | | title: "该书已在清单列表中", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } else { |
| | | item.paperChecked = true; |
| | | wx.showToast({ |
| | | title: "添加成功,在样书申请单等您哦~", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | this.setData({ |
| | | paperBookList: [item] |
| | | }) |
| | | wx.setStorageSync("paperBookList", JSON.stringify(this.data.paperBookList)); |
| | | console.log(this.data.paperBookList, "4") |
| | | } |
| | | } else { |
| | | item.paperChecked = false |
| | | wx.showToast({ |
| | | title: "您的纸质样书申请次数已用尽,若要继续,请联系管理员!", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | //去样书申请单 |
| | | goApply() { |
| | | wx.navigateTo({ |
| | | url: "/pages/sampleBookList/applicationForm/index", |
| | | }); |
| | | }, |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | } |
| | | }) |
New file |
| | |
| | | { |
| | | "navigationBarTitleText": "样书申请", |
| | | "navigationStyle": "custom", |
| | | "onReachBottomDistance": 250, |
| | | "usingComponents": { |
| | | "t-image": "tdesign-miniprogram/image/image", |
| | | "t-dropdown-menu": "tdesign-miniprogram/dropdown-menu/dropdown-menu", |
| | | "t-dropdown-item": "tdesign-miniprogram/dropdown-item/dropdown-item", |
| | | "t-back-top": "tdesign-miniprogram/back-top/back-top", |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-search": "tdesign-miniprogram/search/search", |
| | | "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh" |
| | | } |
| | | } |
New file |
| | |
| | | <!-- 图书服务-列表 --> |
| | | <view class="page-header"> |
| | | <view style="width: 100%; height: {{barHeight}}px;"></view> |
| | | <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> |
| | | <view> |
| | | <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> |
| | | </view> |
| | | <t-search model:value="{{searchValue}}" shape="round" placeholder="请输入关键词/书名/ISBN/作者" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" /> |
| | | </view> |
| | | <view class="list-header"> |
| | | <view class="header-scroll"> |
| | | <scroll-view scroll-x scroll-with-animation='true' class="srcolbox"> |
| | | <t-dropdown-menu> |
| | | <t-dropdown-item label="总分类" options="{{iconList.options}}" value="{{iconList.value}}" optionsColumns="2" bindchange="onChangeIcon" arrow-icon="" /> |
| | | <t-dropdown-item label="一级" options="{{stairList.options}}" value="{{stairList.value}}" optionsColumns="2" bindchange="onChangeStair" arrow-icon="" /> |
| | | <t-dropdown-item label="二级" options="{{secondList.options}}" optionsColumns="2" multiple value="{{secondList.value}}" bind:confirm="onConfirmSecond" bind:change="onChangeSecond" /> |
| | | </t-dropdown-menu> |
| | | </scroll-view> |
| | | </view> |
| | | <view class="header-sort" bind:tap="sortClick"> |
| | | <view class="sort-name">排序</view> |
| | | <view class="sort-icon"> |
| | | <t-icon name="swap-left" size="24rpx" class="icon-right" color="{{sort == 'Asc' ? '#ff6c00' : ''}}" /> |
| | | <t-icon name="swap-left" size="24rpx" class="icon-left" color="{{sort == 'Desc' ? '#ff6c00' : ''}}" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bookServices-list"> |
| | | <view class="list-body"> |
| | | <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="title"> |
| | | <view class="line"></view> |
| | | <view class="icon"> |
| | | <t-image src="/static/images/home/yangshuliebiao.png" mode="heightFix" class="iconImage" /> |
| | | </view> |
| | | </view> |
| | | <view class="book-list" wx:if="{{bookList.length > 0}}"> |
| | | <view class="book-box" wx:for="{{bookList}}" wx:key="id"> |
| | | <view class="book-img" bind:tap="goDetail" data-book="{{item}}"> |
| | | <t-image src="{{item.icon}}" width="105" height="145" aria-label="{{item.name}}" wx:if="{{item.icon}}" /> |
| | | <t-image src="/static/images/default-book-img.png" width="105" height="145" aria-label="{{item.name}}" wx:else /> |
| | | </view> |
| | | <view class="book-name book-color" bind:tap="goDetail" data-book="{{item}}">{{ item.name}}</view> |
| | | <view class="book-author book-color">{{item.author}}</view> |
| | | <view class="checkbox"> |
| | | <t-checkbox label="纸质样书" icon="rectangle" borderless='true' default-checked="{{item.paperChecked}}" disabled="{{item.paperDisabled || item.isApplyBook == '1' || item.isApplyBook == '2'}}" data-book="{{item}}" bind:change="onChangePaper" /> |
| | | <t-checkbox label="电子样书" icon="rectangle" borderless='true' class="eBook" default-checked="{{item.electronChecked}}" disabled="{{item.electronDisabled || item.isApplyBook == '1' || item.isApplyBook == '3'}}" data-book="{{item}}" bind:change="onChangeElectron" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{list.length == 0}}" class="empyt"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </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> |
| | | </view> |
| | | </view> |
| | | <t-back-top theme="round" wx:if="{{isBackTop}}" text="顶部" bind:to-top="onToTop"></t-back-top> |
| | | <view class="applyBox" bindtap="goApply"> |
| | | <view class="box"> |
| | | <t-image src="/static/images/home/yangshuForm.png" mode="heightFix" class="img" /> |
| | | <view class="num">{{num}}</view> |
| | | </view> |
| | | </view> |
New file |
| | |
| | | .page-header { |
| | | background-color: #fff; |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | z-index: 1; |
| | | } |
| | | |
| | | .bookServices-list { |
| | | padding-top: 280rpx; |
| | | } |
| | | |
| | | .nacigationBar { |
| | | display: flex; |
| | | align-items: center; |
| | | --td-search-font-size: 28rpx; |
| | | margin-bottom: 30rpx; |
| | | } |
| | | |
| | | .list-header { |
| | | display: flex; |
| | | z-index: 1, |
| | | } |
| | | |
| | | .header-sort { |
| | | background-color: #fff; |
| | | line-height: 96rpx; |
| | | width: 150rpx; |
| | | font-size: 28rpx; |
| | | color: #999; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .sort-name { |
| | | margin-right: 10rpx; |
| | | } |
| | | |
| | | .header-scroll { |
| | | width: 80vw; |
| | | } |
| | | |
| | | .srcolbox { |
| | | width: 100%; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .t-dropdown-menu:after, |
| | | .t-dropdown-menu::after { |
| | | height: 0px; |
| | | } |
| | | |
| | | |
| | | .t-dropdown-item__body, |
| | | .t-dropdown-item__footer, |
| | | .t-radio { |
| | | background: #F6F6F6 !important; |
| | | } |
| | | |
| | | .t-dropdown-item__body { |
| | | padding: 40rpx 0; |
| | | } |
| | | |
| | | .t-dropdown-menu__item { |
| | | margin: 10rpx 10rpx 0 10rpx; |
| | | border-radius: 40rpx; |
| | | height: 68rpx; |
| | | background: #F6F6F6 !important; |
| | | } |
| | | |
| | | .t-dropdown-menu__item--active { |
| | | height: 85rpx !important; |
| | | background: #F6F6F6 !important; |
| | | border-radius: 40rpx 40rpx 0 0; |
| | | } |
| | | |
| | | .t-dropdown-menu__item--active, |
| | | .t-radio__icon--checked, |
| | | .t-checkbox__icon--checked { |
| | | color: #FF6C00 !important |
| | | } |
| | | |
| | | .t-checkbox__icon--disabled { |
| | | color: #c0c4cc !important; |
| | | } |
| | | |
| | | .t-radio--block { |
| | | padding: 20rpx !important; |
| | | } |
| | | |
| | | .t-radio__border { |
| | | height: 0 !important; |
| | | } |
| | | |
| | | .sort-icon { |
| | | transform: rotate(90deg); |
| | | position: relative; |
| | | } |
| | | |
| | | .sort-icon .icon-left { |
| | | transform: rotate(180deg); |
| | | } |
| | | |
| | | .list-body { |
| | | background: #F2F3F8; |
| | | padding: 40rpx 0; |
| | | } |
| | | |
| | | .title { |
| | | display: flex; |
| | | height: 60rpx; |
| | | font-weight: bold; |
| | | align-items: center; |
| | | } |
| | | |
| | | .title .line { |
| | | border-right: 8rpx solid #FF6C00; |
| | | border-radius: 0 10rpx 10rpx 0; |
| | | margin-right: 20rpx; |
| | | height: 100%; |
| | | } |
| | | |
| | | .title .icon { |
| | | height: 36rpx; |
| | | line-height: 60rpx; |
| | | } |
| | | |
| | | .title .icon .iconImage { |
| | | height: 100%; |
| | | } |
| | | |
| | | .refresh-container { |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .bottom-loading, |
| | | .loading { |
| | | padding: 20rpx; |
| | | text-align: center; |
| | | } |
| | | |
| | | .empyt { |
| | | padding: 200rpx 0; |
| | | } |
| | | |
| | | |
| | | .book-list { |
| | | padding: 24rpx; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | margin-top: 10rpx; |
| | | } |
| | | |
| | | |
| | | |
| | | .book-box { |
| | | box-sizing: border-box; |
| | | width: calc(100%/2 - 10rpx); |
| | | margin-right: 20rpx; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | margin-bottom: 40rpx; |
| | | padding: 50rpx 20rpx 32rpx 20rpx; |
| | | box-shadow: 0rpx 0rpx 18rpx 2rpx rgba(0, 0, 0, 0.08); |
| | | background: #fff; |
| | | } |
| | | |
| | | .book-box:nth-child(2n) { |
| | | margin-right: 0; |
| | | } |
| | | |
| | | .book-color { |
| | | color: #333; |
| | | } |
| | | |
| | | .book-img image { |
| | | object-fit: contain; |
| | | box-shadow: 0px 0px 20rpx 2px rgba(0, 0, 0, 0.08); |
| | | } |
| | | |
| | | .book-name { |
| | | height: 76rpx; |
| | | margin-top: 24rpx; |
| | | width: 100%; |
| | | font-size: 28rpx; |
| | | font-weight: 700; |
| | | word-break: break-all; |
| | | display: -webkit-box; |
| | | -webkit-line-clamp: 2; |
| | | -webkit-box-orient: vertical; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .book-author { |
| | | height: 30rpx; |
| | | margin-top: 16rpx; |
| | | width: 100%; |
| | | font-size: 24rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .checkbox { |
| | | display: flex; |
| | | } |
| | | |
| | | .checkbox .t-checkbox--block { |
| | | padding: 20rpx 0 !important; |
| | | align-items: center; |
| | | } |
| | | |
| | | .checkbox .t-checkbox__icon { |
| | | width: 30rpx !important; |
| | | height: 30rpx !important; |
| | | font-size: 36rpx !important; |
| | | } |
| | | |
| | | .t-checkbox__icon-rectangle { |
| | | width: 60rpx !important; |
| | | height: 60rpx !important; |
| | | } |
| | | |
| | | .checkbox .t-checkbox { |
| | | font-size: 28rpx !important; |
| | | } |
| | | |
| | | .checkbox .t-checkbox__icon--left { |
| | | margin-right: 10rpx !important; |
| | | } |
| | | |
| | | .checkbox .t-checkbox__title { |
| | | color: #FF6C00 !important; |
| | | } |
| | | |
| | | .eBook { |
| | | margin-left: 10rpx; |
| | | } |
| | | |
| | | |
| | | |
| | | .applyBox { |
| | | width: 184rpx; |
| | | height: 184rpx; |
| | | position: fixed; |
| | | bottom: 20%; |
| | | right: 20rpx; |
| | | } |
| | | |
| | | .applyBox .box { |
| | | width: 184rpx; |
| | | height: 184rpx; |
| | | color: #fff; |
| | | } |
| | | |
| | | .applyBox .box .t-image { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | |
| | | if (res) { |
| | | console.log(res, "user"); |
| | | let defaultUser = {}; |
| | | let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') |
| | | let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') |
| | | let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword') |
| | | let WeChatInfo = res.infoList.find((item) => item.type === "WeChat"); |
| | | if (WeChatInfo) { |
| | | if (teacherRole && teacherInfos) { |
| | | defaultUser = { |
| | | ...teacherInfos, |
| | | nickName: teacherInfos.fullName, |
| | | avatarUrl: teacherInfos.icon, |
| | | userId: res.userId, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id |
| | | } |
| | | } else if (WeChatInfo) { |
| | | defaultUser = { |
| | | nickName: WeChatInfo.name, |
| | | avatarUrl: WeChatInfo.icon, |
| | | userId: res.userId |
| | | userId: res.userId, |
| | | } |
| | | } |
| | | if (secretData) { |
| | | } else if (secretData) { |
| | | defaultUser = { |
| | | nickName: secretData.credential, |
| | | avatarUrl: "../../static/images/index/tab.png", |
| | |
| | | text: '样书申请', |
| | | key: 8, |
| | | icon: '/static/images/home/yangshushenqing@2x.png', |
| | | url: '', |
| | | url: '/pages/sampleBookList/index', |
| | | }, |
| | | { |
| | | text: '我要出书', |