纸通宝SAAS仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

56 lines
1.7 KiB

// pages/index/index.js
import { getBalanceInfo } from "../../../api/payment"
import util from '../../../utils/util'
const event = require('../../../utils/event')
const app = getApp()
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
/** 页面的初始数据 */
data: {
userInfo: app.userInfo,
height: app.globalData.safeFragmentHeight - 100,
tabList: [
{ status: 50, badge: '', name: '待预约', icon: '/assets/agent/icon-dyy.png' },
{ status: 51, badge: '', name: '待送货', icon: '/assets/agent/icon-dsh.png' },
{ status: 53, badge: '', name: '结算中', icon: '/assets/agent/icon-sjz.png' },
{ status: 54, badge: '', name: '已完成', icon: '/assets/agent/icon-ywc.png' }
],
banlanceInfo: {accountMoney: 0, frozenMoney: 0}
},
lifetimes: {
attached: function () {
this.setData({userInfo: app.userInfo, height: app.globalData.safeFragmentHeight - 100 })
event.on('EventMessage', this, this.onEvent)
},
detached: function () {
event.remove('EventMessage', this)
}
},
methods: {
onRestart: function () {
getBalanceInfo().then(result => {
if(result.data){
this.setData({ banlanceInfo: result.data })
}
}).catch(err => { })
},
onEvent: function (message) {
if (message.what == 888) {
}
},
agentList: function (e) {
if(e.currentTarget.dataset.status){
wx.navigateTo({ url: `/pages/agent/order-list/index?status=${e.currentTarget.dataset.status}` })
} else {
wx.navigateTo({ url: `/pages/agent/order-list/index` })
}
},
settlementInfo: function(){
wx.navigateTo({ url: `/pages/settlement/index/index` })
},
}
})