| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348 |
- @extends('layouts.base')
- @section('title', '推广页面')
- @section('content')
- <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
- <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-ohter.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;
- }
- /*.el-select .el-input {*/
- /* width: 120px;*/
- /*}*/
- .input-with-select .el-input-group__prepend {
- background-color: #fff;
- }
- </style>
- <div class="all">
- <div id="app" v-cloak>
- <div class="vue-head">
- <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.another_name" placeholder="页面名称"></el-input>
- </el-form-item>
- <el-form-item label="页面类型">
- <el-select v-model="search_form.page_type" clearable placeholder="页面类型">
- <el-option
- v-for="(item,index) in page_type_arr"
- :key="index"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-button type="primary" @click="changeForm()">搜索</el-button>
- </el-form>
- </div>
- </div>
- <div class="vue-main">
- <div class="vue-main-form">
- <div class="vue-main-title" style="margin-top:-10px">
- <div class="title">
- <span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>页面列表</b>
- </div>
- </div>
- </div>
- <div style="margin-bottom:20px">
- </div>
- <el-table :data="list" style="width: 100%;" align="center" :fit="true" :row-style="{ height: '80px'}">
- <el-table-column style="min-height:100px;" min-width="15%" prop="id" label="ID"
- align="center"></el-table-column>
- <el-table-column style="min-height:100px;" min-width="15%" prop="another_name" label="名称"
- align="center"></el-table-column>
- <el-table-column min-width="15%" prop="page_type_name" label="页面类型"
- align="center"></el-table-column>
- <el-table-column min-width="15%" prop="visit_count" label="访问次数" align="center">
- </el-table-column>
- <el-table-column min-width="15%" label="状态" align="center">
- <template slot-scope="scope">
- <el-switch
- :active-value="1"
- :inactive-value="0"
- v-model="scope.row.open_state"
- active-color="#13ce66"
- inactive-color="#545454"
- @change="changeOpenState(scope.row)"
- >
- </el-switch>
- </template>
- </el-table-column>
- <el-table-column min-width="20%" label="操作" align="center">
- <template slot-scope="scope">
- <el-button type="primary" @click="getIntroduceUrl(scope.row)">推广</el-button>
- <el-button type="primary" @click="platDetail(scope.row)">设置</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="vue-page" v-if="total > 0">
- <el-row>
- <el-col align="right">
- <el-pagination layout="prev, pager, next,jumper" @current-change="getData" :total="total"
- :page-size="per_page" :current-page="current_page" background
- ></el-pagination>
- </el-col>
- </el-row>
- </div>
- <el-dialog title="推广链接" :visible.sync="introduce_modal.is_show" width="60%">
- <template>
- <el-tabs v-model="introduce_modal.tab">
- <el-tab-pane label="推广链接" name="1">
- <el-row style="margin-top: 30px">
- <el-col :span="3" style="text-align: right">推广链接</el-col>
- <el-col :span="18" style="margin-left: 10px">
- <el-input style="width: 60%" v-model="introduce_modal.web_url" disabled></el-input>
- <el-button-group>
- <el-button @click="copyUrl(introduce_modal.web_url)">复制</el-button>
- <el-button @click="webCode(introduce_modal.web_url)">生成二维码</el-button>
- </el-button-group>
- </el-col>
- </el-row>
- <div v-if="introduce_modal.web_image" style="width: 100%;margin-top: 30px" align="center">
- <el-image :src="introduce_modal.web_image" style="width: 200px;height: 200px;">
- </el-image>
- </div>
- </el-tab-pane>
- <el-tab-pane label="小程序路径" name="2">
- <el-row style="margin-top: 30px">
- <el-col :span="3" style="text-align: right">小程序路径</el-col>
- <el-col :span="18" style="margin-left: 10px">
- <el-input style="width: 60%" v-model="introduce_modal.mini_url" disabled></el-input>
- <el-button-group>
- <el-button @click="copyUrl(introduce_modal.mini_url)">复制</el-button>
- <el-button @click="miniCode(introduce_modal.mini_url)">生成小程序码</el-button>
- </el-button-group>
- </el-col>
- </el-row>
- <div style="width: 100%;margin-top: 30px" align="center">
- <el-image v-if="introduce_modal.mini_image" :src="introduce_modal.mini_image"
- style="width: 200px;height: 200px;">
- </el-image>
- </div>
- </el-tab-pane>
- </el-tabs>
- </template>
- <span slot="footer" class="dialog-footer">
- <el-button @click="introduce_modal.is_show = false">取 消</el-button>
- </span>
- </el-dialog>
- </div>
- <!-- 分页 -->
- </div>
- </div>
- <script>
- var app = new Vue({
- el: "#app",
- delimiters: ['[[', ']]'],
- name: 'test',
- data() {
- return {
- list: [],
- total: 1,
- per_page: 1,
- current_page: 1,
- search_form: {
- 'another_name': '',
- 'page_type': '',
- },
- search_data: {},
- page_type_arr: [
- {value: '1', label: '公众号'},
- {value: '2', label: '小程序'},
- ],
- introduce_modal: {
- id: 0,
- is_show: false,
- web_url: '',
- mini_url: '',
- web_image: '',
- mini_image: '',
- tab: "1",
- }
- }
- },
- created() {
- },
- mounted() {
- this.changeForm();
- },
- methods: {
- platDetail: function (data) {
- var url = "{!! yzWebUrl('plugin.aggregation-cps.admin.plat-activity.edit') !!}" + '&id=' + data.id;
- window.open(url);
- },
- webCode: function (url) {
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.plat-activity.getWebCode') !!}', {
- 'url': url
- }).then(function (response) {
- if (response.data.result) {
- this.$message({message: response.data.msg, type: 'success'});
- this.getIntroduceUrl({id: this.introduce_modal.id});
- } else {
- this.$message({message: response.data.msg, type: 'error'});
- }
- }, function (response) {
- this.$message({message: response.data.msg, type: 'error'});
- });
- },
- miniCode: function (url) {
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.plat-activity.getMiniCode') !!}', {
- 'url': url, 'activity_id': this.introduce_modal.id
- }).then(function (response) {
- if (response.data.result) {
- this.$message({message: response.data.msg, type: 'success'});
- this.getIntroduceUrl({id: this.introduce_modal.id});
- } else {
- this.$message({message: response.data.msg, type: 'error'});
- }
- }, function (response) {
- this.$message({message: response.data.msg, type: 'error'});
- });
- },
- {{--editCategory: function (data) {--}}
- {{-- var url = "{!! yzWebUrl('plugin.aggregation-cps.admin.link-category.edit') !!}" + '&id=' + data.id;--}}
- {{-- window.location.href = url;--}}
- {{-- // window.open(url);--}}
- {{--},--}}
- {{--addCategory: function () {--}}
- {{-- var url = "{!! yzWebUrl('plugin.aggregation-cps.admin.link-category.edit') !!}" + '&parent_id=' + this.search_data.parent_id;--}}
- {{-- window.location.href = url;--}}
- {{-- // window.open(url);--}}
- {{--},--}}
- {{--childList: function (data) {--}}
- {{-- var level = data.level + 1;--}}
- {{-- var url = "{!! yzWebUrl('plugin.aggregation-cps.admin.link-category.index') !!}" + '&level=' + level + '&parent_id=' + data.id;--}}
- {{-- window.open(url);--}}
- {{--},--}}
- // checkEmpty: function (val) {
- // if (val != 'undefined' && val != null && val != '0' && val != 0 && val != '') {
- // return true;
- // }
- // return false;
- // },
- copyUrl: function (url, msg) {
- let oInput = document.createElement('input');
- oInput.value = url;
- document.body.appendChild(oInput);
- oInput.select(); // 选择对象;
- console.log(oInput.value);
- document.execCommand("Copy"); // 执行浏览器复制命令
- this.$message({message: msg, type: 'success'});
- oInput.remove()
- },
- openUrl: function (url) {
- window.open(url);
- },
- // showAppModal: function () {
- // this.app_list = [];
- // this.app_show = true;
- // this.app_modal_text1 = true;
- // this.app_modal_text2 = false;
- // this.showUploaderEl = true;
- // },
- changeOpenState: function (data) {
- var open_state = data.open_state;
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.plat-activity.changeOpenState') !!}', {
- 'id': data.id, 'open_state': open_state
- }).then(function (response) {
- console.log(response);
- if (response.data.result) {
- this.$message({message: response.data.msg, type: 'success'});
- this.search();
- } else {
- this.$message({message: response.data.msg, type: 'error'});
- this.search();
- }
- }, function (response) {
- this.$message({message: response.data.msg, type: 'error'});
- this.search();
- });
- },
- getIntroduceUrl: function (data) {
- this.introduce_modal.web_url = '';
- this.introduce_modal.mini_url = '';
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.plat-activity.getIntroduceUrl') !!}', {
- 'id': data.id
- }).then(function (response) {
- if (response.data.result) {
- this.introduce_modal.web_url = response.data.data.web_url;
- this.introduce_modal.mini_url = response.data.data.mini_url;
- this.introduce_modal.web_image = response.data.data.web_image;
- this.introduce_modal.mini_image = response.data.data.mini_image;
- this.introduce_modal.id = data.id;
- this.introduce_modal.is_show = 1;
- } else {
- this.$message({message: response.data.msg, type: 'error'});
- }
- }, function (response) {
- this.$message({message: response.data.msg, type: 'error'});
- });
- },
- search: function () {
- this.$http.post('{!! yzWebFullUrl('plugin.aggregation-cps.admin.plat-activity.index') !!}', {
- 'page': this.current_page,
- 'is_json': 1,
- 'search_data': this.search_data,
- }).then(function (response) {
- console.log(response);
- if (response.data.result) {
- let this_data = response.data.data.list;
- this.current_page = this_data.current_page;
- this.list = this_data.data;
- this.total = this_data.total;
- this.per_page = this_data.per_page;
- } else {
- this.$message({message: response.data.msg, type: 'error'});
- }
- }, function (response) {
- this.$message({message: response.data.msg, type: 'error'});
- })
- },
- getData: function (val) {
- this.current_page = val;
- this.search();
- },
- changeForm: function () {
- this.search_data = this.search_form;
- this.current_page = 1;
- this.search();
- }
- },
- })
- </script>
- @endsection
|