| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- <?php
- /**
- * @link:http://www.goodmall.com/
- * @copyright: Copyright (c) 2020
- * Created by PhpStorm
- * Author: ganxiaohao
- * Date: 2020-05-07
- * Time: 16:22
- */
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-export-dialog', '@backend/views/components/common');
- ?>
- <div id="app" v-cloak>
- <div class="order_stat">
- <div class="title">
- <span>会员资产</span>
- <com-export-dialog :field_list='exportList' :action_url="export_url" :params="searchData" @selected="exportConfirm"></com-export-dialog>
- </div>
- </div>
- <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div class="table-body">
- <div class="input-item" v-if="!user_id">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入会员ID" v-model="searchData.user_id" clearable @clear="search">
- <el-button slot="append" @click="search"></el-button>
- </el-input>
- </div>
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入昵称/手机号" v-model="searchData.keyword" clearable @clear="search">
- <el-button slot="append" @click="search"></el-button>
- </el-input>
- </div>
- <div class="input-item">
- <el-button type="primary" size="small" icon="el-icon-search" @click="search" class="search_button">搜索</el-button>
- </div>
- <el-table :data="form" stripe style="width: 100%" v-loading="listLoading">
- <el-table-column prop="id" label="ID" min-width="100" align="center"></el-table-column>
- <el-table-column label="用户信息" min-width="180">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- <div class="table-info-text">
- <div class="over2" v-if="scope.row.nickname">{{scope.row.nickname}}</div>
- <div>{{scope.row.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="scope" label="余额" min-width="200" align="left">
- <template slot-scope="scope">
- <div>当前余额:{{scope.row.balance}}</div>
- <div>累计余额:{{scope.row.total_balance}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="scope" label="积分" min-width="200" align="left">
- <template slot-scope="scope">
- <div>当前积分:{{scope.row.score}}</div>
- <div>累计积分:{{scope.row.total_score}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="scope" label="佣金" min-width="200" align="left">
- <template slot-scope="scope">
- <div>当前佣金:{{scope.row.commission}}</div>
- <div>累计佣金:{{scope.row.total_commission}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="scope" label="优惠券数量" min-width="100" align="center">
- <template slot-scope="scope">
- <div>优惠券总数:{{scope.row.coupon_count}}</div>
- <div>可使用总数:{{scope.row.can_coupon_count ?? 0}}</div>
- </template>
- </el-table-column>
- </el-table>
- <!--工具条 批量操作和分页-->
- <el-col :span="24" class="toolbar">
- <el-pagination background layout="prev, pager, next" @current-change="pageChange" :page-count="pageCount" style="float:right;margin:15px" >
- </el-col>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- searchData: {
- keyword: '',
- user_id: null,
- // date: '',
- // start_date: '',
- // end_at: '',
- },
- pageCount: 0,
- form: [],
- pagination: null,
- listLoading: false,
- pageSize: 10,
- user_id: null, // 外部链接传递进来的 user_id
- export_url: 'mall/finance/index',
- exportList:{},
- };
- },
- methods: {
- exportConfirm() {
- // this.searchData.keyword = this.keyword;
- // this.searchData.start_date = this.date[0];
- // this.searchData.end_date = this.date[1];
- },
- pageChange(currentPage) {
- this.page = currentPage;
- this.getList();
- },
- search() {
- this.page = 1;
- this.getList();
- },
- getList() {
- let user_id = this.user_id ? this.user_id : this.searchData.user_id;
- let params = {
- r: 'mall/finance/index',
- page: this.page,
- date: this.date,
- user_id: user_id,
- keyword: this.searchData.keyword,
- };
- if (this.searchData.date) {
- Object.assign(params, {
- start_time: this.searchData.date[0],
- end_time: this.searchData.date[1],
- });
- }
- request({
- params,
- }).then(e => {
- if (e.data.code === 0) {
- this.form = e.data.data.list;
- this.pagination = e.data.data.pagination;
- this.pageSize = e.data.data.page_size;
- this.pageCount = e.data.data.page_count;
- this.exportList = e.data.data.export_list;
- console.log(this.pageCount);
- } else {
- this.$message.error(e.data.msg);
- }
- this.listLoading = false;
- }).catch(e => {
- this.listLoading = false;
- });
- this.listLoading = true;
- },
- },
- mounted: function() {
- this.getList();
- },
- created: function() {
- this.user_id = getQuery('user_id');
- },
- });
- </script>
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .title{
- font-size: 18px;
- font-weight: bold;
- display: flex;
- align-items: center;
- height: 40px;
- display: flex;
- justify-content: space-between;
- }
- .order_stat > .title > .time{
- font-size: 13px;
- font-weight: 400;
- color: #BFBFBF;
- margin-left: 20px;
- flex: 1;
- }
- .input-item {
- display: inline-block;
- width: 250px;
- margin: 0 0 20px 20px;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper,
- .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .search_button {
- /* margin-left: 108px; */
- margin-right: 10px;
- width: 80px;
- height: 33px;
- border-radius: 5px;
- }
- .default-avatar{
- width: 50px;
- height: 50px;
- border-radius: 50%;
- margin-right: 8px;
- }
- .uer-nickname {
- flex: 1;
- }
- .user_img{
- position: relative;
- margin-right: 8px;
- /* height: 50px;
- width: 50px; */
- }
- </style>
|