| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269 |
- @extends('layouts.base')
- @section('title', "订单列表")
- @section('content')
- <link rel="stylesheet" href="{{resource_get('plugins/aggregation-cps/static/index.css')}}">
- <style>
- .el-table_1_column_2:hover .edit-i{font-weight:900;padding:0;margin:0;display:inline-block;}
- .list-title .list-title-1{display:flex;align-items:center;justify-content: center;}
- .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-crumbs">
- {!! (defined('CPS_PLUGIN_NAME') ? CPS_PLUGIN_NAME : '聚合CPS') !!} > 品牌券
- </div>
- <div class="vue-head">
- <el-radio-group v-model="search_form.category_id" @change="search(1)">
- <el-radio-button v-for="(item,index) in category" :key="item.label" v-if="category" :label="item.b_id" :name="item.b_id">[[item.name]]</el-radio-button>
- </el-radio-group>
- </div>
- <div class="vue-head">
- <div class="vue-search" id="loading1">
- <el-form :inline="true" :model="search_form" class="demo-form-inline">
- <el-form-item label="">
- <el-input v-model="search_form.name" placeholder="分类名称"></el-input>
- </el-form-item>
- <el-form-item label="" prop="is_hot">
- <el-checkbox v-model="search_form.is_hot" :active-value="1" :inactive-value="0">热门</el-checkbox>
- </el-form-item>
- <el-button type="primary" @click="search(1)">搜索</el-button>
- <el-button type="primary" @click="updateCategory">刷新分类</el-button>
- <el-button type="primary" @click="updateBrand">刷新品牌</el-button>
- <el-button type="primary" @click="updateGoods">刷新商品</el-button>
- </el-form>
- </div>
- </div>
- <div class="vue-main">
- <div class="vue-main-form">
- <div class="vue-main-title" style="margin-bottom:20px">
- <div class="vue-main-title-left"></div>
- <div class="vue-main-title-content" style="flex:0 0 160px">品牌列表</div>
- </div>
- <el-table :data="list" style="width: 100%">
- <el-table-column label="品牌ID" align="center" prop="b_id">
- </el-table-column>
- <el-table-column label="品牌名称" align="center" prop="name">
- </el-table-column>
- <el-table-column label="品牌logo" align="center" prop="logo">
- <template slot-scope="scope">
- <div>
- <div v-if="scope.row.logo">
- <el-image :src="scope.row.logo" alt="" style="width:40px;height:40px;"></el-image>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="品牌描述" align="center" prop="description" >
- </el-table-column>
- <el-table-column label="前端显示" align="center" width="80">
- <template slot-scope="scope">
- <div>
- <el-tooltip placement="top">
- <div slot="content">[[scope.row.show_state==1?'显示':'隐藏']]</div>
- <el-switch v-model="scope.row.show_state" @change="changeShow(scope.row.id,scope.row.show_state)" :active-value="1" :inactive-value="0"></el-switch>
- </el-tooltip>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="热门" align="center" width="80">
- <template slot-scope="scope">
- <div>
- <el-tooltip placement="top">
- <div slot="content">[[scope.row.is_hot==1?'显示':'隐藏']]</div>
- <el-switch v-model="scope.row.is_hot" @change="changeHot(scope.row.id,scope.row.is_hot)" :active-value="1" :inactive-value="0"></el-switch>
- </el-tooltip>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- 分页 -->
- <div class="vue-page" v-if="total>0">
- <el-row>
- <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 {
- activeName:'2',
- list:[],
- count:{},
- change_sort:'',
- category:[],
- data:"",
- areaLoading:false,
- search_form:{
- category:'',
- name:''
- },
- rules: {},
- current_page:1,
- total:1,
- per_page:1,
- }
- },
- created() {
- },
- mounted() {
- this.getData(1);
- },
- methods: {
- getData(page) {
- let json = {
- page:page,
- };
- json.search = this.search_form;
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.equity.get-data') !!}',json).then(function(response) {
- if (response.data.result) {
- this.list = response.data.data.brand.data;
- this.current_page=response.data.data.brand.current_page;
- this.total=response.data.data.brand.total;
- this.per_page=response.data.data.brand.per_page;
- this.category=response.data.data.category;
- loading.close();
- } else {
- this.$message({
- message: response.data.msg,
- type: 'error'
- });
- }
- loading.close();
- }, function(response) {
- this.$message({
- message: response.data.msg,
- type: 'error'
- });
- loading.close();
- });
- },
- search(val) {
- this.getData(val);
- },
- changeShow(id, is_show) {
- let loading = this.$loading({
- target: document.querySelector(".content"),
- background: 'rgba(0, 0, 0, 0)'
- });
- let url = `{!! yzWebFullUrl('plugin.aggregation-cps.admin.equity.changeShow') !!}`;
- this.$http.post(url, {id: id, show_state: is_show}).then(function (response) {
- if (response.data.result) {
- this.$message({type: 'success', message: '操作成功!'});
- } else {
- this.$message({type: 'error', message: response.data.msg});
- }
- loading.close();
- this.search(this.current_page);
- }, function (response) {
- this.$message({type: 'error', message: response.data.msg});
- loading.close();
- })
- },
- // 设置显不显示
- changeHot(id,is_hot) {
- let json = {
- id:id,
- is_hot:is_hot,
- }
- let url = `{!! yzWebFullUrl('plugin.aggregation-cps.admin.equity.is-hot') !!}`;
- console.log(json);
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post(url,json).then(function (response) {
- if (response.data.result) {
- this.$message({type: 'success',message: '操作成功!'});
- }
- else{
- this.$message({type: 'error',message: response.data.msg});
- }
- loading.close();
- this.search(this.current_page);
- },function (response) {
- this.$message({type: 'error',message: response.data.msg});
- loading.close();
- })
- },
- updateCategory() {
- let loading = this.$loading({target:document.querySelector("#loading"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.equity.category') !!}',{id:this.id}).then(function (response) {
- if (response.data.result){
- this.$message({message: response.data.msg,type: 'success'});
- }
- else {
- this.$message({message: response.data.msg,type: 'error'});
- }
- loading.close();
- location.reload();
- },function (response) {
- this.$message({message: response.data.msg,type: 'error'});
- loading.close();
- }
- );
- },
- updateBrand() {
- let loading = this.$loading({target:document.querySelector("#loading"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.equity.brand') !!}',{id:this.id}).then(function (response) {
- if (response.data.result){
- this.$message({message: response.data.msg,type: 'success'});
- }
- else {
- this.$message({message: response.data.msg,type: 'error'});
- }
- loading.close();
- location.reload();
- },function (response) {
- this.$message({message: response.data.msg,type: 'error'});
- loading.close();
- }
- );
- },
- updateGoods() {
- let loading = this.$loading({target:document.querySelector("#loading1"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.equity.update-goods') !!}',{id:this.id}).then(function (response) {
- if (response.data.result){
- this.$message({message: response.data.msg,type: 'success'});
- }
- else {
- this.$message({message: response.data.msg,type: 'error'});
- }
- loading.close();
- location.reload();
- },function (response) {
- this.$message({message: response.data.msg,type: 'error'});
- loading.close();
- }
- );
- },
- // 字符转义
- escapeHTML(a) {
- a = "" + a;
- return a.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/'/g, "'");;
- },
- },
- })
- </script>
- @endsection
|