consultation-list.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. }
  17. },
  18. props:["consultaData"],
  19. methods: {
  20. viewDetail: function(list) {
  21. function subTime(d){
  22. return d.substr(5,2)+d.substr(8,2)
  23. }
  24. var title = list.patientName+subTime(list.czrq)+"咨询"
  25. top.layer.open({
  26. type: 2,
  27. title:title,
  28. maxmin: true,
  29. area: ['1000px', '600px'],
  30. shadeClose: false,
  31. content: 'consult-detail.html?consult='+list.code+'&type='+list.type
  32. });
  33. }
  34. },
  35. computed:{
  36. },
  37. watch:{
  38. consultaData:function(val){
  39. this.chatList=this.consultaData;
  40. }
  41. },
  42. mounted: function() {
  43. var divH = $("#tab-iframe",parent.document).height() - 75;
  44. $(".consultation-list").slimScroll({ height: divH,color: '#666'});
  45. }
  46. })