<template>
	<view class="container">
		<swiper class="swiper"
				  indicator-active-color="#FFFFFF"
				  circular
				  autoplay
				>
					<swiper-item
					  v-for="item in info.images"
					  :key="item.id"
					>
						<img  :src = "item" class="image_6"/>
					</swiper-item>
			</swiper>
		<view class="toptap">
			<view class="pricetag"><view class="price">￥{{info.price}}</view><view class="info.scribe_price">￥{{info.scribe_price}}</view></view>
			<view class="goodsname">{{info.name}}</view>
			<view class="spec"><view>查看：{{info.view}}</view><view>库存：{{info.stock}}</view><view>销量：{{info.sold_count}}</view></view>
		</view>
		
		<view class="desc">
			<view class="desc-tit">产品介绍</view>
			<view v-html="info.description"></view>
		</view>
	</view>
</template>

<script>
		import * as GoodsApi   from '@/api/goods'
	export default {
		data() {
			return {
				info:[],
				images:[
					"https://measure.njrenzhou.cn/upload/20230729/76764c4d9f413b5d.png",
					"https://measure.njrenzhou.cn/upload/20230729/76764c4d9f413b5d.png",
					"https://measure.njrenzhou.cn/upload/20230729/76764c4d9f413b5d.png",
					]
			}
		},
		onLoad(options)
		{
			if(options.goods_id)
			{
				GoodsApi.goodsInfo({goods_id:options.goods_id})
				  .then(result => {
					  this.info = result.data;
					  //this.info.images = this.images;
					  console.log(this.info);
				  })
			}
			
			
			
		},
		methods: {
			
		}
	}
</script>

<style>
.container
{
	background-color: #efefef;
	min-height: 100vh;
}
	
.swiper
{
	height: 630rpx;
	
}

.toptap
{
	background-color: #fff;
	padding-bottom: 20rpx;
}

.pricetag
{
	display: flex;
	align-items: center;
	padding:10rpx 30rpx;
	font-size: 30rpx;
	font-weight: bold;
	
}

.price
{
	color: red;
	font-size: 46rpx;
	margin-right:20rpx;
}

.image_6
{
	width: 100%;
}

.goodsname
{
	font-size: 40rpx;
	font-weight: bold;
	padding:10rpx 30rpx;
}

.spec
{
	display: flex;
	justify-content: space-between;
	font-size: 24rpx;
	color: #aaa;
	padding:10rpx 30rpx;
}

.desc
{
	margin-top: 40rpx;
	padding:20rpx 30rpx;
	background-color: #fff;
	min-height: 60vh;
}

.desc-tit
{
	padding:20rpx 0;
	font-size: 32rpx;
	font-weight: bold;
}

</style>
