lhl 1 kuukausi sitten
vanhempi
commit
764e414dfe

+ 80 - 0
src/api/system/chat.js

@@ -0,0 +1,80 @@
+import request from '@/plugins/request/system';
+
+/**
+ * 获取订单列表
+ * @param {Object} data 
+ * @param {String} data.page 
+ * @param {String} data.limit
+ * @param {String} data.status
+ * @param {String} data.order_no
+ * @param {String} data.user_id
+ */
+export function getOrderList(data) {
+	return request({
+	    url: '/systemv1/chat/orderList',
+	    method: 'get',
+	    params: data
+	});
+}
+
+/**
+ * 获取变动明细
+ * @param {Object} data 
+ * @param {String} data.page 
+ * @param {String} data.limit
+ */
+export function getBalanceList(data) {
+	return request({
+	    url: '/systemv1/chat/balanceLogList',
+	    method: 'get',
+	    params: data
+	});
+}
+
+/**
+ * 获取聊天记录
+ * @param {Object} data 
+ * @param {String} data.page 
+ * @param {String} data.limit
+ * @param {String} data.user_id
+ * @param {String} data.to_user_id
+ */
+export function getRecordList(data) {
+	return request({
+	    url: '/systemv1/chat/recordList',
+	    method: 'get',
+	    params: data
+	});
+}
+
+/**
+ * 添加聊天次数
+ * @param {Object} data 
+ * @param {String} data.page 
+ * @param {String} data.limit
+ * @param {String} data.user_id
+ * @param {String} data.to_user_id
+ */
+export function addBalance(data) {
+	return request({
+	    url: '/systemv1/chat/addBalance',
+	    method: 'post',
+	    data: data
+	});
+}
+
+/**
+ * 减少聊天次数
+ * @param {Object} data 
+ * @param {String} data.page 
+ * @param {String} data.limit
+ * @param {String} data.user_id
+ * @param {String} data.to_user_id
+ */
+export function subBalance(data) {
+	return request({
+	    url: '/systemv1/chat/subBalance',
+	    method: 'post',
+	    data: data
+	});
+}

+ 70 - 0
src/api/system/user.js

@@ -195,6 +195,76 @@ export function forumPost(data) {
 	});
 }
 
+/**
+ * 获取荣誉列表
+ * @param {Object} data 
+ * @param {number} data.page 页码
+ * @param {number} data.pageSize 每页数量
+ * @param {number} data.status 状态
+ * @param {String} data.name 名称
+ */
+export function getHonorList(data) {
+	return request({
+	    url: '/systemv1/honor/list',
+	    method: 'get',
+	    params : data
+	});
+}
+
+/**
+ * 添加编辑荣誉
+ * @param {Object} data 
+ * @param {String} data.name 名称
+ * @param {String} data.icon 图标
+ * @param {number} data.status 状态
+ */
+export function saveHonor(data) {
+	return request({
+	    url: '/systemv1/honor/save',
+	    method: 'post',
+	    data: data
+	});
+}
+
+/**
+ * 删除荣誉
+ * @param {Object} data 
+ * @param {String} data.id 
+ */
+export function delHonor(data) {
+	return request({
+	    url: '/systemv1/honor/del',
+	    method: 'get',
+	    params: data
+	});
+}
+
+/**
+ * 获取用户荣誉
+ * @param {Object} data 
+ * @param {String} data.uid 
+ */
+export function getUserHonor(data) {
+	return request({
+	    url: '/systemv1/honor/getUserHonor',
+	    method: 'get',
+	    params: data
+	});
+}
+
+/**
+ * 修改用户荣誉
+ * @param {Object} data 
+ * @param {String} data.uid 
+ * @param {String} data.honor 
+ */
+export function editUserHonor(data) {
+	return request({
+	    url: '/systemv1/honor/userHonorSave',
+	    method: 'post',
+	    data: data
+	});
+}
 
 
 

+ 16 - 15
src/components/system/chat/index.vue

@@ -58,6 +58,7 @@
 <script>
     import IPageHeader from "../../../layouts/system/page-header/index";
     import {SystemShowTemplateList} from "../../../api/system/user";
+	import { getRecordList } from '../../../api/system/chat'
 
     export default {
         name: "chatList",
@@ -225,21 +226,21 @@
                     page :that.page.page,
                     ...that.orderData
                 };
