123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- {extend name="default/base/base_seller" /}
- {block name="seller_main"}
- <div class="dssc-form-default">
- <form id="add_form" method="post" enctype="multipart/form-data" action="{if $type == 'add'}{:url('Sellervoucher/templateadd')}{else}{:url('Sellervoucher/templateedit',['tid'=>$t_info.vouchertemplate_id])}{/if}">
- <dl>
- <dt><i class="required">*</i>{$Think.lang.voucher_template_title}{$Think.lang.ds_colon}</dt>
- <dd>
- <input type="text" class="w300 text" name="txt_template_title" value="{present name='t_info'}{$t_info.vouchertemplate_title}{/present}">
- <span></span>
- </dd>
- </dl>
- {if !$isPlatformStore}
- <dl>
- <dt><i class="required">*</i>{$Think.lang.store_classification}</dt>
- <dd>
- <select name="storeclass_id">
- <option value="0">{$Think.lang.store_classification}</option>
- {foreach name="store_class" item="v"}
- <option value="{$v.storeclass_id}" {present name='t_info'}{if $t_info.vouchertemplate_sc_id == $v.storeclass_id}selected{/if}{/present}>{$v.storeclass_name}</option>
- {/foreach}
- </select>
- <span></span>
- </dd>
- </dl>
- {else /}
- <input type="hidden" name="storeclass_id" value="{$store_info.storeclass_id}"/>
- {/if}
- <dl>
- <dt><em class="pngFix"></em>{$Think.lang.voucher_template_enddate}{$Think.lang.ds_colon}</dt>
- <dd>
- <input type="text" class="text w70" id="txt_template_enddate" name="txt_template_enddate" value="" readonly><em class="add-on"><i class="iconfont"></i></em>
- <span></span><p class="hint">
- {if $isPlatformStore}
- {$Think.lang.blank_defaults}
- {else /}
- {$Think.lang.voucher_template_enddate_tip}{$quotainfo.voucherquota_starttime|date="Y-m-d"} ~ {$quotainfo.voucherquota_endtime|date="Y-m-d"}
- {/if}
- </p>
- </dd>
- </dl>
- <dl>
- <dt>{$Think.lang.voucher_template_price}{$Think.lang.ds_colon}</dt>
- <dd>
- <select id="select_template_price" name="select_template_price" class="w80 vt">
- {notempty name="pricelist"}
- {foreach name="pricelist" item="val"}
- <option value="{$val.voucherprice}" {present name='t_info'}{$t_info.vouchertemplate_price == $val.voucherprice ?'selected':''}{/present}>{$val.voucherprice}</option>
- {/foreach}
- {/notempty}
- </select>
- <em class="add-on"><i class="iconfont"></i></em>
- <span></span>
- </dd>
- </dl>
- <dl>
- <dt><i class="required">*</i>{$Think.lang.voucher_template_total}{$Think.lang.ds_colon}</dt>
- <dd>
- <input type="text" class="w70 text" name="txt_template_total" value="{present name='t_info'}{$t_info.vouchertemplate_total}{/present}">
- <span></span>
- </dd>
- </dl>
- <dl>
- <dt><i class="required">*</i>{$Think.lang.voucher_template_eachlimit}{$Think.lang.ds_colon}</dt>
- <dd>
- <select name="eachlimit" class="w80">
- <option value="0">{$Think.lang.voucher_template_eachlimit_item}</option>
- {for start="1" end="config('ds_config.voucher_buyertimes_limit')"}
- <option value="{$i}" {$t_info.vouchertemplate_eachlimit == $i ? 'selected':''}>{$i}{$Think.lang.ds_zhang}</option>
- {/for}
- </select>
- </dd>
- </dl>
- <dl>
- <dt><i class="required">*</i>{$Think.lang.voucher_template_orderpricelimit}{$Think.lang.ds_colon}</dt>
- <dd>
- <input type="text" name="txt_template_limit" class="text w70" value="{present name='t_info'}{$t_info.vouchertemplate_limit}{/present}"><em class="add-on"><i class="iconfont"></i></em>
- <span></span>
- </dd>
- </dl>
- <dl>
- <dt><i class="required">*</i>{$Think.lang.voucher_template_describe}{$Think.lang.ds_colon}</dt>
- <dd>
- <textarea name="txt_template_describe" class="textarea w400 h600">{present name='t_info'}{$t_info.vouchertemplate_desc}{/present}</textarea>
- <span></span>
- </dd>
- </dl>
- <dl>
- <dt>{$Think.lang.voucher_template_image}{$Think.lang.ds_colon}</dt>
- <dd>
- <div id="customimg_preview" class="dssc-upload-thumb voucher-pic" style="display: none"><p>
- {present name='t_info'}
- {if $t_info.vouchertemplate_customimg}
- <img src="{$t_info.vouchertemplate_customimg}"/>
- {else}
- <i class="iconfont"></i>
- {/if}
- {/present}</p>
- </div>
- <div class="dssc-upload-btn">
- <a href="javascript:void(0);">
- <span>
- <input type="file" hidefocus="true" size="1" class="input-file" name="customimg" id="customimg" ds_type="customimg"/>
- </span>
- <i id="file_name" style="left:100px;position: absolute;white-space: nowrap;"></i>
- <p><i class="iconfont"></i>{$Think.lang.image_upload}</p>
- </a>
- </div>
- <p class="hint">{$Think.lang.voucher_template_image_tip}</p>
- </dd>
- </dl>
- <dl>
- <dt>{$Think.lang.vouchertemplate_if_private}{$Think.lang.ds_colon}</dt>
- <dd>
- <ul class="dssc-form-radio-list">
- <li><label><input type="radio" name="vouchertemplate_if_private" {if !isset($t_info) || $t_info['vouchertemplate_if_private'] == '1'}checked="checked"{/if} value="1" />{$Think.lang.ds_yes}</label></li>
- <li><label><input type="radio" name="vouchertemplate_if_private" {if isset($t_info) && $t_info['vouchertemplate_if_private'] == '0'}checked="checked"{/if} value="0" />{$Think.lang.ds_no}</label></li>
- </ul>
- <p class="hint">{$Think.lang.vouchertemplate_if_private_tip}</p>
- </dd>
- </dl>
- {if $type== 'edit'}
- <dl>
- <dt><em class="pngFix"></em>{$Think.lang.ds_status}{$Think.lang.ds_colon}</dt>
- <dd>
- <input type="radio" value="{$templatestate_arr.usable.0}" name="tstate" {$t_info.vouchertemplate_state == $templatestate_arr.usable.0?'checked':''}> {$templatestate_arr.usable.1}
- <input type="radio" value="{$templatestate_arr.disabled.0}" name="tstate" {$t_info.vouchertemplate_state == $templatestate_arr.disabled.0 ?'checked':''}> {$templatestate_arr.disabled.1}
- </dd>
- </dl>
- {/if}
- <div class="bottom">
- <input id='btn_add' type="button" class="submit" value="{$Think.lang.ds_submit}" />
- </div>
- </form>
- </div>
- <script>
- //判断是否显示预览模块
- {present name='t_info'}
- {notempty name='t_info.vouchertemplate_customimg'}
- $('#customimg_preview').show();
- {/notempty}
- {/present}
- {if !$isPlatformStore}
- var year = {:date('Y',$quotainfo.voucherquota_endtime)};
- var month = {:date('m',$quotainfo.voucherquota_endtime)};
- var day = {:date('d',$quotainfo.voucherquota_endtime)};
- {/if}
- $(document).ready(function(){
- //日期控件
- $('#txt_template_enddate').datepicker({dateFormat: 'yy-mm-dd'});
- var currDate = new Date();
- var date = currDate.getDate();
- date = date + 1;
- currDate.setDate(date);
-
- $('#txt_template_enddate').datepicker( "option", "minDate", currDate);
- {if !$isPlatformStore}
- $('#txt_template_enddate').datepicker( "option", "maxDate", new Date(year,month-1,day));
- {/if}
- $('#txt_template_enddate').val("{present name='t_info'}{if $t_info.vouchertemplate_enddate}{:date('Y-m-d',$t_info.vouchertemplate_enddate)}{/if}{/present}");
- $('#customimg').change(function(){
- var src = getFullPath($(this)[0]);
- if(navigator.userAgent.indexOf("Firefox")>0){
- $('#customimg_preview').show();
- $('#customimg_preview').children('p').html('<img src="'+src+'">');
- }else{
- $('#file_name').text($(this)[0].files[0].name)
- }
- });
- $("#btn_add").click(function(){
- if($('#add_form').valid()){
- $('#add_form').submit();
- }
- });
- //表单验证
- $('#add_form').validate({
- errorPlacement: function(error, element){
- var error_td = element.parent('dd').children('span');
- error_td.append(error);
- },
- rules : {
- txt_template_title: {
- required : true,
- rangelength:[0,100]
- },
- txt_template_total: {
- required : true,
- digits : true
- },
- txt_template_limit: {
- required : true,
- number : true
- },
- txt_template_describe: {
- required : true
- }
- },
- messages : {
- txt_template_title: {
- required : '<i class="iconfont"></i>{$Think.lang.voucher_template_title_error}',
- rangelength : '<i class="iconfont"></i>{$Think.lang.voucher_template_title_error}'
- },
- txt_template_total: {
- required : '<i class="iconfont"></i>{$Think.lang.voucher_template_total_error}',
- digits : '<i class="iconfont"></i>{$Think.lang.voucher_template_total_error}'
- },
- txt_template_limit: {
- required : '<i class="iconfont"></i>{$Think.lang.voucher_template_limit_error}',
- number : '<i class="iconfont"></i>{$Think.lang.voucher_template_limit_error}'
- },
- txt_template_describe: {
- required : '<i class="iconfont"></i>{$Think.lang.voucher_template_describe_error}'
- }
- }
- });
- });
- </script>
- {/block}
|