From 447c83e3e3441a661b2efb3746f0ce46037291ca Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Wed, 24 Feb 2021 19:37:18 +0800 Subject: [PATCH] no message --- pages/client/home/index.js | 13 +++++++++---- pages/client/home/index.wxml | 6 +++--- pages/client/order-list/index.js | 24 ++++++++++++++++++++++-- pages/client/order-list/index.json | 2 ++ pages/client/order-list/index.wxml | 6 ++++++ pages/client/withdrawal/index.js | 3 ++- pages/home/index/index.wxml | 2 +- 7 files changed, 45 insertions(+), 11 deletions(-) diff --git a/pages/client/home/index.js b/pages/client/home/index.js index 82864f5..cae523e 100644 --- a/pages/client/home/index.js +++ b/pages/client/home/index.js @@ -1,9 +1,10 @@ // pages/stock/index.js import Dialog from '../../../components/dialog/dialog' import { finalizeToken } from "../../../api/user" -import { getBaseInfo } from "../../../api/saas" +import { getBalanceInfo } from '../../../api/payment' const util = require('../../../utils/util') const event = require('../../../utils/event') +const math = require('../../../utils/math') const storage = require('../../../utils/storage') const app = getApp() @@ -20,7 +21,7 @@ Component({ firstShow: false, userInfo: null, avatarUrl: '/assets/image/ygImg.png', - creditInfo: { availableCreditLine: 0, creditLine: 0, usedCreditLine: 0.00 } + xsaccountMoney: 0, //显示余额 }, lifetimes: { // 生命周期函数,可以为函数,或一个在methods段中定义的方法名 @@ -35,6 +36,11 @@ Component({ // resume的处理; onRestart: function () { this.setUserInfo() + getBalanceInfo().then(result => { + this.setData({ xsaccountMoney: math.minus(result.data.accountMoney, result.data.frozenMoney) }) + }).catch(err => { + console.log(err) + }) this.data.firstShow = true }, onEvent: function (message) { @@ -46,7 +52,6 @@ Component({ if(!app.userInfo){ return } - var nickname = '' if(app.userInfo.isAuth) { nickname = app.userInfo.realName.substring(0, 14) @@ -71,7 +76,7 @@ Component({ } }, orderList: function(){ - wx.navigateTo({ url: '/pages/mall/order-list/index' }) + wx.navigateTo({ url: '/pages/client/order-list/index' }) }, tipApply: function(){ wx.navigateTo({ url: '/pages/htmls/auths/index' }) diff --git a/pages/client/home/index.wxml b/pages/client/home/index.wxml index 46a14e7..4c9cb34 100644 --- a/pages/client/home/index.wxml +++ b/pages/client/home/index.wxml @@ -29,7 +29,7 @@ - + 账户余额 @@ -37,13 +37,13 @@ 我的余额 - {{formate.formateAmount(creditInfo.availableCreditLine)}} + {{formate.formateAmount(xsaccountMoney)}} 账单明细 待收款 - {{formate.formateAmount(creditInfo.usedCreditLine)}} + {{formate.formateAmount(xsaccountMoney)}} 查看详情 diff --git a/pages/client/order-list/index.js b/pages/client/order-list/index.js index c989896..35f01a4 100644 --- a/pages/client/order-list/index.js +++ b/pages/client/order-list/index.js @@ -8,7 +8,15 @@ Page({ * 页面的初始数据 */ data: { - height: app.globalData.fragmentHeight, + height: app.globalData.fragmentHeight - 90, + tabIndex: 0, + tabList: [ + {id: 0, name: '全部', badge: 0, status: '' }, + {id: 1, name: '待定价', badge: 0, status: 1 }, + {id: 2, name: '过磅审核', badge: 0, status: 2 }, + {id: 3, name: '待付款', badge: 0, status: 3 }, + {id: 4, name: '已付款', badge: 0, status: 4 } + ], loading: true, requesting: false, finished: false, @@ -25,9 +33,21 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - this.setData({ height: app.globalData.fragmentHeight }) + if(options.index){ + this.setData({ tabIndex: Number(options.index), height: app.globalData.fragmentHeight - 90 }) + } else { + this.setData({ height: app.globalData.fragmentHeight - 90 }) + } this.fetchOrderList() }, + onTabChange: function ({detail}) { + if (this.data.tabIndex == Number(detail.index)) { + return + } + this.setData({ tabIndex: detail.index}) + this.data.form.status = this.data.tabList[detail.index].status + this.onRefreshList() + }, onRefreshList: function () { this.setData({ orderList: [], diff --git a/pages/client/order-list/index.json b/pages/client/order-list/index.json index 96f92d6..506a25d 100644 --- a/pages/client/order-list/index.json +++ b/pages/client/order-list/index.json @@ -1,6 +1,8 @@ { "usingComponents": { "refresh-view": "/components/refresher/index", + "van-tabs": "/components/tabs/index", + "van-tab": "/components/tab/index", "van-cell": "/components/cell/index", "van-divider": "/components/divider/index", "van-loading": "/components/loading/index", diff --git a/pages/client/order-list/index.wxml b/pages/client/order-list/index.wxml index c617765..4ebd372 100644 --- a/pages/client/order-list/index.wxml +++ b/pages/client/order-list/index.wxml @@ -3,6 +3,12 @@ 订单列表 + + + + + + diff --git a/pages/client/withdrawal/index.js b/pages/client/withdrawal/index.js index 4028f38..20cbfe2 100644 --- a/pages/client/withdrawal/index.js +++ b/pages/client/withdrawal/index.js @@ -88,8 +88,9 @@ Page({ if (this.data.chooseBankCard) { this.pickerView.showPicker(this.data.banckList, this.data.chooseBankCard.cardId) } else { - Dialog.alert({ title: '温馨提示', message: '您还没有绑定银行卡,请先去绑定银行卡' }).then(() => { + Dialog.confirm({ title: '温馨提示', message: '您还没有绑定银行卡,请先去绑定银行卡' }).then(() => { wx.navigateTo({ url: '/pages/client/bank-add/index' }) + }).catch(err => { }) } }, diff --git a/pages/home/index/index.wxml b/pages/home/index/index.wxml index c4b5d7d..9be9569 100644 --- a/pages/home/index/index.wxml +++ b/pages/home/index/index.wxml @@ -29,7 +29,7 @@ - + 千鸟代付额度