list.vue 2.6 KB

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