<template>
	<view class="">
		<!-- <view class="content">
			<view class="poster">
				<image src="https:\/\/t38.9026.com\/uploads\/golf\/images\/2022-05-31\/20220531739250.png"  mode="aspectFill"></image>
				<view class="code">
					<image src="../../static/travelD/code.png" mode="aspectFill"></image>
				</view>
			</view>
			
			<view class="title">
				<view class="kangyang">
					<text>
						{{goodsInfo.name}}
					</text>
					
				</view>
				<view class="">
					￥{{goodsInfo.min_price}}/人起
				</view>
			</view>
			<view class="" style="font-size: 22rpx;color: #666666;">
				{{created_at?created_at:''}}
			</view>
		</view> -->
		<!-- <view class="content">
			<image :src="" mode="aspectFill"></image>
		</view> -->
		<view class="flex">
			<view class="weix">
				<button type="default" open-type="share" style="background-color: transparent;border-style:none;border:0;padding: 0;line-height: 30rpx;">
					<image src="../../static/travelD/wxin.png"  mode="widthFix"></image>
					<view class="text">
						分享
					</view>
				</button>
				
			</view>
			<view class="xiangc">
				<image src="../../static/travelD/album.png" mode="widthFix"></image>
				<view class="text">
					手机相册
				</view>
			</view>
		</view>
		<view class="paddingsafe"></view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
			goodsInfo:null,
			good_id:''
			}
		},
		// #ifdef MP
		onShareAppMessage(s= false){
		    return this.$shareAppMessage({
		        title: this.goodsInfo.name,
		        imageUrl:"",
		        path: "/pages/travel/travelDetails?id="+this.id,
		       
		    });
		},
		// #endif
		onLoad(o) {
			if(o.goodsInfo){
				let goodsInfo = decodeURIComponent(o.goodsInfo)
				this.goodsInfo = JSON.parse(goodsInfo)
			}
			this.init()
		},
		computed:{
			created_at(){
				let created_at=''
				if(this.goodsInfo.created_at){
					created_at=this.goodsInfo.created_at.slice(0,10)
				}
				return created_at
			}
		},
		methods:{
			init(){
				uni.$u.http.post('/api/share/good', {
					good_id: this.goodsInfo.id.toString()
				}, {
					custom: {
						auth: true
					}
				}).then((res) => {
					// this.imgurl=res.
				}).catch((err) => {
					console.log(err)
				})
			}
		}
	}
</script>

<style lang="less">
	page{
		background-color: #F4F4F4;
	}
	.content{
		box-sizing: border-box;
		background: #ffffff;
		border-radius: 8rpx 32rpx 8rpx 32rpx;
		margin: 24rpx 58rpx 0;
		padding: 24rpx 24rpx 40rpx;
		image{
			width: 596rpx;
			height: 874rpx;
			width: 100%;
			border-radius: 8rpx 20rpx 8rpx 0;
		}
		.poster{
			position: relative;
		}
		.code{
			position: absolute;
			right: 33rpx;
			bottom: 41rpx;
			image{
				width: 120rpx;
				height: 120rpx;
			}
		}
		.title{
			display: flex;
			justify-content: space-between;
			// align-items: center;
			font-size: 30rpx;
			font-weight: 600;
			color: #333333;
			margin: 32rpx 0 16rpx;
			.kangyang{
				word-break:break-all;//英文
				// padding-right: 20rpx;
				width: 400rpx;
			}
		}
	}
	.flex{
		box-sizing: border-box;
		margin: 109rpx 144rpx 0;
		display: flex;
		align-content: center;
		justify-content: space-between;
		.text{
			font-size: 20rpx;
			font-family: PingFang-SC-Medium, PingFang-SC;
			font-weight: 500;
			color: #666666;
			text-align: center;
			margin: 30rpx 0;
		}
		.weix{
			button::after {
					border: none;
				}
			image{
				width: 74rpx;
				height: 74rpx;
			}
		}
		.xiangc{
			image{
				width: 74rpx;
				height: 74rpx;
			}
		}
	}
</style>
