Pārlūkot izejas kodu

修复跳转问题和底部导航栏不同步问题

yfso 2 gadi atpakaļ
vecāks
revīzija
4e31c9702f
5 mainītis faili ar 541 papildinājumiem un 666 dzēšanām
  1. 0 2
      pages.json
  2. 384 0
      pages/index/index.scss
  3. 111 605
      pages/index/index.vue
  4. 43 55
      pages/index/vote-detail/index.vue
  5. 3 4
      pages/map/map.vue

+ 0 - 2
pages.json

xqd
@@ -287,12 +287,10 @@
 		"layout": "@/layout/index.vue"
 	},
 	"tabBar": {
-		"custom": true,
 		"color": "#CBC8C7",
 		"selectedColor": "#FF6200",
 		"backgroundColor": "#fff",
 		"borderStyle": "black",
-		"display": "none",
 		"list": [{
 				"pagePath": "pages/index/index",
 				"iconPath": "static/icon/home02.png",

+ 384 - 0
pages/index/index.scss

xqd
@@ -0,0 +1,384 @@
+	page {
+		height: 100%;
+		background-color: #f9f9f9;
+	}
+
+	.home {
+		height: 100%;
+		background-color: #f9f9f9;
+	}
+
+	//首页广告弹框
+	.popup-banner {
+		position: relative;
+
+		.popup-banner-clean {
+			position: absolute;
+			top: 32rpx;
+			right: 32rpx;
+			width: 48rpx;
+			height: 48rpx;
+			background: #000000;
+			opacity: 0.2;
+			border-radius: 50%;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+		}
+
+	}
+
+
+
+
+	.movableArea {
+		position: fixed;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 100%;
+		z-index: 999;
+		pointer-events: none; //设置area元素不可点击,则事件便会下移至页面下层元素
+
+		.movableView {
+			pointer-events: auto; //可以点击
+			width: 84rpx;
+			height: 84rpx;
+			padding: 0 30rpx;
+
+			.img-IHg {
+				width: 84rpx;
+				height: 84rpx;
+				background-color: #fff;
+				box-shadow: 0px 8rpx 24rpx 0px rgba(220, 222, 229, 0.4);
+				border-radius: 50%;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+			}
+		}
+	}
+
+
+
+	.slot-wrap {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		flex: 1;
+	}
+
+	.home-swiper {
+		width: 100%;
+		height: 592rpx;
+
+		.swiper-box {
+			width: 100%;
+			height: 592rpx;
+			;
+
+			::v-deep .swiper-item {
+				width: 100%;
+				height: 592rpx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+			}
+
+		}
+	}
+
+	.home-nav {
+		position: relative;
+		top: -18rpx;
+		padding-top: 60rpx;
+		border-radius: 24rpx 24rpx 0px 0px;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		background-color: #f9f9f9;
+
+		.home-nav-item {
+			width: 20%;
+			flex: none;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			justify-content: center;
+		}
+	}
+
+	.home-special-area {
+		height: 146rpx;
+		padding: 0 30rpx;
+		// background-color: deeppink;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+
+		.home-special-area-left {
+			display: flex;
+			align-items: center;
+			justify-content: flex-start;
+			color: #333;
+			font-size: 36rpx;
+			font-weight: 800;
+			position: relative;
+
+			.text-shadow {
+				position: absolute;
+				bottom: 0;
+				left: 0;
+				width: 200rpx;
+				height: 16rpx;
+				background: linear-gradient(270deg, rgba(249, 231, 219, 0) 0%, #F9E7DB 100%);
+				border-radius: 200rpx 0px 0px 200rpx;
+			}
+
+			&::before {
+				content: '';
+				display: inline-block;
+				width: 6rpx;
+				height: 34rpx;
+				background: linear-gradient(180deg, #FF6200 0%, #FF4C00 100%);
+				border-radius: 3rpx;
+				margin-right: 8rpx;
+				margin-top: 2rpx;
+			}
+		}
+
+		.home-special-area-right {
+			display: flex;
+			align-items: center;
+			justify-content: flex-end;
+			font-size: 30rpx;
+			color: #999;
+		}
+	}
+
+	.home-special-img {
+		// height: 260rpx;
+		padding: 0 30rpx;
+		// background-color: #fff;
+		display: flex;
+		align-items: flex-start;
+		justify-content: space-between;
+		overflow-x: scroll;
+		overflow-y: hidden;
+
+		.ListItem {
+			width: 312rpx;
+			position: relative;
+			margin-right: 24rpx;
+
+			.kudosicon {
+				width: 40rpx;
+				height: 40rpx;
+				position: absolute;
+				right: 28rpx;
+				top: 16rpx;
+				border-radius: 50%;
+				background: #FFFFFF;
+				opacity: 0.84;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+			}
+		}
+
+		.ListItem:last-child {
+			margin-right: 0;
+		}
+	}
+
+	.home-banner {
+		height: 640rpx;
+		padding: 0 30rpx;
+		padding-top: 64rpx;
+
+		.home-banner-img {
+			position: relative;
+			width: 100%;
+
+			// height: 100%;
+			.baner-video {
+				position: absolute;
+				top: 0;
+				left: 0;
+			}
+
+			.banner-img {
+				position: absolute;
+				top: 0;
+				left: 0;
+				z-index: 9;
+			}
+
+			.img-clean {
+				position: absolute;
+				right: 28rpx;
+				top: 30rpx;
+				z-index: 99;
+			}
+
+			.img-IHg {
+				width: 84rpx;
+				height: 84rpx;
+				background-color: #fff;
+				box-shadow: 0px 8rpx 24rpx 0px rgba(220, 222, 229, 0.4);
+				border-radius: 50%;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				position: fixed;
+				top: 1030rpx;
+				right: 30rpx;
+				z-index: 99;
+
+			}
+		}
+	}
+
+	.home-attach {
+		background-color: #f9f9f9;
+		padding: 40rpx 30rpx 5rpx;
+	}
+
+	.home-hotel {
+		height: 124rpx;
+		background-color: #f9f9f9;
+	}
+
+	.home-hotel-img {
+		background-color: #F9f9f9;
+		padding: 20rpx 30rpx;
+
+		.home-hotel-img-content {
+			display: flex;
+			align-items: flex-start;
+			justify-content: space-between;
+			flex-wrap: wrap;
+
+			.home-hotel-img-content-item {
+				width: 332rpx;
+				background: #FFFFFF;
+				box-shadow: 0px 4rpx 8rpx 0px rgba(0, 0, 0, 0.04);
+				border-radius: 12rpx;
+				margin-bottom: 26rpx;
+				// &:nth-child(2n+1){
+				// 	// position: relative;
+				// 	top: -33px;
+				// }
+				// &:nth-child(1){
+				// 	// position: relative;
+				// 	top: 0;
+				// }
+
+				.home-hotel-img-content-item-img {
+					width: 332rpx;
+					height: 332rpx;
+					object-fit: cover;
+					object-position: center;
+				}
+
+				.home-hotel-img-content-item-img-long {
+					width: 332rpx;
+					height: 400rpx;
+					object-fit: cover;
+					object-position: center;
+				}
+
+				.text {
+					display: flex;
+					flex-direction: column;
+					align-items: flex-start;
+					justify-content: center;
+					padding: 18rpx 22rpx 32rpx;
+
+					.text-top {
+						font-size: 28rpx;
+						font-weight: bold;
+						color: #333;
+					}
+
+					.text-main {
+						display: none;
+						margin-top: 20rpx;
+						font-size: 24rpx;
+						color: #999999;
+					}
+				}
+			}
+		}
+
+
+		.home-hotel-img-more {
+			height: 70rpx;
+			background-color: #fff;
+			border-radius: 10rpx;
+			border: 2rpx solid #ddd;
+			font-size: 28rpx;
+			color: #5A5A5A;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			margin-top: 50rpx;
+		}
+	}
+
+	.home-brand {
+		height: 124rpx;
+		background-color: #f9f9f9;
+	}
+
+	.home-brand-img {
+		padding: 0 30rpx;
+		background-color: #f9f9f9;
+
+		zhe::v-deep .uni-swiper__dots-item {
+			width: 22rpx !important;
+			height: 2rpx !important;
+		}
+
+		::v-deep .uni-swiper__dots-bar {
+			width: 22rpx !important;
+			height: 2rpx !important;
+		}
+
+		::v-deep .uni-swiper__warp {
+			overflow: unset !important;
+		}
+
+		.swiper-box {
+			background-color: #f9f9f9;
+			height: 200rpx;
+
+			::v-deep swiper-item {
+				width: 100%;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+
+				view {
+					width: 164rpx;
+					height: 162rpx;
+					background: #FFFFFF;
+					box-shadow: 0px 4rpx 8rpx 0rpx rgba(220, 222, 229, 0.4);
+					border-radius: 32rpx;
+					display: flex;
+					align-items: center;
+					justify-content: center;
+
+					image {
+						border-radius: 32rpx;
+					}
+				}
+
+			}
+		}
+	}
+
+	.home-bottom {
+		background-color: #f9f9f9;
+		padding-top: 120rpx;
+	}

+ 111 - 605
pages/index/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -7,7 +7,7 @@
 				<swiper class="swiper-box" @change="change1" circular>
 					<swiper-item v-for="(item ,index) in infoList" :key="index">
 						<view class="swiper-item" v-if="item.resource_type == 1"
-							@click="goSwiperSmall(item.jump_type,item.jump_config)">
+							@click="jumpHAppID(item.jump_type,item.jump_config)">
 							<image style="width: 100%;height:592rpx;" :src="item.img" mode="aspectFill"></image>
 						</view>
 						<view class="swiper-item" v-if="item.resource_type == 2">
@@ -23,7 +23,7 @@
 		<!-- 金刚图 -->
 		<view class="home-nav">
 			<view class="home-nav-item" v-for="(item,index) in navList" :key="index"
-				@click="goOther(index,item.jump_type,item.jump_config)">
+				@click="jumpHAppID(item.jump_type,item.jump_config)">
 				<image style="width: 101.96rpx;height: 103.96rpx;" :src="item.img" mode=""></image>
 				<text style="color: #333;font-size: 24rpx;margin-top: 18rpx; ">{{item.title}}</text>
 			</view>
@@ -56,13 +56,13 @@
 					</image>
 				</view>
 				<text style="color: #333;font-weight: bold;font-size: 28rpx;">{{item.title}}</text>
-			</view>
+			</view> 
 		</view>
 
 		<!-- 广告图 -->
 		<view class="home-banner" v-if="!isShowAdver">
 			<view class="home-banner-img" v-if="in_page==1 && type == 1 ">
-				<image style="width: 100%; height: 576rpx; border-radius: 12rpx;" :src="advertisImg" mode=""></image>
+				<image style="width: 100%; height: 576rpx; border-radius: 12rpx;" :src="advData.img" mode="" @click="jumpHAppID(advData.jump_type, advData.jump_config)"></image>
 				<image @click="cleanCoverImg" class="img-clean" style="width: 20rpx; height: 20rpx; "
 					src="/static/icon/clean.png" mode="">
 				</image>
@@ -89,8 +89,8 @@
 		</movable-area>
 
 		<!-- 广告的附图 -->
-		<view class="home-attach" @click="goH5">
-			<image style="width: 690rpx;height: 156rpx;border-radius: 79rpx;" :src="advertisInsetImg" mode=""></image>
+		<view class="home-attach" @click="jumpHAppID(advInsetImg.jump_type, advInsetImg.jump_config)">
+			<image style="width: 690rpx;height: 156rpx;border-radius: 79rpx;" :src="advInsetImg.img" mode=""></image>
 		</view>
 		<!-- 酒店推荐 -->
 		<view class="home-hotel home-special-area">
@@ -135,7 +135,7 @@
 				<swiper class="swiper-box" circular @change="change2">
 					<swiper-item v-for="(items ,index) in info" :key="index">
 						<view v-for="(item ,j) in items" :key="j" class="swiper-item"
-							@click="goGoodsDetail(item.jump_type,item.jump_config)">
+							@click="jumpHAppID(item.jump_type,item.jump_config)">
 							<image style="width:144rpx;height:142rpx;" :src="item.img" mode="aspectFill"></image>
 						</view>
 					</swiper-item>
@@ -150,7 +150,7 @@
 		<!-- 弹窗广告 -->
 		<uni-popup ref="popup" type="center">
 			<view class="popup-banner">
-				<image @click="goPopup" style="width: 656rpx;height: 916rpx;border-radius: 12rpx;" :src="popupImg">
+				<image @click="jumpHAppID(popupData.jump_type, popupData.jump_config)" style="width: 656rpx;height: 916rpx;border-radius: 12rpx;" :src="popupData.img">
 				</image>
 				<view class="popup-banner-clean" @click='closePopupBanner'>
 					<image style="width: 20rpx; height: 20rpx; " src="/static/icon/clean.png" mode="">
@@ -186,7 +186,7 @@
 				jup_type: '',
 				jump_config: '',
 				//广告弹框图
-				popupImg: '',
+				popupData:{},
 				//弹窗的类型 1只弹一次首次  2就是每次都弹啊
 				times_type:'',
 				//弹窗的显示0不显示 1显示
@@ -201,8 +201,10 @@
 				isShowAdver: false,
 				//广告图
 				advertis: '',
+				advData: {},
 				//广告附图展示图片
 				advertisInsetImg: '',
+				advInsetImg:{},
 				//广告图展示图片:
 				advertisImg: '',
 				//广告图展示视频
@@ -265,14 +267,16 @@
 				specialList: []
 			}
 		},
+		onTabItemTap(e){
+			console.log(e)
+		},
 		// 下拉刷新
 		onPullDownRefresh() {
-			let _this = this
-			setTimeout(function() {
+			setTimeout(() => {
 				uni.stopPullDownRefresh();
-				_this.$store.dispatch('user/allset', null)
-				_this.getAllSet()
-				_this.getList()
+				this.$store.dispatch('user/allset', null)
+				this.getAllSet()
+				this.getList()
 			}, 1000);
 		},
 		onReady: function(res) {
@@ -282,90 +286,87 @@
 			//获取token
 			this.getmsg()
 			this.admin = this.$store.getters.userInfo
-			console.log(this.admin);
 		},
 		onLoad() {
-			
 			this.shortLong()
 			this.getAllSet()
-
 		},
 		methods: {
-			//合同伙伴跳转h5和小程序
-			goGoodsDetail(id, urls) {
-				console.log(urls, '----->url');
-				if (id == 1) {
-					const url = urls; // 跳转的外链
-					const navtitle = 'H5'; // 这个标题是你自己可以设置的
-					uni.navigateTo({
-						// 跳转到webview页面
-						url: `/pages/webview/webview?url=${url}&nav=${navtitle}`,
-						success: () => {
-							console.log('成功')
-						},
-						fail: (e) => {
-							console.log(e, "失败")
-						}
-					});
-				} else if (id == 2) {
-					let obj = JSON.parse(urls);
-					wx.navigateToMiniProgram({
-						appId: `${obj.appid}`, //appid
-						path: `${obj.path}`, //path
-						extraData: { //参数
-							foo: 'bar'
-						},
-						// envVersion: 'develop', //开发版develop 开发版 trial   体验版 release 正式版 
-						success(res) {
-							console.log('成功')
-							// 打开成功
-						},
-						fail(e) {
-							console.log(e, '失败')
-						}
+			// **************** Data ***************//
+			//获取配置数据
+			getAllSet() {
+				this.$api.document.allSet().then(res => {
+					this.$store.dispatch('user/allset', res.data)
+					this.infoList = this.$store.getters.allset.banners
+					this.navList = this.$store.getters.allset.nav_icon
+					this.info = this.$store.getters.allset.partner
+			
+					//广告图
+					this.advertis = this.$store.getters.allset.advertises.filter(item => {
+						return item.in_page == 1
 					})
-				}
-			},
-
-			//弹窗广告跳转小程序/h5/内部其他页面
-			goPopup() {
-				//跳转h5
-				if (this.jump_type == 1) {
-					const url = this.jump_config; // 跳转的外链
-					const navtitle = 'H5'; // 这个标题是你自己可以设置的
-					uni.navigateTo({
-						// 跳转到webview页面
-						url: `/pages/webview/webview?url=${url}&nav=${navtitle}`,
-						success: () => {
-							console.log('成功')
-						},
-						fail: (e) => {
-							console.log(e, "失败")
-						}
-					});
-				} else if (this.jump_type == 2) {
-					let obj = JSON.parse(this.jump_config);
-					wx.navigateToMiniProgram({
-						appId: `${obj.appid}`, //appid
-						path: `${obj.path}`, //path
-						extraData: { //参数
-							foo: 'bar'
-						},
-						// envVersion: 'develop', //开发版develop 开发版 trial   体验版 release 正式版 
-						success(res) {
-							console.log('成功')
-							// 打开成功
-						},
-						fail(e) {
-							console.log(e, '失败')
-						}
+					this.advData = this.advertis[0];
+					if (this.advertis[0].type == 1) {
+						this.in_page = 1
+						this.type = 1
+						this.advertisImg = this.advertis[0].img
+					} else if (this.advertis[0].type == 2) {
+						this.in_page = 1
+						this.type = 2
+						this.videoCoverImg = this.advertis[0].video_cover
+						this.videoSrc = this.advertis[0].video
+					}
+					//胶囊图
+					this.advertisInset = this.$store.getters.allset.advertises.filter(item => {
+						return item.in_page == 2
 					})
-				}
+					this.advInsetImg = this.advertisInset[0]
+					this.advertisInsetImg = this.advertisInset[0].img
+					//广告弹框图
+					this.popupData = this.$store.getters.allset.popup_ads[0]
+					//弹窗是否展示
+					this.popupImgStatus =  this.popupData?.status
+					this.times_type =  this.popupData?.times_type
+					//广告弹框跳转h5和小程序和内部
+					this.jump_type = this.popupData?.jump_type,
+						this.jump_config = this.popupData?.jump_config
+					this.open()
+				})
 			},
-
-			//关闭弹框
-			closePopupBanner() {
-				this.$refs.popup.close()
+			// 获取活动列表
+			getList() {
+				this.$api.active.getActiveList({
+					page: 0,
+					keyword: '',
+					category_id: ''
+				}).then(res => {
+					console.log(res, '活动列表')
+					if (res.code == 0) {
+						this.specialList = res.data.data
+					}
+				})
+			},
+			// **************** Dev ***************//
+			shortLong() {
+				this.goodsList.forEach((item, index, arr) => {
+					if (index % 4 === 0) {
+						item.short = true
+					}
+					if (index % 4 === 1) {
+						item.long = true
+					}
+					if (index % 4 === 2) {
+						item.long = true
+						item.marginTop = -68 + "rpx"
+					}
+					if (index % 4 === 3) {
+						item.short = true
+					}
+				})
+			},
+			//隐藏图片
+			cleanCoverImg() {
+				this.isShowAdver = !this.isShowAdver
 			},
 			//打开弹框
 			open() {
@@ -392,19 +393,21 @@
 					this.$refs.popup.close()//不显示广告弹框
 				}
 			},
+			//关闭弹框
+			closePopupBanner() {
+				this.$refs.popup.close()
+			},
 			//点击视频封面图片,播放视频
 			openVideoPlay() {
-				console.log('播放');
 				this.isOpenVideo = !this.isOpenVideo
 				this.videoContext.play()
 			},
-
-
-			//轮播图跳转h5或者小程序
-			goSwiperSmall(type, config) {
-				//跳转h5
-				if (type == 1) {
-					const url = config; // 跳转的外链
+			// **************** 跳转 ***************//
+			//合同伙伴跳转h5和小程序
+			goGoodsDetail(id, urls) {
+				console.log(urls, '----->url');
+				if (id == 1) {
+					const url = urls; // 跳转的外链
 					const navtitle = 'H5'; // 这个标题是你自己可以设置的
 					uni.navigateTo({
 						// 跳转到webview页面
@@ -416,8 +419,8 @@
 							console.log(e, "失败")
 						}
 					});
-				} else if (type == 2) {
-					let obj = JSON.parse(config);
+				} else if (id == 2) {
+					let obj = JSON.parse(urls);
 					wx.navigateToMiniProgram({
 						appId: `${obj.appid}`, //appid
 						path: `${obj.path}`, //path
@@ -435,13 +438,6 @@
 					})
 				}
 			},
-
-
-			//隐藏图片
-			cleanCoverImg() {
-				this.isShowAdver = !this.isShowAdver
-			},
-
 			// 活动详情页
 			activeDetail(id) {
 				uni.navigateTo({
@@ -472,81 +468,7 @@
 						}
 					}
 				})
-			},
-			// 获取活动列表
-			getList() {
-				this.$api.active.getActiveList({
-					page: 0,
-					keyword: '',
-					category_id: ''
-				}).then(res => {
-					console.log(res, '活动列表')
-					if (res.code == 0) {
-						this.specialList = res.data.data
-						console.log(this.specialList, '--->this.specialList');
-					}
-				})
-			},
-
-
-			//获取配置数据
-			getAllSet() {
-				this.$api.document.allSet().then(res => {
-					this.$store.dispatch('user/allset', res.data)
-					this.infoList = this.$store.getters.allset.banners
-					this.navList = this.$store.getters.allset.nav_icon
-					this.info = this.$store.getters.allset.partner
-
-					//广告图
-					this.advertis = this.$store.getters.allset.advertises.filter(item => {
-						return item.in_page == 1
-					})
-					if (this.advertis[0].type == 1) {
-						this.in_page = 1
-						this.type = 1
-						this.advertisImg = this.advertis[0].img
-					} else if (this.advertis[0].type == 2) {
-						this.in_page = 1
-						this.type = 2
-						this.videoCoverImg = this.advertis[0].video_cover
-						this.videoSrc = this.advertis[0].video
-					}
-					//胶囊图
-					this.advertisInset = this.$store.getters.allset.advertises.filter(item => {
-						return item.in_page == 2
-					})
-					this.advertisInsetImg = this.advertisInset[0].img
-					//广告弹框图
-					this.popupImg = this.$store.getters.allset.popup_ads[0].img
-					//弹窗是否展示
-					this.popupImgStatus =  this.$store.getters.allset.popup_ads[0].status
-					this.times_type =  this.$store.getters.allset.popup_ads[0].times_type
-					//广告弹框跳转h5和小程序和内部
-					this.jump_type = this.$store.getters.allset.popup_ads[0].jump_type,
-						this.jump_config = this.$store.getters.allset.popup_ads[0].jump_config
-					console.log(this.jump_type, this.jump_config, '----->this.advertis');
-					this.open()
-				})
-			},
-			shortLong() {
-				this.goodsList.forEach((item, index, arr) => {
-					if (index % 4 === 0) {
-						item.short = true
-					}
-					if (index % 4 === 1) {
-						item.long = true
-					}
-					if (index % 4 === 2) {
-						item.long = true
-						item.marginTop = -68 + "rpx"
-					}
-					if (index % 4 === 3) {
-						item.short = true
-					}
-				})
-				console.log(this.goodsList);
-			},
-
+			},	
 			//跳转方法
 			jumpHAppID(id, urls) {
 				if (id == 1) {
@@ -580,42 +502,14 @@
 						}
 					})
 				} else if (id == 3) {
-					let obj = urls;
-					console.log(obj, '------>obj');
-					uni.redirectTo({
-						url: `${obj}`
-					})
-				}
-			},
-
-
-			// 金刚图跳转
-			goOther(index, jumpType, jumpConfig) {
-				if (this.admin == undefined) {
-					uni.navigateTo({
-						url: '/pages/login/login'
+					uni.reLaunch({
+						url: urls,
+						fail:(err)=>{
+							uni.navigateTo({
+								url: urls
+							})
+						}
 					})
-				} else {
-					switch (index) {
-						case 0:
-							console.log(index, jumpType, jumpConfig, '------>index')
-							this.jumpHAppID(jumpType, jumpConfig)
-							break;
-						case 1:
-							this.jumpHAppID(jumpType, jumpConfig)
-							break;
-						case 2:
-							this.jumpHAppID(jumpType, jumpConfig)
-							break;
-						case 3:
-							this.jumpHAppID(jumpType, jumpConfig)
-							break;
-						case 4:
-							this.jumpHAppID(jumpType, jumpConfig)
-							break;
-						default:
-							console.log(index)
-					}
 				}
 			},
 			// 跳转其他小程序
@@ -673,14 +567,12 @@
 					})
 				}
 			},
-
 			//产品列表
 			goProduceList() {
 				uni.navigateTo({
 					url: '/pages/goods/goods'
 				})
 			},
-
 			//活动列表
 			goSpecialList() {
 				uni.navigateTo({
@@ -732,394 +624,8 @@
 					}
 				})
 			}
-
 		},
 	}
 </script>
 
-<style lang="scss" scoped>
-	page {
-		height: 100%;
-		background-color: #f9f9f9;
-	}
-
-	.home {
-		height: 100%;
-		background-color: #f9f9f9;
-	}
-
-	//首页广告弹框
-	.popup-banner {
-		position: relative;
-
-		.popup-banner-clean {
-			position: absolute;
-			top: 32rpx;
-			right: 32rpx;
-			width: 48rpx;
-			height: 48rpx;
-			background: #000000;
-			opacity: 0.2;
-			border-radius: 50%;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-		}
-
-	}
-
-
-
-
-	.movableArea {
-		position: fixed;
-		top: 0;
-		left: 0;
-		width: 100%;
-		height: 100%;
-		z-index: 999;
-		pointer-events: none; //设置area元素不可点击,则事件便会下移至页面下层元素
-
-		.movableView {
-			pointer-events: auto; //可以点击
-			width: 84rpx;
-			height: 84rpx;
-			padding: 0 30rpx;
-
-			.img-IHg {
-				width: 84rpx;
-				height: 84rpx;
-				background-color: #fff;
-				box-shadow: 0px 8rpx 24rpx 0px rgba(220, 222, 229, 0.4);
-				border-radius: 50%;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-			}
-		}
-	}
-
-
-
-	.slot-wrap {
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		flex: 1;
-	}
-
-	.home-swiper {
-		width: 100%;
-		height: 592rpx;
-
-		.swiper-box {
-			width: 100%;
-			height: 592rpx;
-			;
-
-			::v-deep .swiper-item {
-				width: 100%;
-				height: 592rpx;
-				display: flex;
-				align-items: center;
-				justify-content: space-between;
-			}
-
-		}
-	}
-
-	.home-nav {
-		position: relative;
-		top: -18rpx;
-		padding-top: 60rpx;
-		border-radius: 24rpx 24rpx 0px 0px;
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		background-color: #f9f9f9;
-
-		.home-nav-item {
-			width: 20%;
-			flex: none;
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			justify-content: center;
-		}
-	}
-
-	.home-special-area {
-		height: 146rpx;
-		padding: 0 30rpx;
-		// background-color: deeppink;
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-
-		.home-special-area-left {
-			display: flex;
-			align-items: center;
-			justify-content: flex-start;
-			color: #333;
-			font-size: 36rpx;
-			font-weight: 800;
-			position: relative;
-
-			.text-shadow {
-				position: absolute;
-				bottom: 0;
-				left: 0;
-				width: 200rpx;
-				height: 16rpx;
-				background: linear-gradient(270deg, rgba(249, 231, 219, 0) 0%, #F9E7DB 100%);
-				border-radius: 200rpx 0px 0px 200rpx;
-			}
-
-			&::before {
-				content: '';
-				display: inline-block;
-				width: 6rpx;
-				height: 34rpx;
-				background: linear-gradient(180deg, #FF6200 0%, #FF4C00 100%);
-				border-radius: 3rpx;
-				margin-right: 8rpx;
-				margin-top: 2rpx;
-			}
-		}
-
-		.home-special-area-right {
-			display: flex;
-			align-items: center;
-			justify-content: flex-end;
-			font-size: 30rpx;
-			color: #999;
-		}
-	}
-
-	.home-special-img {
-		// height: 260rpx;
-		padding: 0 30rpx;
-		// background-color: #fff;
-		display: flex;
-		align-items: flex-start;
-		justify-content: space-between;
-		overflow-x: scroll;
-		overflow-y: hidden;
-
-		.ListItem {
-			width: 312rpx;
-			position: relative;
-			margin-right: 24rpx;
-
-			.kudosicon {
-				width: 40rpx;
-				height: 40rpx;
-				position: absolute;
-				right: 28rpx;
-				top: 16rpx;
-				border-radius: 50%;
-				background: #FFFFFF;
-				opacity: 0.84;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-			}
-		}
-
-		.ListItem:last-child {
-			margin-right: 0;
-		}
-	}
-
-	.home-banner {
-		height: 640rpx;
-		padding: 0 30rpx;
-		padding-top: 64rpx;
-
-		.home-banner-img {
-			position: relative;
-			width: 100%;
-
-			// height: 100%;
-			.baner-video {
-				position: absolute;
-				top: 0;
-				left: 0;
-			}
-
-			.banner-img {
-				position: absolute;
-				top: 0;
-				left: 0;
-				z-index: 9;
-			}
-
-			.img-clean {
-				position: absolute;
-				right: 28rpx;
-				top: 30rpx;
-				z-index: 99;
-			}
-
-			.img-IHg {
-				width: 84rpx;
-				height: 84rpx;
-				background-color: #fff;
-				box-shadow: 0px 8rpx 24rpx 0px rgba(220, 222, 229, 0.4);
-				border-radius: 50%;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				position: fixed;
-				top: 1030rpx;
-				right: 30rpx;
-				z-index: 99;
-
-			}
-		}
-	}
-
-	.home-attach {
-		background-color: #f9f9f9;
-		padding: 40rpx 30rpx 5rpx;
-	}
-
-	.home-hotel {
-		height: 124rpx;
-		background-color: #f9f9f9;
-	}
-
-	.home-hotel-img {
-		background-color: #F9f9f9;
-		padding: 20rpx 30rpx;
-
-		.home-hotel-img-content {
-			display: flex;
-			align-items: flex-start;
-			justify-content: space-between;
-			flex-wrap: wrap;
-
-			.home-hotel-img-content-item {
-				width: 332rpx;
-				background: #FFFFFF;
-				box-shadow: 0px 4rpx 8rpx 0px rgba(0, 0, 0, 0.04);
-				border-radius: 12rpx;
-				margin-bottom: 26rpx;
-				// &:nth-child(2n+1){
-				// 	// position: relative;
-				// 	top: -33px;
-				// }
-				// &:nth-child(1){
-				// 	// position: relative;
-				// 	top: 0;
-				// }
-
-				.home-hotel-img-content-item-img {
-					width: 332rpx;
-					height: 332rpx;
-					object-fit: cover;
-					object-position: center;
-				}
-
-				.home-hotel-img-content-item-img-long {
-					width: 332rpx;
-					height: 400rpx;
-					object-fit: cover;
-					object-position: center;
-				}
-
-				.text {
-					display: flex;
-					flex-direction: column;
-					align-items: flex-start;
-					justify-content: center;
-					padding: 18rpx 22rpx 32rpx;
-
-					.text-top {
-						font-size: 28rpx;
-						font-weight: bold;
-						color: #333;
-					}
-
-					.text-main {
-						display: none;
-						margin-top: 20rpx;
-						font-size: 24rpx;
-						color: #999999;
-					}
-				}
-			}
-		}
-
-
-		.home-hotel-img-more {
-			height: 70rpx;
-			background-color: #fff;
-			border-radius: 10rpx;
-			border: 2rpx solid #ddd;
-			font-size: 28rpx;
-			color: #5A5A5A;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			margin-top: 50rpx;
-		}
-	}
-
-	.home-brand {
-		height: 124rpx;
-		background-color: #f9f9f9;
-	}
-
-	.home-brand-img {
-		padding: 0 30rpx;
-		background-color: #f9f9f9;
-
-		zhe::v-deep .uni-swiper__dots-item {
-			width: 22rpx !important;
-			height: 2rpx !important;
-		}
-
-		::v-deep .uni-swiper__dots-bar {
-			width: 22rpx !important;
-			height: 2rpx !important;
-		}
-
-		::v-deep .uni-swiper__warp {
-			overflow: unset !important;
-		}
-
-		.swiper-box {
-			background-color: #f9f9f9;
-			height: 200rpx;
-
-			::v-deep swiper-item {
-				width: 100%;
-				display: flex;
-				align-items: center;
-				justify-content: space-between;
-
-				view {
-					width: 164rpx;
-					height: 162rpx;
-					background: #FFFFFF;
-					box-shadow: 0px 4rpx 8rpx 0rpx rgba(220, 222, 229, 0.4);
-					border-radius: 32rpx;
-					display: flex;
-					align-items: center;
-					justify-content: center;
-
-					image {
-						border-radius: 32rpx;
-					}
-				}
-
-			}
-		}
-	}
-
-	.home-bottom {
-		background-color: #f9f9f9;
-		padding-top: 120rpx;
-	}
-</style>
+<style lang="scss" src="./index.scss" scoped></style>

+ 43 - 55
pages/index/vote-detail/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -118,7 +118,7 @@
 		<!-- 弹出层 -->
 		<uni-popup ref="popup" type="center">
 			<view class="pop">
-				<view class="title"><text>投票成功</text></view>
+				<view class="title"><text>{{pupopSuccess? "投票成功" : "票数不足"}}</text></view>
 				<view class="img" v-if="is_prize==0">
 					<image :src="voteDetail.activity.success_img"></image>
 				</view>
@@ -182,9 +182,8 @@
 		components:{Poster},
 		data() {
 			return {
-				pageControl:{
-					isPosterShow:false,
-				},
+				is_vip: false,
+				pupopSuccess: true,
 				pupopWidth: 590,
 				pupopHeight: 788,
 				//一定要注意像素密度的问题,这里使用的固定数值
@@ -242,12 +241,24 @@
 		},
 		onReady: function(res) {
 			this.videoContext = uni.createVideoContext('myVideo')
+			console.log('onReady')
+			uni.getStorage({
+				key: 'is_vip',
+				success: (data)=> {
+					console.log(data)
+					this.is_vip = data.data === 1 ? true : false
+					console.log(this.is_vip)
+				},
+				fail:()=>{
+					this.is_vip = false;
+				}
+			});
+			
 		},
 		onLoad(op) {
 			this.activity_project_id = op.id
 			this.getDetail(op.id)
 			this.admin = this.$store.getters.userInfo
-			console.log(this.admin);
 			// //海报
 			// this.pupopWidth = this.pupopWidth * this.pixelRatio
 			// this.pupopHeight = this.pupopHeight * this.pixelRatio
@@ -257,7 +268,7 @@
 		watch: {
 			vipRewardTicketNum: {
 				handler(newName, oldName) {
-					console.log(newName, '--->监听')
+					// console.log(newName, '--->监听')
 				},
 				immediate: true,
 				deep: true
@@ -303,14 +314,12 @@
 				this.$api.active.getActiveProjectDetail({
 					activity_project_id: id
 				}).then(res => {
-					console.log(res, "detail")
+					// console.log(res, "detail")
 					if (res.code == 0) {
 						this.voteDetail = res.data
-						console.log(this.voteDetail)
 						this.startTime = res.data.activity.start_time.replace(/-/g, "/")
 						// “yyyy-MM-dd-hh-mm-ss”.replace(/-/g,"/")
 						this.endTime = res.data.activity.end_time.replace(/-/g, "/")
-						console.log(this.startTime, this.endTime);
 						this.cancelTime(this.startTime, this.endTime)
 						//活动可以使用的投票数
 						this.userCanVoteNum = res.data.user_can_vote_num
@@ -334,7 +343,6 @@
 						//banner展示视频或者图片
 						this.resource_type = res.data.resource_type
 						this.video_url = res.data.video_url
-						console.log(this.resource_type, this.video_url, '--->this.video_url');
 						//视频自动播放
 						this.openVideoPlay()
 						//海报图片
@@ -386,6 +394,11 @@
 							var page = getCurrentPages().pop();
 							if (page == undefined || page == null) return;
 							page.onLoad();
+						},
+						fail:()=>{
+							uni.reLaunch({
+								url: obj,
+							})
 						}
 					})
 				}
@@ -396,8 +409,6 @@
 				let endtime = new Date(j); //活动结束时间
 				let lefttime = endtime.getTime() - nowtime.getTime() //距离结束时间的毫秒数
 				let spendtime = nowtime.getTime() - startime.getTime() //距离结束时间的毫秒数
-				console.log(lefttime, '---->lefttime');
-				console.log(spendtime, '---->spendtime');
 				if (lefttime > 0 && spendtime > 0) {
 					//活动进行中
 					this.spending = true
@@ -411,7 +422,8 @@
 
 			},
 			// 打开弹出层
-			openVote() {
+			openVote(mode = true) {
+				this.pupopSuccess = mode
 				this.$refs.popup.open()
 			},
 			// 关闭弹出层
@@ -420,7 +432,7 @@
 			},
 			//再次投票
 			voteAgain(id) {
-				this.goVote(id)
+				this.goVote(id, true)
 			},
 
 			//跳转其他项目
@@ -431,17 +443,14 @@
 			//获取当前页面路径
 			getPageUrl() {
 				const pages = getCurrentPages();
-				console.log(pages, '--------->pages')
 				if (pages.length == 1) {
 					const currentPage = pages[0];
 					let pageUrl = `/${currentPage.route}`;
 					return pageUrl
-					console.log('当前页面url:', pageUrl);
 				} else {
 					const currentPage = pages[pages.length - 1];
 					let pageUrl = `/${currentPage.route}`;
 					return pageUrl
-					console.log('当前页面url:', pageUrl);
 				}
 			},
 
@@ -476,7 +485,11 @@
 							source_type: 1,
 							source_id: _this.sourceId
 						}).then(res => {
-							console.log('-->res', res)
+							uni.setStorage({
+								key: 'is_vip',
+								data: 1,
+							});
+							_this.is_vip = true
 						})
 						// 打开成功
 					},
@@ -486,58 +499,33 @@
 				})
 			},
 			// 投票
