Commit b0187041 by 梁建民

JS

parent 3dd4246e
...@@ -11,7 +11,8 @@ Page({ ...@@ -11,7 +11,8 @@ Page({
*/ */
data: { data: {
tabIndex: 1, tabIndex: 1,
integralBillsList: [] integralBillsList: [],
userExchanges: []
}, },
/** /**
...@@ -65,14 +66,31 @@ Page({ ...@@ -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 (res.errcode === 0) {
if (this.data.tabIndex == 1) {
this.setData({ this.setData({
integralBillsList: res.data integralBillsList: res.data
}); });
} else if (this.data.tabIndex == 2) {
this.setData({
userExchanges: res.data
});
}
} }
}, true, false, true); }, true, false, true);
...@@ -85,15 +103,21 @@ Page({ ...@@ -85,15 +103,21 @@ Page({
let i = e.currentTarget.dataset.index; let i = e.currentTarget.dataset.index;
console.log(i)
this.setData({ this.setData({
tabIndex: i, tabIndex: i,
}); });
this.getData();
},
/**
* 跳转地址
*/
toUrl: function () {
wx.navigateTo({
url: '/pages/person/withdrawal/index'
});
} }
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
font-size: 22rpx; font-size: 22rpx;
line-height: 30rpx; line-height: 30rpx;
} }
.t2s{
.t2s {
color: #EA1717; color: #EA1717;
font-size: 22rpx; font-size: 22rpx;
line-height: 30rpx; line-height: 30rpx;
...@@ -45,6 +46,7 @@ ...@@ -45,6 +46,7 @@
font-size: 24rpx; font-size: 24rpx;
color: #8A9299; color: #8A9299;
} }
} }
} }
......
...@@ -27,31 +27,30 @@ ...@@ -27,31 +27,30 @@
</block> </block>
<block wx:else> <block wx:else>
<view class="content"> <view class="content">
<block wx:for="{{userExchanges}}" wx:key="item">
<view class="list row verCenter bothSide boxsiz"> <view class="list row verCenter bothSide boxsiz">
<view class="column"> <view class="column">
<text class="t1">话费充值</text> <text class="t1">{{item.type}}</text>
<text class="t2">2019-05-10 10:15</text> <text class="t2">{{item.add_time}}</text>
</view> </view>
<view class="t6">15012479484</view> <view class="t6">{{item.mobile}}</view>
<view class="column"> <view class="column">
<text class="t5">¥50</text> <text class="t5">¥{{item.amount}}</text>
<block wx:if="{{item.status == 1}}">
<text class="t2">充值成功</text> <text class="t2">充值成功</text>
</view> </block>
</view> <block wx:elif="{{item.status == 0}}">
<view class="list row verCenter bothSide boxsiz"> <text class="t2">审核中</text>
<view class="column"> </block>
<text class="t1">话费充值</text> <block wx:else>
<text class="t2">2019-05-10 10:15</text>
</view>
<view class="t6">15012479484</view>
<view class="column">
<text class="t5">¥50</text>
<text class="t2s">充值失败</text> <text class="t2s">充值失败</text>
</block>
</view> </view>
</view> </view>
</block>
</view> </view>
</block> </block>
<view class="btn"> <view class="btn" bind:tap="toUrl">
<text class="icon iconfont iconiconxiantiaoshouji28"></text> <text class="icon iconfont iconiconxiantiaoshouji28"></text>
<text class="t1">提现兑换</text> <text class="t1">提现兑换</text>
</view> </view>
......
...@@ -282,7 +282,7 @@ const apis = { ...@@ -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