<template>
	<view class="detail" style="    padding: 30rpx;">

		<scroll-view scroll-y="true" scroll-with-animation='true' style="height: 100%">

			<view class="detail-img">
        <productConSwiperGroupbuying class="skeleton-rect" :imgUrls="goodsInfo.slideshowList" :h="351"
                                     :videoline="goodsInfo.videoUrl" @videoPause="videoPause"></productConSwiperGroupbuying>
<!--				<image :src="goodsInfo.goodsCover" mode="scaleToFill" />-->
			</view>
			<view class="detail-content">
				<view style="display:flex; 	margin-bottom: 20rpx;">
					<text class="red"> ¥{{ goodsInfo.grouponPrice }}</text>
					<text class="line-thr">¥{{ goodsInfo.salePrice }}</text>
				</view>
				<view class="detail-content-t">
					{{ goodsInfo.goodsName }}
				</view>
				<!-- 				<view class='time '>
					<image src="http://www.gzzzyd.com/groupon/home_slices/编辑@2x.png" mode="scaleToFill" />
					发布于：
					<text class="imp_info">
						1天20小时36分钟前
					</text>
				</view> -->
			</view>

			<view class="detail-info product-intro">
				<view class="title">
					商品信息
				</view>
<!--				<u-album :urls="goodsInfo.detailImgUrlList" :rowCount="1" :multipleSize="albumWidth" maxCount="9999"-->
<!--					multipleMode="widthFix"></u-album>-->
        <u-parse :content="goodsInfo.detailContent"></u-parse>
			</view>
		</scroll-view>

<!--		<view class="footer acea-row row-between-wrapper">-->
<!--			&lt;!&ndash; <button open-type="contact" hover-class='none' class='item'>-->
<!--						<view class='iconfont icon-kefu'></view>-->
<!--						<view>客服</view>-->
<!--					</button> &ndash;&gt;-->

<!--			<navigator hover-class="none" class="item skeleton-rect" open-type="switchTab" url="/pages/index/index">-->
<!--				<view class="iconfont icon-shouye6"></view>-->
<!--				<view class="p_center">{{ $t(`首页`) }}</view>-->
<!--			</navigator>-->

<!--			<view style="    margin-right: 30rpx;">-->
<!--				<view class="bnt acea-row">-->
<!--					<view class="buy-box">-->
<!--						<button class="share-btn ">-->
<!--							分享有礼-->
<!--						</button>-->
<!--						<button class="now-btn " @submit="goBuy">-->
<!--							立即购买-->
<!--						</button>-->
<!--					</view>-->
<!--				</view>-->
<!--			</view>-->

<!--		</view>-->

	</view>
</template>

<script>
import {
	userEdit,
} from '@/api/user.js';
import productConSwiperGroupbuying from "@/components/productConSwiperGroupbuying";
import {
	toLogin
} from '@/libs/login.js';
import {
	mapGetters
} from "vuex";
import dayjs from "@/plugin/dayjs/dayjs.min.js";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import colors from '@/mixins/color.js';

export default {
	props: {
		goodsInfo: {
			type: Object,
			default: () => { }
		}
	},
	components: {
    productConSwiperGroupbuying,
		// #ifdef APP-PLUS
		appUpdate,
		// #endif
		// #ifdef MP
		authorize
		// #endif
	},
	mixins: [colors],
	data () {
		return {
			albumWidth: 0,
		};
	},
	computed: mapGetters(['isLogin']),
	watch: {
		isLogin: {
			handler: function (newV, oldV) {
				if (newV) {
				}
			},
			deep: true
		}
	},
	created(options) {
		let that = this;
			uni.getSystemInfo({
				success: function (res) {
					that.albumWidth = res.windowWidth - 30
					that.height = res.windowHeight;
					//res.windowHeight:获取整个窗口高度为px，*2为rpx；98为头部占据的高度；
					// #ifndef APP-PLUS || H5 || MP-ALIPAY
					that.navbarRight =
						res.windowWidth - uni.getMenuButtonBoundingClientRect().left;
					// #endif
				},
			});
	},
	methods: {
    videoPause () {
      let that = this;
      this.$nextTick(() => {
        that.infoScroll();
      });
    },
		formSubmit: function (e) {
			let that = this,
				value = e.detail.value,
				userInfo = that.switchUserInfo[that.userIndex];
			if (!value.nickname) return that.$util.Tips({
				title: that.$t(`请输入姓名`)
			});
			value.avatar = this.userInfo.avatar;
			userEdit(value).then(res => {
				return that.$util.Tips({
					title: res.msg,
					icon: 'success'
				}, {
					tab: 3,
					url: 1
				});
			}).catch(msg => {
				return that.$util.Tips({
					title: msg || that.$t(`保存失败`)
				}, {
					tab: 3,
					url: 1
				});
			});
		}
	}
}
</script>

<style scoped lang="scss">
.time {
	height: 44rpx;
	font-size: 24rpx;
	font-weight: 400;
	color: #999999;
	line-height: 44rpx;

	image {
		width: 40rpx;
		height: 40rpx;
		margin: 0 10rpx;
		vertical-align: middle;
	}

	.imp_info {
		height: 44rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #333333;
		line-height: 44rpx;
	}
}

.detail {
	height: 80vh;
}

.detail-img {
	image {
		width: 702rpx;
		height: 702rpx;
	}

	margin-bottom: 20rpx;
}

.detail-content-t {
	flex: 1;
	font-size: 20rpx;
	font-weight: 400;
	color: #333333;
	line-height: 28rpx;
	margin-bottom: 20rpx;
}

.detail-content {
	.red {
		display: block;
		font-size: 28rpx;
		font-weight: 500;
		color: #B22338 !important;
		margin-right: 10rpx;
	}

	.line-thr {
		display: block;
		font-size: 28rpx;
		font-weight: 400;
		color: #999999;
		text-decoration: line-through;
	}
}

.detail-info {
	.title {
		margin: 30rpx 0;
		height: 44rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #111111;
		line-height: 44rpx;
	}
}


.footer {
	padding: 0 20rpx 0 10rpx;
	position: fixed;
	bottom: 0;
	width: 100%;
	box-sizing: border-box;
	background-color: #fff;
	z-index: 277;
	border-top: 1rpx solid #f0f0f0;
	height: 100rpx;
	height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
	height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
}

.footer .item .iconfont {
	text-align: center;
	font-size: 40rpx;
}

.footer .item .iconfont.icon-shoucang1 {
	color: var(--view-theme);
}

.footer .item .iconfont.icon-gouwuche1 {
	font-size: 40rpx;
	position: relative;
}

.buy-box {
	display: flex;
	width: 100%;
}

.share-btn {
	width: 280rpx;
	height: 84rpx;
	background: #F1F8E5;
	border-radius: 54rpx 0rpx 0rpx 54rpx;

	font-size: 28rpx;
	font-weight: 400;
	color: #75BE00;
	line-height: 84rpx;


}

.now-btn {
	width: 280rpx;
	height: 84rpx;
	background: #B42A3E;
	border-radius: 0rpx 54rpx 54rpx 0rpx;
	font-size: 28rpx;
	font-weight: 400;
	color: #fff;
	line-height: 84rpx;


}
</style>
