Vue.component('consultation-list', {
	template: `<ul class="consultation-list">
				<li class="consultation-list-item" @click="viewDetail(1)" v-for="(list,index) in guidanceList">
					<div class="con-user-info">
						<span class="guidance-status" :data-status="list.status?list.status:1" desc="1未读2已读"></span>
						<p class="article-title">{{list.content}}</p>
						<p class="user-problem">发送时间：{{list.createTime}}</p>
					</div>
				</li>
			</ul>`,
	data: function() {
		return {
			guidanceList: "",
			curPage:1
		}
	},
	props:["guidanceData"],
	methods: {
		viewDetail: function(id) {
			top.layer.open({
		      type: 2,
		      title: '健康指导文章详情',
		      maxmin: true,
		      area: ['1000px', '650px'],
		      shadeClose: true,
		      moveOut:true,
		      btn:'返回',
		      success: function(layero){
			  	layero.find('.layui-layer-btn').css({'text-align': 'center','border-top': '1px solid #ececec','padding-top': '7.5px'});
			  	layero.find('.layui-layer-btn').find('a').addClass("layui-btn").css({background: '#f96565',color: '#fff',width: '100px',border: 'none', height: '34px','line-height':'22px',padding: '6px 12px','font-size': '14px'});
			  },
		      content: '../html/lay_gui_article_detail.html'
		    });
		}
	},
	watch:{
		guidanceData:function(val){
			this.guidanceList=this.guidanceData;
		}
	},
	mounted: function() {
		this.$emit('init-data', this.curPage);
	}
})