-			goVote(id) {
+			goVote(id, again = false) {
+				again && this.closeVote();
 				this.$api.active.vote({
 					activity_project_id: id
 				}).then(res => {
 					console.log(res, '投票')
-					if (res.code == 0) {
-						
-						/**
-						 * 中奖用例
-						res = {
-							data: {
-								"is_prize": 1,
-								"integral": 0,
-								"product": {
-									"id": 1,
-									"type": 1,
-									"hotel_id": 1,
-									"cover_img": "",
-									"banners": "",
-									"name": "测试产品",
-									"category_id": 1,
-									"details": "测试产品",
-									"price": 10,
-									"integral": 0,
-									"stock": 0,
-									"attr_group": "[{\"attr_group_id\":1,\"attr_group_name\":\"口味\",\"attr_list\":[{\"attr_id\":1,\"attr_name\":\"五仁\",\"icon\":\"url1\"},{\"attr_id\":2,\"attr_name\":\"豆沙\",\"icon\":\"url2\"}]},{\"attr_group_id\":2,\"attr_group_name\":\"重量\",\"attr_list\":[{\"attr_id\":3,\"attr_name\":\"100g\",\"icon\":\"url3\"},{\"attr_id\":4,\"attr_name\":\"200g\",\"icon\":\"url4\"}]}]",
-									"created_at": "2022-11-23 18:09:06",
-									"updated_at": "2022-11-23 23:35:26"
-								}
-							}
-						}
-						 */
-					   
+					if (res.code == 0) {			   
 						this.is_prize = res.data.is_prize
 						if (this.is_prize == 1) {
 							this.prizeProduct = res.data?.product?.name
 						}
 						this.openVote()
 						this.getDetail(this.activity_project_id)
-					} else {
-						if (res.msg.length > 7) {
-							uni.showToast({
-								icon: 'none',
-								title: res.msg
-							})
-						} else {
+					}  else if(res.code === 1){
+						if(!this.is_vip){
+							this.openVote(false)
+						}else{
 							uni.showToast({
 								icon: 'error',
 								title: res.msg
 							})
 						}
-
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.msg
+						})
 					}
 				}).catch(err => {
 					console.log(err)

+ 3 - 4
pages/map/map.vue

xqd xqd
@@ -336,7 +336,6 @@
 			this.updated()
 			this.getHotelCategory()
 		},
-
 		methods: {
 			//获取筛选数据
 			getHotelCategory(){
@@ -400,9 +399,9 @@
 			//筛选出距离我最近的酒店--对象
 			getMinDistanceHotel({x0,y0}){
 				this.markers=this.setEachHotelDistance(this.markers,{x0,y0});
-				this.markers.sort((prev,next)=>{
-					return prev.distanceToMe-next.distanceToMe;
-				})
+				// this.markers.sort((prev,next)=>{
+				// 	return prev.distanceToMe-next.distanceToMe;
+				// })
 				return this.markers[0];
 			},
 			space(lat1, lng1, lat2, lng2) {