提交 ac76e195 authored 作者: 陆's avatar

评论

上级 f2205fe5
......@@ -131,6 +131,25 @@
<i-col span="4">
<i-input v-model="q.name" @on-enter="query" placeholder="评论人"/>
</i-col>
<i-col span="4">
<i-input v-model="q.itemName" @on-enter="query" placeholder="商品"/>
</i-col>
<i-col span="4">
<i-input v-model="q.orderNo" @on-enter="query" placeholder="订单号"/>
</i-col>
<i-col span="4">
<i-select v-model="q.real" placeholder="评论类型"/>
<i-option v-for="v in realList" :value="v.value">{{v.label}}</i-option>
</i-select>
</i-col>
<i-col span="5">
<Date-Picker
:value="datavalue"
@on-change="changedata"
placeholder="请选择时间段"
type="daterange" show-week-numbers placement="bottom-end" placeholder="Select date" style="width: 200px"></Date-Picker>
</i-col>
<i-button @click="query">查询</i-button>
<i-button @click="reloadSearch">重置</i-button>
</div>
......@@ -202,16 +221,22 @@
</Form-item>
<Form-item label="商品评分" prop="itemScore" style="width: 500px">
<i-input v-model="tbCfItemComment.itemScore" placeholder="商品评分"/>
<i-input v-model="tbCfItemComment.itemScore" placeholder="商品评分" @on-change="changestar(1)"/>
</Form-item>
<Form-item label="服务评分" prop="serviceScore" style="width: 500px">
<i-input v-model="tbCfItemComment.serviceScore" placeholder="服务评分"/>
<i-input v-model="tbCfItemComment.serviceScore" placeholder="服务评分" @on-change="changestar(2)"/>
</Form-item>
<Form-item label="物流评分" prop="logisticsScore" style="width: 500px">
<i-input v-model="tbCfItemComment.logisticsScore" placeholder="物流评分"/>
<i-input v-model="tbCfItemComment.logisticsScore" placeholder="物流评分" @on-change="changestar(3)"/>
</Form-item>
<Form-item label="价格评分" prop="priceScore" style="width: 500px">
<i-input v-model="tbCfItemComment.priceScore" placeholder="价格评分"/>
<i-input v-model="tbCfItemComment.priceScore" placeholder="价格评分" @on-change="changestar(4)"/>
</Form-item>
<Form-item label="是否显示" prop="priceScore" style="width: 500px">
<i-switch v-model="tbCfItemComment.delFlag == 1?true:false" size="large" @on-change="changeswitch" >
<span slot="open">开启</span>
<span slot="close">关闭</span>
</i-switch>
</Form-item>
<Form-item label="商品评论" prop="itemReview" >
<textarea v-model="tbCfItemComment.itemReview" style="width: 400px;height: 300px;"></textarea>
......
......@@ -593,7 +593,7 @@ stateFormat = function (cellvalue) {
*/
statusFormat = function (cellvalue) {
return cellvalue == 1 ? '正常' : '隐藏';
return cellvalue == 1 ? '正常' : cellvalue == 2?'隐藏':'已隐藏';
};
/**
......
......@@ -4,12 +4,12 @@ $(function () {
colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
{label: '评论人', name: 'userName', index: 'userName', width: 80},
{label: '订单号', name: 'orderNo', index: 'orderNo', width: 80},
{label: '订单号', name: 'orderNo', index: 'orderNo', width: 130},
{label: '商品名称', name: 'itemName', index: 'item_id', width: 80},
{label: '商品评分', name: 'itemScore', index: 'item_score', width: 80},
{label: '服务评分', name: 'serviceScore', index: 'service_score', width: 80},
{label: '物流评分', name: 'logisticsScore', index: 'logistics_score', width: 80},
{label: '价格评分', name: 'priceScore', index: 'price_score', width: 80},
{label: '商品评分', name: 'itemScore', index: 'item_score', width: 60},
{label: '服务评分', name: 'serviceScore', index: 'service_score', width: 60},
{label: '物流评分', name: 'logisticsScore', index: 'logistics_score', width: 60},
{label: '价格评分', name: 'priceScore', index: 'price_score', width: 60},
{label: '商品评论', name: 'itemReview', index: 'item_review', width: 80},
// {label: '点赞人数', name: 'likeNum', index: 'like_num', width: 80},
{label: '状态', name: 'delFlag', index: 'del_flag', width: 80, formatter: statusFormat},
......@@ -83,6 +83,7 @@ let vm = new Vue({
}
],
datavalue:'',//选择时间段
goodslist:[],//商品属性
showList: true,
title: null,
......@@ -100,6 +101,15 @@ let vm = new Vue({
orderNo: '',
itemName: ''
},
realList: [
{
label: '虚拟评论',
value: 0
}, {
label: '真实评论',
value: 1
}
],
q2: {
name: ''
},
......@@ -213,6 +223,18 @@ let vm = new Vue({
if (vm.tbCfItemComment.urls == ''){
vm.tbCfItemComment.urls = null
}
if (vm.tbCfItemComment.itemScore == '' || vm.tbCfItemComment.itemScore == null){
vm.tbCfItemComment.itemScore = 5
}
if (vm.tbCfItemComment.serviceScore == '' || vm.tbCfItemComment.serviceScore == null){
vm.tbCfItemComment.serviceScore = 5
}
if (vm.tbCfItemComment.logisticsScore == '' || vm.tbCfItemComment.logisticsScore == null){
vm.tbCfItemComment.logisticsScore = 5
}
if (vm.tbCfItemComment.priceScore == '' || vm.tbCfItemComment.priceScore == null){
vm.tbCfItemComment.priceScore = 5
}
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfItemComment),
......@@ -436,6 +458,55 @@ let vm = new Vue({
}
});
},
// 修改是否显示
changeswitch(e){
if (e){
vm.tbCfItemComment.delFlag = 1
}else {
vm.tbCfItemComment.delFlag = 2
}
},
//修改时间段
changedata(e){
vm.datavalue = e;
vm.q.startTime = e[0]
vm.q.endTime = e[1]
},
// 判断是否是1~5分
changestar(e){
document.onkeyup=function(){
var reg = /^[1-5]{1}$/;
if (e == 1){
let bl = reg.test(vm.tbCfItemComment.itemScore)
if (bl == false){
vm.tbCfItemComment.itemScore = ''
}
}
if (e == 2){
let bl = reg.test(vm.tbCfItemComment.serviceScore)
if (bl == false){
vm.tbCfItemComment.serviceScore = ''
}
}
if (e == 3){
let bl = reg.test(vm.tbCfItemComment.logisticsScore)
if (bl == false){
vm.tbCfItemComment.logisticsScore = ''
}
}
if (e == 4){
let bl = reg.test(vm.tbCfItemComment.priceScore)
if (bl == false){
vm.tbCfItemComment.priceScore = ''
}
}
}
},
guid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 32 | 0,
......
......@@ -7,7 +7,8 @@ $(function () {
{label: '账号', name: 'account', index: 'account', width: 200},
{label: '用户头像地址', name: 'avatar', index: 'avatar', width: 200, formatter: imageFormat},
{label: '用户名', name: 'nick', index: 'nick', width: 200},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 200},],
{label: '创建时间', name: 'createTime', index: 'create_time', width: 200},
],
shrinkToFit: true,
datatype: "json",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论