123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- {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="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-header">搜索条件</div>
- <div class="layui-card-body">
- <form class="layui-form layui-form-pane" action="">
- <div class="layui-form-item">
- <div class="layui-inline">
- <label class="layui-form-label" style="top: -4.5px">所有场次</label>
- <div class="layui-input-block">
- <select name="auction_id">
- <option value=" ">全部</option>
- {volist name='auction' id='vo'}
- <option value="{$vo.id}">{$vo.nickname}</option>
- {/volist}
- </select>
- </div>
- </div>
- <div class="layui-inline">
- <label class="layui-form-label" style="top: -4.5px">搜索</label>
- <div class="layui-input-block">
- <input type="text" name="store_name" class="layui-input" placeholder="商品名称,编号,拥有人">
- </div>
- </div>
- <div class="layui-inline">
- <label class="layui-form-label" style="top: -4.5px">是否挂售</label>
- <div class="layui-input-block">
- <select name="is_show">
- <option value="">全部</option>
- <option value="2">未挂售</option>
- <option value="1">已挂售</option>
- </select>
- </div>
- </div>
- <div class="layui-inline">
- <div class="layui-input-inline">
- <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
- <i class="layui-icon layui-icon-search"></i>搜索</button>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- <!-- 中间详细信息-->
- <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">
- <div class="layui-btn-container" id="container-action">
- <a class="layui-btn layui-btn-sm" href="{:Url('create')}">添加商品</a>
- <!-- <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
- </div>
- <table class="layui-hide" id="List" lay-filter="List"></table>
- <script type="text/html" id="image">
- <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
- </script>
- <script type="text/html" id="is_show">
- <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show' lay-text='上架|下架' {{ d.is_show == 1 ? 'checked' : '' }}>
- </script>
- <script type="text/html" id="frozen">
- <input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='frozen' lay-text='冻结|解冻' {{ d.frozen == 1 ? 'checked' : '' }}>
- </script>
- <script type="text/html" id="act">
- <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('修改所属人','{:Url('belonging')}?id={{d.id}}',{h:500,w:500})">
- 所属
- </button>
- <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='fz'>
- 复制
- </button>
- <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='edit'>
- 编辑
- </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>
- //实例化form
- layList.form.render();
- layList.tableList('List', "{:Url('list')}", function () {
- return [
- {type: 'checkbox'},
- {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
- {field: 'image', title: '封面', templet: '#image', align: 'center',width: '5%'},
- {field: 'name', title: '商品名', templet: '#nickname', align: 'center'},
- {field: 'au_name', title: '场次', templet: '#auction_name', align: 'center'},
- {field: 'nickname', title: '拥有人', templet: '#nickname', align: 'center'},
- {field: 'price', title: '原价', templet: '#price', align: 'center',style : 'color: #DC143C;'},
- {field: 'hanging_price', title: '挂售价格', templet: '#hanging_price', align: 'center',style : 'color: #DC143C;'},
- {field: 'fictitious_price', title: '虚拟价格', templet: '#fictitious_price', align: 'center',style : 'color: #DC143C;'},
- {field: 'is_show', title: '状态', templet: '#is_show', align: 'center'},
- {field: 'rise', title: '涨幅%', templet: '#rise', align: 'center'},
- {field: 'deduct', title: '扣除%', templet: '#deduct', align: 'center'},
- {field: 'give', title: '赠送%', templet: '#deduct', align: 'center'},
- {field: 'sort', title: '排序', templet: '#sort', align: 'center'},
- {field: 'time', title: '挂售时间', templet: '#time', align: 'center'},
- {field: 'frozen', title: '冻结状态', templet: '#frozen', align: 'center'},
- {field: 'create_time', title: '创建时间', templet: '#create_time', align: 'center'},
- {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '10%'},
- ];
- });
- //点击事件绑定
- layList.tool(function (event,data,obj) {
- switch (event) {
- case 'delete':
- var url=layList.U({c:'auction.auction_product',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':
- layList.createModalFrame(data.name+'-修改',layList.U({a:'edit',q:{id:data.id}}),{h:750,w:1300})
- break;
- case 'fz':
- layList.createModalFrame(data.name+'-复制',layList.U({a:'fz',q:{id:data.id}}),{h:750,w:1300})
- break;
- }
- })
- //查询
- layList.search('search',function(where){
- console.log(111);
- layList.reload(where,true);
- });
- //改状态
- layList.switch('is_show',function (odj,value) {
- if(odj.elem.checked==true){
- layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_status',p:{status:1,id:value}}),function (res) {
- layList.msg(res.msg, function () {
- layList.reload();
- });
- });
- }else{
- layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_status',p:{status:0,id:value}}),function (res) {
- layList.msg(res.msg, function () {
- layList.reload();
- });
- });
- }
- });
- //改状态
- layList.switch('frozen',function (odj,value) {
- if(odj.elem.checked==true){
- layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_frozen',p:{status:1,id:value}}),function (res) {
- layList.msg(res.msg, function () {
- layList.reload();
- });
- });
- }else{
- layList.baseGet(layList.Url({c:'auction.auctionProduct',a:'set_frozen',p:{status:0,id:value}}),function (res) {
- layList.msg(res.msg, function () {
- layList.reload();
- });
- });
- }
- });
- </script>
- {/block}
|