123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- {extend name="public/container"}
- {block name="head_top"}
- {/block}
- {block name="content"}
- <style>
- .btn-outline{
- border:none;
- }
- .btn-outline:hover{
- background-color: #0e9aef;
- color: #fff;
- }
- .layui-form-item .layui-btn {
- margin-top: 5px;
- margin-right: 10px;
- }
- .layui-btn-primary{
- margin-right: 10px;
- margin-left: 0!important;
- }
- label{
- margin-bottom: 0!important;
- margin-top: 4px;
- }
- </style>
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15" id="app">
- <!--搜索条件-->
- <!-- 中间详细信息-->
- <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
- v-for="item in badge" v-cloak="" v-if="item.count > 0">
- </div>
- <!--enb-->
- </div>
- <!--列表-->
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-header">优惠卡</div>
- <div class="layui-card-body">
- <table class="layui-hide" id="List" lay-filter="List"></table>
- <script type="text/html" id="nickname">
- {{d.nickname}}/{{d.uid}}
- </script>
- <script type="text/html" id="status">
- {{# if(d.status==0){ }}
- 未使用
- {{# } }}
- {{# if(d.status==1){ }}
- 已使用
- {{# } }}
- </script>
- <script type="text/html" id="use">
- {{# if(d.use==0){ }}
- 失效
- {{# } }}
- {{# if(d.use==1){ }}
- 正常
- {{# } }}
- {{# if(d.use==-1){ }}
- 过期
- {{# } }}
- </script>
- <script type="text/html" id="type">
- {{# if(d.type==1){ }}
- 限时
- {{# } }}
- {{# if(d.type==2){ }}
- 限次
- {{# } }}
- </script>
- <script type="text/html" id="act">
- <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('编辑','{:Url('equity')}?id={{d.id}}',{h:1100,w:1100})">
- 详情
- </button>
- <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
- 删除
- </button>
- </script>
- </div>
- </div>
- </div>
- </div>
- <!--end-->
- </div>
- <script src="{__ADMIN_PATH}js/layuiList.js"></script>
- {/block}
- {block name="script"}
- <script>
- layList.form.render();
- var id = {$id};
- layList.tableList('List', "{:Url('equity_list')}?id="+id, function () {
- return [
- {type: 'checkbox'},
- {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id', align: 'center'},
- {field: 'name', title: '优惠类型', align: 'center'},
- {field: 'type', title: '剩余次数',templet: '#type', align: 'center'},
- {field: 'number', title: '剩余次数', align: 'center'},
- {field: 'use', title: '状态', templet: '#use', align: 'center'},
- {field: 'create_time', title: '时间', align: 'center'},
- // {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},
- ];
- });
- //查询
- layList.search('search',function(where){
- layList.reload(where,true);
- });
- layList.switch('is_show',function (odj,value) {
- if(odj.elem.checked==true){
- layList.baseGet(layList.Url({a:'set_show',p:{is_show:1,id:value}}),function (res) {
- layList.msg(res.msg);
- });
- }else{
- layList.baseGet(layList.Url({a:'set_show',p:{is_show:0,id:value}}),function (res) {
- layList.msg(res.msg);
- });
- }
- });
- //点击事件绑定
- layList.tool(function (event,data,obj) {
- switch (event) {
- case 'delete':
- var url=layList.U({c:'water.water_cate',a:'delete',q:{id:data.id}});
- var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
- $eb.$swal('delete',function(){
- $eb.axios.get(url).then(function(res){
- if(res.status == 200 && res.data.code == 200) {
- $eb.$swal('success',res.data.msg);
- obj.del();
- location.reload();
- }else
- return Promise.reject(res.data.msg || '删除失败')
- }).catch(function(err){
- $eb.$swal('error',err);
- });
- },code)
- break;
- case 'open_image':
- $eb.openImage(data.image);
- break;
- case 'edit':
- location.href = layList.U({a:'edit',q:{id:data.id}});
- break;
- }
- })
- //改状态
- layList.switch('status',function (odj,value) {
- if(odj.elem.checked==true){
- layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:1,id:value}}),function (res) {
- layList.msg(res.msg, function () {
- layList.reload();
- });
- });
- }else{
- layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:0,id:value}}),function (res) {
- layList.msg(res.msg, function () {
- layList.reload();
- });
- });
- }
- });
- </script>
- {/block}
|