<template>
	<view class="wrap">
		<image src="../../../static/img/hghg/hghgBg.jpg" class="bgImage"></image>
		<view class="btn-wrap">
			<view>
				<text class="button" @click="goKnow()">购票须知</text>
			</view>
			<view style="margin-top: 100rpx;">
				<text class="button" @click="goBuy()">立即购票</text>
			</view>
		</view>
		<!-- 购票须知 -->
		<view class="buy-know" v-if="showKnow" @click="showKnow=false">
			<view class="box">
				<view class="title">
					告游客书
				</view>
				<view>
					尊敬的游客、广大市民：
				</view>
				<view>
					<text>
						开放时间：
					</text>
					{{openTime}}
				</view>
				<view>
					<text>
						博物馆开放日多功能设备运行时间：
					</text>
					09:30 - 12:30；14:30 - 17:30，（根据景区当天实际情况为准）
				</view>
				<view>
					<text>
						免费人群：
					</text>
					需出示身份证及有效证件原件前往检票处登记入园。
				</view>
				<view>
					<text>
						退票须知：
					</text>
					随时可退，过期未核销自动退。
				</view>
				<view style="margin-top: 48rpx;display: flex;justify-content: center;">
					<text class="button" @click.stop="goBuy()">立即购票</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
  data() {
    return {
      urlQuery:'',
      showKnow:false,
      openTime:'09:00 - 18:00，闭馆前1小时（17:00）停止售票',//开放时间
      merchantId:'',//商户Id
    }
  },
  onLoad(option) {
    let channelId=option.channelId||''
    let companyId=option.companyId||''
    let groupId=option.groupId||''
    let groupChannelId=option.groupChannelId||''
    this.merchantId=option.merchantId||''
    this.urlQuery=channelId+'&merchantId='+this.merchantId+'&groupId='+groupId+'&groupChannelId='+groupChannelId+'&companyId='+companyId
  },
  methods: {
    //---购票
    goBuy(){
      uni.navigateTo({
        url:'/pages/combination/distributionCombiChoose/distributionCombiChoose?channelId='+this.urlQuery
      })
    },
    //---购票须知
    goKnow(){
      this.showKnow=true
      this.initDetail()
    },
    //---初始化详情
    initDetail(){
		  let data={
		    userId:uni.getStorageSync('userId')||'',
		    openid:uni.getStorageSync('openid')||'',
		    id:this.merchantId,
		    isDetail:1,//商户详情
		  }
		  this.$request('scenic/user/merchant/findDetailInfo',data).then((res)=>{
		    if(res.code=='00'){
		      let data=res.data.merchantTitleData||[]
		      data.forEach(item => {
		        if (item.titleCode == 'scenic_base_info') {
		          //基本信息
		          item.merchantChildTitleData.forEach(item2=> {
		            if (item2.childTitleCode == '101001') {
		              //开放时间
		              this.openTime = item2.contentList[0].content||'09:00 - 18:00，闭馆前1小时（17:00）停止售票'
		            }
		          })
		        }
          })
		    }else{
		      uni.showToast({
		        title: res.message,
		        icon: 'none'
		      })
		    }
		  })
    },
  }
}
</script>

<style scoped>
.wrap{
	height: 100%;
	font-size: 40rpx;
	display: flex;
	align-items: center;
	justify-content:center;
}
.bgImage{
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
}
.btn-wrap{
	position: relative;
	top: -160rpx;
}
.button{
	width: 520rpx;
	height: 112rpx;
	display:flex;
	align-items: center;
	justify-content: center;
	background: url('../../../static/img/hghg/bigBtn.png') no-repeat;
	background-size: 100% 100%;
}
.buy-know{
	padding: 0 48rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.3);
}
.box{
	padding: 60rpx 40rpx;
	background: url('../../../static/img/hghg/dialog.png') no-repeat;
	background-size: 100% 100%;
	color: #000000;
	font-size: 28rpx;
}
.box>view{
	margin-top: 10rpx;
}
.box view text{
	font-weight: bold;
}
.title{
	font-weight: bold;
	font-size: 40rpx;
	text-align: center;
}
.button{
	display: flex;
	width: 244rpx;
	height: 96rpx;
	background: url('../../../static/img/hghg/smallBtn.png') no-repeat;
	background-size: 100% 100%;
	align-items: center;
	justify-content: center;
	font-size: 32rpx;
}
</style>
