Commit 9c55a194 by 梁建民

提现

parent 8f2cccb3
......@@ -150,8 +150,8 @@ Page({
} else if (id == 4) {
} else if (id == 5) {
wx.navigateTo({
url: "/pages/list/qd/index"
wx.switchTab({
url: '/pages/list/qd/index'
})
} else if (id == 6) {
wx.navigateTo({
......
......@@ -20,6 +20,7 @@ Page({
exchanging: false,
exchange_id: '',
weixin_exchange_info: {},
official_account_bind: '',
isShowTip: true
},
......@@ -99,7 +100,8 @@ Page({
can_exchange: res.can_exchange,
mobile: res.mobile,
weixin_exchange_info: res.weixin_exchange_info,
exchange_id: res.weixin_exchange_info.exchange_id
exchange_id: res.weixin_exchange_info.exchange_id,
official_account_bind: res.official_account_bind
});
}
......@@ -142,7 +144,7 @@ Page({
},
/**
* 提现
* 提现(邀请好友)
*/
withdrawal: function (e) {
......@@ -188,10 +190,83 @@ Page({
});
}
}, true, false, true);
}
},
/**
* 提现
*/
withdrawalfn: function () {
if (this.data.can_exchange === 0) {
wx.showToast({
title: '今天已经兑换过了,请明天再来吧',
icon: 'none',
duration: 2000
});
return false;
} else if (this.data.can_exchange === -1) {
wx.showToast({
title: '用户无法兑换,用户未认证',
icon: 'none',
duration: 2000
});
return false;
}
if (this.data.indexOf == -1) {
wx.showToast({
title: '请选择金额',
icon: 'none',
duration: 2000
});
return false;
}
let exchange_id = this.data.exchangeSettings[this.data.indexOf].id;
let money = this.data.exchangeSettings[this.data.indexOf].amount * 1;
if (exchange_id) {
if (this.data.official_account_bind) {
wx.showModal({
title: '提示',
content: '请关注公众号,才能提现',
showCancel: false,
success(res) {
if (res.confirm) {
wx.showModal({
title: '提示',
content: '请关注公众号,才能提现',
showCancel: false,
success(res) {
if (res.confirm) {
wx.navigateTo({
url: 'https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzU3NDkzMDQ5OA==&scene=124#wechat_redirect'
});
}
}
})
}
}
})
} else {
http.getData(apis.userExchangesConfirm, 'GET', {
exchange_id: exchange_id
}, (res) => {
if (res.errcode === 0) {
wx.navigateTo({
url: '/pages/person/withdrawalsuccess/index?money=' + money
});
} else {
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
}
}, true, false, true);
}
}
},
/**
......
......@@ -55,13 +55,20 @@
</view>
</block>
</view>
<block wx:if="{{weixin_exchange_info.exchanging == 0}}">
<button class="btn {{can_exchange == -1 || can_exchange == 0 ? 'opacity':''}}" bind:tap="withdrawal">
申请提现
<block wx:if="{{weixin_exchange_info.assist_count == 2}}">
<button class="btn {{can_exchange == -1 || can_exchange == 0 ? 'opacity':''}}" bind:tap="withdrawalfn" data-status='yes'>
申请微信提现
</button>
</block>
<block wx:else>
<button class="btns" open-type="share">分享给好友助力,可提现</button>
<block wx:if="{{weixin_exchange_info.exchanging == 0}}">
<button class="btn {{can_exchange == -1 || can_exchange == 0 ? 'opacity':''}}" bind:tap="withdrawal">
申请提现
</button>
</block>
<block wx:else>
<button class="btns" open-type="share">分享给好友助力,可提现</button>
</block>
</block>
<text class="fr-txt">好友助力,已完成({{weixin_exchange_info.assist_count}}/2)</text>
</view>
......
Page({
/**
* 页面的初始数据
*/
data: {
text_1: '话费兑换成功',
text_2: '话费预计将在24小时内充值到账!',
money: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let money = options.money;
if (money) {
this.setData({
text_1: '申请提现成功',
text_2: '预计将在24小时内充值到账!'
});
}
},
/**
......
<view class="success column rowCenter verCenter">
<image src="/res/images/imgs/success.png" class="img"></image>
<text class="tit">话费兑换成功</text>
<text class="t1">话费预计将在24小时内充值到账!</text>
<text class="tit">{{text_1}}</text>
<text class="t1">{{text_2}}</text>
<navigator url="/pages/person/welfare/index" class="btn">
返回福利中心
</navigator>
......
......@@ -310,6 +310,28 @@
"id": -1,
"name": "pages/person/agreement/index",
"pathName": "pages/person/agreement/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/person/withdrawal/index",
"pathName": "pages/person/withdrawal/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/person/withdrawalsuccess/index",
"pathName": "pages/person/withdrawalsuccess/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/person/withdrawalsuccess/index",
"pathName": "pages/person/withdrawalsuccess/index",
"query": "money=10",
"scene": null
}
]
......
......@@ -173,8 +173,8 @@ const apis = {
*/
userSetmsg: user_url + "/user/setmsg",
/***
* 账户隐私项设置
*/
* 账户隐私项设置
*/
userSetprivacy: user_url + "/user/setprivacy",
/***
* 账户设置
......@@ -193,8 +193,8 @@ const apis = {
*/
countBusiness: user_url + '/count/business',
/**
* 获取别人的数量统计
*/
* 获取别人的数量统计
*/
countUserBusiness: user_url + '/count/user/business',
/**
* 获取会员系统通知
......@@ -261,8 +261,8 @@ const apis = {
*/
evaluateList: user_url + '/evaluate/list',
/**
* 评价列表(其他用户,根据user_id获取)
*/
* 评价列表(其他用户,根据user_id获取)
*/
evaluateUserList: user_url + '/evaluate/user/list',
/**
* 新增评价
......@@ -331,7 +331,11 @@ const apis = {
/**
* 添加好友助力
*/
assistsAdd: welfare_url + '/assists/add'
assistsAdd: welfare_url + '/assists/add',
/**
* 确认兑换接口
*/
userExchangesConfirm: welfare_url + '/user_exchanges/exchange/confirm'
}
......
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