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.
127 lines
4.2 KiB
127 lines
4.2 KiB
// pages/index/index.js
|
|
import Dialog from '../../../components/dialog/dialog'
|
|
import { getStatisticsInfo } from "../../../api/saas"
|
|
const event = require('../../../utils/event')
|
|
const app = getApp()
|
|
|
|
Component({
|
|
options: {
|
|
addGlobalClass: true,
|
|
multipleSlots: true
|
|
},
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
userInfo: app.userInfo,
|
|
height: app.globalData.safeFragmentHeight,
|
|
tabList: [
|
|
{ status: 1, badge: '', name: '定价', icon: '/assets/image/icon_pricing.png' },
|
|
{ status: 2, badge: '', name: '过磅审核', icon: '/assets/image/icon_checking.png' },
|
|
{ status: 3, badge: '', name: '待付款', icon: '/assets/image/icon_payment.png' },
|
|
{ status: 4, badge: '', name: '已完成', icon: '/assets/image/icon_finish.png' },
|
|
// { status: 5, badge: '', name: '已关闭', icon: '/assets/image/icon_close.png' }
|
|
],
|
|
tabList2: [
|
|
{ status: 1, badge: '', name: '出库', icon: '/assets/image/icon_checking.png' },
|
|
{ status: 2, badge: '', name: '出库查询', icon: '/assets/image/icon_checking.png' },
|
|
{ status: 3, badge: '', name: '出库总汇', icon: '/assets/image/icon_finish.png' },
|
|
// { status: 5, badge: '', name: '已关闭', icon: '/assets/image/icon_close.png' }
|
|
],
|
|
show: false,
|
|
actions: [
|
|
{ name: '今年' },
|
|
{ name: '今月' },
|
|
{ name: '今日' },
|
|
],
|
|
form: {},
|
|
totalInfo: {
|
|
totalMoney: 0,
|
|
totalWeight: 0,
|
|
}
|
|
},
|
|
lifetimes: {
|
|
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|
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 () {
|
|
this.fetchStatisticsInfo()
|
|
},
|
|
onEvent: function (message) {
|
|
if (message.what == 888) {
|
|
}
|
|
},
|
|
orderList: function (e) {
|
|
wx.navigateTo({ url: '/pages/process/order-list/index' })
|
|
},
|
|
agentList: function (e) {
|
|
wx.navigateTo({ url: '/pages/process/agent-list/index' })
|
|
},
|
|
checkList: function (e) {
|
|
// if(!app.userInfo.isSaasPerssion){
|
|
// Dialog.alert({ title: '温馨提示', message: '您还不是纸通宝SAAS的授权客户,无法使用,如有疑问请联系相关客服人员。' }).then(() => {
|
|
// })
|
|
// return
|
|
// }
|
|
if(app.userInfo.applicationStatus == 0){
|
|
Dialog.alert({ title: '温馨提示', message: '您的申请还在审核中,如有疑问请联系管理员。' }).then(() => {
|
|
})
|
|
return
|
|
}
|
|
if(e.currentTarget.dataset.status == 3){
|
|
wx.navigateTo({ url: '/pages/process/payment-list/index?status=' + e.currentTarget.dataset.status })
|
|
} else {
|
|
wx.navigateTo({ url: '/pages/process/check-list/index?status=' + e.currentTarget.dataset.status })
|
|
}
|
|
},
|
|
outList: function(e){
|
|
|
|
},
|
|
fetchStatisticsInfo: function(){
|
|
getStatisticsInfo(this.data.form).then(result => {
|
|
if(Number(result.data.priceOrderNum) > 0){
|
|
this.data.tabList[0].badge = Number(result.data.priceOrderNum)
|
|
} else {
|
|
this.data.tabList[0].badge = ''
|
|
}
|
|
if(Number(result.data.waitAuditOrderNum) > 0){
|
|
this.data.tabList[1].badge = Number(result.data.waitAuditOrderNum)
|
|
} else {
|
|
this.data.tabList[1].badge = ''
|
|
}
|
|
if(Number(result.data.waitPayOrderNum) > 0){
|
|
this.data.tabList[2].badge = Number(result.data.waitPayOrderNum)
|
|
} else {
|
|
this.data.tabList[2].badge = ''
|
|
}
|
|
this.setData({ tabList: this.data.tabList, totalInfo: result.data })
|
|
}).catch(err => {
|
|
console.log(err)
|
|
})
|
|
|
|
},
|
|
showSheet: function(){
|
|
// this.setData({ show: true })
|
|
// event.emit('TabMessage', { what: 99, visiable: false })
|
|
},
|
|
onClose: function() {
|
|
this.setData({ show: false })
|
|
setTimeout(function(){
|
|
event.emit('TabMessage', { what: 99, visiable: true })
|
|
}, 100)
|
|
},
|
|
onSelect: function({detail}) {
|
|
console.log(detail)
|
|
},
|
|
toAuths: function(){
|
|
wx.navigateTo({ url: '/pages/htmls/auths/index' })
|
|
}
|
|
}
|
|
})
|