<template>
	<!-- #ifndef APP-PLUS || MP-WEIXIN -->
	<view class="fivecontent">
	<!-- #endif -->
		<!-- #ifdef MP-WEIXIN -->
		<view class="fivecontent" :style="isFixedTop?`margin-top:${HeighT.heightBar}px`:''">
		<!-- #endif -->
			<!-- #ifdef APP-PLUS -->
			<view class="fivecontent" :class="{statusbarmargin:isFixedTop}">
			<!-- #endif -->
				<view class="fivecontent_item" v-for="(item,index) in 12" :key="index">
					<view class="fivecontent_item_nav flex-start">
						<image src="@/static/avatar.png" mode="aspectFill"></image>
						<view class="fivecontent_item_nav_left">
							<view class="fivecontent_item_nav_lefttop flex-between">
								<view>
									幸运咖啡（荣民时代广场店）
								</view>
								<view>
									龙首.151m
								</view>
							</view>
							<view class="fivecontent_item_nav_leftlang flex-start">
								<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png"
									mode="aspectFill"></image>
								<text>人气连锁品牌</text>
							</view>
						</view>
					</view>
					<view class="fivecontent_item_box">
						<view class="fivecontent_item_boxitem flex-between">
							<image src="@/static/avatar.png" mode=""></image>
							<view class="fivecontent_item_boxitemleft flex-colum-start">
								<view class="fivecontent_item_boxitemleftone flex-between">
									<view>全场饮品任选</view>
									<text>已抢15789份</text>
								</view>
								<view class="fivecontent_item_boxitemlefttow flex-start">
									<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png"
										mode="aspectFill"></image>
									<text>人气连锁品牌</text>
								</view>
								<view class="indexboxitemleftthere flex-colum-start">
									<view class="indexboxitemleftthereabsolute">
										马上抢
									</view>
									<view class="indexboxitemlefttheretext flex-start">
										<view class="indexboxitemlefttheretextone">
											<text>¥</text>
											<text>1444</text>
										</view>
										<view class="indexboxitemlefttheretexttow">
											¥111
										</view>

									</view>
									<view class="indexboxitemleftthere_countdown flex-between">
										<text class="indexboxitemleftthere_countdowntext">共省4元</text>
										<view class="indexboxitemleftthere_countdowntexts">
											<uni-countdown :show-day="false" :day="1" :hour="1" :minute="12"
												:second="40" color="#FFFFFF" border-color="#00B26A"
												splitorColor="#FFFFFF" :font-size="8"></uni-countdown>
										</view>

									</view>
								</view>
							</view>

						</view>
					</view>
				</view>
			</view>
</template>
<script>
	export default {
		data() {
			return {
				isFixedTop: false, //吸顶是否显示
				Topdistance: 3000, //吸顶初始距离
				keyword: '',
				current: 0,
				opacity: false,
			};
		},

		onPageScroll(e) {
			if (e.scrollTop <= 44) { //搜索导航栏
				this.opacity = false
			} else {
				this.opacity = true
			}
			if (e.scrollTop >= this.Topdistance) { //类别导航栏
				this.isFixedTop = true
			} else {
				this.isFixedTop = false
			}
		},
		computed: {
			HeighT() { //手机类型的尺寸
				return this.$store.getters.is_BarHeight
			},
		},
		onLoad() {
			setTimeout(() => {
				this.GetTop()
			}, 1000)
		},
		onShow() {},
		methods: {
			GetTop() {
				//获取元素距离顶部的距离
				this.$u.getRect('.fourcontent').then(res => {
					this.Topdistance = res.top - this.HeighT.heightBar
				})
			},
			viewHistory() {
				//移动高度=滚动高度 + 距离上面的位置 - 导航条 - 状态栏高度
				uni.pageScrollTo({
					scrollTop: this.Topdistance + 1,
					duration: 300
				});
			},
		}

	};
</script>

