 <template>
	<view class="page">
		<u-navbar title=" " :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37'
			title-size='36' height='46' id="navbar" :custom-back="btnfh">
		</u-navbar>
       <view class="top">
		  <image v-if="type == 1" class="bj" :src="obj.imageUrl" mode="aspectFill"></image>
       	  <image v-else class="bj" :src="obj.picture" mode="aspectFill"></image>
		  <view class="name">
		  	{{obj.name}}
		  </view>
       </view>
		
       <view class="boot">
       	 <image class="botbj" src="https://api.ccttiot.com/smartmeter/img/static/uTeM07FSquwwSTZMqldG" mode=""></image>
		<view class="" style="position: absolute;
		top: 80rpx;
		left: 50%;
		transform: translateX(-50%);">
			<view class="name">
				基本介绍
			</view>
			<view class="cont" v-html="obj.description">
				
			</view>
		</view>
       </view>
        
	</view>
</template>

<script>
	export default {
		data() {	
			return {
                bgc: {
                	backgroundColor: "#fff",
                },
				id:'',
				obj:{},
				type:'',
				fanhui:''
			}
		},
		onLoad(e) {
            this.id = e.id
			this.type = e.type
			this.getxq()
			if(e && e.fanhui){
				this.fanhui = e.fanhui
			}
		},
		// 分享到好友（会话）
		onShareAppMessage: function() {
			return {
				title: '玩转福鼎',
				path: '/page_user/techan/techansp?id=' + this.id + '&type=' + this.type + '&fanhui=1'
			}
		},
		// 分享到朋友圈  
		onShareTimeline: function() {
			return {
				title: '玩转福鼎',
				query: '',
				path: '/page_user/techan/techansp?id=' + this.id + '&type=' + this.type + '&fanhui=1'
			}
		},
		methods: {
			btnfh(){
				if(this.fanhui == 1){
					uni.reLaunch({
						url:'/pages/index/index'
					})
				}else{
					uni.navigateBack()
				}
			},
			// 请求美食详情
			getxq(){
				if(this.type == 1){
					this.$u.get(`/app/dish/${this.id}`).then((res) => {
						if(res.code == 200){
							this.obj = res.data
						}
					})
				}else{
					this.$u.get(`/app/specialty/${this.id}`).then((res) => {
						if(res.code == 200){
							this.obj = res.data
						}
					})
				}
			},
		}
	}
</script>

<style lang="less">
	::v-deep .u-icon__icon,
	::v-deep .u-title{
		padding-bottom: 22rpx !important;
	}
	.boot{
		position: relative;									
		.name{
			font-weight: 600;
			font-size: 40rpx;
			color: #3D3D3D;
			padding-left: 20rpx;
		}	
		.cont{
			width: 702rpx;
			height: 650rpx;
			background: #FFFFFF;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			margin-top: 36rpx;
			padding: 34rpx 26rpx;
			box-sizing: border-box;
			overflow: scroll;
		}
		.botbj{
			width: 750rpx;
			height: 848rpx;
			
		}
	}
	.top{
		position: relative;
		.name{
			width: 702rpx;
			height: 112rpx;
			background: #FFFFFF;
			box-shadow: 0rpx 0rpx 36rpx 0rpx rgba(0,0,0,0.1);
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			position: absolute;
			left: 50%;
			transform: translateX(-50%);
     		bottom: -56rpx;
			font-weight: 600;
			font-size: 36rpx;
			color: #3D3D3D;
			line-height: 112rpx;
			padding-left: 48rpx;
			z-index: 9;
		}
	}
	.bj{
		width: 750rpx;
		height: 582rpx;
	}
	page {
		background: #fff;
		height: 100vh;
		overflow: hidden;
	}
</style>
