<template>
  <view>
	<view v-if="datalist.length>0">
	<!-- 代办提醒 -->
		<block v-if="type=='dbtx'">
			<view class="watlist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite)">
				<view class="tit flex1 over">{{ite.remindTitle}}</view>
				<view class="txt flex0">{{ite.remindTime}}</view>
			</view>
		</block>
		<!-- 系统通知 -->
		<block v-if="type=='xttz'">
			<view class="cards" v-for="(ite,idx) in datalist" :key="idx" @click="getDetail(ite.noticeId)">
				<view class="top flexc">
					<view class="cir bga"></view>
					<view class="tit">系统通知</view>
					<view class="time">{{ite.createTime}}</view>
				</view>
				<view class="ctxt">
					<view>{{ite.noticeContent}}</view>
					<view class="tzhu">祝您生活愉快!</view>
				</view>
			</view>
			<view class="shax" v-if="wtdt">{{wtdt}}</view>
		</block>
		<!-- 代办通知 -->
		<block v-if="type=='dbtz'">
			<view class="cards" v-for="(ite,idx) in datalist" :key="idx" @click="getDetail(ite.remindId)">
				<view class="top flexc">
					<view class="cir bgb"></view>
					<view class="tit">待办通知</view>
					<view class="time">{{ite.remindTime}}</view>
				</view>
				<view class="ctxt">
					<view>
						{{ite.remindContent}}
						<!-- 您有<text class="cof6">1</text>条来自【潜山弘立新型建材有限公司】的申报信 息,请您前往审核。 -->
					</view>
					<view class="tzhu">祝您生活愉快!</view>
					<view class="tzhu tctip" @click.stop="getHandle(ite)">点击此处去处理</view>
				</view>
			</view>
			<view class="shax" v-if="wtdt">{{wtdt}}</view>
		</block>
		
	</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{
		}
	},
	onLoad: function() {
	},
	methods:{
		kaType(data, list) {
			return selectDictValue(list, data);
		},
		getDelFn(id){
			var that=this;
			uni.showModal({
				title: '确认删除',
				content: "是否确认删除该预约",
				cancelText: '取消',
				confirmText: '确认',
				success: function(res) {
					if (res.confirm) {
						that.$emit("getDelFn",id)
					} else if (res.cancel) {
						// console.log('用户点击取消');
					}
				}
			});
		},
		getDetail(e){
			this.$emit('getDetail',e)
		},
		getHandle(e){
			this.$emit('getHandle',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>
.watlist{display: flex;align-items: center;padding: 20rpx 34rpx;
	.tit{font-weight: 500;font-size: 28rpx;color: #222327;line-height: 40rpx;}
	.txt{font-weight: 500;font-size: 24rpx;color: #AAAAAA;margin-left: 20rpx;}
}
.cards{width: 702rpx;background: #FFFFFF;border-radius: 10rpx;margin: 0 auto 24rpx;
	.top{padding: 26rpx 34rpx;
		.cir{width: 20rpx;height: 20rpx;flex: 0 0 auto;margin-right: 20rpx;border-radius: 20rpx;
			&.bga{background: #28C529;}
			&.bgb{background: #FF6969;}
		}
		.tit{flex: 1;font-weight: bold;font-size: 26rpx;color: #343434;line-height: 36rpx;}
		.time{font-weight: 500;font-size: 26rpx;flex: 0 0 auto;margin-right: 20rpx;color: #222327;}
	}
	.ctxt{font-weight: 500;font-size: 26rpx;color: #666666;border-top: 2rpx solid #E5E5E5;padding: 34rpx;
		view{line-height: 36rpx;}
		.tzhu{margin-top: 28rpx;}
		.tctip{color: #00A9F0;text-decoration: underline;}
	}

}
</style>