From d3afb71078112ce7c6bbeaa880665e410f19f69e Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Thu, 21 Jan 2021 11:25:00 +0800 Subject: [PATCH] no message --- components/dialog/dialog.js | 2 +- pages/home/index/index.js | 44 +++++++++++------------------ pages/index/index.json | 3 +- pages/process/index/index.js | 2 +- pages/process/order-list/index.js | 21 ++++++-------- pages/process/order-list/index.wxml | 6 ++-- 6 files changed, 31 insertions(+), 47 deletions(-) diff --git a/components/dialog/dialog.js b/components/dialog/dialog.js index 19aab17..3716210 100644 --- a/components/dialog/dialog.js +++ b/components/dialog/dialog.js @@ -27,7 +27,7 @@ Dialog.defaultOptions = { title: '', width: null, message: '', - zIndex: 100, + zIndex: 60, overlay: true, selector: '#van-dialog', className: '', diff --git a/pages/home/index/index.js b/pages/home/index/index.js index 5a7e61a..125f6fe 100644 --- a/pages/home/index/index.js +++ b/pages/home/index/index.js @@ -2,7 +2,8 @@ import Dialog from '../../../components/dialog/dialog' import { finalizeToken } from "../../api/user" const util = require('../../../utils/util') -const event = require('../../../utils/event.js') +const event = require('../../../utils/event') +const storage = require('../../../utils/storage') const app = getApp() Component({ @@ -33,7 +34,6 @@ Component({ // resume的处理; onRestart: function () { this.setUserInfo() - this.fetchCreditInfo() this.data.firstShow = true }, onEvent: function (message) { @@ -44,53 +44,43 @@ Component({ } }, setUserInfo: function(){ - if(!app.accountInfo){ + if(!app.userInfo){ return } var nickname = '' - if(app.accountInfo.isAuth) { - nickname = app.accountInfo.realName.substring(0, 14) - } else if(!util.isEmpty(app.accountInfo.nickname)){ - nickname = app.accountInfo.nickname.substring(0, 14) - } else if(!util.isEmpty(app.accountInfo.realName)){ - nickname = app.accountInfo.realName.substring(0, 14) + if(app.userInfo.isAuth) { + nickname = app.userInfo.realName.substring(0, 14) + } else if(!util.isEmpty(app.userInfo.nickname)){ + nickname = app.userInfo.nickname.substring(0, 14) + } else if(!util.isEmpty(app.userInfo.realName)){ + nickname = app.userInfo.realName.substring(0, 14) } this.setData({ - avatarUrl: util.isEmpty(app.accountInfo.avatarUrl) ? '/assets/image/ygImg.png' : app.accountInfo.avatarUrl, - userInfo: app.accountInfo, + avatarUrl: util.isEmpty(app.userInfo.avatarUrl) ? '/assets/image/ygImg.png' : app.userInfo.avatarUrl, + userInfo: app.userInfo, userName: nickname, height: app.globalData.safeFragmentHeight }) }, toUserInfo: function(){ - if(!app.accountInfo){ + if(!app.userInfo){ return } - if(!app.accountInfo.isAuth){ + if(!app.userInfo.isAuth){ wx.navigateTo({ url: '/pages/home/authory/index' }) } }, - fetchCreditInfo: function(){ - if(!app.accountInfo || util.isEmpty(app.accountInfo.enterpriseId)){ - return - } - getCreditInfo({enterpriseId: app.accountInfo.enterpriseId}).then(result => { - this.setData({ creditInfo: result.data }) - }).catch(error => { }) - }, orderList: function(){ wx.navigateTo({ url: '/pages/mall/order-list/index' }) }, - tipApply: function(){ - wx.navigateTo({ url: '/pages/htmls/credit/index' }) - }, loginOut: function () { Dialog.confirm({ title: '温馨提示', message: '确定退出云印通账号?' }).then(() => { - wx.removeStorageSync('Authorization') + storage.remove('Authorization') app.globalData.token = null - app.accountInfo = null - this.setData({ userInfo: null, avatarUrl: '/assets/image/ygImg.png', creditInfo: { availableCreditLine: 0, creditLine: 0, usedCreditLine: 0.00 }}) + app.userInfo = null + this.setData({ userInfo: null, avatarUrl: '/assets/image/ygImg.png' }) finalizeToken() + wx.redirectTo({ url: '/pages/login/index' }) event.emit('EventMessage', { what: 888, desc: 'Logout' }) }) } diff --git a/pages/index/index.json b/pages/index/index.json index c95a7d8..176b038 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -5,6 +5,7 @@ "van-tabbar-item": "/components/tabbar-item/index", "mall": "/pages/mall/index/index", "workbench": "/pages/process/index/index", - "home": "/pages/home/index/index" + "home": "/pages/home/index/index", + "van-dialog": "/components/dialog/index" } } \ No newline at end of file diff --git a/pages/process/index/index.js b/pages/process/index/index.js index 6b8a868..f40c63d 100644 --- a/pages/process/index/index.js +++ b/pages/process/index/index.js @@ -16,7 +16,7 @@ Component({ tabList: [ { status: 1, badge: 2, name: '定价', icon: '/assets/image/icon_pricing.png' }, { status: 2, badge: 4, name: '过磅审核', icon: '/assets/image/icon_checking.png' }, - { status: 3, badge: '', name: '代付款', icon: '/assets/image/icon_payment.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' } ] diff --git a/pages/process/order-list/index.js b/pages/process/order-list/index.js index 9208a5d..fe0e21d 100644 --- a/pages/process/order-list/index.js +++ b/pages/process/order-list/index.js @@ -6,10 +6,7 @@ const util = require('../../../utils/util') const app = getApp() Page({ - - /** - * 页面的初始数据 - */ + // * 页面的初始数据 data: { height: app.globalData.fragmentHeight, loading: true, @@ -23,22 +20,20 @@ Page({ }, title: '全部' }, - /** - * 生命周期函数--监听页面加载 - */ + // * 生命周期函数--监听页面加载 onLoad: function (options) { if(options.status){ this.data.form.status = Number(options.status) if(this.data.form.status == 1){ - this.data.title = '定价列表' + this.data.title = '待定价订单' } else if(this.data.form.status == 2){ - this.data.title = '过磅审核' + this.data.title = '待过磅审核订单' } else if(this.data.form.status == 3){ - this.data.title = '代付款' + this.data.title = '待付款订单' } else if(this.data.form.status == 4){ - this.data.title = '已完成' + this.data.title = '已完成订单' } else if(this.data.form.status == 5){ - this.data.title = '已关闭' + this.data.title = '已关闭订单' } } event.on('OrderMessage', this, this.onEvent) @@ -114,7 +109,7 @@ Page({ }) }, priceOrder: function(e){ - wx.navigateTo({ url: '/pages/process/order-info/index?id=' }) + wx.navigateTo({ url: '/pages/process/order-info/index?id=' + e.currentTarget.dataset.id }) }, onUnload: function(){ event.remove('OrderMessage', this) diff --git a/pages/process/order-list/index.wxml b/pages/process/order-list/index.wxml index d010588..a96546d 100644 --- a/pages/process/order-list/index.wxml +++ b/pages/process/order-list/index.wxml @@ -21,10 +21,8 @@ 毛重:2000.00KG - 取消 - - 定价 + 取消 + 定价