Files
addons
extend
hyhproject
admin
app
common
home
home2
behavior
common
conf
controller
model
validate
view
default
articles
css
img
js
shops
sql
users
cashdraws
box_config.html
box_draw.html
cashdraws.js
list.html
favorites
informs
logmoneys
messages
orders
recharge
security
useraddress
userscores
base.html
index.html
my_consult.html
user.js
user_edit.html
base.html
base_js.html
box_login.html
brands_list.html
carts.html
error_lost.html
error_msg.html
error_switch.html
error_sys.html
footer.html
forget_pass.html
forget_pass2.html
forget_pass3.html
forget_pass4.html
goods_contrast.html
goods_detail.html
goods_list.html
goods_search.html
header.html
header_lite.html
index.html
invoices.html
order_pay.html
order_pay_step1.html
order_pay_step2.html
order_pay_step3.html
order_pay_wallets.html
order_success.html
regist.html
right_cart.html
self_shop.html
self_shop_header.html
settlement.html
settlement2.html
settlement_quick.html
shop_apply.html
shop_home.html
shop_join.html
shop_join_step1.html
shop_join_step2.html
shop_join_step3.html
shop_join_step35.html
shop_join_step4.html
shop_join_step5.html
shop_join_success.html
shop_login.html
shop_street.html
top.html
user_login.html
user_protocol.html
mobile2
wechat2
.htaccess
command.php
mobile
oss
static
thinkphp
upload
vendor
wxtmp
.gitignore
.htaccess
.user.ini
404.html
H5B854518.wgt
admin.php
app-release.apk
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/hyhproject/home2/view/default/users/cashdraws/cashdraws.js
2019-09-06 23:53:10 +08:00

199 lines
5.6 KiB
JavaScript
Executable File

$(function () {
$('#tab').TabPanel({tab:0,callback:function(tab){
switch(tab){
case 0:pageQuery(0);break;
case 1:pageConfigQuery(0);break;
}
}})
});
var isSetPayPwd = 1;
function getUserMoney(){
$.post(WST.U('home/users/getUserMoney'),{},function(data,textStatus){
var json = WST.toJson(data);
if(json.status==1){
var userMoney = json.data.userMoney;
var rechargeMoney = json.data.rechargeMoney;
$('#userMoney').html('¥'+userMoney);
$('#lockMoney').html('¥'+json.data.lockMoney);
rechargeMoney = parseFloat(userMoney - rechargeMoney)
$('#userCashMoney').html('¥'+rechargeMoney.toFixed(2));
if(json.data.isDraw==1){
$('#drawBtn').show();
}else{
$('#drawBtn').hide();
}
isSetPayPwd = json.data.isSetPayPwd;
}
});
}
function pageQuery(p){
var tips = WST.load({msg:'正在获取数据,请稍后...'});
var params = {};
params.page = p;
$.post(WST.U('home/cashdraws/pageQuery'),params,function(data,textStatus){
layer.close(tips);
var json = WST.toJson(data);
if(json.status==1){
json = json.data;
var gettpl = document.getElementById('draw-list').innerHTML;
laytpl(gettpl).render(json.Rows, function(html){
$('#draw-page-list').html(html);
});
if(json.TotalPage>1){
laypage({
cont: 'draw-pager',
pages:json.TotalPage,
curr: json.CurrentPage,
skin: '#e23e3d',
groups: 3,
jump: function(e, first){
if(!first){
pageQuery(e.curr);
}
}
});
}else{
$('#draw-pager').empty();
}
}
});
}
var w;
function toDrawMoney(){
if(isSetPayPwd==0){
WST.msg('您尚未设置支付密码,请先设置支付密码',{icon:2},function(){
location.href = WST.U('home/users/security');
});
return;
}
var tips = WST.load({msg:'正在获取数据,请稍后...'});
$.post(WST.U('home/cashdraws/toEdit'),{},function(data,textStatus){
layer.close(tips);
w = WST.open({
type: 1,
title:"申请提现",
shade: [0.6, '#000'],
border: [0],
content: data,
area: ['550px', '250px'],
offset: '100px'
});
});
}
function drawMoney(){
$('#drawForm').isValid(function(v){
if(v){
var params = WST.getParams('.j-ipt');
if(window.conf.IS_CRYPT=='1'){
var public_key=$('#token').val();
var exponent="10001";
var rsa = new RSAKey();
rsa.setPublic(public_key, exponent);
params.payPwd = rsa.encrypt(params.payPwd);
}
var tips = WST.load({msg:'正在提交数据,请稍后...'});
$.post(WST.U('home/cashdraws/drawMoney'),params,function(data,textStatus){
layer.close(tips);
var json = WST.toJson(data);
if(json.status==1){
WST.msg(json.msg,{icon:1},function(){
pageQuery(0);
getUserMoney();
layer.close(w);
});
}else{
WST.msg(json.msg,{icon:2});
}
});
}
});
}
function layerclose(){
layer.close(w);
}
function pageConfigQuery(p){
var tips = WST.load({msg:'正在获取数据,请稍后...'});
var params = {};
params.page = p;
$.post(WST.U('home/cashconfigs/pageQuery'),params,function(data,textStatus){
layer.close(tips);
var json = WST.toJson(data);
if(json.status==1){
json = json.data;
var gettpl = document.getElementById('config-list').innerHTML;
laytpl(gettpl).render(json.Rows, function(html){
$('#config-page-list').html(html);
});
if(json.TotalPage>1){
laypage({
cont: 'config-pager',
pages:json.TotalPage,
curr: json.CurrentPage,
skin: '#e23e3d',
groups: 3,
jump: function(e, first){
if(!first){
pageConfigQuery(e.curr);
}
}
});
}else{
$('#config-pager').empty();
}
}
});
}
function toEditConfig(id){
var tips = WST.load({msg:'正在获取数据,请稍后...'});
$.post(WST.U('home/cashconfigs/toEdit','id='+id),{},function(data,textStatus){
layer.close(tips);
w = WST.open({
type: 1,
title:((id>0)?"编辑":"新增")+"提现账号",
shade: [0.6, '#000'],
border: [0],
content: data,
area: ['600px', '250px'],
offset: '100px'
});
});
}
function editConfig(){
$('#configForm').isValid(function(v){
if(v){
var params = WST.getParams('.j-ipt');
params.accAreaId = WST.ITGetAreaVal('j-areas');
var tips = WST.load({msg:'正在提交数据,请稍后...'});
$.post(WST.U('home/cashconfigs/'+((params.id>0)?'edit':'add')),params,function(data,textStatus){
layer.close(tips);
var json = WST.toJson(data);
if(json.status==1){
WST.msg(json.msg,{icon:1},function(){
pageConfigQuery(0);
layer.closeAll();
});
}else{
WST.msg(json.msg,{icon:2});
}
});
}
});
}
function delConfig(id){
WST.confirm({content:'您确定要删除该提现账号吗?',yes:function(){
var tips = WST.load({msg:'正在提交数据,请稍后...'});
$.post(WST.U('home/cashconfigs/del'),{id:id},function(data,textStatus){
layer.close(tips);
var json = WST.toJson(data);
if(json.status==1){
WST.msg(json.msg,{icon:1},function(){
pageConfigQuery(0);
});
}else{
WST.msg(json.msg,{icon:2});
}
});
}})
}