<!-- 积分 -->

<template>
	<view class="content">
		<uni-nav-bar left-icon="left" color="#000000" backgroundColor="transparent" :fixed="true" :statusBar="true"
			:border="false" @clickLeft="$c.back">
			<view style="font-size: 34rpx; width: 100%; display: flex; justify-content: center; align-items: center;">
				积分赏
			</view>
		</uni-nav-bar>
		<view class="list relative">
			<view class="list-item" v-for="(item, i) in datas" :key="i" @click="items(item)">
				<view class="pic center">
					<image class="pic-img" :src="item.imgurl" lazy-load></image>
					<image :src="$img1('common/new1.png')" class="pic-new" mode="widthFix" v-if="item.new_is == 1">
					</image>
				</view>
				<view class="title hang1">
					{{ item.title }}
				</view>
				<view class="price-box">
					<view class="price">
						<text>{{ item.price }}</text>
						积分
					</view>
					<view class="num-box">
						<view class="num ml10">{{ item.sale_stock }}/{{ item.stock }}</view>
						<view class="box icon">
							<image :src="$img1('index/box.png')" lazy-load></image>
						</view>
					</view>
				</view>
			</view>
		</view>
		 
	</view>
</template>

<script>
import { getGoodsList } from '@/common/server/goods.js';

export default {
	data() {
		return {
			current: 0,
			flga: false,
			datas: [],
			BarHeight: '',
			guize: ''
		}
	},
	onShareAppMessage() {
		let imageUrl = this.$config.getShareImageUrl();
		// 使用小写 id，兼容新版 .NET API
		const userinfo = uni.getStorageSync('userinfo') || {};
		const pid = userinfo.id || userinfo.ID || '';
		return {
			imageUrl: imageUrl,
			title: this.$config.getAppSetting('share_title') || "哈尼盲盒上线,来就送！",
			path: '/pages/shouye/index?pid=' + pid
		}
	},
	methods: {
		items(item) {
			this.$c.to({
				url: '/pages/shouye/detail',
				query: {
					goods_id: item.id,
					type_text: '积分赏'
				}
			})
		},
		getlist(index) {
			this.current = index
			if (index == 1) {
				this.$customRouter.navigateTo('UnlimitedOrder');
			}
		}
	},
	onShow() {
		// this.current = 0
		// const curPages = getCurrentPages()[0]; // 获取当前页面实例
		// if (typeof curPages.getTabBar === 'function' && curPages.getTabBar()) {
		// 	this.$mp.page.getTabBar().setData({
		// 		selected: 1
		// 	});
		// }
	},
	async onLoad() {
		// API: goods
		const res = await getGoodsList({
			type: '5',
			page: 1
		});
		if (res.status == 1 && res.data && res.data.data) {
			this.datas = res.data.data;
		}
		
		uni.getSystemInfo({
			success: (res) => {
				this.BarHeight = res.statusBarHeight;
			}
		});
	}
}
</script>

<style lang="scss">
.navLeft {
	position: fixed;
	left: 30rpx;
	height: 44px;
	z-index: 100;

	>view {
		font-weight: 400;
		font-size: 50rpx;
		color: #FFFFFF;
	}
}

.title1 {
	width: 100%;
	top: 108rpx;
	position: absolute;
	display: flex;
	align-items: center;
	font-size: 34rpx;
	justify-content: center;
	color: black;
	z-index: 50;
}

.activeImg {
	position: absolute;
	width: 32rpx !important;
	height: 16rpx !important;
	bottom: -20rpx;
	left: 0;
	right: 0;
	margin: 0 auto;
}

.pop {
	width: 607rpx;
	// height: 904rpx;
	padding-top: 70rpx;
	box-sizing: border-box;
	position: relative;

	.pop_title {
		font-size: 36rpx;
		font-family: zihun152hao-jijiachaojihei;
		font-weight: 400;
		color: #ffffff;
		text-align: center;
	}

	.pop_con {
		padding: 30rpx 40rpx 50rpx;
		box-sizing: border-box;

		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #ffffff;
		line-height: 42rpx;
	}

	.close {
		position: absolute;
		left: 50%;
		bottom: 0;
		transform: translate(-50%, 100%);
		width: 50rpx;
		height: 50rpx;
	}
}

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

.fixed {
	width: 750rpx;
	padding: 30rpx;
	box-sizing: border-box;
	position: fixed;
	top: 0rpx;
	z-index: 15;
}

.header-left-title {
	width: 104rpx;
	height: 33rpx;
}

.image1 {
	width: 117rpx;
	height: 46rpx;
	background: url('https://baoku.languowangluo.cn/newindex/new.png') no-repeat;
	background-size: 100% 100%;
	position: absolute;
	top: 23rpx;
	left: 18rpx;
}

.gb_title {
	width: 118rpx;
	height: 46rpx;
	position: absolute;
	top: 18rpx;
	right: 18rpx;
	background: url('https://baoku.languowangluo.cn/newindex/infinite_goods_shang_bao.png');
	background-size: 100% 100%;
	background-repeat: no-repeat;
}