-                // SystemShowTemplateList(data)
-                //     .then(res=>{
-                //         that.loading = false;
-                //         if(res.code == 200) {
-                //             that.orderList = res.data.list;
-                //             that.page.pageSize = res.data.pageSize;
-                //             that.page.count = res.data.pageCount;
-                //         } else {
-                //             that.$alert(res.msg);
-                //         }
-                //     })
-                //     .catch(err=>{
-                //         that.loading = false;
-                //         that.$alert("网络繁忙,加载失败,请稍等片刻在尝试!", '系统提示');
-                //     });
+                getRecordList(data)
+                    .then(res=>{
+                        that.loading = false;
+                        if(res.code == 200) {
+                            that.orderList = res.data.list;
+                            that.page.pageSize = res.data.pageSize;
+                            that.page.count = res.data.pageCount;
+                        } else {
+                            that.$alert(res.msg);
+                        }
+                    })
+                    .catch(err=>{
+                        that.loading = false;
+                        that.$alert("网络繁忙,加载失败,请稍等片刻在尝试!", '系统提示');
+                    });
             },
 
         }

+ 257 - 0
src/components/system/chat/log.vue

@@ -0,0 +1,257 @@
+<template>
+    <div style="padding-top: 10px;">
+		<i-page-header :title="pageTitle"></i-page-header>
+        <Card :bordered="false" dis-hover class="ivu-mt">
+            <!-- <Form ref="orderData" :model="orderData">
+                <Row :gutter="24" type="flex">
+					<Col>
+					    <FormItem label="UID:" label-for="uid">
+					        <Input placeholder="用户UID" v-model="orderData.uid"/>
+					    </FormItem>
+					</Col>
+					<Col>
+					    <FormItem label="绑定手机:" label-for="mobile">
+					        <Input placeholder="绑定手机号码" v-model="orderData.mobile"/>
+					    </FormItem>
+					</Col>
+					<Col>
+					    <FormItem label="购买时间:">
+					        <DatePicker v-model="orderData.time" format="yyyy/MM/dd HH:mm:ss" type="datetimerange" placement="bottom-start" placeholder="自定义时间" style="width: 300px;" class="mr20" :options="options"></DatePicker>
+					    </FormItem>
+					</Col>
+					<Col>
+					    <Button label="default" type="primary" icon="ios-search"  class="mr15" style="margin-top: 32px;" @click="orderSearch()">搜索</Button>
+					</Col>
+                </Row>
+            </Form> -->
+            <!-- <Col>
+                <Button class="export" icon="ios-share-outline" @click="exports">导出</Button>
+            </Col> -->
+			
+
+            <Table :columns="columns"  :data="orderList" ref="table" :loading="loading" highlight-row no-data-text="暂无数据" no-filtered-data-text="暂无筛选结果"  class="orderData mt25">
+                <template slot-scope="{ row, index }" slot="order_id">
+                    <span v-text="row.order_id" style="display: block;"></span>
+                </template>
+				<template slot-scope="{ row, index }" slot="uid">
+					<div>{{row.nickname || '微信用户'}}[UID:{{row.uid}}]</div>
+					<div>{{row.mobile || '未绑定手机号'}}</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="imgs">
+					<img v-if="row.imgs.length>0" v-lazy="row.imgs[0]" :src="row.imgs[0]" v-image-preview style="width: 60px;cursor: pointer"/>
+				</template>
+				
+				<template slot-scope="{ row, index }" slot="status">
+					
+				</template>
+				
+				
+				
+            </Table>
+            <div class="acea-row row-right page">
+                <Page :total="page.count" show-elevator show-total @on-change="tapPage" :page-size="page.pageSize"/>
+            </div>
+        </Card>
+       
+    </div>
+</template>
+<script>
+    import IPageHeader from "../../../layouts/system/page-header/index";
+    import {SystemShowTemplateList} from "../../../api/system/user";
+	import { getBalanceList } from "../../../api/system/chat";
+
+    export default {
+        name: "chatList",
+        components: {SystemShowTemplateList,IPageHeader},
+        computed: {},
+        data() {
+            return {
+				pageTitle:"变动明细",
+                options: {
+                    shortcuts: [
+                        {
+                            text: '今天',
+                            value() {
+                                const end = new Date();
+                                const start = new Date();
+                                start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()));
+                                return [start, end];
+                            }
+                        },
+                        {
+                            text: '昨天',
+                            value() {
+                                const end = new Date();
+                                const start = new Date();
+                                start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() - 1)));
+                                end.setTime(end.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate())));
+                                return [start, end];
+                            }
+                        },
+                        {
+                            text: '最近7天',
+                            value() {
+                                const end = new Date();
+                                const start = new Date();
+                                start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() - 6)));
+                                return [start, end];
+                            }
+                        },
+                        {
+                            text: '最近30天',
+                            value() {
+                                const end = new Date();
+                                const start = new Date();
+                                start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() - 29)));
+                                return [start, end];
+                            }
+                        },
+                        {
+                            text: '本月',
+                            value() {
+                                const end = new Date();
+                                const start = new Date();
+                                start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), 1)));
+                                return [start, end];
+                            }
+                        },
+                        {
+                            text: '本年',
+                            value() {
+                                const end = new Date();
+                                const start = new Date();
+                                start.setTime(start.setTime(new Date(new Date().getFullYear(), 0, 1)));
+                                return [start, end];
+                            }
+                        }
+                    ]
+                },
+
+                orderData: {
+					uid             : "",
+                    status          : "all",
+                    time            : [],
+					mobile          : "",
+					show_template_id:"",
+                },
+                columns: [
+					{
+					    title: 'ID',
+					    key: 'id',
+					    align:'center'
+					},
+                    {
+                        title: '用户ID',
+						key: 'user_id',
+                        align:'center'
+                    },
+					{
+					    title: '类型',
+						slot: 'type',
+					    align:'center'
+					},
+					{
+					    title: '变动数量',
+					    key: 'num',
+					    align:'center'
+					},
+					{
+					    title: "变动后余额",
+					    key: 'balance',
+					    align:'left'
+					},
+					{
+					    title: '备注',
+					    key: 'remark',
+					    align:'left'
+					},
+					// {
+					//     title: '关联id',
+					//     key: 'relate_id',
+					//     align:'left'
+					// },
+					{
+					    title: '时间',
+					    key: 'create_time',
+					    align:'left'
+					},
+                ],
+                loading:false,
+                orderList:[],
+                orderDatalist:{},
+                orderId : 0,
+                page: {
+                    total: 0, // 总条数
+                    page: 1, // 当前页
+                    pageSize: 10 // 每页显示条数
+                },
+            }
+        },
+
+        created() {
+			if(this.$route.query.title){
+				this.pageTitle = this.$route.query.title;
+			}
+			if(this.$route.query.uid){
+				this.orderData.uid = parseInt(this.$route.query.uid);
+			}
+			if(this.$route.query.show_template_id){
+				this.orderData.show_template_id = parseInt(this.$route.query.show_template_id);
+			}
+            this.initView();
+        },
+        methods: {
+            /**
+             * 基本数据
+             */
+            initView: function () {
+                this.getData();
+            },
+			tabsHandleClick:function(tab, event){
+				this.page.page = 1;
+				this.getData();
+			},
+            orderSearch:function(){
+                this.page.page = 1;
+                this.getData();
+            },
+            /**
+             * 分页
+             */
+            tapPage:function(index){
+                this.page.page = index;
+                this.getData();
+            },
+            /**
+             * 获取数据
+             */
+            getData:function () {
+				var that =this;
+                // this.loading = true;
+                var data = {
+                    page :that.page.page,
+                    ...that.orderData
+                };
+                getBalanceList(data)
+                    .then(res=>{
+                        that.loading = false;
+                        if(res.code == 200) {
+                            that.orderList = res.data.list;
+                            that.page.pageSize = res.data.pageSize;
+                            that.page.count = res.data.pageCount;
+                        } else {
+                            that.$alert(res.msg);
+                        }
+                    })
+                    .catch(err=>{
+                        that.loading = false;
+                        that.$alert("网络繁忙,加载失败,请稍等片刻在尝试!", '系统提示');
+                    });
+            },
+
+        }
+    }
+</script>
+<style scoped>
+
+</style>

