<template>
  <view>
	<view v-if="datalist.length>0">
		<view class="watlist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail()">
			<view class="tit flex1 over">{{ite.tit}}</view>
			<view class="txt flex0">{{ite.time}}</view>
		</view>
		<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{
		}
	},
	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)
		},
		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;}
}

</style>
