| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- <?php
- ?>
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- .input-item {
- width: 200px;
- margin: 0 0 20px;
- display: inline-block;
- }
- /*.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;
- }
- </style>
- <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">
- <span>兑换记录</span>
- </div>
- <div class="table-body">
- <el-form :inline="true" :model="search" size="small" >
- <div class="input-item">
- <el-input size="small" placeholder="请输入商品名称" v-model="search.goods_name"></el-input>
- </div>
- <div class="input-item">
- <el-input size="small" placeholder="请输入会员ID" v-model="search.user_id"></el-input>
- </div>
- <el-date-picker size="small" placeholder="选择日期" v-model="search.date" type="month" value-format="yyyy-MM">
- </el-date-picker>
- <el-button type="primary" size="small" style="padding: 9px 15px !important;" @click="send('search')">搜索</el-button>
- <el-button type="danger" size="small" style="padding: 9px 15px !important;"
- @click="send('clearSearch')" v-if="search.goods_name != '' || search.user_id != '' ">清除条件</el-button>
- </el-form>
- <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
- <el-table-column label="会员ID" prop="user_id" align="center"></el-table-column>
- <el-table-column align="left" label="会员" width="280">
- <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>{{scope.row.nickname}}</div>-->
- <div>
- <com-ellipsis :line=1 :text="scope.row.nickname"> </com-ellipsis>
- </div>
- <div>{{scope.row.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column align="left" label="商品" width="250">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img" :src="scope.row.pic_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" style="flex: 1">
- <div>
- <com-ellipsis :line=2 :text="scope.row.goods_name"> </com-ellipsis>
- </div>
- <div style="color: #ff2727">{{scope.row.exchange_price}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="订单编号" prop="order_no" align="center"></el-table-column>
- <el-table-column label="兑换数量" prop="num" align="center"></el-table-column>
- <el-table-column label="创建时间" prop="created_at" align="center"></el-table-column>
- <el-table-column label="操作" width="300px" align="center">
- <template slot-scope="scope">
- <el-button size="small" type="text" @click="handle('orderDetail', scope.row.order_id)">订单详情</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div flex="box:last cross:center">
- <div></div>
- <div>
- <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>
- </div>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data: {
- search: {
- goods_name: '',
- user_id: '',
- date: ''
- },
- loading: false,
- page: 1,
- pagination: null,
- list: []
- },
- mounted() {
- this.send('getData');
- },
- methods: {
- send(type) {
- switch (type) {
- case 'getData':
- this.loading = true;
- if (this.search.date) {
- let date = this.search.date.split('-');
- this.search.date = date[0] + '-' + date[1];
- }
- let params = Object.assign({r: 'score-mall/default/exchange-record', page: this.page}, this.search);
- request({
- params: params,
- method: 'get'
- }).then(e=>{
- this.loading = false;
- if (e.data.code == 0) {
- this.pagination = e.data.data.pagination;
- this.list = e.data.data.list;
- this.search.date = e.data.data.date;
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.loading = false;
- self.$message.error(e.data.msg);
- });
- break;
- case 'search':
- this.page = 1;
- this.send('getData');
- break;
- case 'clearSearch':
- this.page = 1;
- this.search.goods_name = '';
- this.search.user_id = '';
- this.send('getData');
- break;
- }
- },
- handle(type, param1 = null, param2 = null) {
- switch (type){
- case 'orderDetail':
- let params = {
- r: 'mall/order/detail'
- };
- if (param1) params = Object.assign(params, {
- id: param1
- });
- navigateTo(params);
- }
- },
- pageChange(page) {
- this.page = page;
- this.send('getData');
- },
- }
- })
- </script>
|