Commit b0187041 by 梁建民

JS

parent 3dd4246e
......@@ -11,7 +11,8 @@ Page({
*/
data: {
tabIndex: 1,
integralBillsList: []
integralBillsList: [],
userExchanges: []
},
/**
......@@ -65,14 +66,31 @@ Page({
/**
* 获取数据
*/
getData: function (url,type) {
getData: function () {
http.getData(apis.integralBillsList, 'GET', null, (res) => {
let url = '';
if (this.data.tabIndex == 1) {
url = apis.integralBillsList;
} else if (this.data.tabIndex == 2) {
url = apis.userExchangesList;
}
http.getData(url, 'GET', null, (res) => {
if (res.errcode === 0) {
if (this.data.tabIndex == 1) {
this.setData({
integralBillsList: res.data
});
} else if (this.data.tabIndex == 2) {
this.setData({
userExchanges: res.data
});
}
}
}, true, false, true);
......@@ -85,15 +103,21 @@ Page({
let i = e.currentTarget.dataset.index;
console.log(i)
this.setData({
tabIndex: i,
});
this.getData();
},
/**
* 跳转地址
*/
toUrl: function () {
wx.navigateTo({
url: '/pages/person/withdrawal/index'
});
}
......
......@@ -17,7 +17,8 @@
font-size: 22rpx;
line-height: 30rpx;
}
.t2s{
.t2s {
color: #EA1717;
font-size: 22rpx;
line-height: 30rpx;
......@@ -45,6 +46,7 @@
font-size: 24rpx;
color: #8A9299;
}
}
}
......
......@@ -27,31 +27,30 @@
</block>
<block wx:else>
<view class="content">
<block wx:for="{{userExchanges}}" wx:key="item">
<view class="list row verCenter bothSide boxsiz">
<view class="column">
<text class="t1">话费充值</text>
<text class="t2">2019-05-10 10:15</text>
<text class="t1">{{item.type}}</text>
<text class="t2">{{item.add_time}}</text>
</view>
<view class="t6">15012479484</view>
<view class="t6">{{item.mobile}}</view>
<view class="column">
<text class="t5">¥50</text>
<text class="t5">¥{{item.amount}}</text>
<block wx:if="{{item.status == 1}}">
<text class="t2">充值成功</text>
</view>
</view>
<view class="list row verCenter bothSide boxsiz">
<view class="column">
<text class="t1">话费充值</text>
<text class="t2">2019-05-10 10:15</text>
</view>
<view class="t6">15012479484</view>
<view class="column">
<text class="t5">¥50</text>
</block>
<block wx:elif="{{item.status == 0}}">
<text class="t2">审核中</text>
</block>
<block wx:else>
<text class="t2s">充值失败</text>
</block>
</view>
</view>
</block>
</view>
</block>
<view class="btn">
<view class="btn" bind:tap="toUrl">
<text class="icon iconfont iconiconxiantiaoshouji28"></text>
<text class="t1">提现兑换</text>
</view>
......
......@@ -282,7 +282,7 @@ const apis = {
/**
* 兑换记录(话费充值, 微信转账)
*/
userExchanges: welfare_url + '/user_exchanges/list',
userExchangesList: welfare_url + '/user_exchanges/list',
/**
* 兑换配置列表(话费, 微信兑换页面的可兑换项)
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment