www.lightcourse.com/app/admin/view/rechargecard/add_card.html

178 lines
7.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{include file="public/header" /}
<div class="page">
<div class="fixed-bar">
<div class="item-title">
<div class="subject">
<h3>平台充值卡</h3>
<h5></h5>
</div>
</div>
</div>
<div class="explanation" id="explanation">
<div class="title" id="checkZoom">
<h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
<span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
</div>
<ul>
<li>平台发布充值卡有3种方式</li>
<li>1. 输入总数以及可选输入的卡号前缀由系统自动生成指定总数、前缀的充值卡卡号系统自动生成部分长度为32</li>
<li>2. 上传文本文件导入充值卡卡号,文件中每行为一个卡号。</li>
<li>3. 在文本框中手动输入多个充值卡卡号,每行为一个卡号;</li>
<li>充值卡卡号为50位之内的字母数字组合可以设置本批次添加卡号的批次标识方便检索。</li>
<li>如新增的充值卡卡号与已有的卡号冲突,则系统自动忽略它们。</li>
</ul>
</div>
<form method="post" enctype="multipart/form-data" name="form_add" id="form_add">
<table class="ds-default-table">
<tbody>
<tr>
<td colspan="2" class="required"><label class="validation">请选择发布方式:</label></td>
</tr>
</tbody>
<tbody>
<tr class="noborder">
<td colspan="2" class="required">
<label class="switch-tab-title">
<input type="radio" name="type" value="0" checked="checked" class="tabswitch" />
输入总数,自动生成
</label>
<label class="switch-tab-title">
<input type="radio" name="type" value="1" class="tabswitch" />
上传文件,导入卡号
</label>
<label class="switch-tab-title">
<input type="radio" name="type" value="2" class="tabswitch" />
手动输入,每行一号
</label>
</td>
</tr>
<tr class="noborder tabswitch-target">
<td class="vatop rowform">
总数:
<input type="text" class="txt" name="total" style="width:40px;" />
前缀:
<input type="text" class="txt" name="prefix" style="width:100px;" />
</td>
<td class="vatop tips">请输入总数总数为1~5000之间的整数可以输入随机生成卡号的统一前缀16字之内字母数字的组合</td>
</tr>
<tr class="noborder tabswitch-target" style="display:none;">
<td class="vatop rowform">
<span class="type-file-box">
<input type="text" name="textfile" id="textfile" class="type-file-text" />
<input type="button" name="button" id="button" value="上传" class="type-file-button" />
<input type="file" name="_textfile" class="type-file-file" size="30" hidefocus="true" onchange="$('#textfile').val(this.value);" />
</span>
</td>
<td class="vatop tips">请上传卡号文件文件为纯文本格式每行一个卡号卡号为字母数字组合限制50字之内不合法卡号将被自动过滤</td>
</tr>
<tr class="noborder tabswitch-target" style="display:none;">
<td class="vatop rowform">
<textarea name="manual" style="width:300px;height:150px;"></textarea>
</td>
<td class="vatop tips">请输入卡号每行一个卡号卡号为字母数字组合限制50字之内不合法卡号将被自动过滤</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2" class="required"><label class="validation">面额(元):</label></td>
</tr>
<tr class="noborder">
<td class="vatop rowform"><input class="txt" type="text" name="denomination" style="width:150px;" /></td>
<td class="vatop tips">请输入面额面额不可超过1000</td>
</tr>
<tr>
<td colspan="2" class="required"><label>批次标识:</label></td>
</tr>
<tr class="noborder">
<td class="vatop rowform"><input class="txt" type="text" name="batchflag" /></td>
<td class="vatop tips">可以输入20字之内“批次标识”用于标识和区分不同批次添加的充值卡便于检索</td>
</tr>
</tbody>
<tfoot>
<tr class="tfoot">
<td colspan="2" ><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
</tr>
</tfoot>
</table>
</form>
</div>
<script type="text/javascript">
$(function(){
$('.tabswitch').click(function() {
var i = parseInt(this.value);
$('.tabswitch-target').hide().eq(i).show();
});
jQuery.validator.addMethod("r0total", function(value, element) {
var v = parseInt(value);
return $(":radio[name='type']:checked").val() != '0' || (value == v && v >= 1 && v <= 5000);
}, "总数必须是1~5000之间的整数");
jQuery.validator.addMethod("r0prefix", function(value, element) {
return $(":radio[name='type']:checked").val() != '0' || this.optional(element) || /^[0-9a-zA-Z]{0,16}$/.test(value);
}, "前缀必须是16字之内字母数字的组合");
jQuery.validator.addMethod("r1textfile", function(value, element) {
return $(":radio[name='type']:checked").val() != '1' || value;
}, "请选择纯文本格式充值卡卡号文件");
jQuery.validator.addMethod("r2manual", function(value, element) {
return $(":radio[name='type']:checked").val() != '2' || value;
}, "请输入充值卡卡号");
$("#form_add").validate({
errorPlacement: function(error, element){
error.appendTo(element.parents('tbody').find('tr:first td:first'));
},
rules : {
denomination : {
required : true,
min: 0.01,
max: 1000
},
batchflag : {
maxlength: 20
},
total : {
r0total : true
},
prefix : {
r0prefix : true
},
textfile : {
r1textfile : true
},
manual : {
r2manual : true
}
},
messages : {
denomination : {
required : '请填写面额',
min : '面额不能小于0.01',
max: '面额不能大于1000'
},
batchflag : {
maxlength: '请输入20字之内的批次标识'
}
}
});
});
</script>