ソースを参照

Merge branch 'master' of http://git.liuniu946.com/lhl/tlfb

hwq 4 年 前
コミット
e5ed5ba1dc
6 ファイル変更250 行追加68 行削除
  1. 55 0
      api/whole.js
  2. 153 63
      pages/index/child/wholesale.vue
  3. 42 5
      pages/product/wholesale.vue
  4. BIN
      static/img/aft.png
  5. BIN
      static/img/eve.png
  6. BIN
      static/img/mom.png

+ 55 - 0
api/whole.js

@@ -0,0 +1,55 @@
+import request from '@/utils/request'
+
+// 获取批发时间段
+export function getWholeTimeArea(data) {
+	return request({
+		url: '/api/whole/index',
+		method: 'get',
+		data
+	});
+}
+
+// 获取批发商品列表
+export function getWholeList(data,time) {
+	return request({
+		url: '/api/whole/list/' + time,
+		method: 'get',
+		data
+	});
+}
+
+// 获取批发商品详情
+export function getWholeDetai(data,) {
+	return request({
+		url: '/api/whole/detail/:id/[:time]/[:status]' + time,
+		method: 'get',
+		data
+	});
+}
+
+// 预约包
+export function reservePackage(data) {
+	return request({
+		url: '/api/package/reserve',
+		method: 'post',
+		data
+	});
+}
+
+// 我的包
+export function getMyPackage() {
+	return request({
+		url: '/api/package/mylist',
+		method: 'post',
+		data
+	});
+}
+
+// 上传评证
+export function upEvaluation() {
+	return request({
+		url: '/api/package/evaluation',
+		method: 'post',
+		data
+	});
+}

+ 153 - 63
pages/index/child/wholesale.vue

@@ -1,73 +1,163 @@
-<template>
-	<view class="wholesale">
-		<view class="title">
-			<view class="img">
-				<image src="../../../static/img/list1.png" mode=""></image>
-			</view>
-			<view class="title-t"> 批发专区 </view>
-			<view class="about"> 限时抢购 </view>
-		</view>
-		<view class="date" @click="navto('/pages/product/wholesale')">
-			<image src="@/static/error/errorImage.jpg"></image>
-			<image src="@/static/error/errorImage.jpg"></image>
-			<image src="@/static/error/errorImage.jpg"></image>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
+<template>
+	<view class="wholesale">
+		<view class="title">
+			<view class="img">
+				<image src="../../../static/img/list1.png" mode=""></image>
+			</view>
+			<view class="title-t"> 批发专区 </view>
+			<view class="about"> 限时抢购 </view>
+		</view>
+		<view class="date">
+			<view class="date-item" @click="navto('/pages/product/wholesale?bin=' + encodeURI(list[0].time) + '&stp=' + list[0].stop + '&status=' + list[0].status + '&state=' + list[0].state)">
+				<image src="../../../static/img/mom.png"></image>
+				<view class="item-name">
+					上午场
+				</view>
+				<view class="item-time">
+					{{list[0].time}}~{{list[0].stop | time}}
+				</view>
+			</view>
+			<view class="date-item" @click="navto('/pages/product/wholesale?bin=' + encodeURI(list[1].time) + '&stp=' + list[1].stop + '&status=' + list[1].status  + '&state=' + list[1].state)">
+				<image src="../../../static/img/aft.png"></image>
+				<view class="item-name">
+					下午场
+				</view>
+				<view class="item-time">
+					{{list[1].time}}~{{list[1].stop | time}}
+				</view>
+			</view>
+			<view class="date-item" @click="navto('/pages/product/wholesale?bin=' + encodeURI(list[2].time) + '&stp=' + list[2].stop + '&status=' + list[2].status  + '&state=' + list[2].state)">
+				<image src="../../../static/img/eve.png"></image>
+				<view class="item-name">
+					晚上场
+				</view>
+				<view class="item-time">
+					{{list[2].time}}~{{list[2].stop | time}}
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		getWholeTimeArea
+	} from '@/api/whole.js'
+	export default {
 		data() {
 			return {
-				
+				list: []
 			}
 		},
+		filters: {
+			time(val) {
+				let str = ''
+				if (val) {
+					let time = new Date(val * 1000);
+					let h = time.getHours() >= 10 ? time.getHours() : ('0' + time.getHours())
+					let m = time.getMinutes() >= 10 ? time.getMinutes() : ('0' + time.getMinutes())
+					str = h + ':' + m
+				}
+				return str
+			}
+		},
+		mounted() {
+			this.getTimeArea()
+		},
 		methods: {
 			navto(url) {
 				uni.navigateTo({
-					url:url
+					url: url
+				})
+			},
+			getTimeArea() {
+				getWholeTimeArea().then(({
+					data
+				}) => {
+					this.list = data.seckillTime
 				})
 			}
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-$grey: #95A0B1;
-$text: #333333;
-$red: #FF4C4C;
-.wholesale {
-	padding: 20rpx;
-	background-color: #fff;
-	margin : 20rpx 0;
-	.title {
-		display: flex;
-		line-height: 40rpx;
-		.title-t {
-			color: $text;
-			font-weight: bold;
-			margin: 0 20rpx;
-			font-size: 34rpx;
-		}
-		.about {
-			font-size: 24rpx;
-			color: $grey;
-		}
-		image {
-			width: 40rpx;
-			height: 40rpx;
-		}
-	}
-	.date {
-		padding: 30rpx 0;
-		display: flex;
-		justify-content: space-between;
-		image {
-			border-radius: 20rpx;
-			max-width: 32%;
-			width: 220rpx;
-			height: 300rpx;
-		}
-	}
-}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	$grey: #95A0B1;
+	$text: #333333;
+	$red: #FF4C4C;
+
+	.wholesale {
+		padding: 20rpx;
+		background-color: #fff;
+		margin: 20rpx 0;
+
+		.title {
+			display: flex;
+			line-height: 40rpx;
+
+			.title-t {
+				color: $text;
+				font-weight: bold;
+				margin: 0 20rpx;
+				font-size: 34rpx;
+			}
+
+			.about {
+				font-size: 24rpx;
+				color: $grey;
+			}
+
+			image {
+				width: 40rpx;
+				height: 40rpx;
+			}
+		}
+
+		.date {
+			padding: 30rpx 0;
+			display: flex;
+			justify-content: space-between;
+
+			.date-item {
+				width: 220rpx;
+				height: 300rpx;
+				position: relative;
+
+				image {
+					border-radius: 20rpx;
+					// max-width: 32%;
+					width: 220rpx;
+					height: 300rpx;
+				}
+
+				.item-name {
+					font-size: 32rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #FFFFFF;
+					position: absolute;
+					top: 36rpx;
+					padding-left: 30rpx;
+
+				}
+
+				.item-time {
+					font-size: 22rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #FFFFFF;
+					position: absolute;
+					top: 80rpx;
+					padding-left: 30rpx;
+				}
+			}
+
+			// image {
+			// 	border-radius: 20rpx;
+			// 	// max-width: 32%;
+			// 	width: 220rpx;
+			// 	height: 300rpx;
+			// }
+		}
+	}
 </style>

+ 42 - 5
pages/product/wholesale.vue

@@ -2,10 +2,10 @@
 	<view class="content">
 		<image src="" mode="" class="to-bg"></image>
 		<view class="top-tit">
-			距离下场开始
+			{{state}}
 		</view>
 		<view class="top-time">
-			03:40:50
+			{{showTime()}}
 		</view>
 		<view class="center-btn flex" @click="navto('/pages/user/myWholesale')">
 			<image src="" mode="" class="center-logo"></image>
@@ -50,7 +50,11 @@
 				page: 1,
 				limit: 10,
 				loadingType: 'more',
-				loaded: false
+				loaded: false,
+				bin: '',
+				stop: '',
+				status: 0,
+				state: ''
 			}
 		},
 		onReady(res) {
@@ -67,11 +71,32 @@
 				fail: res => {}
 			});
 		},
