| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- <?php
- ?>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div>
- <span>参团奖励明细</span>
- <!-- <div style="float: right; margin: -5px 0">
- <com-export-dialog :field_list='exportList' :params="searchData">
- </com-export-dialog>
- </div> -->
- </div>
- </div>
- <div class="table-body">
- 会员编号:
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="用户ID" v-model="searchData.user_id" clearable @clear="search"></el-input>
- </div>
- 会员昵称:
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="用户昵称" v-model="searchData.nickname" clearable @clear="search"></el-input>
- </div>
- 联系电话:
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="手机号码" v-model="searchData.mobile" clearable @clear="search"></el-input>
- </div>
- 奖励类型:
- <div class="input-item">
- <el-select v-model="searchData.prize_type" placeholder="奖励类型">
- <el-option
- v-for="(item,key) in prize_type_arr"
- :label="item"
- :value="key">
- </el-option>
- </el-select>
- </div>
- <br />
- 奖励时间段:
- <el-date-picker size="small" v-model="date" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" @change="selectDateTime" end-placeholder="结束日期">
- </el-date-picker>
- <div style="display: inline-block;margin-left: 10px;">
- <el-button type="primary" size="small" @click="search">查询</el-button>
- <el-button type="primary" size="small" @click="resetForm" style=" margin-left: 0px;background-color: #ef1818;border-color: #ef1818;">重置</el-button>
- </div>
- <el-table class="table-info" :data="form" stripe style="width: 100%" v-loading="listLoading">
- <el-table-column prop="id" label="ID" width="60" align="center"></el-table-column>
- <el-table-column label="会员" width="180">
- <template slot-scope="scope">
- <div style="display: flex;align-items: center;">
- <com-image style="margin-right: 5px;display: block;flex-shrink: 0;border-radius:5px" mode="aspectFill" :src="scope.row.avatar_url ? scope.row.avatar_url : ''"></com-image>
- <div v-if="scope.row" style="line-height: 18px;">
- <div v-if="scope.row.nickname">{{scope.row.nickname}}</div>
- <div v-else>{{scope.row.username}}</div>
- <div>用户id:{{scope.row.user_id}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="mobile" label="手机号" align="center">
- <template slot-scope="scope">{{scope.row.mobile ? scope.row.mobile :'--'}}</template>
- </el-table-column>
- <el-table-column prop="" label="拼团等级" align="center">
- <template slot-scope="scope">
- <el-tag v-if="scope.row.group_level">{{scope.row.group_level.name}}</el-tag>
- <el-tag v-else-if="scope.row.level == -1">普通用户</el-tag>
- <el-tag v-else>游客</el-tag>
- </template>
- </el-table-column>
- <!-- <el-table-column prop="title" label="拼团活动名称" align="center"> -->
- </el-table-column>
- <el-table-column prop="money" label="金额" align="center">
- <template slot-scope="scope">
- {{scope.row.money.toFixed(2)}}
- </template>
- </el-table-column>
- <el-table-column prop="money_type" label="资金属性" align="center">
- <template slot-scope="scope">
- {{getMoneyType(scope.row.money_type)}}
- </template>
- </el-table-column>
- <el-table-column prop="prize_type" label="奖励类型" align="center">
- <template slot-scope="scope">
- {{getPrizeType(scope.row.prize_type)}}
- </template>
- </el-table-column>
-
- <el-table-column prop="desc" width="300" label="描述" align="center">
- </el-table-column>
- <el-table-column prop="created_at" label="奖励时间" width="160px" align="center">
- <template slot-scope="scope">
- {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
- </div>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- searchData: {
- user_id: '',
- nickname: '',
- mobile: '',
- start_date: '',
- end_date: '',
- prize_type:''
- },
- prize_type_arr:[],
- money_type_arr:[],
- date: '',
- form: [],
- member: [],
- pageCount: 0,
- page: 1,
- member_page: 1,
- currentPage: null,
- listLoading: false,
- btnLoading: false,
- // 导出
- exportList: [],
- };
- },
- methods: {
- openId(index) {
- let item = this.form;
- item[index].is_open_id = !item[index].is_open_id;
- this.form = JSON.parse(JSON.stringify(this.form));
- },
- getMoneyType(money_type){
- return this.money_type_arr[money_type] ? this.money_type_arr[money_type] : '未知资金类型';
- },
- getPrizeType(prize_type){
- return this.prize_type_arr[prize_type] ? this.prize_type_arr[prize_type] : '未知奖励类型';
- },
- //搜索
- search() {
- this.page = 1;
- this.getList();
- },
- pagination(currentPage) {
- this.page = currentPage;
- this.getList();
- },
- getList() {
- this.listLoading = true;
- request({
- params: {
- r: 'lucky-group/bill/award-list',
- page: this.page,
- user_id: this.searchData.user_id,
- nickname: this.searchData.nickname,
- mobile: this.searchData.mobile,
- start_date: this.searchData.start_date,
- end_date: this.searchData.end_date,
- prize_type: this.searchData.prize_type,
- pagesize: 10
- },
- }).then(e => {
- if (e.data.code === 0) {
- this.form = e.data.data.list;
- this.pageCount = e.data.data.page_count;
- this.currentPage = e.data.data.pagination.current_page;
- this.exportList = e.data.data.exportList;
- this.mall_members = e.data.data.mall_members;
- this.prize_type_arr = e.data.data.prize_type_arr;
- this.money_type_arr = e.data.data.money_type_arr;
- } else {
- this.$message.error(e.data.msg);
- }
- console.log(this.prize_type_arr);
- this.listLoading = false;
- }).catch(e => {
- this.listLoading = false;
- });
- },
- // 时间搜索触发
- selectDateTime(e) {
- if (e != null) {
- this.searchData.start_date = e[0];
- this.searchData.end_date = e[1];
- } else {
- this.searchData.start_date = '';
- this.searchData.end_date = '';
- }
- this.page = 1;
- this.search();
- },
- //重置
- resetForm() {
- this.searchData.user_id = '';
- this.searchData.nickname = '';
- this.searchData.mobile = '';
- this.searchData.start_date = '';
- this.searchData.end_date = '';
- this.searchData.prize_type = '';
- this.date = '';
- },
- },
- mounted: function() {
- this.page = getQuery('page') ? getQuery('page') : 1;
- this.getList();
- }
- });
- </script>
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- /* .table-info .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- } */
- .input-item {
- display: inline-block;
- width: 150px;
- margin: 0 0 20px;
- }
- .input-item .el-input__inner {
- border-right: 1px solid #dcdfe6;
- }
- .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;
- }
- .select {
- float: left;
- width: 100px;
- margin-right: 10px;
- }
- .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;
- }
- </style>
|