<template>
	<view>
		<home v-if="iosAudig == 0" ref="homeview"></home>
		<oldHome v-if="iosAudig == 1"></oldHome>
	</view>
</template>

<script>
import home from './part/home.vue';
import oldHome from './part/oldHome.vue';
export default {
	components: {
		home,
		oldHome
	},
	data() {
		return {
			iosAudig: -1
		};
	},
	onShow() {
		// #ifdef APP-PLUS
		this.getData();
		// #endif
		// #ifndef APP-PLUS
		this.iosAudig = 0;
		if(this.$refs.homeview){
			this.$refs.homeview.getData();
			this.$refs.homeview.getCartNum();
		}
		
		// #endif
		
		/* 特殊账号拦截 */
		let loginType = uni.getStorageSync('loginType');
		if(loginType == 1){
			uni.reLaunch({
				url: '/pages/special/goods/index'
			});
		}
	},
	methods: {
		getData() {
			let self = this;
			let url = this.config.yxyapi;
			// #ifdef APP-PLUS
			plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
				uni.request({
					url: url +'/yiti.php',
					data: {
						type: 1,
						version: widgetInfo.version,
						platform: uni.getSystemInfoSync().platform
					},
					success: result => {
						var data = result.data;
						self.iosAudig = data.iosAudig;
					},
					error: error => {
						console.log('----------------error');
						console.log(error);
					}
				});
			});
			// #endif
		}
	}
};
</script>

<style lang="scss">
.product-list {
	padding: 0 26rpx 0 23rpx;
}

.diy-banner-box {
	// margin-bottom: 30rpx;
}

.diy-banner-box {
	padding-top: 25rpx;
}

.diy-banner-box .swiper {
	width: 750rpx;
	height: 310rpx;
}

.diy-banner-box image {
	width: 702rpx;
	height: 310rpx;
	margin: 0 auto;
	border-radius: 25rpx;
}

.diy-banner-box .swiper-dots {
	position: absolute;
	bottom: 15rpx;
	left: 0;
	right: 0;
	margin: auto;
}

.swiper-dots .swiper-dot {
	width: 28rpx;
	height: 6rpx;
	border-radius: 3rpx;
	background: #ffffff;
	opacity: 0.75;
	margin-right: 4rpx;
}

.swiper-dots .swiper-dot.active {
	background: #f94856;
	opacity: 1;
}

.top_head {
	z-index: 1;
	padding: 0 26rpx;
	width: 750rpx;
	position: sticky;
	top: 0;
	left: 0;
	z-index: 100;
	box-sizing: border-box;
}

.head_top {
	width: 100%;
	height: var(--status-bar-height);
}

.t-i-j {
	width: 180rpx;
	text-align: justify;
	height: 36rpx;
	overflow: hidden;
	line-height: 1;
}

.jus-null {
	display: inline-block;
	width: 100%;
}

.nav-list {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	padding: 0 24rpx;
}

.nav-item {
	width: 344rpx;
	// height: 222rpx;
	background: #ffffff;
	border-radius: 15rpx;
	margin-bottom: 20rpx;

	.nav-item-name {
		font-size: 30rpx;
		color: #333;
		font-weight: bold;
		padding: 0 20rpx;
		height: 68rpx;
		line-height: 68rpx;
		background: linear-gradient(-120deg, rgba(252, 231, 228, 0.85) 0%, rgba(255, 235, 224, 0.45) 38%, rgba(253, 247, 235, 0.45) 99%);
	}

	.nav-item-product {
		padding: 10rpx 20rpx;
	}

	.nav-i-p-item {
		width: 140rpx;
		height: 140rpx;
		margin-right: 20rpx;

		image {
			width: 140rpx;
			height: 140rpx;
		}
	}
}

.packAdswiper-box {
	width: 344rpx;
	// width: 702rpx;
	height: 449rpx;
	position: relative;
	margin-bottom: 20rpx;
}

.packAdswiper-box .swiper-dots {
	position: absolute;
	bottom: 15rpx;
	left: 0;
	right: 0;
	margin: auto;
}

.packAdswiper-box .swiper-dots .swiper-dot {
	width: 16rpx;
	height: 16rpx;
	border-radius: 50%;
	background: #ffffff;
	opacity: 0.75;
	margin-right: 4rpx;
}

.packAdswiper-box .swiper-dots .swiper-dot.active {
	background: #f94856;
	opacity: 1;
}

.packAdswiper {
	width: 344rpx;
	// width: 702rpx;
	height: 449rpx;
	// border-radius: 25rpx;
	margin: 0 auto;
	border-radius: 15rpx;
	overflow: hidden;
}

.packAdswiper image {
	width: 344rpx;
	height: 449rpx;
	margin: 0 auto;
	border-radius: 15rpx;
}

.product-item {
	width: 340rpx;
	background-color: #ffffff;
	border-radius: 15rpx;
	margin-bottom: 20rpx;
	overflow: hidden;
}

.product-item .product-img {
	width: 100%;
	display: block;
}

.product-info {
	padding: 20rpx;
}
</style>
