Browse Source

feat(评论): 添加评论列表组件并修复占位符显示问题

- 在文章页面集成评论列表组件
- 修复评论输入框占位符在没有名称时显示默认文本
- 添加相关mixins和API调用逻辑
master
前端-胡立永 2 weeks ago
parent
commit
9423919203
2 changed files with 24 additions and 4 deletions
  1. +21
    -2
      pages_order/article/index.vue
  2. +3
    -2
      pages_order/components/list/comment/commentList.vue

+ 21
- 2
pages_order/article/index.vue View File

@ -26,23 +26,41 @@
<text class="error-text">文章不存在或已被删除</text>
</view>
</view>
<commentList @getData="getData" :list="list" :params="params" />
</view>
</template>
<script>
import mixinsList from '@/mixins/list.js'
import commentList from '../components/list/comment/commentList.vue'
export default {
components: {
commentList,
},
mixins: [mixinsList],
data() {
return {
mixinsListApi : 'getCommentPage',
articleId: '',
articleDetail: null,
loading: false
loading: false,
params : {
type : '8',
orderId : '',
name : '',
}
}
},
onLoad(options) {
if (options.id) {
this.articleId = options.id;
this.loadArticleDetail();
this.queryParams.type = this.params.type
this.queryParams.orderId = options.id
this.params.orderId = options.id
}
},
onShareAppMessage(res) {
@ -67,6 +85,7 @@
this.loading = false;
if (res.code === 200 && res.result) {
this.params.name = res.result.title
this.articleDetail = res.result;
} else {
uni.showToast({


+ 3
- 2
pages_order/components/list/comment/commentList.vue View File

@ -11,12 +11,13 @@
<uv-icon color="#00cf05" size="50rpx" name="weixin-fill"></uv-icon>
</button>
<input type="text" disabled @click="openCommentPublish" :placeholder="'评论给' + params.name" />
<input type="text" disabled @click="openCommentPublish"
:placeholder="'评论给' + params.name || '他'" />
</view>
</view>
<!-- 评论发布组件 -->
<commentPublish ref="commentPublish" :params="params" :placeholder="'评论给' + params.name" @success="handleCommentSuccess" />
<commentPublish ref="commentPublish" :params="params" :placeholder="'评论给' + params.name || '他'" @success="handleCommentSuccess" />
</view>
</template>


Loading…
Cancel
Save