+ 259 - 2
src/components/system/chat/order.vue

@@ -1,8 +1,265 @@
 <template>
-</template>
+	<div style="padding-top: 10px;">
+		<i-page-header :title="pageTitle"></i-page-header>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Form ref="orderData" :model="orderData">
+                <Row :gutter="24" type="flex">
+					<Col>
+					    <FormItem label="UID:" label-for="uid">
+					        <Input placeholder="用户UID" v-model="orderData.uid"/>
+					    </FormItem>
+					</Col>
+					<Col>
+					    <FormItem label="绑定手机:" label-for="mobile">
+					        <Input placeholder="绑定手机号码" v-model="orderData.mobile"/>
+					    </FormItem>
+					</Col>
+					<Col>
+					    <FormItem label="购买时间:">
+					        <DatePicker v-model="orderData.time" format="yyyy/MM/dd HH:mm:ss" type="datetimerange" placement="bottom-start" placeholder="自定义时间" style="width: 300px;" class="mr20" :options="options"></DatePicker>
+					    </FormItem>
+					</Col>
+					<Col>
+					    <Button label="default" type="primary" icon="ios-search"  class="mr15" style="margin-top: 32px;" @click="orderSearch()">搜索</Button>
+					</Col>
+                </Row>
+            </Form>
+			<!-- <Col>
+                <Button class="export" icon="ios-share-outline" @click="exports">导出</Button>
+            </Col> -->
+
+
+			<Table :columns="columns" :data="orderList" ref="table" :loading="loading" highlight-row no-data-text="暂无数据"
+				no-filtered-data-text="暂无筛选结果" class="orderData mt25">
+				<template slot-scope="{ row, index }" slot="order_id">
+					<span v-text="row.order_id" style="display: block;"></span>
+				</template>
+				<template slot-scope="{ row, index }" slot="uid">
+					<div>{{row.nickname || '微信用户'}}[UID:{{row.uid}}]</div>
+					<div>{{row.mobile || '未绑定手机号'}}</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="imgs">
+					<img v-if="row.imgs.length>0" v-lazy="row.imgs[0]" :src="row.imgs[0]" v-image-preview
+						style="width: 60px;cursor: pointer" />
+				</template>
+
+				<template slot-scope="{ row, index }" slot="status">
+
+				</template>
+
 
