Files
addons
app_download_files
extend
hyhproject
mobile
oss
static
app
css
img
js
activity1.js
activity10.js
activity2.js
activity3.js
activity4.js
activity5.js
activity6.js
activity7.js
activity8.js
activity9.js
appraise.js
binaryajax.js
canvasResize.js
choiceness.js
classify.js
collect.js
collect_commodity.js
collect_store.js
common.js
common_home.js
complain.js
confirmOrder.js
details.js
details_ac.js
discounts.js
dynamic.js
ect_address.js
ect_index.js
ect_list.js
ect_transfer_accounts.html.js
ect_transfer_accounts.js
editAddress.js
exif.js
goodsList.js
home.js
indent.js
indentcon.js
index.js
journalism.js
journalism_con.js
jquery-3.2.1.min.js
login.js
logistics.js
logisticscon.js
msg.js
msg_con.js
mui.js
mui.min.js
my.js
new_product.js
newuser.js
order_con.js
order_out.js
photoswipe-ui-default.min.js
photoswipe.js
pj.js
plupload.full.min.js
qrcode.js
register.js
setting.js
setting_address.js
setting_fogetPayPwd.js
setting_fogetPwd.js
setting_loginInfo.js
setting_payPwd.js
setting_phone.js
setting_pwd.js
setting_user.js
share.js
share_user_list.js
shopGoodsList.js
shoppingcart.js
shopsList.js
store_activity.js
store_class.js
store_commodity.js
store_home.js
store_info.js
store_new.js
storeout.js
swiper.min.js
time_limit.js
upload.js
upload1.js
app2
images
js
plugins
src
template
thinkphp
upload
vendor
wxtmp
.gitignore
.htaccess
.user.ini
404.html
H5436787D.wgt
admin.php
app-release.apk
app_download.html
cash.lock
demo.php
get_startup.php
get_version.php
get_version_new.php
index.html
index.php
reg.lock
robots.txt
qlg.tsgz.moe/static/app/js/ect_transfer_accounts.html.js
2019-09-06 23:53:10 +08:00

138 lines
4.2 KiB
JavaScript
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mui.plusReady(function() {
// function hyhUrl(url) {
// return 'http://192.168.1.101/hyh/' + url;
// }
var token = localStorage.getItem('token');
$('input').eq(0).attr('id','ectNum');
$('input').eq(1).attr('id','payPwd');
$('.num p').html('');
$('input').eq(0).attr('placeholder','ect数量至少为500');
// alert(token);
mui.ajax(hyhUrl('app/Ectwallets/listQuery'), { 
headers: { 
"HYH-Token": token
},
data: {},
dataType: 'json', //服务器返回json格式数据  
type: 'post', //HTTP请求类型  
timeout: 10000, //超时时间设置为10秒  
success: function(data) {           //服务器返回响应,根据响应结果,分析是否登录成功;  
var data = toJson(data, 1);
if(data.status == 1) {
var html = '';
if(data.data != '') {
$.each(data.data, function() {
html += '<option value="' + this.eAddress + '">' + this.eAddress + '</option>'
});
$('#select').html(html);
}
} else {
// console.log(data.status)
}
},
error: function(xhr, type, errorThrown) {           //异常处理;  
// alert(errorThrown);      
}  
}); 
mui.ajax(hyhUrl('app/Ectwallets/index'), { 
headers: { 
"HYH-Token": token
},
data: {},
dataType: 'json', //服务器返回json格式数据  
type: 'post', //HTTP请求类型  
timeout: 10000, //超时时间设置为10秒  
success: function(data) {           //服务器返回响应,根据响应结果,分析是否登录成功;  
var data = toJson(data, 1);
if(data.status == 1) {
$('.num p').html(data.data.ectNum);
} else {
// console.log(data.status)
}
},
error: function(xhr, type, errorThrown) {           //异常处理;  
// alert(errorThrown);      
}  
}); 
mui('body').on('tap', '.btn_ture', function() {
var eAddress = $('#select').val();
var ectNum = $('#ectNum').val();
var payPwd = $('#payPwd').val();
if(eAddress == '') {
plus.nativeUI.toast('未选择钱包地址');
return;
}
if(!(ectNum >= 500)) {
plus.nativeUI.toast('ect数量必须大于500');
return;
}
if(payPwd == '') {
plus.nativeUI.toast('未填写支付密码');
return;
}
$('.btn_ture').attr('disabled', 'disabled');
mui.ajax(hyhUrl('app/Ectwallets/withdraw'), { 
headers: { 
"HYH-Token": token
},
data: {
eAddress: eAddress,
ectNum: ectNum,
payPwd: payPwd
},
dataType: 'json', //服务器返回json格式数据  
type: 'post', //HTTP请求类型  
timeout: 10000, //超时时间设置为10秒  
success: function(data) {           //服务器返回响应,根据响应结果,分析是否登录成功; 
var data = toJson(data, 1);
if(data.status == 1) {
// console.log(data.data.id)
var id =data.data.id;
// $('.btn_ture').removeAttr('disabled');
mui.ajax('http://moacapi.heyuanhui.cn/api/ect/ect_transfer', { 
data: {
id:id
},
dataType: 'json', //服务器返回json格式数据  
type: 'post', //HTTP请求类型  
timeout: 10000, //超时时间设置为10秒  
success: function(data) {           //服务器返回响应,根据响应结果,分析是否登录成功;  
// console.log(data)
var data = toJson(data, 1);
if(data.status == 1) {
mui.fire(plus.webview.getWebviewById('templete/my.html'), 'refresh');
mui.fire(plus.webview.getWebviewById('ect_index.html'), 'refresh');
alert(data.msg);
location.reload();
} else {
// console.log(data.status)
}
$('.btn_ture').removeAttr('disabled');
},
error: function(xhr, type, errorThrown) {           //异常处理;  
// alert(errorThrown);      
}  
}); 
} else {
alert(data.msg);
location.reload();
$('.btn_ture').removeAttr('disabled');
}
},
error: function(xhr, type, errorThrown) {           //异常处理;  
// alert(errorThrown);      
}  
}); 
})
})