| | |
| | | */ |
| | | onLoad() { |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.getUserInfo() |
| | | this.getStaticsSum(); |
| | | this.getDataList(false); |
| | | |
| | | } |
| | | }) |
| | | } else { |
| | | this.getUserInfo() |
| | | this.getStaticsSum(); |
| | | this.getDataList(false); |
| | | |
| | | } |
| | | |
| | | }, |
| | | |
| | |
| | | this.getTabBar().setData({ |
| | | active: 2 |
| | | }) |
| | | } |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | | this.getUserInfo() |
| | | this.getStaticsSum(); |
| | | this.getDataList(false); |
| | | this.getListCount() |
| | | } |
| | | }) |
| | | } else { |
| | | this.getUserInfo() |
| | | this.getStaticsSum(); |
| | | this.getDataList(false); |
| | | this.getListCount() |
| | | } |
| | | |
| | | }, |
| | |
| | | } |
| | | }) |
| | | }, |
| | | getListCount() { |
| | | let that = this; |
| | | let data = { |
| | | Size: 9999, |
| | | Start: 0, |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate", |
| | | }, |
| | | searchList: [{ |
| | | keywords: 'jsek_mediaBook', |
| | | field: "ProductType", |
| | | }], |
| | | } |
| | | app.MG.store.getPurchasedProductList(data).then((res) => { |
| | | that.setData({ |
| | | titleBook: "图书(" + res.totalSize + "本)", |
| | | }) |
| | | }) |
| | | let data1 = { |
| | | Size: 9999, |
| | | Start: 0, |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate", |
| | | }, |
| | | searchList: [{ |
| | | keywords: 'jsek_digitalCourses', |
| | | field: "ProductType", |
| | | }], |
| | | } |
| | | app.MG.store.getPurchasedProductList(data1).then((res) => { |
| | | that.setData({ |
| | | titleCourse: "课程(" + res.totalSize + "门)", |
| | | }) |
| | | }) |
| | | let data2 = { |
| | | Size: 9999, |
| | | Start: 0, |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate", |
| | | }, |
| | | searchList: [{ |
| | | keywords: 'jsek_digitalTextbooks', |
| | | field: "ProductType", |
| | | }], |
| | | } |
| | | app.MG.store.getPurchasedProductList(data2).then((res) => { |
| | | that.setData({ |
| | | titleTextBook: "数字教材(" + res.totalSize + "本)", |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | tabClick(item) { |
| | | let that = this; |
| | |
| | | this.setData({ |
| | | list: dataList, |
| | | pageTotalCount: res.totalSize, |
| | | titleBook: "图书(" + res.totalSize + "本)", |
| | | bottomLoading: false, |
| | | isMoreData: dataList.length > 0 ? false : true, |
| | | skeletonLoding: false, |
| | |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | list: [], |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |