release.html
3.9 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
{extend name="layout/default"}
{block name="title"}发起招标{/block}
{block name="title1"}{/block}
{block name="content"}
<div class="main">
<!-- 当前位置 -->
<div class="backNav">
<div class="backNav_Img"><img src="/static/image/icon14.png" alt=""></div>
<div class="back_nav">
<a href="/api/index/index">首页</a>
<span>></span>
<a href="/api/invitation/index?pid=9">招标招商</a>
<span>></span>
<a href="">发布招标</a>
</div>
<div class="backNav_Img2"><img src="/static/image/touxiang_img.png" alt=""></div>
</div>
<div class="tender_hairBox">
<h1 class="tender_rTxt">发起招标</h1>
<div class="tender_rBox">
<form id="form">
<div class="release_Li clearfix">
<label for=""><span>*</span>类 型</label>
<select name="" id="" class="release_op">
<option value="">请选择类型</option>
{foreach $style as $s}
<option value="">{$s.title}</option>
{/foreach}
</select>
</div>
<div class="release_Li clearfix">
<label for=""><span>*</span>标 题</label>
<input type="text" name="title" class="release_input" placeholder="请输入标题">
</div>
<div class="release_Li clearfix">
<label for=""><span>*</span>内 容</label>
<textarea placeholder="请输入内容" name="content" id="" cols="30" rows="10" class="release_textarea"></textarea>
</div>
<input type="hidden" name="image" id="image">
<div class="release_Li clearfix">
<label for=""><span>*</span>文 件</label>
<div class="release_file">
<input type="file" name="file" onchange="sc(this)" value="">
<div class="release_fileImg"><img src="/static/image/icon20.png" alt="" ></div>
</div>
</div>
</form>
<div class="release_btn">提交</div>
</div>
</div>
</div>
<script>
$('.release_op').change(function () {
$(this).css('color','black')
});
function sc(e){
var data = new FormData($('#form')[0]);
c(data);
$.ajax({
url: "/admin/ajax/upload",
type: 'POST',
data: data,
dataType: 'JSON',
cache: false,
processData: false,
contentType: false
}).done(function(ret){
if(ret['code']==1){
$("#image").val(ret.data.url);
$('.release_fileImg').find('img').attr('src',ret.data.url)
w('上传成功');
}else{
w('上传失败');
}
});
}
$(".release_btn").on("click",function () {
var data=$("#form").serialize();
if($(".release_op option:selected").text() == '请选择类型'){
w('请选择类型');
}else if($('.release_input').val() == ''){
w('请输入标题');
}else if($('.release_textarea').val() ==''){
w('请输入内容');
}else if($('.release_file input').val() == ''){
w('请选择文件');
}else{
ajax("/index/invitation/release",data,"post",function (res) {
w(res.msg);
},"");
}
})
</script>
{/block}