| | |
| | | const app = getApp(); |
| | | import moment from 'moment' |
| | | import { |
| | | loginInfo |
| | | } from '../../assets/js/login'; |
| | |
| | | { |
| | | title: '出书申请', |
| | | icon: '/static/images/personal/chushu.png', |
| | | url: '', |
| | | url: '/packagePersonal/pages/publishBooks/index', |
| | | type: 'publishBooks', |
| | | } |
| | | ]; |
| | |
| | | size: '10rpx', |
| | | }, |
| | | scrollTop: 0, |
| | | visibleIntegral: false, |
| | | recordList: [] |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | |
| | | currAuthStep: 2, |
| | | }); |
| | | this.getUserInfo() |
| | | this.getIntegral() |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | currAuthStep: 3, |
| | | }); |
| | | this.getUserInfo() |
| | | this.getIntegral() |
| | | } |
| | | }, |
| | | /** |
| | |
| | | 'baseRefresh.value': true, |
| | | }) |
| | | this.getUserInfo() |
| | | this.getIntegral() |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | |
| | | }); |
| | | }, |
| | | |
| | | getIntegral() { |
| | | app.MG.store |
| | | .getUserWallet({ |
| | | type: 'integral' |
| | | }) |
| | | .then((res) => { |
| | | this.setData({ |
| | | integral: res.balance, |
| | | }); |
| | | }) |
| | | }, |
| | | getIntegralList() { |
| | | app.MG.store |
| | | .getWalletHistory({ |
| | | Size: 999, |
| | | Start: 0, |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | }, |
| | | type: 'integral' |
| | | }) |
| | | .then((res) => { |
| | | if (res.datas.length > 0) { |
| | | res.datas.forEach((element) => { |
| | | element.createDate = moment(element.createDate).format('YYYY-MM-DD HH:mm:ss') |
| | | if (element.refType == 'sign') { |
| | | element.type = '每日登录' |
| | | } |
| | | if (element.refType == 'Reward') { |
| | | element.type = '上传资源奖励' |
| | | } |
| | | if (element.refType == 'OrderCoinBonus') { |
| | | element.type = '订单支付奖励' |
| | | } |
| | | if (element.refType == 'Order' && element.value < 0) { |
| | | element.type = '订单支付抵扣' |
| | | } |
| | | if (element.refType == 'Order' && element.value > 0) { |
| | | element.type = '订单取消退回' |
| | | } |
| | | if (element.refType == 'AdminRecharge') { |
| | | element.type = '管理员充值' |
| | | } |
| | | }) |
| | | this.setData({ |
| | | recordList: res.datas, |
| | | visibleIntegral: true |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | onVisibleIntegralChange(e) { |
| | | this.setData({ |
| | | visibleIntegral: e.detail.visible, |
| | | }); |
| | | }, |
| | | onClose() { |
| | | this.setData({ |
| | | visibleIntegral: false, |
| | | }); |
| | | }, |
| | | |
| | | //点击目录 |
| | | toPages(item) { |
| | | let info = item.currentTarget.dataset.info |