2019-09-06 23:53:10 +08:00

171 lines
3.2 KiB
HTML
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

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.

{extend name="base" /}
{block name="css"}
{/block}
{block name="js"}
{/block}
{block name="main"}
<div class="l-loading" style="display: block" id="wst-loading"></div>
<table class='wst-form wst-box-top'>
<tr>
<th width='150'>账号<font color='red'>*</font></th>
<td width='370'>
{if ($data['userId']>0)}
{$data['loginName']}
{else /}
<input type="text" class="ipt" id="loginName" name="loginName" />
{/if}
</td>
</tr>
<tr>
<th>选择币种<font color='red'>*</font></th>
<td>
<select class="ipt" id="rechargeCurrency" name="rechargeCurrency" >
<option value="0">请选择</option>
<option value="1">预获产品券</option>
<option value="2">预获优惠券</option>
<option value="3">产品券</option>
<option value="4">优惠券</option>
<option value="5">旺旺券</option>
</select>
</td>
</tr>
<tr>
<th>充值/扣除<font color='red'>*</font></th>
<td>
<input type="radio" name="rechargeType" id="recharge" value="1" checked>
<label for="recharge">充值</label>
<input type="radio" name="rechargeType" id="deduct" value="0">
<label for="deduct">扣除</label>
</td>
</tr>
<tr>
<th>充值/扣除数量<font color='red'>*</font></th>
<td>
<input type="text" class="ipt" id="rechargeNum" name="rechargeNum" value="" />
</td>
</tr>
<tr>
<td colspan='2' align='center'>
<input type="hidden" name="id" id="userId" class="ipt" value="<?=(int)$data['userId']?>" />
<button type="submit" class="btn btn-primary btn-mright submit" ><i class="fa fa-check"></i>提交</button>
<button type="button" class="btn" onclick="javascript:history.go(-1)"><i class="fa fa-angle-double-left"></i>返回</button>
</td>
</tr>
</table>
<script>
$(".submit").click(function(){
var userId = $('#userId').val();
var loginName = $('#loginName').val();
var rechargeCurrency = $('#rechargeCurrency').val();
var rechargeType = $("input[name='rechargeType']:checked").val();
var rechargeNum = $('#rechargeNum').val();
if(!rechargeNum || rechargeNum <= 0){
WST.msg('请正确输入充值或扣除数量');
return;
}
$(".submit").attr('disabled','disabled');
$.ajax({
type: "POST",
url:WST.U('admin/users/recharge'),
data:{"loginName":loginName,"userId":userId,"rechargeNum":rechargeNum,"rechargeType":rechargeType,"rechargeCurrency":rechargeCurrency},
dataType:"json",
success:function(response){
alert(response.msg);
$(".submit").removeAttr('disabled');
},error:function(data){
WST.msg(data);
$(".submit").removeAttr('disabled');
}
});
});
</script>
{/block}