payment_edit.html
5.48 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
{echo:JS::import('form');}
{echo:JS::import('editor');}
{echo:JS::import('dialog?skin=brief');}
{echo:JS::import('dialogtools');}
<script>
var description , note;
var items = [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'link'];
KindEditor.ready(function(K) {
note = K.create('textarea[name="note"]', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
items : items
});
});
KindEditor.ready(function(K) {
description = K.create('textarea[name="description"]', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
items : items
});
});
</script>
<h1 class="page_title">支付方式配置</h1>
<form action="{url:/admin/payment_save}" method="post" callback="check_invalid" >
{if:isset($id)}
<input type="hidden" name="id" value="{$id}">
{/if}
<input type="hidden" name="plugin_id" value="{$plugin_id|$pay_plugin['id']}">
<div class="form2">
<dl class="lineD">
<dt><b class="red">*</b>支付方式名称:</dt>
<dd>
<input class="normal" name="pay_name" type="text" value="{$pay_name|$pay_plugin['name']}" pattern="required" alt="支付方式名称不能为空!" /><label> 用来显示的支付名称!</label>
</dd>
</dl>
{list:items=$config_form}
{if:$item['type']=='string'}
<dl class="lineD">
<dt><b class="red">*</b>{$item['caption']}:</dt>
<dd>
<input class="normal" name="{$item['field']}" pattern="required" type="text" value="" />
</dd>
</dl>
{elseif:$item['type']=='select'}
{set:$options = explode(',',$item['options']);}
<dl class="lineD">
<dt><b class="red">*</b>{$item['caption']}:</dt>
<dd>
<select name="{$item['field']}">
{list:items=$options item=$option}
{set:$attrs = explode(':',$option);}
<option value="{$attrs[0]}">{$attrs[1]}</option>
{/list}
</select>
</dd>
</dl>
{/if}
{/list}
<dl class="lineD">
<dt><b class="red">*</b>手续费设置:</dt>
<dd>
<label><input type="radio" checked="checked" value="1" name="fee_type">百分比</label>
<label><input type="radio" value="2" name="fee_type">固定额度</label>
<p id="pay_fee">
费率:<input type="text" alt="费率不能为空!" pattern="required" value="{$pay_fee|0.00}" name="pay_fee" class="tiny"> % 说明:顾客将支付订单总金额乘以此费率作为手续费;
</p>
<p id="pay_fee_fix" style="display:none;">
金额:<input class="tiny" name="pay_fee_fix" value="{$pay_fee|0.00}" pattern="required" alt="金额不能为空!" type="text"> 元 说明:顾客每笔订单需要支付的手续费;
</p>
</dd>
</dl>
<dl class="lineD">
<dt><b class="red">*</b>排序:</dt>
<dd>
<input class="small" name="sort" type="text" value="{$sort}" pattern="int" alt="排序不能为空!" />
</dd>
</dl>
<dl class="lineD">
<dt><b class="red">*</b>是否开启:</dt>
<dd>
<label class='attr'><input name="status" type="radio" value="0" checked="checked" />开启</label>
<label class='attr'><input name="status" type="radio" value="1" />关闭</label>
<label></label>
</dd>
</dl>
<dl class="lineD">
<dt><b class="red">*</b>支持终端:</dt>
<dd>
<label class='attr'><input name="client_type" type="radio" value="0" checked="checked" />PC</label>
<label class='attr'><input name="client_type" type="radio" value="1" />移动</label>
<label class='attr'><input name="client_type" type="radio" value="2" />PC+移动</label>
<label></label>
</dd>
</dl>
<dl class="lineD">
<dt><b class="red">*</b>简述:</dt>
<dd>
<textarea class="normal" name="description" style="width:400px;" >{$description|$pay_plugin['description']}</textarea>
</dd>
</dl>
<dl class="lineD">
<dt><b class="red"></b>支付说明:</dt>
<dd>
<textarea id="note" name="note" style="width:700px;height:180px;visibility:hidden;">{$note}</textarea>
<label>此信息会展示在用户的支付页面</label>
</dd>
</dl>
<div style="text-align:center;margin-top:20px;">
<input type="submit" class="focus_button" value="提交">
<input type="reset" value="重置" class="button"></div>
</div>
</form>
<script language="javascript">
//DOM加载完毕
$(function(){
var form = new Form();
form.setValue("status","{$status}");
form.setValue("fee_type","{$fee_type|1}");
form.setValue("client_type","{$client_type|0}");
changeFee({$fee_type|1});
//展示支付费用
$('input[name="fee_type"]').each(function(){
$(this).on("click",function(){
var value = $(this).val();
changeFee(value);
})
});
//
function changeFee(value){
if(value==1){
$("#pay_fee").show();
$("#pay_fee_fix").hide();
}else{
$("#pay_fee").hide();
$("#pay_fee_fix").show();
}
}
});
$(function(){
var form = new Form();
{if:isset($config) && $config}
{list:items=unserialize($config)}
form.setValue("{$key}","{$item}");
{/list}
{/if}
});
</script>