Commit 1e5d71e778b3a9e1052a176bbe7b63bb24f60b64

Authored by teemitop
1 parent b0f6edb1

删除商家活动

@@ -375,4 +375,12 @@ class Seller extends Common @@ -375,4 +375,12 @@ class Seller extends Common
375 $this->assign ( 'title','添加活动'); 375 $this->assign ( 'title','添加活动');
376 return $this->fetch(); 376 return $this->fetch();
377 } 377 }
  378 +
  379 + //删除活动
  380 + public function del_activity(){
  381 + $data = Request::except('file');
  382 + $res= file_get_contents(ON_LINE.'App.Seller.DelSellerActivity&sid='.$data['sid'].'&aid='.$data['aid']);
  383 + $res = json_decode($res,TRUE);
  384 + return $this->fetch('seller/seller_activity_list');
  385 + }
378 } 386 }
@@ -4,13 +4,14 @@ @@ -4,13 +4,14 @@
4 <legend>{$title}</legend> 4 <legend>{$title}</legend>
5 </fieldset> 5 </fieldset>
6 <form class="layui-form layui-form-pane"> 6 <form class="layui-form layui-form-pane">
7 - <table class="layui-table"> 7 + <table class="layui-table" id="list" lay-filter="list">
8 <thead> 8 <thead>
9 <tr> 9 <tr>
10 <th lay-data="{field:'id', width:80, sort: true}">ID</th> 10 <th lay-data="{field:'id', width:80, sort: true}">ID</th>
11 <th lay-data="{field:'username', width:80, templet: '#usernameTpl'}">商家ID</th> 11 <th lay-data="{field:'username', width:80, templet: '#usernameTpl'}">商家ID</th>
12 <th lay-data="{field:'sex', width:80, sort: true, templet: '#sexTpl'}">标题</th> 12 <th lay-data="{field:'sex', width:80, sort: true, templet: '#sexTpl'}">标题</th>
13 <th lay-data="{field:'city', width:80}">描述</th> 13 <th lay-data="{field:'city', width:80}">描述</th>
  14 + <th lay-data="">操作</th>
14 </tr> 15 </tr>
15 </thead> 16 </thead>
16 {if $seller_activity} 17 {if $seller_activity}
@@ -20,11 +21,12 @@ @@ -20,11 +21,12 @@
20 <th>{$vo.sid}</th> 21 <th>{$vo.sid}</th>
21 <th>{$vo.title}</th> 22 <th>{$vo.title}</th>
22 <th>{$vo.desc}</th> 23 <th>{$vo.desc}</th>
  24 + <th><a href="{:url('del_activity')}?aid={$vo.id}&sid={$vo.sid}" class="layui-btn layui-btn-xs">删除</a></th>
23 </tr> 25 </tr>
24 {/foreach} 26 {/foreach}
25 {else} 27 {else}
26 <tr> 28 <tr>
27 - <th colspan="4" style="text-align:center">商家暂无活动</th> 29 + <th colspan="5" style="text-align:center">商家暂无活动</th>
28 </tr> 30 </tr>
29 {/if} 31 {/if}
30 </table> 32 </table>
@@ -55,8 +57,8 @@ @@ -55,8 +57,8 @@
55 </div> 57 </div>
56 {include file="common/foot"/} 58 {include file="common/foot"/}
57 <script> 59 <script>
58 - layui.use('form', function () {  
59 - var form = layui.form, $ = layui.jquery; 60 + layui.use(['form','table'], function () {
  61 + var form = layui.form, $ = layui.jquery,table = layui.table;
60 //根据菜品ID 修改对应菜品的GIF、视频url 62 //根据菜品ID 修改对应菜品的GIF、视频url
61 form.on('submit(submit)', function (data) { 63 form.on('submit(submit)', function (data) {
62 if(data.field.aid==0){ 64 if(data.field.aid==0){
@@ -74,12 +76,5 @@ @@ -74,12 +76,5 @@
74 } 76 }
75 }); 77 });
76 }) 78 })
77 -  
78 - //单选按钮显示隐藏  
79 - form.on('select(aid)', function(data){  
80 - var dataval=$(data.elem).find("option:selected").attr("data-val");  
81 - $("#txt").show();  
82 - $("#txt").html(dataval);  
83 - });  
84 }); 79 });
85 </script> 80 </script>