
-
- //显示数据的布局页面
- //因为涉及到评论人和回复人 所以要绑定两次数据 具体如下
- <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();
-
- });
- 好了 我们下期见
评价
瑾冰