<template>
	<view class="content">
		<view class="bgtop" v-if="xllist.photo.length!=0" :style="{background: 'url(https://qyly1.csly-travel.com/api/mc-config/model/device/file/t_1684805150186614785?deviceId='+ xllist._id +'&fileId='+ xllist.photo[0].fileId +'&useCode=false) no-repeat'}"></view>
		<view class="bgboxs">
			<view class="xwtitle">
				<view class="tit">
					<view class="icon">
						<image :src="$getimg('icon-yyyc.png')" mode=""></image>  <!-- 非遗 -->
					</view>
					<view class="titwz">{{xllist.name }}</view>
				</view>
				<view class="xqtimeright">
					<text class="sjsj1">{{xllist.level}}</text>
				</view>
			</view>
			<view class="xwnr">
				<view class="xwnrdiv" v-html="xllist.introduce"></view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	components:{},
	data() {
		return {
			id: 0,
			xllist: {
				photo: []
			},
		};
	},
	onLoad(option) {
		this.id = option.id;
		this.getToken();//传承有人
	},
	onReady() {},
	onShareAppMessage() {},
	methods: {
		getToken() {
			var url = 'https://qyly1.csly-travel.com/tours/commonMethod.jspx'
			var para = {
				type:1,url: 'http://36.153.213.27:8888/api/mc-config/model/aggregation-external/getToken',param:'username=user_xcx&password=Supcon'
			};
			var that = this;
			that.httpPostxin(that, url, para, function(res) {
				that.token = res.data.obj;
				if(res.data.success==false){
					that.sxToken();
				}else{
					that.getfyyrDaya();
				}
			});
		},
		sxToken(){
			var url = 'https://qyly1.csly-travel.com/tours/commonMethod.jspx'
			var para = {type:1,url: 'http://36.153.213.27:8888/api/mc-config/model/aggregation-external/refreshToken',param:'accessToken='+this.token};
			var that = this;
			that.httpPostxin(that, url, para, function(res) {
				that.token=res.data.obj;
				that.getfyyrDaya();
			});
		},
		getfyyrDaya() {
			uni.showLoading({title: '加载中...'});
			var url = 'https://qyly1.csly-travel.com/tours/commonMethod.jspx';
			var para = {type:2,url: 'http://36.153.213.27:8888/api/mc-config/model/aggregation-external/aggregation?accessToken='+this.token,param:{
				"code": "0001_fy",
				"params": {},
				"page": 0,
				"size": 0,	
				"result": {},
				"orders": []		
			}};
			var that = this;
			that.httpPostxin(that, url, para, function(res) {
				if (res.data.success) {
					let json = res.data.obj.data;
					for (let i = 0; i < json.length; i++) {
						if(that.id == json[i]._id) {
							that.xllist = json[i]
						}
					}
					console.log(that.xllist)
					uni.hideLoading();
				}else {
					uni.hideLoading();
				}
			});
		}
	}
};
</script>

<style lang="scss">
	$url:'https://qyly1.csly-travel.com/r/cms/www/m/changshu/';
	page {
	    background: #ffffff;
	}
.content {
	width: 750rpx;
	// padding-top: 30upx;
	overflow-x: hidden;
	.bgtoptxt{
		font-size: 26upx;
		font-weight: 500;
		color: #FFFFFF;
		background: linear-gradient(0deg, #3269F7 0%, #4A9AF9 100%);
		border-radius: 26upx;
		width: 160upx;
		height: 56upx;
		line-height: 56upx;
		text-align: center;
		margin: 0upx 0 30upx 30upx;
	}
	.bgtop{
		width: 100%;
		height: 460upx;
		background-size: 100% 100% !important;
	}
	.bgboxs{
		width: 100%;
		margin: -40rpx auto 0;
		background: #fff;
		border-radius: 30rpx 30rpx 0rpx 0rpx;
		.xwtitle {
			font-size: 40upx;
			font-weight: bold;
			color: #333333;
			display: flex;
			align-items: center;
			padding: 50rpx 20rpx 0;
			position: relative;
			.tit{
				display: flex;
				align-items: center;
			}
			.icon{
				width: 62upx;
				height: 56upx;
				margin-right: 10rpx;
				image{
					display: block;
					width: 100%;
					height: 100%;
				}
			}
		}
		.xqtimeright {
		  font-size: 24rpx;
		  position: absolute;
		  right: 50rpx;
		  image{
			  width: 28rpx;
			  height: 28rpx;
		  }
		}
		.xqtimeright .sjsj::before {
		  content: '';
		  display: inline-block;
		  width: 28rpx;
		  height: 28rpx;
		  background: url( $url+"icon-dianzhan.png") no-repeat;
		  background-size: 100% auto;
		  margin-right: 10rpx;
		  margin-top: -9rpx;
		  vertical-align: middle;
		}
		.xwnr {
			font-size: 24upx;
			font-weight: 500;
			color: #666;
			width: 90%;
			margin: 30upx auto 0 auto;
			line-height: 1.6;
			.xwnrdiv {
				margin: 0rpx 0rpx 55rpx 0rpx;
				line-height: 2;
			}
		}
		.xwdzAllfotter {
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: center;
			margin-bottom: 40rpx;
			.xwdzAll {
				overflow: hidden;
				border: 1rpx solid #d6d6d6;
				border-radius: 35rpx;
				display: flex;
				flex-direction: row;
				align-items: center;
				width: 155rpx;
				justify-content: center;
				height: 70rpx;
				.xwdzimg {
					width: 32rpx;
					height: 32rpx;
					float: left;
					margin-right: 10rpx;
				}
				.xwdzsl {
					font-size: 28rpx;
					font-family: Microsoft YaHei;
					font-weight: bold;
					color: #111111;
					margin: 0rpx 0rpx 0rpx 18rpx;
					float: left;
					&.active {
						color: #ff3335;
					}
				}
				&.active{
					border: 1rpx solid #ff3334;
				}
			}
		}
	}
	.yudingimg{
		width: 110rpx;
		height: 110rpx;
		position: fixed;
		top: 278rpx;
		right: 50rpx;
		z-index: 999;
	}
}

</style>
