_brand2.html
7.39 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
<include file="public/min-header"/>
<div class="wrapper">
<include file="public/breadcrumb"/>
<section class="content">
<!-- Main content -->
<div class="container-fluid">
<div class="pull-right">
<a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
<a onclick="get_help(this)" data-url="http://www.tp-shop.cn/Doc/Indexbbc/article/id/1072/developer/user.html" class="btn btn-default" href="javascript:;"><i class="fa fa-question-circle"></i> 帮助</a>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list"></i> 品牌详情</h3>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab_tongyong" data-toggle="tab">商品类型</a></li>
</ul>
<!--表单数据-->
<form method="post" id="addEditBrandForm" onsubmit="return checkName();">
<!--通用信息-->
<div class="tab-content">
<div class="tab-pane active" id="tab_tongyong">
<table class="table table-bordered">
<tbody>
<tr>
<td>品牌名称:</td>
<td>
<input type="text" value="{$brand.name}" name="name" class="form-control" style="width:200px;"/>
<span id="err_name" style="color:#F00; display:none;">品牌名称不能为空</span>
</td>
</tr>
<tr>
<td>品牌网址:</td>
<td>
<input type="text" value="{$brand.url}" name="url" class="form-control" style="width:250px;"/>
<span id="err_url" style="color:#F00; display:none;"></span>
</td>
</tr>
<tr>
<td>所属分类:</td>
<td>
<div class="col-sm-3">
<select name="cat_id1" id="cat_id1" onchange="get_category(this.value,'cat_id2','0');" class="form-control" style="width:250px;margin-left:-15px;">
<option value="0">请选择分类</option>
<foreach name="cat_list" item="v" >
<option value="{$v[id]}" <if condition="$v[id] eq $brand[cat_id1]"> selected="selected" </if>>{$v[name]}</option>
</foreach>
</select>
</div>
<div class="col-sm-3">
<select name="cat_id2" id="cat_id2" class="form-control" style="width:250px;margin-left:-15px;">
<option value="0">请选择分类</option>
</select>
</div>
</td>
</tr>
<tr>
<td>品牌logo:</td>
<td>
<div class="col-sm-3">
<input type="text" value="{$brand.logo}" name="logo" id="logo" class="form-control" style="width:350px;margin-left:-15px;"/>
</div>
<div class="col-sm-3">
<input onclick="GetUploadify(1,'logo','brand');" type="button" class="btn btn-default" value="上传logo"/>
</div>
</td>
</tr>
<tr>
<td>品牌排序:</td>
<td>
<input type="text" value="{$brand.sort}" name="sort" class="form-control" style="width:200px;" placeholder="50"/>
</td>
</tr>
<tr>
<td>品牌描述:</td>
<td>
<textarea rows="4" cols="60" name="desc">{$brand.desc}</textarea>
<span id="err_desc" style="color:#F00; display:none;"></span>
</td>
</tr>
<if condition="$brand[status] gt 0">
<tr>
<td>审核状态:</td>
<td>
<input type="radio" name="status" value="0" />审核通过
<input type="radio" name="status" value="2" <if condition="$brand[status] eq 2">checked="checked"</if> />审核失败
</td>
</tr>
</if>
</tbody>
</table>
</div>
</div>
<div class="pull-right">
<input type="hidden" name="id" value="{$brand.id}">
<input type="hidden" name="p" value="{$_GET[p]}">
<button class="btn btn-primary" data-toggle="tooltip" type="submit" data-original-title="保存">保存</button>
</div>
</form><!--表单数据-->
</div>
</div>
</div> <!-- /.content -->
</section>
</div>
<script>
// 判断输入框是否为空
function checkName(){
layer.msg('加载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '10px', time:100000}) ;
var name = $("#addEditBrandForm").find("input[name='name']").val();
if($.trim(name) == '')
{
layer.closeAll();
$("#err_name").show();
return false;
}
return true;
}
window.onload = function(){
if({$brand.cat_id2} > 0 ){
get_category($("#cat_id1").val(),'cat_id2',{$brand.cat_id2});
}
}
</script>
</body>
</html>