| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426 |
- @extends('layouts.base')
- @section('title', "专题管理")
- @section('content')
- <link rel="stylesheet" href="{{resource_get('plugins/store-cashier/src/common/static/index.css')}}">
- <style>
- .edit-i{display:none;}
- .el-table_1_column_2:hover .edit-i{font-weight:900;padding:0;margin:0;display:inline-block;}
- .el-tabs__item,.is-top{font-size:16px}
- .el-tabs__active-bar { height: 3px;}
- </style>
- <div class="all">
- <div id="app" v-cloak>
- <div class="vue-crumbs">
- 案例库 > 专题管理
- </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="addModal">添加专题</el-button>
- </div>
- </div>
- <div class="vue-search">
- <el-form :inline="true" :model="search_form" class="demo-form-inline">
- <el-form-item label="">
- <el-input v-model="search_form.special_name" placeholder="专题名称"></el-input>
- </el-form-item>
- <el-form-item label="">
- <el-select v-model="search_form.is_open" clearable placeholder="状态">
- <el-option label="启用中" value="1"></el-option>
- <el-option label="未启用" value="0"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="">
- <el-select v-model="search_form.is_hot" clearable placeholder="是否热门">
- <el-option label="是" value="1"></el-option>
- <el-option label="否" value="0"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="创建时间">
- <el-date-picker
- v-model="times"
- type="datetimerange"
- value-format="yyyy-MM-dd HH:mm:ss"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- style="margin-left:5px;"
- align="right">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="">
- <el-button type="primary" @click="search(1)">搜索</el-button>
- </el-form-item>
- </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 120px">专题列表</div>
- <div class="" style="text-align:left;font-size:14px;color:#999">
- <span>专题数量:[[count.total]]</span>
- <span>启用专题数量:[[count.success]]</span>
- </div>
- </div>
- <el-table :data="list" style="width: 100%">
- <el-table-column label="发布时间" align="center" prop="created_at" width="110">
- <template slot-scope="scope">
- <div>
- <div>[[scope.row.created_at]]</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="名称" align="center" prop="special_name"></el-table-column>
- <el-table-column label="ID" align="center" prop="is_hot">
- <template slot="header" slot-scope="scope">
- <div>热门推荐</div>
- </template>
- <template slot-scope="scope">
- <el-switch v-model="scope.row.is_hot" :active-value="1" :inactive-value="0" @change="editStatus(scope.row.id,scope.$index,'is_hot')"></el-switch>
- </template>
- </el-table-column>
- <el-table-column label="案例数量" align="center" prop="case_count"></el-table-column>
- <el-table-column label="浏览量" align="center" prop="read_num"></el-table-column>
- <el-table-column label="ID" align="center" prop="id">
- <template slot="header" slot-scope="scope">
- <div>状态</div>
- </template>
- <template slot-scope="scope">
- <el-switch v-model="scope.row.is_open" :active-value="1" :inactive-value="0" @change="editStatus(scope.row.id,scope.$index,'is_open')"></el-switch><br />
- </template>
- </el-table-column>
-
- <el-table-column prop="refund_time" label="操作" align="center" width="250">
- <template slot-scope="scope">
- <el-link title="推广" :underline="false" @click="openShare(scope.row)" style="width:50px;">
- {{--<i class="iconfont icon-fontclass-fenxiang"></i>--}}推广
- </el-link>
- <el-link title="编辑" :underline="false" @click="gotoDetail(scope.row)" style="width:50px;">
- <i class="iconfont icon-ht_operation_edit"></i>
- </el-link>
- <el-link title="删除" :underline="false" @click="del(scope.row.id,scope.$index)" style="width:50px;">
- <i class="iconfont icon-ht_operation_delete"></i>
- </el-link>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <el-dialog title="推广" :visible.sync="share_show" width="800">
- <div style="display:flex">
- <div class="left" style="flex:2;text-align:left">
- <el-button type="text" @click="changeShare(1)" :style="{color:(share_index==1?'':'#333')}" style="font-size:18px">推广链接和二维码</el-button><br />
- <el-button type="text" @click="changeShare(2)" :style="{color:(share_index==2?'':'#333')}" style="font-size:18px" v-if="share_data.mini_show">微信小程序</el-button>
- </div>
- <div class="center" style="width:355px;height:550px;margin:0 20px" >
- <img :src="show_share_data.poster" alt="" style="width:100%;">
- </div>
- <div class="right" style="flex:3">
- <div>分享链接</div>
- <el-input v-model="show_share_data.url" style="width:70%" ref="url"></el-input>
- <el-button @click="copyLink('url')">复制</el-button>
- <div class="tip" style="margin:20px 0">可在微信好友、微信群、微博、QQ、知乎、短信群发等渠道推广,或者用户页面装修等!</div>
- <div>
- <el-button type="text" @click="download(show_share_data.poster,'poster')">下载海报</el-button>
- <el-button type="text" @click="download(show_share_data.qr_code,'qr_code')">下载二维码</el-button>
- </div>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <!-- <el-button @click="share_show = false">取 消</el-button> -->
- <!-- <el-button type="primary" @click="img_text_url = false">确 定</el-button> -->
- </span>
- </el-dialog>
- <!-- 分页 -->
- <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',
- street:0,
- list:[],
- change_sort:'',
- times:[],
- category_list:[
-
- ],
- province_list:[],
- city_list : [],
- search_form:{
- special_name:"",
- is_open:"",
- is_hot:"",
- },
- share_data : {
- mini:{},
- h5:{},
- mini_show:0
- },
- show_share_data : {
- url:"",
- qr_code:"",
- poster:""
- },
- // 统计
- count:{
- success: 0,
- total: 0,
- },
- share_show:false,
- share_index:1,
- rules: {},
- current_page:1,
- total:1,
- per_page:1,
- }
- },
- created() {
- },
- mounted() {
- this.getData(1);
-
- },
- methods: {
- getData(page) {
- console.log(this.times)
- let json = {
- page:page,
- search:{
- special_name:this.search_form.special_name,
- is_open:this.search_form.is_open,
- is_hot:this.search_form.is_hot,
- }
- };
- if(this.times && this.times.length>0) {
- // json.start_time = this.times[0]/1000;
- // json.end_time = this.times[0]/1000;
- json.search.timeStart = this.times[0];
- json.search.timeEnd = this.times[1];
- }
- console.log(json)
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.case-library.admin.special.special-list') !!}',json).then(function(response) {
- if (response.data.result) {
- this.list = response.data.data.list.data;
- this.count.success = response.data.data.is_open;
- this.count.total = response.data.data.total;
- this.current_page=response.data.data.list.current_page;
- this.total=response.data.data.list.total;
- this.per_page=response.data.data.list.per_page;
- 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();
- });
- },
- editStatus(id,index,type){
- let json = {
- id:id,
- type:type
- }
- if(type == 'is_hot'){
- json.status = this.list[index].is_hot;
- }else {
- json.status = this.list[index].is_open;
- }
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.case-library.admin.special.edit-special-status') !!}',json).then(function (response) {
- if (response.data.result){
- this.$message.success("操作成功");
- this.search(this.current_page);
- }
- else {
- this.$message.error( response.data.msg );
- }
- loading.close();
- },function (response) {
- this.$message.error(response.data.msg);
- loading.close();
- }
- );
- },
- initProvince(val) {
- console.log(val);
- this.areaLoading = true;
- this.$http.get("{!! yzWebUrl('area.list.init', ['area_ids'=>'']) !!}"+val).then(response => {
- this.province_list = response.data.data;
- this.areaLoading = false;
- }, response => {
- this.areaLoading = false;
- });
- },
- changeProvince(val) {
- this.city_list = [];
- this.district_list = [];
- this.street_list = [];
- // this.search_form.province_id = "";
- this.search_form.city_id = "";
- this.search_form.district_id = "";
- this.search_form.street_id = "";
- this.areaLoading = true;
- let url = "<?php echo yzWebUrl('area.list', ['parent_id'=> '']); ?>" + val;
- this.$http.get(url).then(response => {
- if (response.data.data.length) {
- this.city_list = response.data.data;
- } else {
- this.city_list = null;
- }
- this.areaLoading = false;
- }, response => {
- this.areaLoading = false;
- });
- },
- gotoDetail(item) {
- let link = `{!! yzWebFullUrl('plugin.case-library.admin.special.special-edit') !!}`+`&id=`+item.id;
- window.location.href = link;
- },
- addModal() {
- let link = `{!! yzWebFullUrl('plugin.case-library.admin.special.special-add') !!}`;
- console.log(link);
- window.location.href = link;
- },
- gotoMember(id) {
- window.location.href = `{!! yzWebFullUrl('member.member.detail') !!}`+`&id=`+id;
- },
- openShare(id) {
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.case-library.admin.special.special-extension') !!}',{id:id}).then(function (response) {
- if (response.data.result){
- this.share_index = 1;
- this.share_data.h5 = response.data.data.h5;
- this.share_data.mini = response.data.data.mini;
- this.share_data.mini_show = response.data.data.mini_show;
- this.show_share_data = this.share_data.h5;
- this.share_show = true;
- }
- else {
- this.$message.error( response.data.msg );
- }
- loading.close();
- },function (response) {
- this.$message.error(response.data.msg);
- this.share_show = false;
- loading.close();
- }
- );
- },
- changeShare(index) {
- this.share_index = index;
- if(index == 1){
- this.show_share_data = this.share_data.h5;
- }else if(index == 2 && this.share_data.mini_show) {
- this.show_share_data = this.share_data.mini;
- }
- },
-
- search(val) {
- this.getData(val);
- },
-
- pass(id) {
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.store-cashier.admin.store-apply.accept') !!}',{id:id}).then(function (response) {
- if (response.data.result){
- this.$message.success("操作成功");
- this.search(this.current_page);
- }
- else {
- this.$message.error( response.data.msg );
- }
- loading.close();
- },function (response) {
- this.$message.error(response.data.msg);
- loading.close();
- }
- );
- },
- reject(id) {
- this.$confirm('确定驳回吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.store-cashier.admin.store-apply.reject') !!}',{id:id}).then(function (response) {
- if (response.data.result){
- this.$message.success("操作成功");
- this.search(this.current_page);
- }
- else {
- this.$message.error( response.data.msg );
- }
- loading.close();
- },function (response) {
- this.$message.error(response.data.msg);
- loading.close();
- }
- );
- }).catch(() => {
- this.$message({type: 'info',message: '已取消驳回'});
- });
- },
- del(id) {
- let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
- this.$http.post('{!! yzWebFullUrl('plugin.case-library.admin.special.special-del') !!}',{id:id}).then(function (response) {
- if (response.data.result){
- this.$message.success("操作成功");
- this.search(this.current_page);
- }
- else {
- this.$message.error( response.data.msg );
- }
- loading.close();
- },function (response) {
- this.$message.error(response.data.msg);
- loading.close();
- }
- );
- },
- copyLink(type) {
- this.$refs[type].select();
- document.execCommand("Copy")
- this.$message.success("复制成功!");
- },
- download(href, name) {
- let eleLink = document.createElement("a");
- eleLink.download = name;
- eleLink.href = href;
- eleLink.click();
- eleLink.remove();
- },
- },
- })
- </script>
- @endsection
|