| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- @extends('layouts.base')
- @section('title', '分类广告')
- @section('content')
- <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
- <link rel="stylesheet" href="{{resource_get('plugins/pc-terminal/views/admin/index.css')}}">
- <style>
- /* 导航 */
- .el-radio-button .el-radio-button__inner,.el-radio-button:first-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;border-left: 0px;}
- .el-radio-button__inner{border:0;}
- .el-radio-button:last-child .el-radio-button__inner {border-radius: 4px 4px 4px 4px;}
- </style>
- <div class="all">
- <div id="app" v-cloak>
- <div class="vue-head">
- <el-radio-group v-model="order_type">
- <el-radio-button label="1" @click.native="gotoOther(1)">幻灯片</el-radio-button>
- <el-radio-button label="2" @click.native="gotoOther(2)">banner图</el-radio-button>
- <el-radio-button label="3" @click.native="gotoOther(3)">三栏广告</el-radio-button>
- <el-radio-button label="4" @click.native="gotoOther(4)">双栏广告</el-radio-button>
- <el-radio-button label="5" @click.native="gotoOther(5)">分类广告</el-radio-button>
- </el-radio-group>
- </div>
- <div class="vue-head">
- <div class="vue-main-title" style="margin-bottom:20px">
- <div class="vue-main-title-left"></div>
- <div class="vue-main-title-content">商品分类</div>
- {{--<div class="vue-main-title-button">--}}
- {{--<el-button type="primary" plain icon="el-icon-plus" size="small" @click="addFirst">添加一级分类</el-button>--}}
- {{--</div>--}}
- </div>
- <div class="vue-search">
- <el-input v-model="keyword" style="width:40%"></el-input>
- <el-button type="primary" @click="search(1)">搜索</el-button>
- <el-link class="el-link-assist" :underline="false" @click="openAll">
- 全部展开
- </el-link>
- <el-link class="el-link-assist" :underline="false" @click="closeAll" style="margin-left:20px;">
- 全部折叠
- </el-link>
- </div>
- </div>
-
- <div class="vue-main">
-
-
- <div class="vue-main-form">
- <el-table
- v-if="show_table"
- :data="list"
- row-key="id"
- ref="table"
- default-expand-all
- :tree-props="{children: 'children'}"
- style="width: 100%"
- >
- <el-table-column prop="name" label="分类名称"></el-table-column>
- <el-table-column prop="refund_time" label="操作" align="left" width="400">
- <template slot-scope="scope">
- <div style="text-align:left">
- <el-link title="编辑分类" :underline="false" v-if="scope.row.level<3" @click="editChild(scope.row)" style="text-align: left;display: inline-block;font-size:26px;width:50px;">
- <i class="iconfont icon-ht_operation_edit"></i>
- </el-link>
- </div>
-
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- 分页 -->
- <div class="vue-page">
- <el-row v-if="total>0">
- <el-col align="right">
- <el-pagination layout="prev, pager, next,jumper" @current-change="search" :total="total"
- :page-size="per_page" :current-page="current_page" background
- ></el-pagination>
- </el-col>
- </el-row>
- </div>
- </div>
- </div>
- <script>
- var app = new Vue({
- el: "#app",
- delimiters: ['[[', ']]'],
- name: 'test',
- data() {
- return {
- order_type:'5',
- list:[],
- keyword:'',
- rules: {},
- thirdShow:true,
- show_table:true,
- current_page:1,
- total:1,
- per_page:1,
- }
- },
- created() {
- },
- mounted() {
- this.getData(1);
- },
- methods: {
- getData(page) {
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.show_table = false;
- this.$http.post('{!! yzWebFullUrl('plugin.pc-terminal.admin.category.category-list') !!}',{page:page,keyword:this.keyword}).then(function(response) {
- if (response.data.result) {
- this.list = response.data.data.data.data;
- this.current_page=response.data.data.data.current_page;
- this.total=response.data.data.data.total;
- this.per_page=response.data.data.data.per_page;
- this.thirdShow=response.data.data.thirdShow;
- loading.close();
- this.show_table = true;
- } else {
- this.$message({
- message: response.data.msg,
- type: 'error'
- });
- this.show_table = true;
- }
- loading.close();
- }, function(response) {
- this.$message({
- message: response.data.msg,
- type: 'error'
- });
- loading.close();
- this.show_table = true;
- });
- },
-
- search(val) {
- if(this.keyword == "") {
- this.getData(val);
- return;
- }
- this.show_table = false;
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.pc-terminal.admin.category.category-list') !!}',{page:val,keyword:this.keyword}).then(function(response) {
- if (response.data.result) {
- this.list = response.data.data.data;
- this.list = response.data.data.data;
- this.current_page=response.data.data.current_page;
- this.total=response.data.data.total;
- this.per_page=response.data.data.per_page;
- this.show_table = true;
- this.$forceUpdate()
- // this.thirdShow=response.data.thirdShow;
- loading.close();
- } else {
- this.$message({
- message: response.data.msg,
- type: 'error'
- });
- this.show_table = false;
- }
- loading.close();
- }, function(response) {
- this.$message({
- message: response.data.msg,
- type: 'error'
- });
- loading.close();
- this.show_table = false;
- });
- },
- openAll() {
- this.list.forEach((item,index) => {
- // this.$refs.table.toggleRowExpansion(item, true)
- if(this.list[index].children && this.list[index].children.length>0) {
- this.$refs.table.toggleRowExpansion(item, true)
- }
- })
-
- },
- closeAll() {
- this.list.forEach((item,index) => {
- if(this.list[index].children && this.list[index].children.length>0) {
- this.$refs.table.toggleRowExpansion(item, false)
- }
- })
- },
- // 编辑子分类
- editChild(item) {
- let link = `{!! yzWebFullUrl('plugin.pc-terminal.admin.category.category-info') !!}`+`&id=`+item.id;
- window.location.href = link;
- },
- gotoOther(type) {
- let url = ""
- if(type==1) {
- url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.slide.slide-list') !!}'
- }
- else if(type==2) {
- url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.set.banner') !!}'
- }
- else if(type==3) {
- url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.advert.three-advert-list') !!}'
- }
- else if(type==4) {
- url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.advert.two-advert-list') !!}'
- }
- else if(type==5) {
- // url = '{!! yzWebFullUrl('plugin.pc-terminal.admin.category.category-list') !!}'
- }
- if(url) {
- window.location.href=url
- }
- },
- },
- })
- </script>
- @endsection
|