+
+			</Table>
+			<div class="acea-row row-right page">
+				<Page :total="page.count" show-elevator show-total @on-change="tapPage" :page-size="page.pageSize" />
+			</div>
+		</Card>
+
+	</div>
+</template>
 <script>
+	import IPageHeader from "../../../layouts/system/page-header/index";
+	import {
+		SystemShowTemplateList
+	} from "../../../api/system/user";
+	import {
+		getOrderList
+	} from '../../../api/system/chat'
+
+	export default {
+		name: "chatList",
+		components: {
+			SystemShowTemplateList,
+			IPageHeader
+		},
+		computed: {},
+		data() {
+			return {
+				pageTitle: "购买记录",
+				options: {
+					shortcuts: [{
+							text: '今天',
+							value() {
+								const end = new Date();
+								const start = new Date();
+								start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date()
+									.getDate()));
+								return [start, end];
+							}
+						},
+						{
+							text: '昨天',
+							value() {
+								const end = new Date();
+								const start = new Date();
+								start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(),
+									new Date().getDate() - 1)));
+								end.setTime(end.setTime(new Date(new Date().getFullYear(), new Date().getMonth(),
+									new Date().getDate())));
+								return [start, end];
+							}
+						},
+						{
+							text: '最近7天',
+							value() {
+								const end = new Date();
+								const start = new Date();
+								start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(),
+									new Date().getDate() - 6)));
+								return [start, end];
+							}
+						},
+						{
+							text: '最近30天',
+							value() {
+								const end = new Date();
+								const start = new Date();
+								start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(),
+									new Date().getDate() - 29)));
+								return [start, end];
+							}
+						},
+						{
+							text: '本月',
+							value() {
+								const end = new Date();
+								const start = new Date();
+								start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(),
+									1)));
+								return [start, end];
+							}
+						},
+						{
+							text: '本年',
+							value() {
+								const end = new Date();
+								const start = new Date();
+								start.setTime(start.setTime(new Date(new Date().getFullYear(), 0, 1)));
+								return [start, end];
+							}
+						}
+					]
+				},
+				orderData: {
+					user_id: "",
+					status: "all",
+					order_no: '',
+					time: [],
+					mobile: "",
+					show_template_id: "",
+				},
+				columns: [{
+						title: 'ID',
+						key: 'id',
+						align: 'center'
+					},
+					{
+						title: '用户ID',
+						key: 'user_id',
+						align: 'center'
+					},
+					{
+						title: '购买次数',
+						key: 'chat_num',
+						align: 'center'
+					},
+					{
+						title: '价格',
+						key: 'price',
+						align: 'center'
+					},
+					{
+						title: '支付状态',
+						slot: 'status',
+						align: 'left'
+					},
+					{
+						title: '支付时间',
+						key: 'pay_time',
+						align: 'left'
+					},
+					{
+						title: '创建时间',
+						key: 'create_time',
+						align: 'left'
+					},
+				],
+				loading: false,
+				orderList: [],
+				orderDatalist: {},
+				orderId: 0,
+				page: {
+					total: 0, // 总条数
+					page: 1, // 当前页
+					pageSize: 10 // 每页显示条数
+				},
+			}
+		},
+
+		created() {
+			if (this.$route.query.title) {
+				this.pageTitle = this.$route.query.title;
+			}
+			if (this.$route.query.uid) {
+				this.orderData.uid = parseInt(this.$route.query.uid);
+			}
+			if (this.$route.query.show_template_id) {
+				this.orderData.show_template_id = parseInt(this.$route.query.show_template_id);
+			}
+			this.initView();
+		},
+		methods: {
+			/**
+			 * 基本数据
+			 */
+			initView: function() {
+				this.getData();
+			},
+			tabsHandleClick: function(tab, event) {
+				this.page.page = 1;
+				this.getData();
+			},
+			orderSearch: function() {
+				this.page.page = 1;
+				this.getData();
+			},
+			/**
+			 * 分页
+			 */
+			tapPage: function(index) {
+				this.page.page = index;
+				this.getData();
+			},
+			/**
+			 * 获取数据
+			 */
+			getData: function() {
+				var that = this;
+				// this.loading = true;
+				var data = {
+					page: that.page.page,
+					...that.orderData
+				};
+				getOrderList(data)
+					.then(res => {
+						that.loading = false;
+						if (res.code == 200) {
+							that.orderList = res.data.list;
+							that.page.pageSize = res.data.pageSize;
+							that.page.count = res.data.pageCount;
+						} else {
+							that.$alert(res.msg);
+						}
+					})
+					.catch(err => {
+						that.loading = false;
+						that.$alert("网络繁忙,加载失败,请稍等片刻在尝试!", '系统提示');
+					});
+			},
+
+		}
+	}
 </script>
