mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-06 10:57:26 +08:00
fix: 更新 API 请求参数格式及优化组件样式
- 将 addEvaluation API 的参数从 params 修改为 data,以符合标准请求格式 - 在多个组件中调整样式,提升响应式布局和用户体验 - 优化商品详情页的倒计时显示,增强视觉效果 - 更新购物车操作按钮样式,提升一致性和可用性
This commit is contained in:
@@ -28,10 +28,10 @@
|
||||
<div class="eval-con">
|
||||
<div>
|
||||
<span class="color999">商品评价:</span>
|
||||
<el-radio-group style="margin-bottom:5px;color:#999" v-model="orderGoods.grade" type="button" button-style="solid">
|
||||
<el-radio label="GOOD">好评</el-radio>
|
||||
<el-radio label="MODERATE">中评</el-radio>
|
||||
<el-radio label="WORSE">差评</el-radio>
|
||||
<el-radio-group v-model="orderGoods.grade">
|
||||
<el-radio-button value="GOOD">好评</el-radio-button>
|
||||
<el-radio-button value="MODERATE">中评</el-radio-button>
|
||||
<el-radio-button value="WORSE">差评</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-input type="textarea" maxlength="500" show-word-limit :rows="4" v-model="orderGoods.content" />
|
||||
</div>
|
||||
@@ -106,6 +106,12 @@ export default {
|
||||
|
||||
if (!this.form.descriptionScore) {
|
||||
this.$Message.warning('描述评价不能为空')
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.orderGoods.content || !String(this.orderGoods.content).trim()) {
|
||||
this.$Message.warning('评论内容不能为空')
|
||||
return false;
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
@@ -118,17 +124,20 @@ export default {
|
||||
serviceScore: this.form.serviceScore,
|
||||
deliveryScore: this.form.deliveryScore,
|
||||
grade: goods.grade,
|
||||
content: goods.content || '',
|
||||
images: goods.uploadList.toString()
|
||||
content: goods.content.trim(),
|
||||
images: goods.uploadList.length ? goods.uploadList.join(',') : ''
|
||||
}
|
||||
addEvaluation(params).then(res => {
|
||||
this.loading = false
|
||||
if (res.success) {
|
||||
this.$Message.success('评价成功')
|
||||
this.$router.push('/home/CommentList')
|
||||
} else {
|
||||
this.$Message.error(res.message || '评价失败,请稍后重试')
|
||||
}
|
||||
}).catch(() => {
|
||||
}).catch((err) => {
|
||||
this.loading = false;
|
||||
this.$Message.error(err?.message || '评价失败,请稍后重试')
|
||||
})
|
||||
},
|
||||
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
|
||||
|
||||
Reference in New Issue
Block a user