| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- <?php
- use common\helpers\ComponentHelper;
- ?>
- <style>
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .table1 .el-table__footer-wrapper,
- .table1 .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .user_img{
- position: relative;
- margin-right: 8px;
- /* height: 50px;
- width: 50px; */
- }
- .default-avatar{
- width: 50px;
- height: 50px;
- border-radius: 50%;
- margin-right: 8px;
- }
- .uer-nickname {
- flex: 1;
- }
- .name-box {
- display: flex;
- flex-direction: column;
- }
- </style>
- <div id="app">
- <div class="table-body" style="min-width: 1000px;">
- <div slot="header" class="clearfix" style="height: 20px;">
- <span>数据概况</span>
- </div>
- <div slot="header" class="clearfix" style="margin-top: 20px;">
- <div class="demo-input-suffix" style="margin-top: 20px;margin-bottom: 10px;">
- <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="请输入会员昵称/ID/手机号" v-model="search.keyword" clearable>
- </el-input>
- <el-select size="small" v-model="search.level" @change='toSearch' class="select" style="margin-right: 20px;width: 150px;" placeholder="请选择代理等级">
- <el-option label="全部等级" value=""></el-option>
- <el-option :key="index" :label="item.name" :value="item.level" v-for="(item, index) in levelList"></el-option>
- </el-select>
- <el-date-picker
- style="margin-right: 20px;"
- size="small"
- v-model="selectDate"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- <el-button type="primary" size="small" @click="toSearch">搜索</el-button>
- </div>
- </div>
- <template>
- <el-table :data="list" stripe style="width: 100%" v-loading="listLoading" class="table1">
- <el-table-column prop="user_id" label="用户ID" align="center"></el-table-column>
- <el-table-column label="基本信息" >
- <template slot-scope="scope">
- <div class="user_img" flex="cross:center">
- <el-image class="default-avatar" :src="scope.row.user.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- <div class="name-box">
- <div class="uer-nickname over1" style="color:#000;">{{scope.row.user.nickname}}</div>
- <div class="user-realname">{{scope.row.mobile == null || scope.row.mobile == '' ? scope.row.user.mobile : scope.row.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="total_commission" label="区域代理等级" align="center">
- <template slot-scope="scope">
- <div>{{level_map[scope.row.level]}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="address" label="代理区域" align="center"></el-table-column>
- <el-table-column prop="order_num" label="订单量" align="center"></el-table-column>
- <el-table-column prop="order_amount" label="订单总金额" align="center"></el-table-column>
- <el-table-column prop="order_pay_amount" label="实付总金额" align="center"></el-table-column>
- <el-table-column prop="refund_amount" label="退款总金额" align="center"></el-table-column>
- <el-table-column prop="date" label="统计日期" align="center"></el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-button @click="$navigate({r:'area/data/list', user_id:scope.row.user_id})" type="text" size="mini">明细</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div flex="main:right cross:center" style="margin-top: 20px;">
- <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
- style="display: inline-block;float: right;" background @current-change="pageChange"
- layout="prev, pager, next" :total="pagination.totalCount">
- </el-pagination>
- </div>
- </template>
- </div>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- listLoading: false,
- list: [],
- pagination: {
- total: 0
- },
- loading: false,
- LoadDataType: -1, //默认显示全部数据
- dialogFormVisible: false, //默认不显示弹窗
- group_buy_attr_list: [],
- goodsDetail: {},
- dialogLoading:false,
- commander_level_limit_text:'',
- user_level_limit_text:'',
- level_map:null,
- selectDate:'',
- search: {
- page: 1,
- limit:10,
- start:'',
- end:'',
- keyword: '',
- level: '',
- },
- levelList:[
- ],
- show: false,
- level: {
- show: false,
- area: null,
- },
- current_area:null,
- }
- },
- methods: {
- //状态按钮的点击事件
- toSearch() {
- if(this.selectDate && this.selectDate[0]){
- this.search.start = this.selectDate[0];
- this.search.end = this.selectDate[1];
- }else{
- this.search.start = '';
- this.search.end = '';
- }
- this.search.page = 1;
- this.loadData();
- },
- toSearchActivity() {
- this.loadData()
- },
- pageChange(page) {
- this.search.page = page;
- this.loadData();
- },
- // 请求获取数据--获取拼团商品列表
- loadData() {
- this.listLoading = true;
- let params = {
- r: 'area/data/index'
- };
- params = Object.assign(params, this.search);
- request({
- params: params,
- method: 'get',
- }).then(e => {
- let res = e.data;
- this.listLoading = false;
- if (res.code === 0) {
- try {
- this.list = res.data.list;
- this.level_map = res.data.level_map;
- this.pagination = res.data.pagination; //拿到关于页码页容量的数据
- this.levelList = [];
- for(var i in this.level_map){
- if (i == 6){
- this.levelList.splice(1, 0, {'name':this.level_map[i],'level':i})
- }else{
- this.levelList.push({'name':this.level_map[i],'level':i})
- }
- }
- } catch (e) {
- console.error(e)
- }
- } else {
- this.$message.error(res.msg);
- }
- }).catch(e => {});
- },
- editClick() {
- this.show = true;
- },
- levelSuccess() {
- this.loadData();
- },
- editLevel(row) {
- this.level.show = true;
- this.current_area = row;
- },
- },
- // 加载的时候获取到列表页
- mounted() {
- // 数据初始化
- this.LoadDataType = -1;
- this.loadData();
- }
- })
- </script>
|