refactor: 优化订单填写页面和评价组件的逻辑与样式

- 移除不必要的返回监听逻辑,简化页面返回处理
- 更新不支持运费提示的显示方式,使用文本替代列表
- 改进评价组件的初始化逻辑,确保更好的用户体验
- 统一数据结构,提升代码可读性
This commit is contained in:
pikachu1995@126.com
2026-07-06 14:15:06 +08:00
parent 90ee7d5b1d
commit 6198a6d244
3 changed files with 47 additions and 74 deletions

View File

@@ -26,7 +26,7 @@
text-indent="0"
:show-height="120"
>
<rich-text @load="parseLoaded(commIndex)" :nodes="commItem.content" class="con"></rich-text>
<rich-text :nodes="commItem.content" class="con"></rich-text>
</u-read-more>
<scroll-view scroll-x class="scroll-x" v-if="commentImages(commItem).length">
<view class="img-list">
@@ -70,7 +70,8 @@ export default {
data() {
return {
lightColor: this.$lightColor,
commDetail: [],
commDetail: {},
readMoreInited: {},
grade: "",
params: {
pageNumber: 1,
@@ -106,18 +107,27 @@ export default {
return typeof images === "string" ? images.split(",").filter(Boolean) : images;
},
parseLoaded(index) {
initReadMore(index) {
if (this.readMoreInited[index]) return;
this.readMoreInited[index] = true;
this.$nextTick(() => {
const refs = this.$refs.uReadMore;
const target = Array.isArray(refs) ? refs[index] : refs;
target && target.init && target.init();
target?.init?.();
});
},
getGoodsCommentsMethods() {
if (!this.goodsDetail.goodsId) return;
API_Members.getGoodsComments(this.goodsDetail.goodsId, this.params).then((res) => {
this.commDetail = res.data.result;
this.readMoreInited = {};
this.commDetail = res.data.result || {};
this.$nextTick(() => {
const records = this.commDetail.records || [];
records.slice(0, 2).forEach((_, index) => {
setTimeout(() => this.initReadMore(index), 50 * (index + 1));
});
});
});
},