Commit 8d091cde by 梁建民

js

parent 9c55a194
...@@ -197,75 +197,26 @@ Page({ ...@@ -197,75 +197,26 @@ Page({
*/ */
withdrawalfn: function () { withdrawalfn: function () {
if (this.data.can_exchange === 0) { let exchange_id = this.data.weixin_exchange_info.exchange_id;
wx.showToast({ let money = 10;
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 (exchange_id) {
if (this.data.official_account_bind) { http.getData(apis.userExchangesConfirm, 'GET', {
wx.showModal({ exchange_id: exchange_id
title: '提示', }, (res) => {
content: '请关注公众号,才能提现', if (res.errcode === 0) {
showCancel: false, wx.navigateTo({
success(res) { url: '/pages/person/withdrawalsuccess/index?money=' + money
if (res.confirm) { });
wx.showModal({ } else {
title: '提示', wx.showToast({
content: '请关注公众号,才能提现', title: res.errmsg,
showCancel: false, icon: 'none',
success(res) { duration: 2000
if (res.confirm) { });
wx.navigateTo({ }
url: 'https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzU3NDkzMDQ5OA==&scene=124#wechat_redirect' }, true, false, true);
});
}
}
})
}
}
})
} 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);
}
} }
}, },
......
...@@ -47,12 +47,20 @@ ...@@ -47,12 +47,20 @@
<text class="t1">红包提现</text> <text class="t1">红包提现</text>
<text class="t2">账户红包:¥{{integral}}</text> <text class="t2">账户红包:¥{{integral}}</text>
</view> </view>
<view class="list row boxsiz"> <view class="list row boxsiz {{weixin_exchange_info.assist_count == 2 ? 'opacity':''}}">
<block wx:for="{{exchangeSettings}}" wx:key="item" wx:for-index="index"> <block wx:for="{{exchangeSettings}}" wx:key="item" wx:for-index="index">
<view class="wrap column rowCenter verCenter boxsiz {{index == indexOf ? 'curr':''}}" data-index="{{index}}" data-id="{{item.id}}" data-stock="{{item.stock}}" bind:tap="tab"> <block wx:if="{{weixin_exchange_info.assist_count == 2}}">
<text class="t1">{{item.name}}</text> <view class="wrap column rowCenter verCenter boxsiz {{index == indexOf ? 'curr':''}}" data-index="{{index}}" data-id="{{item.id}}" data-stock="{{item.stock}}">
<text class="t2">剩余名额:{{item.stock}}</text> <text class="t1">{{item.name}}</text>
</view> <text class="t2">剩余名额:{{item.stock}}</text>
</view>
</block>
<block wx:else>
<view class="wrap column rowCenter verCenter boxsiz {{index == indexOf ? 'curr':''}}" data-index="{{index}}" data-id="{{item.id}}" data-stock="{{item.stock}}" bind:tap="tab">
<text class="t1">{{item.name}}</text>
<text class="t2">剩余名额:{{item.stock}}</text>
</view>
</block>
</block> </block>
</view> </view>
<block wx:if="{{weixin_exchange_info.assist_count == 2}}"> <block wx:if="{{weixin_exchange_info.assist_count == 2}}">
......
...@@ -333,6 +333,13 @@ ...@@ -333,6 +333,13 @@
"pathName": "pages/person/withdrawalsuccess/index", "pathName": "pages/person/withdrawalsuccess/index",
"query": "money=10", "query": "money=10",
"scene": null "scene": null
},
{
"id": -1,
"name": "pages/person/withdrawalsuccess/index",
"pathName": "pages/person/withdrawalsuccess/index",
"query": "money=10",
"scene": null
} }
] ]
} }
......
const auth_url = 'https://authapi.icsales.com'; // const auth_url = 'https://authapi.icsales.com';
const so_url = 'https://soapi.icsales.com'; // const so_url = 'https://soapi.icsales.com';
const offer_url = "https://offerapi.icsales.com"; // const offer_url = "https://offerapi.icsales.com";
const user_url = 'https://userapi.icsales.com'; // const user_url = 'https://userapi.icsales.com';
const goods_url = 'https://goodsapi.icsales.com'; // const goods_url = 'https://goodsapi.icsales.com';
const home_url = 'https://home.icsales.com'; // const home_url = 'https://home.icsales.com';
const welfare_url = 'https://welfareapi.icsales.com' // const welfare_url = 'https://welfareapi.icsales.com'
// const auth_url = 'http://authapi.icsales.cc'; const auth_url = 'http://authapi.icsales.cc';
// const so_url = 'http://soapi.icsales.cc'; const so_url = 'http://soapi.icsales.cc';
// const offer_url = "http://offerapi.icsales.cc"; const offer_url = "http://offerapi.icsales.cc";
// const user_url = 'http://userapi.icsales.cc'; const user_url = 'http://userapi.icsales.cc';
// const goods_url = 'http://goodsapi.icsales.cc'; const goods_url = 'http://goodsapi.icsales.cc';
// const home_url = 'http://home.icsales.cc'; const home_url = 'http://home.icsales.cc';
// const welfare_url = 'http://welfareapi.icsales.cc'; const welfare_url = 'http://welfareapi.icsales.cc';
const apis = { const apis = {
......
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