284 lines
14 KiB
PHP
284 lines
14 KiB
PHP
@extends('layouts.base')
|
||
@section('title', "奖励记录")
|
||
@section('content')
|
||
<link rel="stylesheet" href="{{resource_get('plugins/new-poster/views/admin/index.css')}}">
|
||
<link rel="stylesheet" href="//at.alicdn.com/t/font_432132_2czx2z2x7lu.css">
|
||
<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">
|
||
</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.title" placeholder="海报名称"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="">
|
||
<el-input v-model="search_form.recommender" placeholder="推荐人昵称/姓名/手机号"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="">
|
||
<el-input v-model="search_form.recommender_id" placeholder="推荐人会员ID"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="">
|
||
<el-input v-model="search_form.subscriber" placeholder="被推荐人昵称/姓名/手机号"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="">
|
||
<el-input v-model="search_form.subscriber_id" placeholder="被推荐人会员ID"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="时间范围">
|
||
<el-date-picker
|
||
v-model="times"
|
||
type="datetimerange"
|
||
value-format="timestamp"
|
||
range-separator="至"
|
||
start-placeholder="开始日期"
|
||
end-placeholder="结束日期"
|
||
style="margin-left:5px;"
|
||
align="right">
|
||
</el-date-picker>
|
||
</el-form-item>
|
||
{{--<el-form-item label="">--}}
|
||
{{--<el-select v-model="search_form.poster_type" clearable placeholder="海报类型">--}}
|
||
{{--<el-option label="微信公众号关注海报" value="1"></el-option>--}}
|
||
{{--<el-option label="微信小程序海报" value="2"></el-option>--}}
|
||
{{--<el-option label="H5商城海报" value="5"></el-option>--}}
|
||
{{--<el-option label="APP分享海报" value="7"></el-option>--}}
|
||
{{--<el-option label="商品详情页海报" value="15"></el-option>--}}
|
||
{{--</el-select>--}}
|
||
{{--</el-form-item>--}}
|
||
|
||
<el-form-item label="">
|
||
<el-button type="primary" @click="search(1)">搜索</el-button>
|
||
<el-button type="primary" @click="export1(1)">导出</el-button>
|
||
</el-form-item>
|
||
</el-form>
|
||
</div>
|
||
</div>
|
||
<div class="vue-main">
|
||
<div>
|
||
<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 100px">奖励列表</div>
|
||
<div class="" style="text-align:left;font-size:12px;color:#999">
|
||
<span>记录条数:[[total]]</span>
|
||
<span>积分奖励总数量:[[point_count]]</span>
|
||
<span>余额奖励总数量:[[bonus_count]]</span>
|
||
<span>微信余额奖励总数量:[[wechat_bonus_count]]</span>
|
||
</div>
|
||
<div class="vue-main-title-button">
|
||
<!-- <el-button type="primary" plain icon="el-icon-plus" size="small" @click="addModal">添加海报</el-button> -->
|
||
</div>
|
||
|
||
</div>
|
||
<el-table :data="list" style="width: 100%">
|
||
<!-- <el-table-column label="ID" align="center" prop="id" width="70"></el-table-column> -->
|
||
<el-table-column label="奖励时间" align="center" prop="created_at"></el-table-column>
|
||
<el-table-column label="海报名称" align="center" prop="poster.title"></el-table-column>
|
||
<el-table-column label="海报类型" align="center" prop="created_at">
|
||
<template slot-scope="scope">
|
||
<div v-if="scope.row.poster.poster_type==1">微信公众号关注海报</div>
|
||
<div v-if="scope.row.poster.poster_type==2">微信小程序海报</div>
|
||
<div v-if="scope.row.poster.poster_type==5">H5商城海报</div>
|
||
<div v-if="scope.row.poster.poster_type==7">APP分享海报</div>
|
||
<div v-if="scope.row.poster.poster_type==15">商品详情页海报</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column align="center" prop="created_at">
|
||
<template slot="header" slot-scope="scope">
|
||
<div>推荐人信息</div>
|
||
<div>会员ID/昵称</div>
|
||
</template>
|
||
<template slot-scope="scope">
|
||
<div v-if="scope.row.recommender&&scope.row.recommender!=null">
|
||
<div>
|
||
<img :src="scope.row.recommender.avatar_image" alt="" style="width:40px;height:40px;border-radius:50%">
|
||
</div>
|
||
<div class="vue-ellipsis">[[scope.row.recommender.uid]]/[[scope.row.recommender.nickname]]</div>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="推荐人奖励" align="center" prop="">
|
||
<template slot-scope="scope">
|
||
<div>
|
||
<span v-if="scope.row.recommender_credit">[[scope.row.recommender_credit]]个积分;</span>
|
||
<span v-if="scope.row.recommender_bonus > 0 || scope.row.recommender_wechat_bonus > 0">
|
||
<span>[[scope.row.recommender_bonus || scope.row.recommender_wechat_bonus]]元现金;</span>
|
||
</span>
|
||
<span v-if="scope.row.recommender_coupon_num">优惠券(ID为[[scope.row.recommender_coupon_id]])共[[scope.row.recommender_coupon_num]]张</span>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column align="center" prop="created_at">
|
||
<template slot="header" slot-scope="scope">
|
||
<div>被推荐人信息</div>
|
||
<div>会员ID/昵称</div>
|
||
</template>
|
||
<template slot-scope="scope">
|
||
<div v-if="scope.row.subscriber&&scope.row.subscriber!=null">
|
||
<div>
|
||
<img :src="scope.row.subscriber.avatar_image" alt="" style="width:40px;height:40px;border-radius:50%">
|
||
</div>
|
||
<div class="vue-ellipsis">[[scope.row.subscriber.uid]]/[[scope.row.subscriber.nickname]]</div>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="被推荐人奖励" align="center" prop="">
|
||
<template slot-scope="scope">
|
||
<div>
|
||
<span v-if="scope.row.subscriber_credit">[[scope.row.subscriber_credit]]个积分;</span>
|
||
<span v-if="scope.row.subscriber_bonus > 0 || scope.row.subscriber_wechat_bonus > 0">
|
||
<span>[[scope.row.subscriber_bonus || scope.row.subscriber_wechat_bonus]]元现金;</span>
|
||
</span>
|
||
<span v-if="scope.row.subscriber_coupon_num">优惠券(ID为[[scope.row.subscriber_coupon_id]])共[[scope.row.subscriber_coupon_num]]张</span>
|
||
</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 {
|
||
search_form:{},
|
||
times:[],
|
||
list:[],
|
||
count:{},
|
||
bonus_count: 0,
|
||
point_count: 0,
|
||
wechat_bonus_count: 0,
|
||
rules: {},
|
||
current_page:1,
|
||
total:1,
|
||
per_page:1,
|
||
}
|
||
},
|
||
created() {
|
||
|
||
},
|
||
mounted() {
|
||
this.id = this.getParam('id');
|
||
this.getData(1);
|
||
},
|
||
methods: {
|
||
|
||
getData(page) {
|
||
let json = {
|
||
page:page,
|
||
search_form:{
|
||
title:this.search_form.title,
|
||
recommender:this.search_form.recommender,
|
||
recommender_id:this.search_form.recommender_id,
|
||
subscriber:this.search_form.subscriber,
|
||
subscriber_id:this.search_form.subscriber_id,
|
||
poster_type:this.search_form.poster_type,
|
||
search_time:[],
|
||
}
|
||
|
||
}
|
||
console.log(this.times)
|
||
if(this.times&&this.times!=null&&this.times.length>0) {
|
||
json.search_form.search_time.push(this.times[0]/1000,this.times[1]/1000,)
|
||
}
|
||
if(this.id) {
|
||
json.id = this.id
|
||
}
|
||
let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
|
||
this.$http.post('{!! yzWebFullUrl('plugin.new-poster.admin.poster-award.getList') !!}',json).then(function(response) {
|
||
if (response.data.result) {
|
||
this.list = response.data.data.list.data;
|
||
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;
|
||
this.bonus_count=response.data.data.bonus_count;
|
||
this.point_count=response.data.data.point_count;
|
||
this.wechat_bonus_count=response.data.data.wechat_bonus_count;
|
||
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();
|
||
});
|
||
},
|
||
gotoDetail(item) {
|
||
let link = `{!! yzWebFullUrl('plugin.answer-reward.admin.subject.get-view') !!}`+`&id=`+item.id;
|
||
window.location.href = link;
|
||
},
|
||
|
||
search(val) {
|
||
this.getData(val);
|
||
},
|
||
|
||
export1(){
|
||
let json = {
|
||
}
|
||
let url = '{!! yzWebFullUrl('plugin.new-poster.admin.poster-award.export') !!}';
|
||
let str = '';
|
||
for(let i in this.search_form) {
|
||
if(this.search_form[i]) {
|
||
if (i == 'times') {
|
||
let start = new Date(this.search_form[i][0]).getTime() /1000;
|
||
let end = new Date(this.search_form[i][1]).getTime() /1000;
|
||
str += '&search['+i+'[0]]='+start+'&search['+i+'[1]]='+end
|
||
continue;
|
||
}
|
||
str += '&search['+i+']='+this.search_form[i]
|
||
}
|
||
}
|
||
url = url+str
|
||
console.log(url)
|
||
window.location.href = url;
|
||
},
|
||
|
||
addModal() {
|
||
let link = `{!! yzWebFullUrl('plugin.answer-reward.admin.subject.get-view') !!}`;
|
||
console.log(link);
|
||
window.location.href = link;
|
||
},
|
||
|
||
getParam(name) {
|
||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||
var r = window.location.search.substr(1).match(reg);
|
||
if (r != null) return unescape(r[2]);
|
||
return null;
|
||
},
|
||
|
||
|
||
},
|
||
})
|
||
</script>
|
||
@endsection |