+		onLoad(opt) {
+			let obj = this
+			obj.bin = decodeURI(opt.bin)
+			obj.stop = opt.stp
+			obj.stauts = opt.status
+			obj.state = opt.state
+			console.log(obj.bin, obj.stop)
+		},
 		methods: {
 			navto(url) {
 				uni.navigateTo({
 					url: url
 				})
+			},
+			showTime() {
+				let obj =this
+				console.log(obj.status,'obj.status++++++++')
+				if(obj.status == 1) {
+					return '距离结束'
+				}
+				if(obj.status == 0) {
+					return ''
+				}
+				if(obj.status == 2) {
+					return obj.bin + '开始'
+				}
 			}
 		}
 	}
@@ -114,12 +139,14 @@
 		padding: 20rpx 32rpx;
 		background-color: #fff;
 		margin-bottom: 20rpx;
+
 		.center-logo {
 			width: 83rpx;
 			height: 106rpx;
 			flex-shrink: 0;
 			background-color: #eee;
 		}
+
 		.center-tit {
 			padding-left: 30rpx;
 			flex-grow: 1;
@@ -128,6 +155,7 @@
 			font-weight: 500;
 			color: #999999;
 			line-height: 1.5;
+
 			.tit-top {
 				font-size: 32rpx;
 				font-family: PingFang SC;
@@ -135,22 +163,26 @@
 				color: #333333;
 			}
 		}
+
 		.look-more {
 			width: 16rpx;
 			height: 30rpx;
 			flex-shrink: 0;
 		}
 	}
+
 	.scroll-wrap {
 		// background-color: red;
-		
+
 	}
+
 	.good-wrap {
 		display: flex;
 		// padding: 0 0 20rpx 20rpx;
 		padding-left: 20rpx;
 		flex-wrap: wrap;
 	}
+
 	.good {
 		width: 345rpx;
 		height: 480rpx;
@@ -159,12 +191,14 @@
 		background: #FFFFFF;
 		box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
 		border-radius: 10rpx;
+
 		.goo-img {
 			width: 345rpx;
 			height: 345rpx;
 			border-radius: 10rpx 10rpx 0 0;
 			background-color: #bfa;
 		}
+
 		.good-tit {
 			padding: 15rpx 20rpx;
 			font-size: 30rpx;
@@ -173,15 +207,18 @@
 			color: #333333;
 			line-height: 35rpx;
 		}
+
 		.good-price {
 			padding-left: 20rpx;
 			justify-content: flex-start;
+
 			.new-price {
 				font-size: 36rpx;
 				font-family: PingFang SC;
 				font-weight: bold;
 				color: #FF4C4C;
 			}
+
 			.old-price {
 				padding-left: 8rpx;
 				font-size: 26rpx;
@@ -189,7 +226,7 @@
 				font-weight: bold;
 				text-decoration: line-through;
 				color: #999999;
-				
+
 			}
 		}
 	}

BIN
static/img/aft.png


BIN
static/img/eve.png


BIN
static/img/mom.png