Browse Source

no message

feature/v1.0
xpz2018 5 years ago
parent
commit
447c83e3e3
7 changed files with 45 additions and 11 deletions
  1. 13
      pages/client/home/index.js
  2. 6
      pages/client/home/index.wxml
  3. 24
      pages/client/order-list/index.js
  4. 2
      pages/client/order-list/index.json
  5. 6
      pages/client/order-list/index.wxml
  6. 3
      pages/client/withdrawal/index.js
  7. 2
      pages/home/index/index.wxml

13
pages/client/home/index.js

@ -1,9 +1,10 @@
// pages/stock/index.js // pages/stock/index.js
import Dialog from '../../../components/dialog/dialog' import Dialog from '../../../components/dialog/dialog'
import { finalizeToken } from "../../../api/user" import { finalizeToken } from "../../../api/user"
import { getBaseInfo } from "../../../api/saas"
import { getBalanceInfo } from '../../../api/payment'
const util = require('../../../utils/util') const util = require('../../../utils/util')
const event = require('../../../utils/event') const event = require('../../../utils/event')
const math = require('../../../utils/math')
const storage = require('../../../utils/storage') const storage = require('../../../utils/storage')
const app = getApp() const app = getApp()
@ -20,7 +21,7 @@ Component({
firstShow: false, firstShow: false,
userInfo: null, userInfo: null,
avatarUrl: '/assets/image/ygImg.png', avatarUrl: '/assets/image/ygImg.png',
creditInfo: { availableCreditLine: 0, creditLine: 0, usedCreditLine: 0.00 }
xsaccountMoney: 0, //显示余额
}, },
lifetimes: { lifetimes: {
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名 // 生命周期函数,可以为函数,或一个在methods段中定义的方法名
@ -35,6 +36,11 @@ Component({
// resume的处理; // resume的处理;
onRestart: function () { onRestart: function () {
this.setUserInfo() 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 this.data.firstShow = true
}, },
onEvent: function (message) { onEvent: function (message) {
@ -46,7 +52,6 @@ Component({
if(!app.userInfo){ if(!app.userInfo){
return return
} }
var nickname = '' var nickname = ''
if(app.userInfo.isAuth) { if(app.userInfo.isAuth) {
nickname = app.userInfo.realName.substring(0, 14) nickname = app.userInfo.realName.substring(0, 14)
@ -71,7 +76,7 @@ Component({
} }
}, },
orderList: function(){ orderList: function(){
wx.navigateTo({ url: '/pages/mall/order-list/index' })
wx.navigateTo({ url: '/pages/client/order-list/index' })
}, },
tipApply: function(){ tipApply: function(){
wx.navigateTo({ url: '/pages/htmls/auths/index' }) wx.navigateTo({ url: '/pages/htmls/auths/index' })

6
pages/client/home/index.wxml

@ -29,7 +29,7 @@
<text class="cuIcon-right text-gray" style="font-size:18px"></text> <text class="cuIcon-right text-gray" style="font-size:18px"></text>
</view> </view>
<!-- 授信信息 --> <!-- 授信信息 -->
<view class="bg-white" wx:if="{{userInfo.position != 'ORDINARY'}}" style="margin-top: 16rpx">
<view class="bg-white" style="margin-top: 16rpx">
<view class="flex" style="padding: 20rpx 32rpx"> <view class="flex" style="padding: 20rpx 32rpx">
<text class="text-lg text-bold">账户余额</text> <text class="text-lg text-bold">账户余额</text>
<text class="text-df text-gray" style="padding-top:6rpx;margin-left:8rpx"></text> <text class="text-df text-gray" style="padding-top:6rpx;margin-left:8rpx"></text>
@ -37,13 +37,13 @@
<view class="flex" style="padding:0rpx 32rpx 24rpx 32rpx"> <view class="flex" style="padding:0rpx 32rpx 24rpx 32rpx">
<view style="flex:1;border: 2rpx solid #eeeeee;padding:24rpx 32rpx;margin-right:12rpx"> <view style="flex:1;border: 2rpx solid #eeeeee;padding:24rpx 32rpx;margin-right:12rpx">
<view class="text-black">我的余额</view> <view class="text-black">我的余额</view>
<view class="text-xxl text-bold text-price" style="margin:12rpx 0rpx">{{formate.formateAmount(creditInfo.availableCreditLine)}}</view>
<view class="text-xxl text-bold text-price" style="margin:12rpx 0rpx">{{formate.formateAmount(xsaccountMoney)}}</view>
<view class="text-blue text-sm" style=";text-decoration:underline" wx:if="{{!creditInfo.creditLine}}" <view class="text-blue text-sm" style=";text-decoration:underline" wx:if="{{!creditInfo.creditLine}}"
catchtap="tipApply">账单明细</view> catchtap="tipApply">账单明细</view>
</view> </view>
<view style="flex:1;border: 2rpx solid #eeeeee;padding:24rpx 32rpx;margin-left:12rpx" bindtap="orderList"> <view style="flex:1;border: 2rpx solid #eeeeee;padding:24rpx 32rpx;margin-left:12rpx" bindtap="orderList">
<view class="text-black">待收款</view> <view class="text-black">待收款</view>
<view class="text-xxl text-bold text-price" style="margin:12rpx 0rpx">{{formate.formateAmount(creditInfo.usedCreditLine)}}</view>
<view class="text-xxl text-bold text-price" style="margin:12rpx 0rpx">{{formate.formateAmount(xsaccountMoney)}}</view>
<view class="text-gray text-sm">查看详情</view> <view class="text-gray text-sm">查看详情</view>
</view> </view>
</view> </view>

24
pages/client/order-list/index.js

@ -8,7 +8,15 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { 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, loading: true,
requesting: false, requesting: false,
finished: false, finished: false,
@ -25,9 +33,21 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { 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() 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 () { onRefreshList: function () {
this.setData({ this.setData({
orderList: [], orderList: [],

2
pages/client/order-list/index.json

@ -1,6 +1,8 @@
{ {
"usingComponents": { "usingComponents": {
"refresh-view": "/components/refresher/index", "refresh-view": "/components/refresher/index",
"van-tabs": "/components/tabs/index",
"van-tab": "/components/tab/index",
"van-cell": "/components/cell/index", "van-cell": "/components/cell/index",
"van-divider": "/components/divider/index", "van-divider": "/components/divider/index",
"van-loading": "/components/loading/index", "van-loading": "/components/loading/index",

6
pages/client/order-list/index.wxml

@ -3,6 +3,12 @@
<view slot="content">订单列表</view> <view slot="content">订单列表</view>
</cu-custom> </cu-custom>
<view class="bg-white" style="height:90rpx;" wx:if="{{tabList.length}}">
<van-tabs sticky active="{{tabIndex}}" color="#008AFF" bind:change="onTabChange" line-height="2px" swipe-threshold="6">
<van-tab wx:for="{{tabList}}" wx:key="index" title="{{item.name}}" title-style="color:{{tabIndex==index?'#008AFF':'#333333'}}"></van-tab>
</van-tabs>
</view>
<refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchOrderList"> <refresh-view bind:refresh="onRefreshList" height="{{height}}" triggered="{{requesting}}" scrollTop="{{top}}" bind:scrolltolower="fetchOrderList">
<view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}"> <view class="list-empty" style="height:{{height}}rpx" wx:if="{{!orderList.length}}">
<view style="margin-bottom:24px" wx:if="{{loading}}"> <view style="margin-bottom:24px" wx:if="{{loading}}">

3
pages/client/withdrawal/index.js

@ -88,8 +88,9 @@ Page({
if (this.data.chooseBankCard) { if (this.data.chooseBankCard) {
this.pickerView.showPicker(this.data.banckList, this.data.chooseBankCard.cardId) this.pickerView.showPicker(this.data.banckList, this.data.chooseBankCard.cardId)
} else { } else {
Dialog.alert({ title: '温馨提示', message: '您还没有绑定银行卡,请先去绑定银行卡' }).then(() => {
Dialog.confirm({ title: '温馨提示', message: '您还没有绑定银行卡,请先去绑定银行卡' }).then(() => {
wx.navigateTo({ url: '/pages/client/bank-add/index' }) wx.navigateTo({ url: '/pages/client/bank-add/index' })
}).catch(err => {
}) })
} }
}, },

2
pages/home/index/index.wxml

@ -29,7 +29,7 @@
<text class="cuIcon-right text-gray" style="font-size:18px"></text> <text class="cuIcon-right text-gray" style="font-size:18px"></text>
</view> </view>
<!-- 授信信息 --> <!-- 授信信息 -->
<view class="bg-white" wx:if="{{userInfo.position != 'ORDINARY'}}" style="margin-top: 16rpx">
<view class="bg-white" style="margin-top: 16rpx">
<view class="flex" style="padding: 20rpx 32rpx"> <view class="flex" style="padding: 20rpx 32rpx">
<text class="text-lg text-bold">千鸟代付额度</text> <text class="text-lg text-bold">千鸟代付额度</text>
<text class="text-df text-gray" style="padding-top:6rpx;margin-left:8rpx"></text> <text class="text-df text-gray" style="padding-top:6rpx;margin-left:8rpx"></text>

Loading…
Cancel
Save