You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
53
hyhproject/home2/view/default/shops/freights/freights.js
Executable file
53
hyhproject/home2/view/default/shops/freights/freights.js
Executable file
@ -0,0 +1,53 @@
|
||||
$(function(){
|
||||
areasByList();
|
||||
});
|
||||
//运费列表
|
||||
function areasByList(){
|
||||
$.post(WST.U('home/shopfreights/listProvince'),'',function(data){
|
||||
var json = WST.toJson(data);
|
||||
var gettpl = document.getElementById('list').innerHTML;
|
||||
laytpl(gettpl).render(json, function(html){
|
||||
$('#list-info').html(html);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function treeOpen(obj,id){
|
||||
if( $(obj).attr('class').indexOf('active') > -1 ){
|
||||
$(obj).removeClass('active');
|
||||
$(obj).html('<img class="wst-lfloat" style="margin-top:-3px;" src="'+WST.conf.ROOT+'/wstmart/home/view/default/img/seller_icon_zk.png">');
|
||||
$('.text_'+id).show();
|
||||
$('.tree_'+id).show();
|
||||
}else{
|
||||
$(obj).addClass('active');
|
||||
$(obj).html('<img class="wst-lfloat" style="margin-top:-3px;" src="'+WST.conf.ROOT+'/wstmart/home/view/default/img/seller_icon_sq.png">');
|
||||
$('.text_'+id).hide();
|
||||
$('.tree_'+id).hide();
|
||||
}
|
||||
}
|
||||
|
||||
function freightOnblur(obj,id,v){
|
||||
$postage = $(obj).val();
|
||||
if(v == 0){
|
||||
$('.possort').val($postage);
|
||||
}else{
|
||||
$('.price_'+id).val($postage);
|
||||
}
|
||||
}
|
||||
|
||||
function freightSubmit(){
|
||||
var params = WST.getParams('.ipt');
|
||||
var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000});
|
||||
$.post(WST.U('home/shopfreights/edit'),params,function(data,textStatus){
|
||||
layer.close(loading);
|
||||
var json = WST.toJson(data);
|
||||
if(json.status=='1'){
|
||||
WST.msg(json.msg,{icon:1});
|
||||
setTimeout(function(){
|
||||
//location.href=WST.U('home/shopfreights/index');
|
||||
},2000);
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
});
|
||||
}
|
61
hyhproject/home2/view/default/shops/freights/list.html
Executable file
61
hyhproject/home2/view/default/shops/freights/list.html
Executable file
@ -0,0 +1,61 @@
|
||||
{extend name="default/shops/base" /}
|
||||
{block name="title"}运费设置 - 卖家中心{__block__}{/block}
|
||||
{block name="css"}{/block}
|
||||
|
||||
{block name="content"}
|
||||
|
||||
<div class="wst-body">
|
||||
<div class="wst-shop-head"><span>运费设置</span></div>
|
||||
<div class="wst-clear"></div>
|
||||
<form autocomplete="off">
|
||||
<table id="cat_list_tab" class='wst-list wst-form'>
|
||||
<thead>
|
||||
<tr class="wst-colour">
|
||||
<th class="wst-fre-th">名称</th>
|
||||
<th class="wst-fre-th" width="200">运费</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="wst-fre-hov">
|
||||
<td class="wst-fre-td">
|
||||
<span style='width:400px;height:22px;'>默认运费</span>
|
||||
</td>
|
||||
<td><input type='text' style='width:80px;' value="{$shFreight['freight']}" onblur="javascript:freightOnblur(this,'',0)" onkeyup="javascript:WST.isChinese(this,1)" onkeypress="return WST.isNumberKey(event)"/></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody id="list-info"></tbody>
|
||||
</table>
|
||||
<div class='wst-tbar-group' style='height:76px;text-align:center;'>
|
||||
<a class='s-btn' style='margin-top:30px;width:100px;height: 30px;' type="button" onclick='javascript:freightSubmit()'>保 存</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script id="list" type="text/html">
|
||||
{{# for(var i = 0; i < d.length; i++){ }}
|
||||
<tr isLoad='1' class="wst-fre-hov">
|
||||
<td class="wst-fre-td">
|
||||
<span class='wst-tree-open active' onclick='javascript:treeOpen(this,"{{ d[i].areaId }}")'><img class="wst-lfloat" style="margin-top:-3px;" src="__STYLE__/img/seller_icon_sq.png"></span>
|
||||
<span style='width:400px;height:22px;'>{{ d[i].areaName }}</span>
|
||||
</td>
|
||||
<td><input class='possort text_{{ d[i].areaId }}' type='text' style='width:80px;display:none;' value="" onblur='javascript:freightOnblur(this,"{{ d[i].areaId }}",2)' onkeyup="javascript:WST.isChinese(this,1)" onkeypress="return WST.isNumberKey(event)"/></td>
|
||||
</tr>
|
||||
{{# for(var j = 0; j < d[i].listProvince.length; j++){ }}
|
||||
<tr class="tree_{{ d[i].listProvince[j].parentId }} hide wst-fre-hov">
|
||||
<td class="wst-fre-td">
|
||||
<span class="wst-tree-second"></span>
|
||||
<span style='width:400px;height:22px;'>{{ d[i].listProvince[j].areaName }}</span>
|
||||
</td>
|
||||
{{#if(typeof(d[i].listProvince[j].freight)=='object'){}}
|
||||
<td><input class='price_{{ d[i].listProvince[j].parentId }} possort ipt' id="{{ d[i].listProvince[j].areaId }}" type='text' style='width:80px;' value="{$shFreight['freight']}" onkeyup="javascript:WST.isChinese(this,1)" onkeypress="return WST.isNumberKey(event)"/></td>
|
||||
{{# }else{ }}
|
||||
<td><input class='price_{{ d[i].listProvince[j].parentId }} possort ipt' id="{{ d[i].listProvince[j].areaId }}" type='text' style='width:80px;' value="{{d[i].listProvince[j].freight}}" onkeyup="javascript:WST.isChinese(this,1)" onkeypress="return WST.isNumberKey(event)"/></td>
|
||||
{{# } }}
|
||||
</tr>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
</script>
|
||||
{/block}
|
||||
{block name="footer"}
|
||||
{include file="default/footer" /}
|
||||
{/block}
|
||||
{block name="js"}<script type='text/javascript' src='__STYLE__/shops/freights/freights.js?v={$v}'></script>{/block}
|
Reference in New Issue
Block a user