mirror of
https://gitee.com/ZhongBangKeJi/crmeb_java.git
synced 2026-04-24 12:28:33 +08:00
1. 【修复】申请退款后积分等操作可能出现错误的问题 2. 【修复】拼团支付可能出现支付错误的问题 3. 【修复】退款申请后的订单流程优化和积分赠送的问题 4. 【修复】回收站中的商品无法恢复的问题 5. 【修复】一号通短信查询记录不完整的问题 6. 【修复】用户管理批量加分组,标签的问题 7. 【修复】积分日志搜索显示有误的问题 8. 【修复】手动发送优惠券可能会出错的问题 9. 【修复】核销订单创建在某种条件下会出错的问题 10. 【修复】移动端商品详情,购物车等样式兼容问题 11. 【修复】业务流程性的优化
244 lines
7.3 KiB
Vue
244 lines
7.3 KiB
Vue
<template>
|
|
<el-form :model="formValidate" :rules="rules" ref="formValidate" label-width="100px" class="demo-formValidate" v-loading="loading">
|
|
<el-form-item label="商品:" prop="productId">
|
|
<div class="upLoadPicBox" @click="changeGood">
|
|
<div v-if="formValidate.productId" class="pictrue"><img :src="image"></div>
|
|
<div v-else class="upLoad">
|
|
<i class="el-icon-camera cameraIconfont"/>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
<el-form-item label="用户名称:" prop="nickname">
|
|
<el-input type="text" v-model="formValidate.nickname "></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="评价文字:" prop="comment">
|
|
<el-input type="textarea" v-model="formValidate.comment "></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="商品分数:" prop="productScore" class="productScore">
|
|
<el-rate v-model="formValidate.productScore"></el-rate>
|
|
<!--<el-input-number type="textarea" v-model="formValidate.productScore "></el-input-number>-->
|
|
</el-form-item>
|
|
<el-form-item label="服务分数:" prop="serviceScore" class="productScore">
|
|
<el-rate v-model="formValidate.serviceScore"></el-rate>
|
|
<!--<el-input-number type="textarea" v-model="formValidate.serviceScore "></el-input-number>-->
|
|
</el-form-item>
|
|
<el-form-item label="用户头像:" prop="avatar">
|
|
<div class="upLoadPicBox" @click="modalPicTap('1')">
|
|
<div v-if="formValidate.avatar" class="pictrue"><img :src="formValidate.avatar"></div>
|
|
<div v-else class="upLoad">
|
|
<i class="el-icon-camera cameraIconfont"/>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
<el-form-item label="评价图片:">
|
|
<div class="acea-row">
|
|
<div
|
|
v-for="(item,index) in pics"
|
|
:key="index"
|
|
class="pictrue"
|
|
draggable="false"
|
|
@dragstart="handleDragStart($event, item)"
|
|
@dragover.prevent="handleDragOver($event, item)"
|
|
@dragenter="handleDragEnter($event, item)"
|
|
@dragend="handleDragEnd($event, item)"
|
|
>
|
|
<img :src="item">
|
|
<i class="el-icon-error btndel" @click="handleRemove(index)" />
|
|
<!--<Button shape="circle" icon="md-close" class="btndel" @click.native="handleRemove(index)" />-->
|
|
</div>
|
|
<div v-if="pics<10" class="upLoadPicBox" @click="modalPicTap('2')">
|
|
<div class="upLoad">
|
|
<i class="el-icon-camera cameraIconfont" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button size="mini" type="primary" @click="submitForm('formValidate')" :loading="loadingbtn">提交</el-button>
|
|
<el-button size="mini" @click="resetForm('formValidate')">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
</template>
|
|
|
|
<script>
|
|
import { replyCreatApi, replyEditApi, replyInfoApi } from '@/api/store'
|
|
const defaultObj= {
|
|
avatar: '',
|
|
comment: '',
|
|
nickname: '',
|
|
pics: '',
|
|
productId: '',
|
|
productScore: null,
|
|
serviceScore: null,
|
|
sku: ''
|
|
}
|
|
export default {
|
|
name: "creatComment",
|
|
props:{
|
|
num: {
|
|
type: Number,
|
|
required: 0
|
|
},
|
|
},
|
|
data() {
|
|
var checkProductScore = (rule, value, callback) => {
|
|
if (!value) {
|
|
return callback(new Error('商品分数不能为空'));
|
|
}else{
|
|
callback();
|
|
}
|
|
};
|
|
var checkServiceScore = (rule, value, callback) => {
|
|
if (!value) {
|
|
return callback(new Error('服务分数不能为空'));
|
|
}else{
|
|
callback();
|
|
}
|
|
};
|
|
return {
|
|
loadingbtn: false,
|
|
loading: false,
|
|
pics: [],
|
|
image: '',
|
|
formValidate: Object.assign({}, defaultObj),
|
|
rules: {
|
|
avatar: [
|
|
{required: true, message: '请选择用户头像', trigger: 'change'},
|
|
],
|
|
productId: [
|
|
{required: true, message: '请选择商品', trigger: 'change'},
|
|
],
|
|
comment: [
|
|
{required: true, message: '请填写评价内容', trigger: 'blur'},
|
|
],
|
|
nickname: [
|
|
{required: true, message: '请填写用户名称', trigger: 'blur'},
|
|
],
|
|
pics: [
|
|
{required: true, message: '请选择评价图片', trigger: 'change'},
|
|
],
|
|
productScore: [
|
|
{required: true, validator: checkProductScore, trigger: 'blur'},
|
|
],
|
|
serviceScore: [
|
|
{required: true, validator: checkServiceScore, trigger: 'change'},
|
|
],
|
|
}
|
|
}
|
|
},
|
|
watch: {
|
|
num: {
|
|
handler: function(val) {
|
|
this.resetForm('formValidate')
|
|
},
|
|
deep: true
|
|
}
|
|
},
|
|
methods: {
|
|
changeGood(){
|
|
const _this = this
|
|
this.$modalGoodList(function(row) {
|
|
_this.image = row.image
|
|
_this.formValidate.productId = row.id
|
|
_this.formValidate.sku = row.attrValue[0].suk
|
|
})
|
|
},
|
|
// 点击商品图
|
|
modalPicTap (tit) {
|
|
const _this = this
|
|
_this.$modalUpload(function(img) {
|
|
tit==='1' ? _this.formValidate.avatar = img[0].sattDir : img.map((item) => {
|
|
_this.pics.push( item.sattDir)
|
|
})
|
|
},tit, 'store')
|
|
},
|
|
handleRemove (i) {
|
|
this.pics.splice(i, 1)
|
|
},
|
|
submitForm(formName) {
|
|
this.loadingbtn = true;
|
|
this.formValidate.pics = this.pics.length>0 ? JSON.stringify(this.pics) : ''
|
|
this.$refs[formName].validate((valid) => {
|
|
if (valid) {
|
|
replyCreatApi(this.formValidate).then(() => {
|
|
this.$message.success("新增成功")
|
|
setTimeout(() => {
|
|
// this.clear();
|
|
this.$emit('getList');
|
|
}, 600);
|
|
this.loadingbtn = false;
|
|
}).catch(()=>{
|
|
this.loadingbtn = false;
|
|
})
|
|
} else {
|
|
return false;
|
|
}
|
|
});
|
|
},
|
|
resetForm(formName) {
|
|
this.$refs[formName].resetFields()
|
|
this.pics=[]
|
|
this.formValidate.pics=''
|
|
},
|
|
info(){
|
|
this.loading = true
|
|
replyInfoApi(this.formValidate).then(() => {
|
|
this.formValidate = res
|
|
this.loading = false
|
|
}).catch(() => {
|
|
this.loading = false
|
|
})
|
|
},
|
|
// 移动
|
|
handleDragStart (e, item) {
|
|
this.dragging = item;
|
|
},
|
|
handleDragEnd (e, item) {
|
|
this.dragging = null
|
|
},
|
|
handleDragOver (e) {
|
|
e.dataTransfer.dropEffect = 'move'
|
|
},
|
|
handleDragEnter (e, item) {
|
|
e.dataTransfer.effectAllowed = 'move'
|
|
if (item === this.dragging) {
|
|
return
|
|
}
|
|
const newItems = [...this.pics]
|
|
const src = newItems.indexOf(this.dragging)
|
|
const dst = newItems.indexOf(item)
|
|
newItems.splice(dst, 0, ...newItems.splice(src, 1))
|
|
this.pics = newItems;
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.productScore{
|
|
/deep/.el-rate{
|
|
line-height: 2.4;
|
|
}
|
|
}
|
|
.pictrue{
|
|
width: 60px;
|
|
height: 60px;
|
|
border: 1px dotted rgba(0,0,0,0.1);
|
|
margin-right: 10px;
|
|
position: relative;
|
|
cursor: pointer;
|
|
img{
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
.btndel{
|
|
position: absolute;
|
|
z-index: 1;
|
|
width :20px !important;
|
|
height: 20px !important;
|
|
left: 46px;
|
|
top: -4px;
|
|
}
|
|
</style>
|