tnblog
首页
视频
资源
登录

mui-app之评论

5640人阅读 2019/11/19 17:04 总访问:448632 评论:4 收藏:0 手机
分类: 笔记
  1.                  
  2. //显示数据的布局页面
  3. //因为涉及到评论人和回复人 所以要绑定两次数据 具体如下
  4.     <div id="comment" v-for="item in commentlist"> //第一次绑定的数据
  5.     <ul class="mui-table-view">
  6.     <li class="mui-table-cell mui-media" v-for="item in commentlist">
  7.     <div>
  8.     <a class="user" v-bind:title="item.userName">
  9.     <img style="border-radius: 50%;width: 11%;float: left;" v-bind:src="item.img" />
  10.     </a>
  11.     <div style="float: left;margin-left: 12px;width:80%;">
  12.     {{item.replyName}}
  13.     <br />
  14.     <p v-html="item.content" style="margin-top: 10px;margin-bottom: 20px;"></p>
  15.     <p style="margin-bottom: 20px;">{{item.time}}</p>
  16.     </div>
  17.     //第二次绑定的数据 
  18.     <div v-for="realy in item.replyBody">
  19.     <a class="user" v-bind:title="realy.userName">
  20.     <img style="border-radius: 50%;width: 11%;float: left;" v-bind:src="realy.img" />
  21.     </a>
  22.     <div style="float: left;margin-left: 12px;width:80%;">
  23.     {{realy.replyName}}
  24.     <br />
  25.     <p v-html="realy.content" style="margin-top: 10px;margin-bottom: 20px;"></p>
  26.     <p style="margin-bottom: 20px;">{{realy.time}}</p>
  27.     </div>
  28.     </div>
  29.     </div>
  30.     </li>
  31.     </ul>
  32.     </div>
  33.          
  34.     
  35.     
  36.     
  37.     //评论的页面          
  38.     mui.plusReady(function() {
  39.     //通过它取得传递的值
  40.     var self = plus.webview.currentWebview();
  41.     
  42.                             //得到评论
  43.     mui.ajax('接口地址' + self.did, {
  44.     success: function(data) {
  45.    
  46.     vue = new Vue({
  47.     el: "#comment",
  48.     data: {
  49.     commentlist: data.value,
  50.     //关闭等待框
  51.     plus.nativeUI.closeWaiting();
  52.     //显示当前页面
  53.     mui.currentWebview.show();
  54. });       
  55.    好了 我们下期见


评价

瑾冰

2019/11/19 17:09:16

[哈哈][哈哈]

剑轩:@瑾冰真实的接口地址最好用xx/yy什么的代替一下

2019/11/20 8:56:59 回复

瑾冰:@剑轩嗯嗯,好的。我去该一下

2019/11/20 9:18:33 回复

2019/11/22 15:52:19 回复

每一段路程,都是一种领悟
排名
10
文章
100
粉丝
17
评论
34
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:50010702506256
欢迎加群交流技术