dispatch.html
9.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
{template 'common/header'}
{template 'common'}
<ul class="nav nav-tabs">
<li {if $operation == 'display' && $operExp == 'express'}class="active" {/if}><a href="{php echo $this->createWebUrl('express',array('op' =>'display'))}">快递管理</a></li>
<li {if $operation == 'post' && $operExp == 'express' && $express['id'] == ''} class="active" {/if}><a href="{php echo $this->createWebUrl('express',array('op' =>'post'))}">添加快递公司</a></li>
<li {if $operation == 'display' && $operExp == 'dispatch'} class="active" {/if}><a href="{php echo $this->createWebUrl('dispatch',array('op' =>'display'))}">配送管理</a></li>
<li {if $operation == 'post' && $operExp == 'dispatch' && $dispatch['id'] == ''} class="active" {/if}><a href="{php echo $this->createWebUrl('dispatch',array('op' =>'post'))}">添加配送方式</a></li>
{if !empty($express['id']) && $operation== 'post'}
<li class="active"><a href="{php echo $this->createWebUrl('express',array('op' =>'post','id'=>$express['id']))}">编辑快递公司</a></li>
{/if}
{if !empty($dispatch['id']) && $operation== 'post'}
<li class="active"><a href="{php echo $this->createWebUrl('dispatch',array('op' =>'post','id'=>$dispatch['id']))}">编辑配送方式</a></li>
{/if}
</ul>
{if $operation == 'display'}
<div class="main">
<div class="panel panel-default">
<div class="panel-heading">配送管理</div>
<div class="panel-body">
<div class="form-group">
<table class="table table-hover">
<thead class="navbar-inner">
<tr>
<th style="width:30px;">ID</th>
<th>显示顺序</th>
<th>配送名称</th>
<th>付款方式</th>
<th>首重价格</th>
<th>续重价格</th>
<th >操作</th>
</tr>
</thead>
<tbody>
{loop $list $item}
<tr>
<td>{$item['id']}</td>
<td>{$item['displayorder']}</td>
<td>{$item['dispatchname']}</td>
<td>
{if $item['dispatchtype']==0}货到付款{/if}
{if $item['dispatchtype']==1}微支付{/if}
{if $item['dispatchtype']==2}支付宝{/if}
{if $item['dispatchtype']==3}余额付款{/if}
</td>
<td>{$item['firstprice']}</td>
<td>{$item['secondprice']}</td>
<td style="text-align:left;"><a href="{php echo $this->createWebUrl('dispatch', array('op' => 'post', 'id' => $item['id']))}">修改</a> <a href="{php echo $this->createWebUrl('dispatch', array('op' => 'delete', 'id' => $item['id']))}">删除</a></td>
</tr>
{/loop}
</tbody>
</table>
{$pager}
</div>
</div>
</div>
</div>
{elseif $operation == 'post'}
<div class="main">
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data" onsubmit='return formcheck()'>
<input type="hidden" name="c" value="site" />
<input type="hidden" name="a" value="entry" />
<input type="hidden" name="m" value="wwx_fxxt" />
<input type="hidden" name="id" value="{$dispatch['id']}" />
<input name="token" type="hidden" value="{$_W['token']}" />
<div class="panel panel-default">
<div class="panel-heading">配送方式设置</div>
<div class="panel-body">
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">排序</label>
<div class="col-sm-1 col-xs-12">
<input type="text" name="displayorder" class="form-control" value="{$dispatch['displayorder']}" />
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class='red'>*</span>配送名称</label>
<div class="col-sm-5 col-xs-12">
<input type="text" name="dispatchname" id='dispatchname' class="form-control" value="{$dispatch['dispatchname']}" />
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">付款方式</label>
<div class="col-sm-5 col-xs-12">
<select class="form-control" name="dispatchtype" id="dispatchtype">
<option value="-1" >请选择付款方式</option>
{if !empty($setting['payment']['delivery']['switch'])}
<option value="0" {if $dispatch['dispatchtype']==0}selected{/if}>货到付款</option>
{/if}
{if !empty($setting['payment']['wechat']['switch'])}
<option value="1" {if $dispatch['dispatchtype']==1}selected{/if}>微信支付</option>
{/if}
{if !empty($setting['payment']['alipay']['switch'])}
<option value="2" {if $dispatch['dispatchtype']==2}selected{/if}>支付宝</option>
{/if}
{if !empty($setting['payment']['credit']['switch']) }
<option value="3" {if $dispatch['dispatchtype']==3}selected{/if}>余额付款</option>
{/if}
</select>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">重量设置</label>
<div class="col-sm-5 col-xs-12">
<div class="input-group input-medium">
<span class="input-group-addon">首重重量</span>
<select name="firstweight" id="firstweight" class="form-control input-medium" >
<option value="500" {if $dispatch['firstweight']==500}selected{/if}>0.5</option>
<option value="1000" {if $dispatch['firstweight']==1000 || empty($dispatch['firstweight'])}selected{/if}>1</option>
<option value="1200" {if $dispatch['firstweight']==1200}selected{/if}>1.2</option>
<option value="2000" {if $dispatch['firstweight']==2000}selected{/if}>2</option>
<option value="5000" {if $dispatch['firstweight']==5000}selected{/if}>5</option>
<option value="10000" {if $dispatch['firstweight']==10000}selected{/if}>10</option>
<option value="20000" {if $dispatch['firstweight']==20000}selected{/if}>20</option>
<option value="50000" {if $dispatch['firstweight']==50000}selected{/if}>50</option>
</select> <span class="input-group-addon">KG</span>
</div>
<br>
<div class="input-group input-medium">
<span class="input-group-addon">续重重量</span>
<select name="secondweight" id="secondweight" class="form-control input-medium" >
<option value="500" {if $dispatch['secondweight']==500}selected{/if}>0.5</option>
<option value="1000" {if $dispatch['secondweight']==1000 || empty($dispatch['secondweight'])}selected{/if}>1</option>
<option value="1200" {if $dispatch['secondweight']==1200}selected{/if}>1.2</option>
<option value="2000" {if $dispatch['secondweight']==2000}selected{/if}>2</option>
<option value="5000" {if $dispatch['secondweight']==5000}selected{/if}>5</option>
<option value="10000" {if $dispatch['secondweight']==10000}selected{/if}>10</option>
<option value="20000" {if $dispatch['secondweight']==20000}selected{/if}>20</option>
<option value="50000" {if $dispatch['secondweight']==50000}selected{/if}>50</option>
</select> <span class="input-group-addon">KG</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">价格设置</label>
<div class="col-sm-5 col-xs-12">
<div class="input-group input-medium">
<span class="input-group-addon">首重价格</span>
<input type="text" name="firstprice" id='firstprice' class="form-control" value="{$dispatch['firstprice']}" />
<span class="input-group-addon">元</span>
</div>
<br>
<div class="input-group input-medium">
<span class="input-group-addon">续重价格</span>
<input type="text" name="secondprice" id='secondprice' class="form-control" value="{$dispatch['secondprice']}" />
<span class="input-group-addon">元</span>
</div>
<span class='help-block'>根据重量来计算运费,当物品不足《首重重量》时,按照《首重费用》计算,超过部分按照《续重重量》和《续重费用》乘积来计算</span>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">快递公司</label>
<div class="col-sm-5 col-xs-12">
<select name='express' class="form-control">
<option value="" {if empty($dispatch['express'])}selected{/if}>{$express['express_name']}</option>
{loop $express $ex}
<option value="{$ex['id']}" {if $dispatch['express']==$ex['id']}selected{/if}>{$ex['express_name']}</option>
{/loop}
</select>
<a href="{php echo $this->createWebUrl('express',array('op' =>'post'))}">添加快递公司</a>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">介绍</label>
<div class="col-sm-9 col-xs-12">
<textarea name="description" class="form-control" cols="70" rows="10">{$dispatch['description']}</textarea>
</div>
</div>
<div class="form-group">
<input name="submit" type="submit" value="提交" class="btn btn-primary">
<input type="hidden" name="token" value="{$_W['token']}" />
</div>
</div>
</div>
</form>
</div>
<script language='javascript'>
function formcheck() {
if ($("#dispatchtype").val()==-1) {
alert( "请选择付款方式");
return false;
}
if ($("#dispatchname").isEmpty()) {
Tip.focus("dispatchname", "请填写配送方式名称!", "right");
return false;
}
if (!$("#firstprice").isNumber()) {
Tip.select("firstprice", "请填写数字首重价格!", "top");
return false;
}
if (!$("#secondprice").isNumber()) {
Tip.select("secondprice", "请填写数字续重价格!", "top");
return false;
}
return true;
}
$(function() {
$("#common_corp").change(function() {
var obj = $(this);
var sel = obj.find("option:selected");
$("#dispatch_name").val(sel.attr("data-name"));
$("#dispatch_url").val(sel.attr("data-url"));
});
})
</script>
{/if}
{template 'common/footer'}