| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383 |
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .input-item {
- display: inline-block;
- width: 250px;
- margin: 0 0 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;
- }
- .label {
- margin-right: 10px;
- }
- .default-goods{
- max-width: 50px;
- max-height: 50px;
- }
- .flex-x-between {
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-pack: space-between;
- -webkit-justify-content: space-between;
- -ms-flex-pack: space-between;
- justify-content: space-between;
- }
- .cont-title {
- font-size: 15px;
- padding-top: 20px;
- padding-bottom: 10px;
- font-weight: 700;
- }
- .cont-num {
- font-size: 14px;
- font-weight: 700;
- padding-bottom: 10px;
- }
- .center {
- text-align: center;
- }
- .el-dialog__header .el-dialog__title{
- font-size: 18px;
- }
- .el-dialog__wrapper .el-dialog__body{
- padding: 3px 20px;
- }
- /*头像样式 start*/
- .default-avatar{
- width: 50px;
- height: 50px;
- border-radius: 50%;
- }
- .user_img{
- position: relative;
- margin-right: 8px;
- height: 50px;
- width: 50px;
- }
- .el-table_1_column_2 .cell { /*-2 表示在第二行*/
- display: flex;
- }
- /*头像样式 end*/
- </style>
- <div id="app" v-cloak>
- <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div>
- <span>奖励明细</span>
- </div>
- </template>
- </div>
- <div class="table-body el-input--small">
- <el-form size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
- <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
- <div class="label">会员昵称</div>
- <el-input style="width: 200px" v-model="search.user_name" placeholder="会员昵称"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
- <div class="label">会员手机号码</div>
- <el-input style="width: 200px" v-model="search.mobile" placeholder="会员手机号码"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
- <div class="label">会员ID</div>
- <el-input style="width: 200px" v-model="search.user_id" placeholder="会员ID"></el-input>
- </div>
- <div class="item-box" flex="dir:left cross:center">
- <div class="label">发布类型</div>
- <el-select v-model="search.note_type" @change='searchs' class="select" size="small">
- <el-option :key="0" label="全部" :value="0"></el-option>
- <el-option :key="1" label="文章" :value="1"></el-option>
- <el-option :key="2" label="视频" :value="2"></el-option>
- <el-option :key="3" label="广告" :value="3"></el-option>
- </el-select>
- </div>
- <div class="item-box" flex="dir:left cross:center">
- <div class="label">奖励来源</div>
- <el-select v-model="search.reward_source" @change='searchs' class="select" size="small">
- <el-option :key="0" label="全部" :value="0"></el-option>
- <el-option :key="1" label="阅读" :value="1"></el-option>
- <el-option :key="2" label="分享" :value="2"></el-option>
- </el-select>
- </div>
- <div class="item-box" flex="dir:left cross:center">
- <el-button type="primary" style="padding: 12px 34px !important;" @click="searchs">搜索
- </el-button>
- </div>
- </el-form>
- <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
- <el-table-column label="会员ID" min-width="80" align="center">
- <template slot-scope="scope">
- <p>{{scope.row.user_id}}</p>
- </template>
- </el-table-column>
- <el-table-column label="会员名称" width="180" >
- <template slot-scope="scope">
- <div class="user_img" v-if="scope.row.user_id>0">
- <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>
- <div class="user_img" v-else>
- <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>
- <div>
- <div style="color:#000;" v-if="scope.row.user_id>0">{{scope.row.user.nickname}}</div>
- <div style="color:#000;" v-else>{{scope.row.user_name}}</div>
- <div style="font-size: 13px;" v-if="scope.row.user_id>0">{{scope.row.user.mobile}}</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="类型" min-width="80" align="center">
- <template slot-scope="scope">
- <p>{{scope.row.note_type_name}}</p>
- </template>
- </el-table-column>
- <el-table-column label="奖励来源" min-width="80" align="center">
- <template slot-scope="scope">
- <p>{{scope.row.reward_source_name}}</p>
- </template>
- </el-table-column>
- <el-table-column prop="scope" width="160" label="创建时间">
- <template slot-scope="scope">
- {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- <el-table-column label="奖励" min-width="80" align="center">
- <template slot-scope="scope">
- <p>{{scope.row.reward_content}} </p>
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination v-if="pagination" :page-size="pagination.pageSize"
- style="display: inline-block;float: right;" background @current-change="pageChange"
- layout="prev, pager, next" :total="pagination.total_count">
- </el-pagination>
- </div>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- listLoading: false,
- page: 1,
- pageCount: 0,
- //基础数据
- editBasisData: {
- materialTypeList: [],
- },
- //本地存时间,请求时不发送
- time: [],
- search: {
- keyword: '',
- user_id: '',
- title: '',
- user_name: '',
- note_type: '',
- reward_source: '',
- check_status: '1',
- date_start: null,
- date_end: null,
- },
- list: [],
- //弹框配置
- addForm: {
- id: '',
- name: '',
- },
- title: "",
- dialogFormVisible: false, //数据弹窗
- data_list: {
- source:{"type":1,"source": ['1','2']},
- },//数据
- goods_data:[],//详细数据
- dialogAddgsVisible: false,
- // 对话框显示与否
- dialogVisible: false,
- dataloading: false,
- pagination:null,
- };
- },
- methods: {
- searchs() {
- this.page = 1;
- this.getList();
- },
- pageChange(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList();
- },
- getList() {
- let self = this;
- self.listLoading = true;
- // 检查是否选择了搜索时间
- if (!self.time) {
- self.search.date_start = '';
- self.search.date_end = '';
- } else {
- self.search.date_start = self.time[0];
- self.search.date_end = self.time[1];
- }
- request({
- method: 'post',
- params: {
- r: 'operating-note/reward/index',
- },
- data: {
- page: self.page,
- // keyword: self.search.keyword,
- note_type: self.search.note_type,
- reward_source: self.search.reward_source,
- user_id: self.search.user_id,
- mobile: self.search.mobile,
- user_name: self.search.user_name,
- // check_status: self.search.check_status,
- // date_start: self.search.date_start,
- // date_end: self.search.date_end,
- // title: self.search.title,
- },
- }).then(e => {
- self.listLoading = false;
- self.list = e.data.data.list;
- this.pagination = e.data.data.pagination;
- this.pagination.pageSize = e.data.data.page_size;
- this.pagination.total_count = e.data.data.count;
- }).catch(e => {
- console.log(e);
- });
- },
- detail(data) {
- console.log(data);
- this.data_list = [];
- this.goods_data = [];
- this.dialogFormVisible = true;
- this.data_list = data;
- this.goods_data.push(data);
- },
- handle(type,data = null){
- switch (type) {
- case 'delete':// 删除
- this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {type: 'warning'}).then(() => {this.send({id: data.id,status:-1,type:'1'});})
- break;
- case 'enable':
- var status = 0;
- if(data.status=='0') status = 1;
- this.send({id: data.id,status: status,type:'1'});
- break;
- }
- },
- send(data){
- let self = this;
- self.listLoading = true;
- request({
- params: {
- r: 'xhs/default/edit',
- },
- method: 'post',
- data:data,
- }).then(e => {
- self.listLoading = false;
- if (e.data.code === 0) {
- self.$message.success(e.data.msg);
- } else {
- self.$message.error(e.data.msg);
- }
- self.getList();
- }).catch(e => {
- console.log(e);
- });
- },
- /**
- *关闭或取消模态框,清空值
- * @param
- */
- closeDialogAddgsVisible() {
- this.$refs.addForm.resetFields();//element封装的方法,清空模态框的值
- this.title = "" //初始化title的值
- this.addForm = {//初始化addForm中的值
- title: "",
- }
- },
- },
- mounted: function () {
- this.getList();
- }
- });
- </script>
|