tnblog
首页
视频
资源
登录

mui-app之评论

4530人阅读 2019/11/19 17:04 总访问:353809 评论:4 收藏:0 手机
分类: 笔记
                 
//显示数据的布局页面
//因为涉及到评论人和回复人 所以要绑定两次数据 具体如下
    <div id="comment" v-for="item in commentlist"> //第一次绑定的数据
    <ul class="mui-table-view">
    <li class="mui-table-cell mui-media" v-for="item in commentlist">
    <div>
    <a class="user" v-bind:title="item.userName">
    <img style="border-radius: 50%;width: 11%;float: left;" v-bind:src="item.img" />
    </a>
    <div style="float: left;margin-left: 12px;width:80%;">
    {{item.replyName}}
    <br />
    <p v-html="item.content" style="margin-top: 10px;margin-bottom: 20px;"></p>
    <p style="margin-bottom: 20px;">{{item.time}}</p>
    </div>
    //第二次绑定的数据 
    <div v-for="realy in item.replyBody">
    <a class="user" v-bind:title="realy.userName">
    <img style="border-radius: 50%;width: 11%;float: left;" v-bind:src="realy.img" />
    </a>
    <div style="float: left;margin-left: 12px;width:80%;">
    {{realy.replyName}}
    <br />
    <p v-html="realy.content" style="margin-top: 10px;margin-bottom: 20px;"></p>
    <p style="margin-bottom: 20px;">{{realy.time}}</p>
    </div>
    </div>
    </div>
    </li>
    </ul>
    </div>
         
    
    
    
    //评论的页面          
    mui.plusReady(function() {
    //通过它取得传递的值
    var self = plus.webview.currentWebview();
    
                            //得到评论
    mui.ajax('接口地址' + self.did, {
    success: function(data) {
   
    vue = new Vue({
    el: "#comment",
    data: {
    commentlist: data.value,


    //关闭等待框
    plus.nativeUI.closeWaiting();
    //显示当前页面
    mui.currentWebview.show();

});       
   好了 我们下期见


评价
每一段路程,都是一种领悟
排名
6
文章
6
粉丝
16
评论
8
{{item.articleTitle}}
{{item.blogName}} : {{item.content}}
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2024TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
欢迎加群交流技术