duxin 2 жил өмнө
parent
commit
e9db3e48b9

+ 14 - 11
core/src/qfw/manage/exhibition.go

@@ -71,16 +71,14 @@ func (a *Exhibition) SaveExhibition() error {
 		data["contacts"] = a.GetString("s_contacts")
 		data["contact_phone"] = a.GetString("contact_phone")
 		data["province"] = a.GetString("province")
-
+		data["specific_location"] = a.GetString("specific_location")
+		tm := time.Now().Unix()
 		data["city"] = a.GetString("city")
-		data["specific_location"] = a.GetStringComm("s_content")
 		data["hall"] = a.GetString("hall")
-		data["website_address"] = a.GetSession("website_address")
-		data["activity_introduction"] = a.GetStringComm("activity_introduction")
+		data["website_address"] = a.GetString("website_address")
+		data["activity_introduction"] = a.GetStringComm("s_content")
 		data["picture"] = a.GetString("s_pic")
-		data["status"] = a.GetSession("status")
-		data["creation_time"] = time.Now().Unix()
-		tm := time.Now().Unix()
+		data["creation_time"] = tm
 		switch {
 		case tm < startTime:
 			data["status"] = 0
@@ -154,12 +152,16 @@ func (e *Exhibition) ManageExhibitionList(list string) error {
 // GetExhibitionJsonList 取得列表JSON
 func (e *Exhibition) GetExhibitionJsonList() error {
 	if e.Method() == "POST" {
+		count := Count("exhibition_info", nil)
+		if count == 0 {
+			return nil
+		}
 		size, _ := e.GetInteger("perPage")
 		currentPage, _ := e.GetInteger("currentPage")
 		if size <= 0 || size > 100 {
 			size = 20
 		}
-		data := Find("exhibition_info", nil, "{'creation_time':-1}", nil, false, (currentPage-1)*size, size)
+		data := Find("exhibition_info", nil, `{"creation_time": -1}`, nil, false, (currentPage-1)*size, size)
 		for _, v := range *data {
 			release := v["creation_time"]
 			v["creation_time"] = util.FormatDateWithObj(&release, util.Date_Short_Layout)
@@ -169,6 +171,7 @@ func (e *Exhibition) GetExhibitionJsonList() error {
 			v["end_time"] = util.FormatDateWithObj(&endTime, util.Date_Short_Layout)
 		}
 		res := map[string]interface{}{}
+		res["totalRows"] = count
 		res["data"] = data
 		res["currentPage"] = currentPage
 		e.ServeJson(&res)
@@ -192,12 +195,12 @@ func (n *Exhibition) NewsExhibition(_id string) error {
 				(*r)["creation_time"] = util.FormatDateWithObj(&data_1, util.Date_Full_Layout)
 				startTime := (*r)["start_time"]
 				(*r)["start_time"] = util.FormatDateWithObj(&startTime, util.Date_Full_Layout)
-				endTime := (*r)["ent_time"]
-				(*r)["ent_time"] = util.FormatDateWithObj(&endTime, util.Date_Full_Layout)
+				endTime := (*r)["end_time"]
+				(*r)["end_time"] = util.FormatDateWithObj(&endTime, util.Date_Full_Layout)
 				(*r)["activity_introduction"] = template.HTML((*r)["activity_introduction"].(string))
 				(*r)["s_preurl"] = SysConfig.Jyadd + se.EncodeString((*r)["_id"].(string)) + ".html"
 				n.T = *r
-				return n.Render("/manage/newscontent.html")
+				return n.Render("/manage/newExhibition.html")
 			} else {
 				return n.Render("/manage/errcontent.html")
 			}

+ 6 - 4
core/src/web/templates/manage/addExhibition.html

@@ -225,14 +225,16 @@
 
               <div class="form-group">
                 <label id="col-sm-2" class="col-sm-2 control-label" for="name">开始时间:</label>
-                <div class="col-sm-3">
+                <div class="col-sm-2">
                   <input style="background:#fff url({{Msg "seo" "cdn"}}/images/datePicker.gif) no-repeat right;"  id="s_start_time"  datatype="*"
                   onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" name="s_start_time" class="form-control" placeholder="请输入开始时间!" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="ture" />
                 </div>
-                <label id="col-sm-2" class="col-sm-1 control-label" for="name">结束时间:</label>
-                <div class="col-sm-3">
+                <div class="col-sm-1">
+                </div>
+                <label id="col-sm-1" class="col-sm-1 control-label" for="name">结束时间:</label>
+                <div class="col-sm-2">
                   <input style="background:#fff url({{Msg "seo" "cdn"}}/images/datePicker.gif) no-repeat right;"  id="s_end_time"  datatype="*"
-                  onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" name="s_start_time" class="form-control" placeholder="请输入结束时间!" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="ture" />
+                  onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" name="s_end_time" class="form-control" placeholder="请输入发布时间!" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="ture" />
                 </div>
                 <div class="col-sm-4">
                 </div>

+ 1 - 1
core/src/web/templates/manage/exhibitionlist.html

@@ -68,7 +68,7 @@
                 ,callback:function(ct,cd,val,k,m){
                   var v=ct["i_status"]==1?ct["s_title"]:cd;
                   var id = ct["_id"]
-                  if(v) v="<a href='/manage/content/"+id+"'>"+v+"</a>"
+                  if(v) v="<a href='/manage/exhibition/"+id+"'>"+v+"</a>"
                   return v
                 }
               },

+ 18 - 45
core/src/web/templates/manage/newExhibition.html

@@ -91,37 +91,8 @@
         {{include "/manage/slider.html"}}
 
         <div id="content">
-            <!-- 文章内容 -->
-            <div id="first" class="container-fluid">
-                <div style="margin-top:0px;" class="row-fluid">
-                    <div class="span12">
-                        <div class="widget-box">
-                            <div class="widget-content nopadding">
-                                <div style="width:90%; margin:auto; margin-bottom:80px;">
-                                    <div style="top: 6px;position: absolute;right: 52px" class="controls pull-right">
-                                        {{if  eq .T.s_contenttype "appxxtz"}}
-                                        <!--							<span><button class="btn btn-info" onClick="window.open('{{.T.s_preurl}}')" type="button">预览</button></span>{{end}}-->
-                                        <span style="margin-left:15px;"><button class="btn btn-info" onClick="editarticle();" type="button">编辑</button></span>
-                                        <span style="margin-left:15px;"><button class="btn btn-info" onClick="delearticle(1);" type="button">删除</button></span></div>
-                                    <span style="margin-left:15px;"><button class="btn btn-info" onClick="delearticle(2);" type="button">删除</button></span></div>
-
-                                    <h4><p style="font-weight:bold; border-bottom:1px dashed #98D6DC; padding-bottom:20px;" class="text-center">{{.T.s_title}}</p></h4>
-                                    <div>
-                                        <p style="font-size:12px; margin-bottom:30px;" class="text-center">{{if eq .T.s_author ""}}发布人:{{.T.s_editorname}}{{else}}作者:{{.T.s_author}}{{end}}    发布日期: {{if not .T.releasetime}}{{.T.l_createdate}} {{else}} {{.T.releasetime}}{{end}}   (文章来源:<a style="font-size:14px; color:#0000FF;" target="_blank"  href="{{.T.s_url}}">{{.T.s_source}}</a>)</p>                 </div>
-                                    <div class="index-new-image" style="font-size:14px; line-height:25px; width:90%; margin:auto;">
-                                        {{.T.s_content}}
-                                        <span style="display:none;">{{.T._id}}</span>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-
-            </div>
-
             <!-- 修改文章 -->
-            <div id="second"  style="display: none;" class="widget-box">
+            <div id="second" class="widget-box">
                 <div class="widget-content nopadding">
                     <div style="width:90%; margin:auto; margin-bottom:80px; margin-top:50px;">
                         <form class="registerform form-horizontal" role="form" id="updatearticle" method="post">
@@ -129,7 +100,7 @@
                             <div class="form-group">
                                 <label id="col-sm-2" class="col-sm-2 control-label" for="name">展会标题:</label>
                                 <div class="col-sm-6">
-                                    <input  type="text" name="s_title" value="{{.T.s_title}}" class="form-control" placeholder="请输入展会标题">
+                                    <input  type="text" name="s_title" value="{{.T.title}}" class="form-control" placeholder="请输入展会标题">
                                 </div>
                                 <div class="col-sm-4">
                                 </div>
@@ -139,10 +110,10 @@
                                 <label id="col-sm-2" class="col-sm-2 control-label" for="name">信息类型:</label>
                                 <div class="col-sm-2">
                                     <select name="s_type" class="form-control">
-                                        <option value=1 {{if  eq .T.s_type 1}} selected="selected" {{end}}> 展会 </option>
-                                        <option value=2 {{if  eq .T.s_type 2}} selected="selected" {{end}}> 高峰论坛 </option>
-                                        <option value=3 {{if  eq .T.s_type 3}} selected="selected" {{end}}> 行业交流会 </option>
-                                        <option value=4 {{if  eq .T.s_type 4}} selected="selected" {{end}}> 小型沙龙会 </option>
+                                        <option value=1 {{if  eq .T.type 1}} selected="selected" {{end}}> 展会 </option>
+                                        <option value=2 {{if  eq .T.type 2}} selected="selected" {{end}}> 高峰论坛 </option>
+                                        <option value=3 {{if  eq .T.type 3}} selected="selected" {{end}}> 行业交流会 </option>
+                                        <option value=4 {{if  eq .T.type 4}} selected="selected" {{end}}> 小型沙龙会 </option>
                                     </select>
                                 </div>
                             </div>
@@ -150,7 +121,7 @@
                             <div class="form-group">
                                 <label id="col-sm-2" class="col-sm-2 control-label" for="name">主办单位:</label>
                                 <div class="col-sm-2">
-                                    <input  type="text" name="s_organizers" class="form-control" value="{{.T.s_organizers}}" placeholder="请输入主办单位">
+                                    <input  type="text" name="s_organizers" class="form-control" value="{{.T.organizers}}" placeholder="请输入主办单位">
                                 </div>
                                 <div class="col-sm-4 text-center">
                                 </div>
@@ -159,7 +130,7 @@
                             <div class="form-group">
                                 <label id="col-sm-2" class="col-sm-2 control-label" for="name">联系人:</label>
                                 <div class="col-sm-2">
-                                    <input  type="text" name="s_contacts" class="form-control" value="{{.T.s_contacts}}" placeholder="请输入联系人">
+                                    <input  type="text" name="s_contacts" class="form-control" value="{{.T.contacts}}" placeholder="请输入联系人">
                                 </div>
                                 <div class="col-sm-4 text-center">
                                 </div>
@@ -222,7 +193,7 @@
                             <div class="form-group">
                                 <label id="col-sm-2" class="col-sm-2 control-label" for="name">具体地点:</label>
                                 <div class="col-sm-4">
-                                    <input  type="text" name="specific_location" class="form-control" value="{{.T.specific_location}}" placeholder="请输入具体地点">
+                                    <input  type="text" name="website_address" class="form-control" value="{{.T.specific_location}}" placeholder="请输入具体地点">
                                 </div>
                                 <div class="col-sm-4 text-center">
                                 </div>
@@ -248,14 +219,16 @@
 
                             <div class="form-group">
                                 <label id="col-sm-2" class="col-sm-2 control-label" for="name">开始时间:</label>
-                                <div class="col-sm-3">
+                                <div class="col-sm-2">
                                     <input style="background:#fff url({{Msg "seo" "cdn"}}/images/datePicker.gif) no-repeat right;"  id="s_start_time"  datatype="*"
                                     onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" name="s_start_time" class="form-control" placeholder="请输入开始时间!" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="ture" value="{{.T.start_time}}"/>
                                 </div>
-                                <label id="col-sm-2" class="col-sm-1 control-label" for="name">结束时间:</label>
-                                <div class="col-sm-3">
+                                <div class="col-sm-1">
+                                </div>
+                                <label id="col-sm-1" class="col-sm-1 control-label" for="name">结束时间:</label>
+                                <div class="col-sm-2">
                                     <input style="background:#fff url({{Msg "seo" "cdn"}}/images/datePicker.gif) no-repeat right;"  id="s_end_time"  datatype="*"
-                                    onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" name="s_start_time" class="form-control" placeholder="请输入结束时间!" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="ture" value="{{.T.end_time}}"/>
+                                    onFocus="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" name="s_end_time" class="form-control" placeholder="请输入发布时间!" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="ture" value="{{.T.end_time}}"/>
                                 </div>
                                 <div class="col-sm-4">
                                 </div>
@@ -528,16 +501,16 @@
         clickCount++;
     }
 
-    function delearticle(status){
+    function delearticle(){
         Dialog.confirm('警告:您确认要删除吗?',function(){
             $.ajax({
                 type:'post',
                 url:'/manage/deleteExhibition',
-                data:{_id:'{{.T._id}}',status:{{status}}},
+                data:{_id:'{{.T._id}}',status:{{"1"}}},
             cache:false,
                 dataType:'json',
                 success:function(data){
-                Dialog.alert(data.msg,function(){location.href ="/manage/articlelist"});
+                Dialog.alert(data.msg,function(){location.href ="/manage/exhibitionlist"});
             }
         });
         })