+<style scoped>
 
-<style>
 </style>

+ 10 - 0
src/components/system/setting/sys/index.vue

@@ -195,6 +195,12 @@
               <el-form-item label="分享赠送积分"> 
                 <el-input v-model="scoreForm.points_share" placeholder="请输入分享赠送积分"></el-input>
               </el-form-item>
+			  <el-form-item label="赠送聊天次数">
+			    <el-input v-model="scoreForm.chat_num" placeholder="请输入赠送聊天次数"></el-input>
+			  </el-form-item>
+			  <el-form-item label="聊天次数积分价格">
+			    <el-input v-model="scoreForm.chat_price" placeholder="请输入聊天次数积分价格"></el-input>
+			  </el-form-item>
               </Col>
             </Row>
             <el-form-item>
@@ -337,6 +343,8 @@ export default {
       scoreForm: {
         points_transformation: "",
         points_share: "",
+		chat_num: '',
+		chat_price: ''
       },
     }
   },
@@ -369,6 +377,8 @@ export default {
           this.scoreForm = {
             points_transformation: res.data.points_transformation,
             points_share: res.data.points_share,
+			chat_num: res.data.chat_num,
+			chat_price: res.data.chat_price
           }
         } else {
           this.$alert(res.msg);

+ 386 - 0
src/components/system/user/honor.vue

@@ -0,0 +1,386 @@
+<template>
+	<div style="padding-top: 10px;">
+		<i-page-header :title="pageTitle"></i-page-header>
+		<Card :bordered="false" dis-hover class="ivu-mt">
+			<Form ref="orderData" :model="orderData">
+				<Row :gutter="24" type="flex">
+					<Col>
+					<FormItem label="荣誉名称:" label-for="name">
+						<Input placeholder="荣誉名称" v-model="orderData.name" />
+					</FormItem>
+					</Col>
+					<Col>
+					<FormItem label="是否启用:" label-for="status">
+						<el-select v-model="orderData.status">
+							<el-option label="启用" value="1"></el-option>
+							<el-option label="禁用" value="0"></el-option>
+						</el-select>
+					</FormItem>
+					</Col>
+					<!-- <Col>
+					    <FormItem label="购买时间:">
+					        <DatePicker v-model="orderData.time" format="yyyy/MM/dd HH:mm:ss" type="datetimerange" placement="bottom-start" placeholder="自定义时间" style="width: 300px;" class="mr20" :options="options"></DatePicker>
+					    </FormItem>
+					</Col> -->
+					<Col>
+					<Button label="default" type="primary" icon="ios-search" class="mr15" style="margin-top: 32px;"
+						@click="orderSearch()">搜索</Button>
+					</Col>
+				</Row>
+			</Form>
+			<Col>
+			<el-button type="primary" class="export" @click="add">添加荣誉</el-button>
+			</Col>
+
+
+			<Table :columns="columns" :data="orderList" ref="table" :loading="loading" highlight-row no-data-text="暂无数据"
+				no-filtered-data-text="暂无筛选结果" class="orderData mt25">
+				<template slot-scope="{ row, index }" slot="order_id">
+					<span v-text="row.order_id" style="display: block;"></span>
+				</template>
+				<template slot-scope="{ row, index }" slot="uid">
+					<div>{{ row.nickname || '微信用户' }}[UID:{{ row.uid }}]</div>
+					<div>{{ row.mobile || '未绑定手机号' }}</div>
+				</template>
+				<template slot-scope="{ row, index }" slot="icon">
+					<img v-lazy="row.icon" :src="row.icon" v-image-preview style="width: 60px;cursor: pointer" />
+				</template>
+
+				<template slot-scope="{ row, index }" slot="status">
+					<el-tag type="success" size="mini" v-if="row.status == 1">启用</el-tag>
+					<el-tag type="danger" size="mini" v-else>禁用</el-tag>
+				</template>
+				<template slot-scope="{row,index}" slot="operation">
+					<el-button type="primary" size="mini" @click="edit(row)">编辑</el-button>
+					<el-button type="danger" size="mini" @click="deletes(row.id)">删除</el-button>
+				</template>
+
+
+			</Table>
+			<div class="acea-row row-right page">
+				<Page :total="page.count" show-elevator show-total @on-change="tapPage" :page-size="page.pageSize" />
+			</div>
+		</Card>
+		<Modal v-model="addModal" title="添加荣誉" @on-ok="sendOk('sendFormValidate')" @on-cancel="sendCancel" width="800">
+			<Form :model="sendData" :label-width="labelWidth" :rules="ruleValidate" ref="sendFormValidate">
+				<FormItem label="荣誉名称" prop="name">
+					<Input v-model="sendData.name" type="text" placeholder="请输入荣誉名称"></Input>
+				</FormItem>
+				<FormItem label="荣誉描述" prop="description">
+					<Input v-model="sendData.description" type="textarea" :autosize="{ minRows: 5, maxRows: 5 }"
+						placeholder="请输入荣誉描述"></Input>
+				</FormItem>
+				<FormItem label="图标" prop="icon">
+					<div class="clearfix" style="width: 100%;">
+						<div class="upimg-item fx-r fx-bc fx-ac" style="" v-if="sendData.icon">
+							<img v-lazy="sendData.icon" :src="sendData.icon" v-image-preview />
+							<i class="el-icon-error img-remove-btn" @click="removeImgs()"></i>
+						</div>
+						<ui-upload style="float: left;" :upUrl="upUrl" fileName="上传图片" :headers="upHeaders"
+							:updata="{isz:0,code:'goods'}" @onUpload="onUpload"></ui-upload>
+					</div>
+				</FormItem>
+				<FormItem label="排序" prop="sort">
+					<Input v-model="sendData.sort" type="number" placeholder="请输入排序"></Input>
+				</FormItem>
+				<FormItem label="是否启用" prop="status">
+					<el-radio-group v-model="sendData.status">
+						<el-radio :label="1">启用</el-radio>
+						<el-radio :label="0">禁用</el-radio>
+					</el-radio-group>
+				</FormItem>
+			</Form>
+			<div slot="footer">
+				<Button size="large" :loading="modal_loading" @click="sendCancel">取消</Button>
+				<Button type="primary" size="large" :loading="modal_loading"
+					@click="sendOk('sendFormValidate')">提交</Button>
+			</div>
+		</Modal>
+	</div>
+</template>
+<script>
+	import IPageHeader from "../../../layouts/system/page-header/index";
+	import UiUpload from "@/ui/upload/index";
+	import Setting from '@/setting';
+	import {
+		getHonorList,
+		saveHonor,
+		delHonor
+	} from "../../../api/system/user";
+
+	export default {
+		name: "chatList",
+		components: {
+			IPageHeader,
+			UiUpload
+		},
+		computed: {},
+		data() {
+			return {
+				labelWidth: 120,
+				upUrl: '',
+				upHeaders: '',
+				modal_loading: false,
+				addModal: false,
+				pageTitle: "荣誉列表",
+				orderData: {
+					uid: "",
+					status: "",
+					time: [],
+					mobile: "",
+					show_template_id: "",
+				},
+				sendData: {
+					id: 0,
+					name: '',
+					description: '',
+					icon: '',
+					sort: 0,
+					status: 1
+				},
+				ruleValidate: {
+					name: [{
+						required: true,
+						message: '请输入荣誉名称'
+					}],
+					description: [{
+						required: true,
+						message: '请输入荣誉描述'
+					}],
+					icon: [{
+						required: true,
+						message: '请选择图标'
+					}],
+				},
+				columns: [{
+						title: 'ID',
+						align: 'center',
+						key: 'id',
+						align: 'center'
+					},
+					{
+						title: '名称',
+						key: 'name',
+						align: 'center'
+					},
+					{
+						title: '描述',
+						key: 'description',
+						align: 'center'
+					},
+					{
+						title: '图标',
+						slot: 'icon',
+						align: 'center'
+					},
+					{
+						title: '排序',
+						key: 'sort',
+						align: 'center'
+					},
+					{
+						title: '状态',
+						slot: 'status',
+						align: 'center'
+					},
+					{
+						title: '时间',
+						align: 'center',
+						key: 'create_time',
+						align: 'center'
+					},
+					{
+						title: '操作',
+						slot: 'operation',
+						align: 'center'
+					},
+				],
+				loading: false,
+				orderList: [],
+				orderDatalist: {},
+				orderId: 0,
+				page: {
+					total: 0, // 总条数
+					page: 1, // 当前页
+					pageSize: 10 // 每页显示条数
+				},
+			}
+		},
+
+		created() {
+			if (this.$route.query.title) {
+				this.pageTitle = this.$route.query.title;
+			}
+			if (this.$route.query.uid) {
+				this.orderData.uid = parseInt(this.$route.query.uid);
+			}
+			if (this.$route.query.show_template_id) {
+				this.orderData.show_template_id = parseInt(this.$route.query.show_template_id);
+			}
+			this.initView();
+		},
+		methods: {
+			initView() {
+				var upHeaders = {};
+				this.upUrl = Setting.apiBaseURL + "/systemv1/upload/index";
+				const token = this.$utils.util.cookies.get('system_token');
+				if (token) {
+					upHeaders['SYSTEM-ACC-TOKEN'] = token;
+				}
+				this.upHeaders = upHeaders;
+				this.getData();
+			},
+			deletes(id) {
+				this.$confirm('确定删除吗?', '系统提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					delHonor({
+						id: id
+					}).then(res => {
+						if (res.code == 200) {
+							this.$Message.success('删除成功!');
+							this.getData()
+						} else {
+							this.$Message.error(res.msg);
+						}
+					}).catch(err => {
+						this.$Message.error(err.msg);
+					})
+				}).catch(() => {
+					
+				});
+			},
+			onUpload: function(res) {
+				if (res.code == -1) {
+					Notice.error({
+						title: "系统提示",
+						content: res.msg
+					});
+				} else {
+					this.sendData.icon = res.data.img;
+				}
+			},
+			removeImgs() {
+				this.sendData.icon = ''
+			},
+			sendCancel() {
+				this.addModal = false
+				this.sendData = {
+					name: '',
+					description: '',
+					icon:'',
+					sort:0,
+					status: 1
+				}
+			},
+			sendOk(name) {
+				let that = this
+				this.$refs[name].validate((valid) => {
+					if (valid) {
+						let pdata;
+						if (that.sendData.id) {
+							pdata = this.sendData
+						} else {
+							pdata = {
+								name: that.sendData.name,
+								description: that.sendData.description,
+								icon: that.sendData.icon,
+								sort: that.sendData.sort,
+								status: that.sendData.status
+							}
+						}
+						saveHonor(pdata).then(res => {
+							if(res.code == 200) {
+								that.$message.success(res.msg)
+								that.sendCancel()
+								that.getData()
+							}else {
+								that.$message.error(res.msg)
+							}
+						})
+					} else {}
+				})
+				// if(!that.sendData.name) {
+				// 	return that.$message.error('请输入荣誉名称')
+				// }
+
+
+			},
+			add() {
+				this.addModal = true
+			},
+			edit(row) {
+				this.sendData = row
+				console.log(row);
+				this.addModal = true
+			},
+			tabsHandleClick: function(tab, event) {
+				this.page.page = 1;
+				this.getData();
+			},
+			orderSearch: function() {
+				this.page.page = 1;
+				this.getData();
+			},
+			/**
+			 * 分页
+			 */
+			tapPage: function(index) {
+				this.page.page = index;
+				this.getData();
+			},
+			/**
+			 * 获取数据
+			 */
+			getData: function() {
+				var that = this;
+				// this.loading = true;
+				var data = {
+					page: that.page.page,
+					...that.orderData
+				};
+				getHonorList(data)
+					.then(res => {
+						that.loading = false;
+						if (res.code == 200) {
+							that.orderList = res.data.list;
+							that.page.pageSize = res.data.pageSize;
+							that.page.count = res.data.pageCount;
+						} else {
+							that.$alert(res.msg);
+						}
+					})
+					.catch(err => {
+						that.loading = false;
+						that.$alert("网络繁忙,加载失败,请稍等片刻在尝试!", '系统提示');
+					});
+			},
+
+		}
+	}
+</script>
+<style scoped>
+	.upimg-item {
+		width: 82px;
+		height: 82px;
+		margin-right: 5px;
+		overflow: hidden;
+		float: left;
+		margin-bottom: 5px;
+		position: relative;
+	}
+
+	.upimg-item img {
+		width: 82px;
+		cursor: pointer;
+	}
+
+	.img-remove-btn {
+		position: absolute;
+		top: 0px;
+		right: 0px;
+		font-size: 24px;
+	}
+</style>

