refactor: 统一组件导入与消息提示方式

- 将多个组件中的 require 替换为 import,提升代码一致性。
- 更新消息提示方式,使用统一的 Message 和 Modal 组件,增强用户体验。
- 调整部分组件的样式和逻辑,确保界面一致性与可读性。
This commit is contained in:
田香琪
2026-07-08 18:36:06 +08:00
parent f6ddcf4f99
commit 106e059d1a
63 changed files with 429 additions and 314 deletions

View File

@@ -75,6 +75,7 @@
</div>
</template>
<script>
import { Message, Notice } from "@/utils/message";
import { Camera, Delete, View } from '@element-plus/icons-vue';
import { orderDetail } from '@/api/order.js';
import { addEvaluation } from '@/api/member.js';
@@ -109,17 +110,17 @@ export default {
},
save () { // 保存评价
if (!this.form.serviceScore || !this.form.deliveryScore) {
this.$Message.warning('物流服务评价不能为空')
Message.warning('物流服务评价不能为空')
return false;
}
if (!this.form.descriptionScore) {
this.$Message.warning('描述评价不能为空')
Message.warning('描述评价不能为空')
return false;
}
if (!this.orderGoods.content || !String(this.orderGoods.content).trim()) {
this.$Message.warning('评论内容不能为空')
Message.warning('评论内容不能为空')
return false;
}
@@ -139,14 +140,14 @@ export default {
addEvaluation(params).then(res => {
this.loading = false
if (res.success) {
this.$Message.success('评价成功')
Message.success('评价成功')
this.$router.push('/home/CommentList')
} else {
this.$Message.error(res.message || '评价失败,请稍后重试')
Message.error(res.message || '评价失败,请稍后重试')
}
}).catch((err) => {
this.loading = false;
this.$Message.error(err?.message || '评价失败,请稍后重试')
Message.error(err?.message || '评价失败,请稍后重试')
})
},
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
@@ -171,7 +172,7 @@ export default {
handleBeforeUpload () { // 上传之前钩子
const check = this.orderGoods.uploadList.length < 9;
if (!check) {
this.$Notice.warning({
Notice.warning({
title: '最多可以上传九张图片'
});
return check;