.qiehuan_left {
	display: flex;
	font-family: 'YouSheBiaoTiHei';
	/* border-top: 2rpx solid #333333; */
	margin-left: 30rpx;
	/* text-shadow: 0px 0px 12rpx rgba(150, 255, 254, 0.7); */
	/* 	font-family: 'zcq'; */
}

.wzs {
	font-size: 32rpx;
	font-family: zihun152hao-jijiachaojihei;
	font-weight: 400;
	color: #9c9c9c;
}

.xzs {
	font-size: 32rpx;
	font-family: zihun152hao-jijiachaojihei;
	font-weight: 400;
	color: #ffffff;
	text-shadow: 0 0 10rpx #ba39ff;
}

.qiehuan_left>view {
	margin-right: 70rpx;
	position: relative;
}

.dibuzhe {
	background: rgba(0, 0, 0, 0.8);
	// background: #f00;
	display: flex;
	justify-content: space-between;
	/* padding-top:5rpx; */
	position: absolute;
	width: calc(100% - 16rpx - 16rpx);
	left: 16rpx;
	bottom: 16rpx;
	height: 74rpx;
	align-items: center;
	border-radius: 0 0 20rpx 20rpx;
	box-sizing: border-box !important;
}

.left {
	width: 400rpx;
	font-size: 28rpx;
	font-weight: 400;
	color: #ffffff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-left: 22rpx;
	/* font-family: 'zcq';
		text-shadow: 0px 0px 14rpx rgba(237, 87, 255, 0.7); */
}

.gb {
	color: #ffffff;
	/* font-family: 'zcq';
		text-shadow: 0px 0px 14rpx red; */
}

.right {
	font-size: 28rpx;
	font-family: zihun152hao-jijiachaojihei;
	font-weight: 400;
	color: #ffffff;
	text-shadow: 0 0 10rpx #22aeff;
	padding-right: 20rpx;
}

.items {
	width: 714rpx;
	height: 504rpx;
	padding: 16rpx;
	margin: 30rpx auto 0;
	position: relative;

	box-sizing: border-box;
}

::v-deep .u-tab-item {
	color: #222222 !important;
}

.baibei {
	width: 720rpx;
	height: 78rpx;
	/* background: #FFFFFF; */
	display: flex;
	justify-content: space-between;
	align-items: center;
	/* font-family: 'zcq'; */
}

.content {
	width: 100vw;
	min-height: 100vh;
	/* padding-top: 1rpx; */
	padding-bottom: 100px;
	box-sizing: border-box;
	background: #FFFFFF;
}

.item_image {
	width: 100%;
	height: 472rpx;
	// margin: 17rpx auto 0;
	position: relative;
	border-radius: 20rpx;
	overflow: hidden;
}

.item_image image {
	width: 100%;
	height: 100%;
}

.page-hd {
	width: 100%;
	height: 430rpx;
	z-index: 1;
}

.list {
	margin-top: 20rpx;
	padding: 1rpx 30rpx 30rpx;
	display: flex;
	flex-flow: row wrap;
	justify-content: space-between;
	z-index: 10;

	.list-item {
		width: 330rpx;
		height: 487rpx;
		background-color: #F8F8F8;
		border-radius: 16rpx;
		// background: url($imgurl+'common/goodsBg.png') no-repeat 0 0 / 100% 100%;
		margin-top: 30rpx;

		.pic {
			width: 100%;
			height: 332rpx;
			background-color: #E4E4E4;
			position: relative;
			border-radius: 16rpx 16rpx 0rpx 0rpx;

			.pic-img {
				// width: 290rpx;
				// height: 290rpx;
				width: 100%;
				height: 100%;
			}

			.pic-type {
				padding: 0 21rpx 0 32rpx;
				height: 44rpx;
				position: absolute;
				top: 10rpx;
				right: 10rpx;

				>text {
					font-size: 28rpx;
					font-weight: 400;
					color: #111111;
					text-shadow: 2rpx 2rpx #FFFFFF;
				}
			}

			.pic-new {
				width: 80rpx;
				position: absolute;
				z-index: 10;
				top: -10rpx;
				left: 10rpx;
			}
		}

		.title {
			padding: 24rpx 26rpx 0;
			font-size: 20rpx;
			font-weight: 400;
			color: #333333;
		}

		.hang1 {}

		.hot-num {
			padding: 10rpx 20rpx 0;

			font-size: 24rpx;
			font-weight: 400;
			color: #cccccc;
		}

		.price-box {
			padding: 60rpx 20rpx 10rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.price {
				font-weight: 500;
				font-size: 18rpx;
				color: #333333;

				text {
					font-size: 18rpx;
				}
			}

			.num-box {
				display: flex;
				align-items: center;

				.num {
					font-size: 18rpx;
					font-weight: 400;
					color: #6C6C6C;
				}

				.box {
					width: 20rpx;
					height: 17.56rpx;
					margin-left: 6rpx;
				}

				.icon {}
			}
		}
	}
}
</style>