+ 90 - 3
src/components/system/user/list.vue

@@ -120,7 +120,9 @@
 						<div>
 							<el-button plain size="mini" @click="tapEdit(scope.row)">编辑</el-button>
 							<el-button plain size="mini" @click="tapScoreEdit(scope.row)">积分补扣</el-button>
-							<el-button plain size="mini" @click="openFt(scope.row)">{{scope.row.permission == 0 ? '开放发帖': '关闭发帖' }}</el-button>
+							<el-button plain size="mini"
+								@click="openFt(scope.row)">{{scope.row.permission == 0 ? '开放发帖': '关闭发帖' }}</el-button>
+							<el-button plain size="mini" @click="editHonor(scope.row)">编辑荣誉</el-button>
 
 							<!-- <Divider type="vertical"/>
 							<i-link :to="'/system/order/index?uid=' + scope.row.uid + '&title=' +scope.row.nickname+ '的订单列表' ">
@@ -188,6 +190,21 @@
 				<el-button type="primary" @click="subAdminscore">确 定</el-button>
 			</span>
 		</Modal>
+		<Modal v-model="honorDialogVisible" title="荣誉详情" @on-cancel="honorClose">
+			<el-tag :key="tag.id" v-for="(tag,index) in honor.list" closable :disable-transitions="false"
+				style="margin-right: 10px;" @close="handleClose(index)">
+				{{tag.name}}
+			</el-tag>
+			<el-select v-if="showHonor" placeholder="请选择" v-model="addHonorId" @change="addHonor">
+				<el-option v-for="item in honorList" :key="item.id" :label="item.name" :value="item">
+				</el-option>
+			</el-select>
+			<el-button v-else class="button-new-tag" size="small" @click="showInput">添加荣誉</el-button>
+			<span slot="footer" class="dialog-footer">
+				<el-button @click="honorClose">取 消</el-button>
+				<el-button type="primary" @click="subhonor">确 定</el-button>
+			</span>
+		</Modal>
 	</div>
 </template>
 <script>
