| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316 |
- @extends('layouts.base')
- @section('title', '活动管理')
- @section('content')
- <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-ohter.css')}}"/>
- <style>
- </style>
- <div id='re_content' >
- <div class="con">
- <div class="setting">
- <div class="block">
- <el-form label-width="10%">
- <div class="title" style="justify-content: space-between;"><div style="display:flex;align-items:center;"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>打包一口价</b><span></div><a href="{!! yzWebFullUrl('plugin.pack-fixed-price.admin.activity.add-page') !!} "><el-button size="mini" type="primary">添加活动</el-button></a></div>
- <el-input v-model="search_form.activity_name" style="width:15%;margin-right:16px;" placeholder="活动名称"></el-input>
- <el-select v-model="search_form.status" placeholder="请选择状态" style="margin-right:16px;width:12%;" clearable>
- <el-option
- v-for="item in options"
- :key="item.id"
- :label="item.label"
- :value="item.id">
- </el-option>
- </el-select>
- <a >
- <el-button type="primary" icon="el-icon-search" @click="search()">搜索</el-button>
- </a>
- <el-form>
- </div>
- <div style="background: #eff3f6;width:100%;height:15px;"></div>
- <div class="block">
- <div class="title"><div style="display:flex;align-items:center;"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>活动列表</b></div></div>
- </div>
- <template style="margin-top:-10px;">
- <el-table
- :data="tableData"
- style="padding:0 10px"
- >
- <el-table-column
- prop="activity_name"
- align="center"
- label="活动名称"
- >
- </el-table-column>
- <el-table-column
- prop="target_name"
- align="center"
- label="状态"
- >
- <template slot-scope="scope" >
- <div v-if="scope.row.status==1">未开始</div>
- <div v-if="scope.row.status==2">进行中</div>
- <div v-if="scope.row.status==3">已结束</div>
- <div v-if="scope.row.status==4">已失效</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="start_at"
- align="center"
- label="活动时间"
- >
- <template slot-scope="scope" >
- [[scope.row.start_at]]至[[scope.row.end_at]]
- </template>
- </el-table-column>
- <el-table-column
- prop="paid_count"
- align="center"
- label="支付订单数"
- >
- </el-table-column>
- <el-table-column
- prop="paid_amount"
- align="center"
- label="实付金额(元) "
- >
- </el-table-column>
- <el-table-column
- align="center"
- label="操作"
- >
- <template slot-scope="scope" >
- <el-button size="mini" style="margin-right: 10px;" v-if="scope.row.status==2||scope.row.status==1" @click="openDia(scope.row)">推广</el-button>
- <el-button size="mini" style="margin-right: 10px;" @click="goEdit(scope.row)">编辑</el-button>
- <el-button size="mini" style="margin-right: 10px;" v-if="scope.row.status==2" @click="close(scope, tableData)">失效</el-button>
- <el-button size="mini" style="margin-right: 10px;" v-if="scope.row.status==3" @click="del(scope, tableData)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-row style="background-color:#fff;">
- <el-col :span="24" align="center" migra style="padding:15px 5% 15px 0" v-loading="loading">
- <el-pagination background @current-change="currentChange"
- :current-page="current_page"
- layout="prev, pager, next"
- :page-size="Number(page_size)" :current-page="current_page" :total="page_total"></el-pagination>
- </el-col>
- </el-row>
- </template>
- </div>
- <el-dialog
- center
- title="推广"
- :visible.sync="dialogVisible"
- width="60%">
- <template>
- <el-radio-group v-model="activeName" >
- <el-radio-button label="one" >推广链接和二维码</el-radio-button>
- <el-radio-button label="second">微信小程序</el-radio-button>
- </el-radio-group>
- </template>
- <div v-if="activeName=='one'" style="display:flex;margin-top:20px;">
- <div><img :src="`${obj.extension_poster}?${Date.now()}`" style="width: 298px;height: 418px;"></div>
- <div class="right" style="margin-left:20px;">
- <div style="margin-bottom:20px;">分享链接</div>
- <div style="display:flex;"><el-input type="text" v-model="obj.extension_url" ref="extension_url"> </el-input><el-button @click="copy_two" type="primary" size="small">复制链接</el-button></div>
- <div class="tips" style="margin-top:20px;margin-bottom:20px;">可在微信好友、微信群、微博、QQ、知乎、短信群发等渠道推广,或者用户页面装修等!</div>
- <div style="display:flex;"><el-button type="primary" size="small" style="margin-right:20px;" @click="download(1)">下载海报</el-button> <el-button type="primary" size="small" @click="download(2)">下载二维码</el-button></div>
- </div>
- </div>
- <div v-if="activeName=='second'" style="display:flex;margin-top:20px;">
- <div><img :src="`${obj.applets_poster}?${Date.now()}`" style="width: 298px;height: 418px;"></div>
- <div class="right" style="margin-left:20px;">
- <div style="margin-bottom:20px;">小程序路径</div>
- <div style="display:flex;"><el-input type="text" v-model="obj.applets_url" ref="applets_url"> </el-input><el-button @click="copy" type="primary" size="small">复制链接</el-button></div>
- <div class="tips" style="margin-top:20px;margin-bottom:20px;">可在微信好友、微信群、微博、QQ、知乎、短信群发等渠道推广,或者用户页面装修等!</div>
- <div style="display:flex;"><el-button type="primary" size="small" style="margin-right:20px;" @click="download(3)">下载海报</el-button> <el-button type="primary" size="small" @click="download(4)">下载二维码</el-button></div>
- </div>
- </div>
- </el-dialog>
- </div>
- </div>
- <script>
- var vm = new Vue({
- el: "#re_content",
- delimiters: ['[[', ']]'],
- data() {
- return {
- obj:{},
- activeName:'one',
- loading:false,
- page_total:0,
- page_size:0,
- current_page:0,
- dialogVisible:false,
- options: [
- {
- id: 1,
- label: '未开始'
- },
- {
- id: 2,
- label: '进行中'
- },
- {
- id: 3,
- label: '已结束'
- },
-
- ],
- report_id:'',
- times:[],
- loading:false,
- search_loading:false,
- all_loading:false,
- info:{},
- search_form:{
- activity_name:'',
- status:''
- },
- real_search_form:{},
- tableData: []
- }
- },
- mounted () {
- this.search();
- },
- methods: {
- copy_two() {
- that = this;
- let Url =that.$refs['extension_url'];
- Url.select(); // 选择对象
- document.execCommand("Copy",false);
- that.$message({message:"复制成功!",type:"success"});
- },
- copy() {
- that = this;
- let Url =that.$refs['applets_url'];
- Url.select(); // 选择对象
- document.execCommand("Copy",false);
- that.$message({message:"复制成功!",type:"success"});
- },
- download(type){
- var url = '{!! yzWebFullUrl('plugin.pack-fixed-price.admin.download.download') !!}'+ '&id=' + this.obj.id + '&type=' + type;
- var a = document.createElement('a');
- a.target = "_blank";
- a.href = url;
- a.click();
- },
- openDia(item){
- this.activeName="one"
- this.obj=item;
- this.dialogVisible=true
- },
- del(scope,rows){
- this.$confirm('是否删除?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- rows.splice(scope.$index, 1);
- let json={
- id:scope.row.id
- }
- this.$http.post('{!! yzWebFullUrl('plugin.pack-fixed-price.admin.activity.delete') !!}',json).then(function (response){
- if (response.data.result) {
- this.$message({message:"删除成功",type:"success"});
- this.loading = false;
- }else {
- this.$message({message: response.data.msg,type: 'error'});
- }
- },function (response) {
- console.log(response);
- this.loading = false;
- }
- );
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消操作'
- });
- });
- },
- close(scope,rows){
- this.$confirm('是否失效?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let json={
- id:scope.row.id
- }
- this.$http.post('{!! yzWebFullUrl('plugin.pack-fixed-price.admin.activity.update-status') !!}',json).then(function (response){
- if (response.data.result) {
- this.$message({message:"操作成功!",type:"success"});
- this.loading = false;
- }else {
- this.$message({message: response.data.msg,type: 'error'});
- }
- },function (response) {
- console.log(response);
- this.loading = false;
- }
- );
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消操作'
- });
- });
- },
- goEdit(item){
- let link = `{!! yzWebFullUrl('plugin.pack-fixed-price.admin.activity.add-page') !!}`+`&id=`+item.id;
- window.location.href = link;
- },
- search() {
- this.search_loading = true;
- let json={
- search:this.search_form,
- }
- this.$http.post('{!! yzWebFullUrl('plugin.pack-fixed-price.admin.activity.search') !!}',json
- ).then(function (response) {
- if (response.data.result){
- let datas = response.data.data.activity;
- this.tableData=datas.data
- this.page_total = datas.total;
- this.page_size = datas.per_page;
- this.current_page = datas.current_page;
- this.loading = false;
- this.real_search_form=Object.assign({},this.search_form);
- }
- else {
- this.$message({message: response.data.msg,type: 'error'});
- }
- this.search_loading = false;
- },function (response) {
- this.search_loading = false;
- this.$message({message: response.data.msg,type: 'error'});
- }
- );
- },
- currentChange(val) {
- this.loading = true;
- this.$http.post('{!! yzWebFullUrl('plugin.pack-fixed-price.admin.activity.search') !!}',{page:val,search:this.real_search_form}).then(function (response){
- if (response.data.result){
- let datas = response.data.data.activity;
- this.tableData=datas.data
- this.page_total = datas.total;
- this.page_size = datas.per_page;
- this.current_page = datas.current_page;
- this.loading = false;
- } else {
- this.$message({message: response.data.msg,type: 'error'});
- }
- },function (response) {
- console.log(response);
- this.loading = false;
- }
- );
- },
- },
- });
- </script>
- @endsection
|