123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <template>
- <view>
- <view v-if="datalist.length>0">
- <!-- 新闻 -->
- <block v-if="type==1">
- <view class="nlist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.reservatId)">
- <!-- 置顶 -->
- <block v-if="ite.isTop">
- <view class="nrbox">
- <image :src="topbg"></image>
- <view>置顶</view>
- </view>
- <image :src="ite.img" class="titimg"></image>
- </block>
- <view class="tit overtwo">{{ite.tit}}</view>
- <view class="txt flexcj">
- <view class="flex0">来源<text>|</text></view>
- <view class="flex1 over">{{ite.from}}</view>
- <view class="flex0 ml6">{{ite.time}}</view>
- </view>
- </view>
- </block>
- <view class="shax" v-if="wtdt">{{wtdt}}</view>
- </view>
- <block v-else>
- <no-data></no-data>
- </block>
- </view>
- </template>
- <script>
- import { selectDictValue } from '@/utils/common.js';
- import noData from "@/components/nodata/nodata.vue"
- export default {
- props:{
- datalist: {
- type: Array,
- default () {
- return []
- }
- },
- wtdt:{
- type: String,
- default () {
- return ''
- }
- },
- type:{
- type: [String,Number],
- default () {
- return ''
- }
- },
- },
- components:{
- noData
- },
- data(){
- return{
- topbg:require("@/static/images/home/topbg.png"),
- }
- },
- onLoad: function() {
- },
- methods:{
- getDetail(e){
- this.$emit('getDetail',e)
- },
- typeFn(data){
- if(data){
- var newArr=[]
- var astr=data.split('-')
- astr.forEach(ite=>{
- var a=ite.substring(0,5);
- newArr.push(a)
- })
- return newArr.join('-')
- }else{
- return ''
- }
- },
- },
-
- }
- </script>
- <style lang="scss" scoped>
- .nlist{
- position: relative;padding: 34rpx 0 30rpx;border-bottom: 2rpx solid #E6E6E6;
- &:last-child{border: none;}
- .nrbox{position: absolute;right: 0;top: 34rpx;z-index: 1;
- image{width: 112rpx;height: 52rpx;}
- 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;}
- }
- .titimg{width: 100%;height: 258rpx;margin-bottom: 26rpx;}
- .tit{font-weight: bold;font-size: 32rpx;color: #222327;margin-bottom: 24rpx;line-height: 44rpx;}
- .txt{font-weight: 500;font-size: 24rpx;color: #AAAAAA;
- text{margin:0 12rpx;}
- }
- }
- </style>
|