miaosha.vue 4.4 KB
<template>
	<view class="content">
		<view class='homehead miaoshahead'>
			<view class="miaoshaimg">
				<image src="../../static/miaoshatop.png" mode=""></image>
			</view>

		</view>
		<view class="miaoshatime flexthree">
			<view class='miaoname'>距离开始</view>
			<view class='miaotime miaohour boxsizing'>8</view>
			<view class="miaoname">天</view>
			<view class="miaofen flexone miaohour">
				<view class='miaotime miaok'>2</view>
				<view class='miaotime'>3</view>
			</view>
			<view class="miaoname">:</view>
			<view class="miaofen flexone miaohour">
				<view class='miaotime boxsizing miaok'>4</view>
				<view class='miaotime boxsizing'>5</view>
			</view>
			<view class="miaoname">:</view>
			<view class="miaofen flexone miaohour">
				<view class='miaotime boxsizing miaok'>1</view>
				<view class='miaotime boxsizing'>2</view>
			</view>
		</view>

		<!-- 搜索商品 -->
		<view class="searchgood commnonpadding">
			<view class="searchgooditem flexone boxsizing" v-for="(item,index) in orderlist" :key="index"  @click="goodtail" :data-id="item.id">
				<view class="gooditemleft">
					<image :src="item.image" mode=""></image>
				</view>
				<view class="gooditemright ">
					<view class="goodsouname morehidden">{{item.name}}</view>

					<view class="miaogood flextwo">
						<view class="miaogoodleft">
							<view class="saleprice">¥{{item.seckill_price}}</view>
							<view class="yuansaleprice">¥{{item.goods_price}}</view>
						</view>
						<view class="buynow">立即抢购</view>
					</view>

					<view class="miaojindu flextwo">
						<view class="miaojinduleft">
							<view class="miaojinnei"  :style="{width:item.percentage+'%'}"></view>
						</view>
						<view class="miaojinduright">已抢{{item.percentage}}%</view>
					</view>
				</view>
			</view>

			<!-- <view class="searchgooditem flexone boxsizing">
				<view class="gooditemleft">
					<image src="../../static/goopic.png" mode=""></image>
				</view>
				<view class="gooditemright ">
					<view class="goodsouname morehidden">商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称</view>

					<view class="miaogood flextwo">
						<view class="miaogoodleft">
							<view class="saleprice">¥288</view>
							<view class="yuansaleprice">¥340</view>
						</view>
						<view class="buynow">立即抢购</view>

					</view>

					<view class="miaojindu flextwo">
						<view class="miaojinduleft">
							<view class="miaojinnei"></view>
						</view>
						<view class="miaojinduright">已抢60%</view>
					</view>



				</view>
			</view>

			<view class="searchgooditem flexone boxsizing">
				<view class="gooditemleft">
					<image src="../../static/goopic.png" mode=""></image>
				</view>
				<view class="gooditemright ">
					<view class="goodsouname morehidden">商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称</view>

					<view class="miaogood flextwo">
						<view class="miaogoodleft">
							<view class="saleprice">¥288</view>
							<view class="yuansaleprice">¥340</view>
						</view>
						<view class="buynow">立即抢购</view>

					</view>

					<view class="miaojindu flextwo">
						<view class="miaojinduleft">
							<view class="miaojinnei"></view>
						</view>
						<view class="miaojinduright">已抢60%</view>
					</view>



				</view>
			</view>

 -->

		</view>


	</view>
</template>

<script>
	import app from "../../App.vue";
	export default {
		data() {
			return {
				showbanben: false,
				page:1,
				orderlist:[]
			}
		},
		onLoad() {
			this.getmiaosha()
		},
		methods: {
			getmiaosha() {
				let that = this;
				var url = 'flour_goods/get_flour_goods';
				console.log('获取的参数', that.seldata)
				var params = {
					is_seckill: 1,
					page: that.page,
					pageNum: 10
				}
				console.log(params)
				app.post(url, params, "post").then((res) => {
					console.log(res);
					that.orderlist=that.orderlist.concat(res.data.data)
					// that.goodinfo=res.data.data;


				}).catch((err) => {})
			},
			
			// 商品详情
			goodtail(e) {
				let id = e.currentTarget.dataset.id;
				console.log(id)
				// type 1 面访商品
				uni.navigateTo({
					url: '/pages/nearshop/goodtail?id=' + id + '&type=' + 1
				})
			},

		},
		onReachBottom() {
			let newpage=this.page;
			newpage++;
			this.page=newpage;
			this.getmiaosha()
		}

	}
</script>

<style>
	@import url('../../base/homepage');
</style>