1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<template>
<div class="index">
<!-- <el-form ref="searchFrom" :model="searchFrom" label-width="80px" inline>
<el-form-item label="用户ID">
<el-input v-model="searchFrom.user_id"
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" plain @click="initPage">
搜索
</el-button>
</el-form-item>
</el-form> -->
<el-table
:data="tableData"
style="width: 100%">
<el-table-column
prop="nickname"
label="用户">
</el-table-column>
<el-table-column
prop="mobile"
label="手机号">
</el-table-column>
<el-table-column
prop="integral"
label="积分">
</el-table-column>
<el-table-column
prop="desc"
label="备注">
</el-table-column>
<el-table-column
label="操作"
min-width="150"
v-if="!$store.state.readonly">
<template slot-scope="scope">
<el-button
@click="editComment(scope.row.id, scope.row.integral)"
type="text"
plain
size="mini">
修改积分
</el-button>
</template>
</el-table-column>
</el-table>
<page :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
<!-- 修改积分 -->
<el-dialog
title="修改积分"
center
append-to-body
:visible.sync="showCommentDialog"
:close-on-click-modal="false"
:close-on-press-escape="false"
:show-close="false"
width="600px">
<div>
<el-form ref="commentFrom" :model="commentForm" inline>
<el-form-item label="积分">
<el-input-number v-model="commentForm.integral" :min="0"></el-input-number>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="showCommentDialog = false">取 消</el-button>
<el-button type="primary" @click="saveComment(commentForm.integral)">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import page from '../framework/page'
import {} from "../../service/api";
export default {
name: "index",
components:{
page
},
data(){
return {
total:0,
nowPage:1,
limit: 10,
searchFrom: {
source:''
},
tableData:[1,2],
commentForm: {
integral:0,
},
showCommentDialog: false
}
},
created(){
this.initPage()
},
methods:{
initPage(){
let json = {
limit: this.limit,
page: this.nowPage
}
// if (this.searchFrom.user_id) {
// json.user_id = this.searchFrom.user_id
// }
// getAdsInnerListApi(json).then((res)=>{
// this.tableData = res.list;
// this.total = res.total
// })
},
onPageChange(val){
this.nowPage = val
this.initPage()
},
onSizeChange(val){
this.nowPage = 1
this.limit = val
this.initPage()
},
saveComment(data){
this.$confirm('确定修改?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(()=>{
let json={
integral:data,
}
// Api(id).then(res=>{
this.$message({
type: 'success',
message: '修改成功'
});
this.showCommentDialog = false;
this.initPage();
});
// });
},
editComment(id, integral) {
this.showCommentDialog = true;
this.commentForm = {
id: id,
integral: integral
};
},
}
}
</script>
<style scoped lang="less">
.index {
padding: 20px 0;
}
</style>