@@ -195,7 +212,10 @@
 		SystemUserList,
 		SystemUserSave,
 		SystemUserScoreDetailSave,
-		forumPost
+		forumPost,
+		getUserHonor,
+		getHonorList,
+		editUserHonor
 	} from "../../../api/system/user";
 
 	import IPageHeader from "../../../layouts/system/page-header/index";
@@ -210,6 +230,15 @@
 		computed: {},
 		data() {
 			return {
+				addHonorId: '',
+				showHonor: false,
+				honorDialogVisible: false,
+				honorList: [],
+				honor: {
+					list: [],
+					uid: '',
+					selected: []
+				},
 				scoreDialogVisible: false,
 				scoreform: {
 					uid: '',
@@ -321,11 +350,69 @@
 				this.detial.parent_uid = parseInt(this.$route.query.parent_uid);
 			}
 			this.initView();
+			this.getHonor()
 		},
 		methods: {
+			getHonor() {
+				getHonorList({
+					page: 1,
+					limit: 100
+				}).then(res => {
+					this.honorList = res.data.list
+				})
+			},
+			handleClose(e) {
+				this.honor.list.splice(e, 1)
+				this.honor.selected.splice(e, 1)
+			},
+			honorClose() {
+				this.honorDialogVisible = false
+				this.honor = {
+					uid: '',
+					selected: [],
+					list: []
+				}
+			},
+			showInput() {
+				this.showHonor = true
+			},
+			subhonor() {
+				console.log(this.honor)
+				editUserHonor({
+					uid: this.honor.uid,
+					honor: this.honor.selected.join(',')
+				}).then(res => {
+					if(res.code == 200) {
+						this.$message.success(res.msg)
+						this.honorClose()
+					}else {
+						this.$message.error(res.msg)
+					}
+				})
+			},
+			addHonor(e) {
+				if(this.honor.selected.indexOf(e.id + '') == -1) {
+					this.honor.list.push(e)
+					this.honor.selected.push(e.id + '')
+				}
+				this.showHonor = false
+				this.addHonorId = ''
+			},
+			editHonor(row) {
+				getUserHonor({
+					uid: row.uid
+				}).then(res => {
+					this.honor.list = res.data.honor_list
+					this.honor.uid = row.uid
+					this.honor.selected = res.data.honor_list.map(item => {
+						return item.id + ''
+					})
+					this.honorDialogVisible = true
+				})
+			},
 			openFt(row) {
 				forumPost({
-					permission: row.permission == 0? 1: 0,
+					permission: row.permission == 0 ? 1 : 0,
 					uid: row.uid
 				}).then(res => {
 					this.$message.success(res.msg);

+ 27 - 0
src/router/routes.js

@@ -101,6 +101,15 @@ const system = [{
 				},
 				component: () => import('@/components/system/user/list')
 			},
+			{
+				path: '/system/user/honor',
+				name: 'system_user_honor',
+				meta: {
+					title: '荣誉列表',
+					auth: true
+				},
+				component: () => import('@/components/system/user/honor')
+			},
 			{
 				path: '/system/user/workerList',
 				name: 'system_user_workerList',
@@ -429,6 +438,24 @@ const system = [{
 				},
 				component: () => import('@/components/system/chat/index')
 			},
+			{
+				path: '/system/chat/order',
+				name: 'system_chat_order',
+				meta: {
+					title: '购买记录',
+					auth: true
+				},
+				component: () => import('@/components/system/chat/order')
+			},
+			{
+				path: '/system/chat/log',
+				name: 'system_chat_log',
+				meta: {
+					title: '变动明细',
+					auth: true
+				},
+				component: () => import('@/components/system/chat/log')
+			},
 			{
 				path: '/system/forum/index',
 				name: 'system_forum_index',