<template>
	<view class="page">
		<pyh-nv ref="nv" :config="nvConfig"></pyh-nv>
		<view class="listBox" :style="{'padding-top':(pageTop+'px')}">
		<view class="content">
		<!-- 订单列表 -->
		<view class="order-list">
			<view class="list" @click="funeralcremation">
				<view class="goods-list">
					<view class="goods">
							<view class="goods-name">
								<view class="goods-name-title">遗体火化</view>
								<view>遗体火化，又称火葬，是一种处理尸体的科学方法。</view>
							</view>
							<view>
								<view class="btn">
									<image src="../../static/btn.png" mode="widthFix"></image>
									<text>预约</text>
								</view>
							</view>
					</view>
				</view>
			</view>
			<view class="list" @click="auditorium">
				<view class="goods-list">
					<view class="goods">
							<view class="goods-name">
								<view class="goods-name-title">礼堂预约</view>
								<view>殡仪馆或墓园等场所预约使用礼堂进行追悼会或告别仪式</view>
							</view>
							<view>
								<view class="btn">
									<image src="../../static/btn.png" mode="widthFix"></image>
									<text>预约</text>
								</view>
							</view>
					</view>
				</view>
			</view>
			<view class="list" @click="funeralash">
				<view class="goods-list">
					<view class="goods">
							<view class="goods-name">
								<view class="goods-name-title">骨灰寄存</view>
								<view>骨灰寄存是指将逝者的骨灰存放在殡仪馆或墓园的骨灰寄存室中</view>
							</view>
							<view>
								<view class="btn">
									<image src="../../static/btn.png" mode="widthFix"></image>
									<text>预约</text>
								</view>
							</view>
					</view>
				</view>
			</view>
		</view>
		</view>
		</view>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				OrderType: 0,
				nvConfig:{
					title:"线上预约",
					bgColor:"#ffffff",
					color:"#000000",
					fixedAssist:{
						hide:true,
					},
				},
				tz:true
			};
		},
		onPageScroll(e) {this.$refs.nv.pageScroll(e)},
		computed:{
			pageTop(){return parseInt(88*uni.getSystemInfoSync().windowWidth/750) + uni.getSystemInfoSync().statusBarHeight}
		},
		onLoad(params) {
			this.OrderType = params.type;
			this.getbsinfo();
		},
		methods:{
			getbsinfo(){
				console.log("userinfo",uni.getStorageSync("USERS_KEY"));
				var info = {
					userId:uni.getStorageSync("USERS_KEY").userId
				}
				this.API.getbsinfo(info).then(res=>{
					console.log("获取用户报丧信息",res);
					if(res.rows.length == 0){
						this.tz = false
					}
				})
			},
			funeralcremation(){
				if(this.tz){
					uni.navigateTo({
						url: '/pages/funeralcremation/funeralcremation',
					})
				}else{
					this.$refs.uToast.show({
						type: 'error',
						title: '成功主题(带图标)',
						message: "请先去线上报丧",
						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
					})
				}
			},
			funeralash(){
				if(this.tz){
					uni.navigateTo({
						url: '/pages/funeralash/funeralash',
					})
				}else{
					this.$refs.uToast.show({
						type: 'error',
						title: '成功主题(带图标)',
						message: "请先去线上报丧",
						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
					})
				}
				
			},
			auditorium(){
				if(this.tz){
					uni.navigateTo({
						url: '/pages/auditorium/auditorium',
					})
				}else{
					this.$refs.uToast.show({
						type: 'error',
						title: '成功主题(带图标)',
						message: "请先去线上报丧",
						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
					})
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	@import 'funeralreservation.scss';
</style>