<style scoped lang="scss">
	.fivecontent {
		padding: 0 28rpx;

		.fivecontent_item {
			margin-top: 32rpx;
			padding: 24rpx 32rpx;
			width: 100%;
			background: #FFFFFF;
			border-radius: 18rpx 18rpx 18rpx 18rpx;

			.fivecontent_item_nav {
				image {
					width: 60rpx;
					height: 60rpx;
					border-radius: 8rpx;
				}

				.fivecontent_item_nav_left {
					flex: auto;
					margin-left: 12rpx;

					.fivecontent_item_nav_lefttop {
						font-family: Source Han Sans CN, Source Han Sans CN;
						font-weight: 400;
						font-size: 24rpx;
						color: #666666;
					}

					.fivecontent_item_nav_leftlang {
						margin-top: 8rpx;
						width: max-content;
						padding: 4rpx 10rpx;
						background: #FFF9E1;
						border-radius: 4rpx 4rpx 4rpx 4rpx;

						text {
							margin-left: 6rpx;

							font-family: Source Han Sans CN, Source Han Sans CN;
							font-weight: 400;
							font-size: 16rpx;
							color: #F9A511;
						}

						image {
							width: 10.82rpx;
							height: 14.06rpx;
						}
					}
				}
			}

			.fivecontent_item_box {
				margin-top: 20rpx;
				border-top: 2rpx solid #E5E5E5;
				padding-top: 14rpx;

				.fivecontent_item_boxitem {
					image {
						width: 192rpx;
						height: 192rpx;
						border-radius: 12rpx;
					}

					.fivecontent_item_boxitemleft {
						margin-left: 24rpx;
						flex: auto;

						.fivecontent_item_boxitemleftone {
							width: 100%;

							text {
								font-family: Source Han Sans CN, Source Han Sans CN;
								font-weight: 400;
								font-size: 24rpx;
								color: #999999;
							}

							view {
								font-family: Source Han Sans CN, Source Han Sans CN;
								font-weight: 500;
								font-size: 28rpx;
								color: #333333;
							}
						}

						.fivecontent_item_boxitemlefttow {
							margin-top: 8rpx;
							width: max-content;
							padding: 4rpx 10rpx;
							background: #FFF9E1;
							border-radius: 4rpx 4rpx 4rpx 4rpx;

							text {
								margin-left: 6rpx;

								font-family: Source Han Sans CN, Source Han Sans CN;
								font-weight: 400;
								font-size: 16rpx;
								color: #F9A511;
							}

							image {
								width: 10.82rpx;
								height: 14.06rpx;
							}
						}

						.indexboxitemleftthere {
							position: relative;
							margin-top: 30rpx;
							padding-left: 16rpx;
							width: 100%;
							height: 88rpx;
							background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/qinggou.png) no-repeat;
							background-size: 100% 100%;

							.indexboxitemleftthereabsolute {
								position: absolute;
								top: 14rpx;
								right: 12rpx;
								font-family: Source Han Sans CN, Source Han Sans CN;
								font-weight: bold;
								font-size: 24rpx;
								color: #FFFFFF;
							}

							.indexboxitemlefttheretext {
								.indexboxitemlefttheretextone {
									text {
										font-family: SourceHanSansCN-Bold, SourceHanSansCN-Bold;
										font-weight: normal;
										color: #FF5053;
									}

									text:nth-child(2) {
										font-weight: bold;
										font-size: 34rpx;
									}

									text:nth-child(1) {
										font-size: 24rpx;
									}
								}

								.indexboxitemlefttheretexttow {
									margin-left: 12rpx;
									font-size: 20rpx;
									font-family: SourceHanSansCN-Regular, SourceHanSansCN-Regular;
									font-weight: normal;
									color: #999999;
									text-decoration: line-through;
								}
							}

							.indexboxitemleftthere_countdown {
								width: 100%;

								.indexboxitemleftthere_countdowntext {
									font-family: Source Han Sans CN, Source Han Sans CN;
									font-weight: 400;
									font-size: 24rpx;
									color: #999999;
								}

								.indexboxitemleftthere_countdowntexts {
									font-family: Roboto, Roboto;
									font-weight: 400;
									color: #333333;
									margin-left: 16rpx;
									font-size: 22rpx;
								}
							}
						}
					}
				}
			}
		}

	}
</style>