list.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view>
  3. <view v-if="datalist.length>0">
  4. <!-- 消息通知 -->
  5. <block v-if="type==1">
  6. <!-- -->
  7. <view class="newslist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.zxNoticeId)">
  8. <view class="newsl">
  9. <image :src="ntyaimg" class="imga" ></image>
  10. <!-- <image :src="ntybimg" class="imgb" v-if="ite.type==1"></image>
  11. <image :src="ntycimg" class="imgc" v-if="ite.type==2"></image>
  12. <image :src="ntydimg" class="imgd" v-if="ite.type==3"></image> -->
  13. </view>
  14. <view class="newsr">
  15. <view class="flexc over mb8">
  16. <view class="tit over">{{ite.noticeTitle}}</view>
  17. <view class="time">{{ite.issuerTime}}</view>
  18. </view>
  19. <view class="txt overtwo"><rich-text :nodes="ite.noticeContent" v-if="ite.noticeContent"></rich-text></view>
  20. <!-- <view class="overtwo txt">{{ite.noticeContent}}</view> -->
  21. </view>
  22. </view>
  23. </block>
  24. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  25. </view>
  26. <block v-else>
  27. <no-data></no-data>
  28. </block>
  29. </view>
  30. </template>
  31. <script>
  32. import { selectDictValue } from '@/utils/common.js';
  33. import noData from "@/components/nodata/nodata.vue"
  34. export default {
  35. props:{
  36. datalist: {
  37. type: Array,
  38. default () {
  39. return []
  40. }
  41. },
  42. wtdt:{
  43. type: String,
  44. default () {
  45. return ''
  46. }
  47. },
  48. type:{
  49. type: [String,Number],
  50. default () {
  51. return ''
  52. }
  53. },
  54. },
  55. components:{
  56. noData
  57. },
  58. data(){
  59. return{
  60. ntyaimg:require("@/work/static/images/ntya.png"),
  61. ntybimg:require("@/work/static/images/ntyb.png"),
  62. ntycimg:require("@/work/static/images/ntyc.png"),
  63. ntydimg:require("@/work/static/images/ntyd.png"),
  64. }
  65. },
  66. onLoad: function() {
  67. },
  68. methods:{
  69. getDetail(e){
  70. this.$emit('getDetail',e)
  71. },
  72. getTuiFn(txt){
  73. var obj={
  74. type:txt,
  75. id:1,
  76. }
  77. this.$emit('getTuiFn',obj)
  78. },
  79. typeFn(data){
  80. if(data){
  81. var newArr=[]
  82. var astr=data.split('-')
  83. astr.forEach(ite=>{
  84. var a=ite.substring(0,5);
  85. newArr.push(a)
  86. })
  87. return newArr.join('-')
  88. }else{
  89. return ''
  90. }
  91. },
  92. },
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .newslist{padding: 0rpx 24rpx;display: flex;align-items: center;
  97. .newsl{width: 86rpx;height: 86rpx;margin-right:14rpx;flex: 0 0 auto;display: flex;align-items: center;justify-content: center;background: rgba(29, 100, 226, 0.1);border-radius: 50%;
  98. .imga{width: 36rpx;height: 32rpx;}
  99. .imgb{width: 30rpx;height: 30rpx;}
  100. .imgc{width: 32rpx;height: 32rpx;}
  101. .imgd{width: 26rpx;height: 32rpx;}
  102. }
  103. .newsr{border-bottom: 2rpx solid #C1C1C1;flex:1;overflow: hidden;padding: 36rpx 2rpx 32rpx 8rpx;
  104. .tit{font-weight: bold;font-size: 30rpx;color: #222327;flex: 1;}
  105. .time{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
  106. .txt{font-weight: 500;font-size: 24rpx;color: #A0A0A0;}
  107. }
  108. }
  109. </style>