list.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view>
  3. <view v-if="datalist.length>0">
  4. <!-- 新闻 -->
  5. <block v-if="type==1">
  6. <view class="nlist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.reservatId)">
  7. <!-- 置顶 -->
  8. <block v-if="ite.isTop">
  9. <view class="nrbox">
  10. <image :src="topbg"></image>
  11. <view>置顶</view>
  12. </view>
  13. <image :src="ite.img" class="titimg"></image>
  14. </block>
  15. <view class="tit overtwo">{{ite.tit}}</view>
  16. <view class="txt flexcj">
  17. <view class="flex0">来源<text>|</text></view>
  18. <view class="flex1 over">{{ite.from}}</view>
  19. <view class="flex0 ml6">{{ite.time}}</view>
  20. </view>
  21. </view>
  22. </block>
  23. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  24. </view>
  25. <block v-else>
  26. <no-data></no-data>
  27. </block>
  28. </view>
  29. </template>
  30. <script>
  31. import { selectDictValue } from '@/utils/common.js';
  32. import noData from "@/components/nodata/nodata.vue"
  33. export default {
  34. props:{
  35. datalist: {
  36. type: Array,
  37. default () {
  38. return []
  39. }
  40. },
  41. wtdt:{
  42. type: String,
  43. default () {
  44. return ''
  45. }
  46. },
  47. type:{
  48. type: [String,Number],
  49. default () {
  50. return ''
  51. }
  52. },
  53. },
  54. components:{
  55. noData
  56. },
  57. data(){
  58. return{
  59. topbg:require("@/static/images/home/topbg.png"),
  60. }
  61. },
  62. onLoad: function() {
  63. },
  64. methods:{
  65. getDetail(e){
  66. this.$emit('getDetail',e)
  67. },
  68. typeFn(data){
  69. if(data){
  70. var newArr=[]
  71. var astr=data.split('-')
  72. astr.forEach(ite=>{
  73. var a=ite.substring(0,5);
  74. newArr.push(a)
  75. })
  76. return newArr.join('-')
  77. }else{
  78. return ''
  79. }
  80. },
  81. },
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .nlist{
  86. position: relative;padding: 34rpx 0 30rpx;border-bottom: 2rpx solid #E6E6E6;
  87. &:last-child{border: none;}
  88. .nrbox{position: absolute;right: 0;top: 34rpx;z-index: 1;
  89. image{width: 112rpx;height: 52rpx;}
  90. view{position: absolute;right: 0;top: 0;left: 0;bottom: 0;font-weight: bold;font-size: 24rpx;color: #FFFFFF;line-height: 52rpx;padding-left: 40rpx;box-sizing: border-box;}
  91. }
  92. .titimg{width: 100%;height: 258rpx;margin-bottom: 26rpx;}
  93. .tit{font-weight: bold;font-size: 32rpx;color: #222327;margin-bottom: 24rpx;line-height: 44rpx;}
  94. .txt{font-weight: 500;font-size: 24rpx;color: #AAAAAA;
  95. text{margin:0 12rpx;}
  96. }
  97. }
  98. </style>