consultation-list.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Vue.component('consultation-list', {
  2. template: '<ul class="consultation-list">\
  3. <li v-for="(list,index) in chatList" class="consultation-list-item" @click="viewDetail(list)">\
  4. <img class="con-avatar" :src="httpRequest.getImgUrl(list.patientPhoto)" alt="" onerror="onerror=null;src=\'../../../images/p-female.png\'" />\
  5. <div class="con-user-info">\
  6. <span class="con-status" :data-status="list.status" desc="0进行1结束"></span>\
  7. <p><span class="con-user-name">{{list.patientName}}</span><span class="small con-time">{{list.czrq.substring(0,list.czrq.length-2)}}</span></p>\
  8. <p class="user-problem">咨询问题:{{list.symptoms}}</p>\
  9. </div>\
  10. </li>\
  11. </ul>',
  12. data: function() {
  13. return {
  14. chatList: "",
  15. curPage:1,
  16. httpRequest: httpRequest
  17. }
  18. },
  19. props:["consultaData"],
  20. methods: {
  21. viewDetail: function(list) {
  22. function subTime(d){
  23. return d.substr(5,2)+d.substr(8,2)
  24. }
  25. var title = list.patientName+subTime(list.czrq)+"咨询"
  26. top.layer.open({
  27. type: 2,
  28. title:title,
  29. maxmin: true,
  30. area: ['1000px', '600px'],
  31. shadeClose: false,
  32. content: 'consult-detail.html?consult='+list.code+'&type='+list.type
  33. });
  34. }
  35. },
  36. computed:{
  37. },
  38. watch:{
  39. consultaData:function(val){
  40. this.chatList=this.consultaData;
  41. }
  42. },
  43. mounted: function() {
  44. var divH = $("#tab-iframe",parent.document).height() - 75;
  45. $(".consultation-list").slimScroll({ height: divH,color: '#666'});
  46. }
  47. })