Browse Source

改名字

hwq 4 years ago
parent
commit
af55e38056
5 changed files with 363 additions and 152 deletions
  1. 8 2
      pages.json
  2. 23 16
      pages/index/index.vue
  3. 16 16
      pages/myteam/myteam.vue
  4. 118 118
      pages/prefecture/consumer.vue
  5. 198 0
      pages/prefecture/integral.vue

+ 8 - 2
pages.json

@@ -438,9 +438,15 @@
 			}
 			}
 		},
 		},
 		{
 		{
-			"path": "pages/integral/index",
+			"path": "pages/prefecture/integral",
 			"style": {
 			"style": {
-				"navigationBarTitleText": "积分商城"
+				"navigationBarTitleText": "积分兑换"
+			}
+		},
+		{
+			"path": "pages/prefecture/consumer",
+			"style": {
+				"navigationBarTitleText": "消费券兑换"
 			}
 			}
 		},
 		},
 		{
 		{

+ 23 - 16
pages/index/index.vue

@@ -37,46 +37,53 @@
 					<text>商家联盟</text>
 					<text>商家联盟</text>
 				</view>
 				</view>
 			</navigator>
 			</navigator>
-			<navigator url="/pages/product/giftBag">
+			<!-- <navigator url="/pages/product/giftBag">
 				<view class="cate-item">
 				<view class="cate-item">
 					<image src="/static/icon/c3.png"></image>
 					<image src="/static/icon/c3.png"></image>
 					<text>联盟礼包</text>
 					<text>联盟礼包</text>
 				</view>
 				</view>
-			</navigator>
-			<navigator url="/pages/integral/index">
+			</navigator> -->
+			<navigator url="/pages/prefecture/integral">
 				<view class="cate-item">
 				<view class="cate-item">
 					<image src="/static/icon/c6.png"></image>
 					<image src="/static/icon/c6.png"></image>
 					<text>积分商城</text>
 					<text>积分商城</text>
 				</view>
 				</view>
 			</navigator>
 			</navigator>
-			<navigator url="/pages/sign/index">
+			<!-- <navigator url="/pages/sign/index">
 				<view class="cate-item">
 				<view class="cate-item">
 					<image src="/static/icon/c8.png"></image>
 					<image src="/static/icon/c8.png"></image>
 					<text>每日签到</text>
 					<text>每日签到</text>
 				</view>
 				</view>
+			</navigator> -->
+			<navigator url="/pages/prefecture/consumer">
+				<view class="cate-item">
+					<image src="/static/icon/c8.png"></image>
+					<text>消费券商城</text>
+				</view>
+			</navigator>
+			<navigator url="/pages/received/index?state=0">
+				<view class="cate-item">
+					<!--v-if="userInfo.level>0"-->
+					<image src="/static/icon/c9.png"></image>
+					<text>收付款</text>
+				</view>
 			</navigator>
 			</navigator>
 		</view>
 		</view>
 		<view class="cate-section">
 		<view class="cate-section">
-			<navigator url="/pages/groupBooking/index">
+			<!-- <navigator url="/pages/groupBooking/index">
 				<view class="cate-item">
 				<view class="cate-item">
 					<image src="/static/icon/c5.png"></image>
 					<image src="/static/icon/c5.png"></image>
 					<text>超值拼团</text>
 					<text>超值拼团</text>
 				</view>
 				</view>
-			</navigator>
-			<navigator url="/pages/seckill/seckill">
+			</navigator> -->
+			<!-- <navigator url="/pages/seckill/seckill">
 				<view class="cate-item">
 				<view class="cate-item">
-					<!--v-if="userInfo.level>0"-->
+					v-if="userInfo.level>0"
 					<image src="/static/icon/c7.png"></image>
 					<image src="/static/icon/c7.png"></image>
 					<text>限时秒杀</text>
 					<text>限时秒杀</text>
 				</view>
 				</view>
-			</navigator>
-			<navigator url="/pages/received/index?state=0">
-				<view class="cate-item">
-					<!--v-if="userInfo.level>0"-->
-					<image src="/static/icon/c9.png"></image>
-					<text>收付款</text>
-				</view>
-			</navigator>
+			</navigator> -->
+			
 			<!-- <view class="cate-item"><text class="none-font-color">每日签到</text></view> -->
 			<!-- <view class="cate-item"><text class="none-font-color">每日签到</text></view> -->
 			<view class="cate-item"><text class="none-font-color">每日签到</text></view>
 			<view class="cate-item"><text class="none-font-color">每日签到</text></view>
 		</view>
 		</view>

+ 16 - 16
pages/myteam/myteam.vue

@@ -18,7 +18,7 @@
 				<text>{{ item.text }}</text>
 				<text>{{ item.text }}</text>
 			</view>
 			</view>
 		</view>
 		</view>
-		<swiper :current="tabCurrentIndex" :style="{ height: maxheight + 'rpx' }" class="swiper-box" duration="300" @change="changeTab">
+		<swiper :current="tabCurrentIndex" :style="{ height: maxheight + 'px' }" class="swiper-box" duration="300" @change="changeTab">
 			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
 			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
 				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
 				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
 					<!-- 空白页 -->
 					<!-- 空白页 -->
@@ -51,21 +51,21 @@ export default {
 		empty,
 		empty,
 		uniLoadMore
 		uniLoadMore
 	},
 	},
-	onReady() {
-		// 初始化获取页面宽度
-		uni.createSelectorQuery()
-			.select('.content')
-			.fields(
-				{
-					size: true
-				},
-				data => {
-					// 保存头部高度
-					// this.maxheight = data.height - Math.floor((data.width / 750) * 570);
-					this.maxheight = 940;
-				}
-			)
-			.exec();
+	onReady(res) {
+		var _this = this;
+		uni.getSystemInfo({
+			success: resu => {
+				console.log(resu,'11111');
+				const query = uni.createSelectorQuery();
+				query.select('.swiper-box').boundingClientRect();
+				query.exec(function(res) {
+					console.log(res, 'ddddddddddddd');
+					_this.maxheight = resu.windowHeight - res[0].top;
+					console.log('打印页面的剩余高度', _this.maxheight);
+				});
+			},
+			fail: res => {}
+		});
 	},
 	},
 	data() {
 	data() {
 		return {
 		return {

+ 118 - 118
pages/integral/index.vue → pages/prefecture/consumer.vue

@@ -1,30 +1,30 @@
 <template>
 <template>
 	<view class="container">
 	<view class="container">
-		<view class="jg"></view>
-		<view class="good-wrapper flex" v-for="(good ,index) in list" :key="good.id">
-			<image :src="good.image" mode="" class="good-img"></image>
-			<view class="good-info flex">
-				<view class="tit clamp2">
-					{{good.store_name  }}
-				</view>
-				<view class="price-wrap">
-					<view class="old-price">
-						<text class="old">¥{{good.ot_price}}</text>
-						<image src="../../static/icon/down.png" mode=""></image>
-						<text class="zj">直降{{good.ot_price - good.use_max_integral}}元</text>
-					</view>
-					<view class="integral-wrap">
-						<image src="../../static/icon/jf.png" mode=""></image>
-						<text class="price">{{good.use_max_integral}}</text>
-					</view>
-				</view>
-				<view class="btn">
-					立即购买
-				</view>
-			</view>
-		</view>
 		<view class="jg"></view>
 		<view class="jg"></view>
-	</view>
+		<view class="good-wrapper flex" v-for="(good ,index) in list" :key="good.id">
+			<image :src="good.image" mode="" class="good-img"></image>
+			<view class="good-info flex">
+				<view class="tit clamp2">
+					{{good.store_name  }}
+				</view>
+				<view class="price-wrap">
+					<view class="old-price">
+						<text class="old">¥{{good.ot_price}}</text>
+						<image src="../../static/icon/down.png" mode=""></image>
+						<text class="zj">直降{{good.ot_price - good.use_max_integral}}元</text>
+					</view>
+					<view class="integral-wrap">
+						<image src="../../static/icon/jf.png" mode=""></image>
+						<text class="price">{{good.use_max_integral}}</text>
+					</view>
+				</view>
+				<view class="btn">
+					立即购买
+				</view>
+			</view>
+		</view>
+		<view class="jg"></view>
+	</view>
 	
 	
 </template>
 </template>
 
 
@@ -95,99 +95,99 @@ export default {
 page {
 page {
 	background: $page-color-base;
 	background: $page-color-base;
 }
 }
-.jg {
-	height: 20rpx;
-}
-.good-wrapper {
-	width: 690rpx;
-	height: 276rpx;
-	justify-content: flex-start;
-	align-items: flex-start;
-	margin: 0 auto 20rpx;
-	// &:last-of-type {
-	// 	margin-bottom: 0;
-	// }
-	background: #FFFFFF;
-	box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
-	border-radius: 10rpx;
-	padding: 20rpx 25rpx 20rpx 15rpx;
-	.good-img {
-		flex-shrink: 0;
-		background-color: #eee;
-		width: 236rpx;
-		height: 236rpx;
-		border-radius: 10rpx;
-		margin-right: 20rpx;
-	}
-	.good-info {
-		flex-direction: column;
-		align-items: flex-start;
-		width: 100%;
-		height: 100%;
-		position: relative;
-		.tit {
-			padding-top: 10rpx;
-			padding-right: 15rpx;
-			font-size: 32rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-		}
-		.btn {
-			width: 137rpx;
-			line-height: 52rpx;
-			background: linear-gradient(0deg, #52C696 0%, #52C696 100%);
-			border-radius: 26rpx;
-			font-size: 26rpx;
-			font-family: PingFang SC;
-			font-weight: 500;
-			text-align: center;
-			color: #FFFFFF;
-			position: absolute;
-			bottom: 0;
-			right: 0;
-		}
-		.price-wrap {
-			.old-price {
-				
-				.old {
-					font-size: 26rpx;
-					font-family: PingFang SC;
-					font-weight: 500;
-					text-decoration: line-through;
-					color: #999999;
-				}
-				image {
-					display: inline-block;
-					width: 14rpx;
-					height: 20rpx;
-					margin: 0 6rpx 0 10rpx;
-				}
-				.zj {
-					font-size: 24rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #B59467;
-				}
-			}
-			.integral-wrap {
-				display: flex;
-				justify-content: flex-start;
-				padding-top: 14rpx;
-				image {
-					width: 40rpx;
-					height: 40rpx;
-					margin-right: 8rpx;
-				}
-				.price {
-					font-size: 36rpx;
-					font-family: PingFang SC;
-					font-weight: bold;
-					color: #FF6F0F;
-					line-height: 40rpx;
-				}
-			}
-		}
-		
-	}
+.jg {
+	height: 20rpx;
+}
+.good-wrapper {
+	width: 690rpx;
+	height: 276rpx;
+	justify-content: flex-start;
+	align-items: flex-start;
+	margin: 0 auto 20rpx;
+	// &:last-of-type {
+	// 	margin-bottom: 0;
+	// }
+	background: #FFFFFF;
+	box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
+	border-radius: 10rpx;
+	padding: 20rpx 25rpx 20rpx 15rpx;
+	.good-img {
+		flex-shrink: 0;
+		background-color: #eee;
+		width: 236rpx;
+		height: 236rpx;
+		border-radius: 10rpx;
+		margin-right: 20rpx;
+	}
+	.good-info {
+		flex-direction: column;
+		align-items: flex-start;
+		width: 100%;
+		height: 100%;
+		position: relative;
+		.tit {
+			padding-top: 10rpx;
+			padding-right: 15rpx;
+			font-size: 32rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+		}
+		.btn {
+			width: 137rpx;
+			line-height: 52rpx;
+			background: linear-gradient(0deg, #52C696 0%, #52C696 100%);
+			border-radius: 26rpx;
+			font-size: 26rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			text-align: center;
+			color: #FFFFFF;
+			position: absolute;
+			bottom: 0;
+			right: 0;
+		}
+		.price-wrap {
+			.old-price {
+				
+				.old {
+					font-size: 26rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					text-decoration: line-through;
+					color: #999999;
+				}
+				image {
+					display: inline-block;
+					width: 14rpx;
+					height: 20rpx;
+					margin: 0 6rpx 0 10rpx;
+				}
+				.zj {
+					font-size: 24rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #B59467;
+				}
+			}
+			.integral-wrap {
+				display: flex;
+				justify-content: flex-start;
+				padding-top: 14rpx;
+				image {
+					width: 40rpx;
+					height: 40rpx;
+					margin-right: 8rpx;
+				}
+				.price {
+					font-size: 36rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #FF6F0F;
+					line-height: 40rpx;
+				}
+			}
+		}
+		
+	}
 }
 }
 </style>
 </style>

+ 198 - 0
pages/prefecture/integral.vue

@@ -0,0 +1,198 @@
+<template>
+	<view class="container">
+		<view class="jg"></view>
+		<view class="good-wrapper flex" v-for="(good ,index) in list" :key="good.id">
+			<image :src="good.image" mode="" class="good-img"></image>
+			<view class="good-info flex">
+				<view class="tit clamp2">
+					{{good.store_name  }}
+				</view>
+				<view class="price-wrap">
+					<view class="old-price">
+						<text class="old">¥{{good.ot_price}}</text>
+						<image src="../../static/icon/down.png" mode=""></image>
+						<text class="zj">直降{{good.ot_price - good.use_max_integral}}元</text>
+					</view>
+					<view class="integral-wrap">
+						<image src="../../static/icon/jf.png" mode=""></image>
+						<text class="price">{{good.use_max_integral}}</text>
+					</view>
+				</view>
+				<view class="btn" @click="nav(good.id)">
+					立即购买
+				</view>
+			</view>
+		</view>
+		<view class="jg"></view>
+	</view>
+	
+</template>
+
+<script>
+import { groomList } from '@/api/product.js';
+export default {
+	filters: {
+		toFixed: function(value) {
+			// 判断是否为整数
+			if (value % 1 == 0) {
+				return value;
+			} else {
+				return value.toFixed(2);
+			}
+		}
+	},
+	data() {
+		return {
+			list: [],
+			bannerImg: []
+		};
+	},
+	onLoad(option) {
+		// 加载基础数据
+		this.loadData();
+	},
+	methods: {
+		//详情页
+		navToDetailPage(item) {
+			uni.navigateTo({
+				url: '/pages/product/product?id=' + item.id
+			});
+		},
+		// 轮播图跳转
+		bannerNavToUrl(item) {
+			// #ifdef H5
+			if (item.wap_link.indexOf('http') > 0) {
+				window.location.href = item.wap_link;
+			}
+			// #endif
+			//测试数据没有写id,用title代替
+			uni.navigateTo({
+				url: item.wap_link
+			});
+		},
+		// 请求载入数据
+		async loadData() {
+			groomList({}, 5)
+				.then(({ data }) => {
+					// 保存轮播图
+					this.bannerImg = data.banner;
+					// 保存商品信息
+					this.list = data.list.map(e => {
+						e.price = Number(e.price);
+						e.ot_price = Number(e.ot_price);
+						return e;
+					});
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
+		nav(id) {
+			uni.navigateTo({
+				url:'/pages/product/product?id=' + id
+			})
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+page {
+	background: $page-color-base;
+}
+.jg {
+	height: 20rpx;
+}
+.good-wrapper {
+	width: 690rpx;
+	height: 276rpx;
+	justify-content: flex-start;
+	align-items: flex-start;
+	margin: 0 auto 20rpx;
+	// &:last-of-type {
+	// 	margin-bottom: 0;
+	// }
+	background: #FFFFFF;
+	box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
+	border-radius: 10rpx;
+	padding: 20rpx 25rpx 20rpx 15rpx;
+	.good-img {
+		flex-shrink: 0;
+		background-color: #eee;
+		width: 236rpx;
+		height: 236rpx;
+		border-radius: 10rpx;
+		margin-right: 20rpx;
+	}
+	.good-info {
+		flex-direction: column;
+		align-items: flex-start;
+		width: 100%;
+		height: 100%;
+		position: relative;
+		.tit {
+			padding-top: 10rpx;
+			padding-right: 15rpx;
+			font-size: 32rpx;
+			font-family: PingFang SC;
+			font-weight: bold;
+		}
+		.btn {
+			width: 137rpx;
+			line-height: 52rpx;
+			background: linear-gradient(0deg, #52C696 0%, #52C696 100%);
+			border-radius: 26rpx;
+			font-size: 26rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			text-align: center;
+			color: #FFFFFF;
+			position: absolute;
+			bottom: 0;
+			right: 0;
+		}
+		.price-wrap {
+			.old-price {
+				
+				.old {
+					font-size: 26rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					text-decoration: line-through;
+					color: #999999;
+				}
+				image {
+					display: inline-block;
+					width: 14rpx;
+					height: 20rpx;
+					margin: 0 6rpx 0 10rpx;
+				}
+				.zj {
+					font-size: 24rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #B59467;
+				}
+			}
+			.integral-wrap {
+				display: flex;
+				justify-content: flex-start;
+				padding-top: 14rpx;
+				image {
+					width: 40rpx;
+					height: 40rpx;
+					margin-right: 8rpx;
+				}
+				.price {
+					font-size: 36rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #FF6F0F;
+					line-height: 40rpx;
+				}
+			}
+		}
+		
+	}
+}
+</style>