Bladeren bron

优化页面

xiaoxin 2 jaren geleden
bovenliggende
commit
4abe848488
7 gewijzigde bestanden met toevoegingen van 300 en 158 verwijderingen
  1. 86 80
      manifest.json
  2. 3 0
      pages.json
  3. 14 8
      pages/detail/detail.vue
  4. 189 63
      pages/home3/home3.vue
  5. 3 3
      pagesSub/couponCenter/couponCenter.vue
  6. 4 4
      pagesSub/home/home.vue
  7. 1 0
      pagesSub/newsDetail/newsDetail.vue

+ 86 - 80
manifest.json

@@ -1,83 +1,89 @@
-{
-	"name": "Hwxb064310cc85cf115omestay_manage_app",
-	"appid": "",
-	"description": "",
-	"versionName": "1.0.0",
-	"versionCode": "100",
-	"transformPx": false,
-	/* 5+App特有相关 */
-	"app-plus": {
-		"usingComponents": true,
-		"nvueStyleCompiler": "uni-app",
-		"compilerVersion": 3,
-		"splashscreen": {
-			"alwaysShowBeforeRender": true,
-			"waiting": true,
-			"autoclose": true,
-			"delay": 0
-		},
-		/* 模块配置 */
-		"modules": {},
-		/* 应用发布信息 */
-		"distribute": {
-			/* android打包配置 */
-			"android": {
-				"permissions": [
-					"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-					"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
-					"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
-					"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
-					"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
-					"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.CAMERA\"/>",
-					"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
-					"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
-					"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-					"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-					"<uses-feature android:name=\"android.hardware.camera\"/>",
-					"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
-				]
-			},
-			/* ios打包配置 */
-			"ios": {},
-			/* SDK配置 */
-			"sdkConfigs": {}
-		}
-	},
-	/* 快应用特有相关 */
-	"quickapp": {},
-	/* 小程序特有相关 */
-	"mp-weixin": {
-		"appid": "wxb064310cc85cf115",
-		"setting": {
-			"urlCheck": false,
-			"es6": true,
-			"postcss": true,
-			"minified": true
-		},
+{
+	"name": "Hwxb064310cc85cf115omestay_manage_app",
+	"appid": "",
+	"description": "",
+	"versionName": "1.0.0",
+	"versionCode": "100",
+	"transformPx": false,
+	/* 5+App特有相关 */
+	"app-plus": {
 		"usingComponents": true,
-		"lazyCodeLoading": "requiredComponents",
-		"permission": {
-			"scope.userLocation": {
-				"desc": "获取用户位置已展示距离民宿的距离"
-			}
+		"nvueStyleCompiler": "uni-app",
+		"compilerVersion": 3,
+		"splashscreen": {
+			"alwaysShowBeforeRender": true,
+			"waiting": true,
+			"autoclose": true,
+			"delay": 0
 		},
-		"requiredPrivateInfos" : [ "chooseLocation", "getLocation" ,"chooseAddress" ]
-		// "requiredPrivateInfos": ["getLocation"]
-	},
-	"mp-alipay": {
-		"usingComponents": true
-	},
-	"mp-baidu": {
-		"usingComponents": true
-	},
-	"mp-toutiao": {
-		"usingComponents": true
-	},
-	"uniStatistics": {
-		"enable": false
-	},
-	"vueVersion": "2"
+		/* 模块配置 */
+		"modules": {},
+		/* 应用发布信息 */
+		"distribute": {
+			/* android打包配置 */
+			"android": {
+				"permissions": [
+					"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+					"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
+					"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
+					"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
+					"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
+					"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.CAMERA\"/>",
+					"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
+					"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
+					"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
+					"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
+					"<uses-feature android:name=\"android.hardware.camera\"/>",
+					"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
+				]
+			},
+			/* ios打包配置 */
+			"ios": {},
+			/* SDK配置 */
+			"sdkConfigs": {}
+		}
+	},
+	/* 快应用特有相关 */
+	"quickapp": {},
+	/* 小程序特有相关 */
+	"mp-weixin": {
+		"appid": "wxb064310cc85cf115",
+		"setting": {
+			"urlCheck": false,
+			"es6": true,
+			"postcss": true,
+			"minified": true
+		},
+		"usingComponents": true,
+		"lazyCodeLoading": "requiredComponents",
+		"permission": {
+			"scope.userLocation": {
+				"desc": "获取用户位置已展示距离民宿的距离"
+			}
+		},
+		"requiredPrivateInfos": ["chooseLocation", "getLocation", "chooseAddress"]
+		// "requiredPrivateInfos": ["getLocation"]
+		// "plugins": {
+		// 	"txvideo": {
+		// 		"version": "2.4.6",
+		// 		"provider": "wxa75efa648b60994b"
+		// 	}
+		// }
+	},
+	"mp-alipay": {
+		"usingComponents": true
+	},
+	"mp-baidu": {
+		"usingComponents": true
+	},
+	"mp-toutiao": {
+		"usingComponents": true
+	},
+	"uniStatistics": {
+		"enable": false
+	},
+	"vueVersion": "2"
 }

+ 3 - 0
pages.json

@@ -465,6 +465,9 @@
 		"navigationBarTitleText": "靖安民宿",
 		"navigationBarBackgroundColor": "#F8F8F8",
 		"backgroundColor": "#F8F8F8"
+		// "usingComponents": {
+		// 	"tx-video": "plugin://txvideo/video"
+		// }
 	},
 	"uniIdRouter": {}
 }

+ 14 - 8
pages/detail/detail.vue

@@ -403,13 +403,15 @@ export default {
 			// 周边列表每页多少条
 			rows: 10,
 			// 周边列表总条数
-			rimTotal: null,
+			rimTotal: 0,
 			// 用户定位经度
 			myLng: 0,
 			// 用户定位纬度
 			myLat: 0,
 			// 所属乡镇
-			town: ''
+			town: '',
+			// 是否允许下拉刷新
+			isReachBottom: true
 		}
 	},
 	mounted() {
@@ -422,7 +424,7 @@ export default {
 	onLoad(options) {
 		this.getTimes()
 		this.hotelId = options.id
-		this.distance = options.distance === 'undefined' ? false : options.distance
+		this.distance = options.distance ? false : options.distance
 		this.town = options.town
 		uni.getSetting({
 			success: (res) => {
@@ -468,10 +470,11 @@ export default {
 		}
 	},
 	onReachBottom() {
+		if (!this.isReachBottom) return
 		if (this.rimActiveIndex != 0) {
-			if (this.rimList < this.rimTotal) {
+			if (this.rimList.length < this.rimTotal) {
 				this.page++
-				this.getRimList()
+				this.getRimList(this.page)
 			} else {
 				uni.showToast({
 					title: '没有更多数据了',
@@ -517,12 +520,13 @@ export default {
 					})
 				}
 			}
+			this.isReachBottom = true
 		},
-		async getRimList() {
+		async getRimList(pageValue = 1) {
 			const res = await this.$myRequest({
 				url: '/mhotel/applistAround.action',
 				data: {
-					page: this.page,
+					page: pageValue,
 					rows: this.rows,
 					rtype: this.rimHeaderList[this.rimActiveIndex]
 				}
@@ -541,6 +545,7 @@ export default {
 					})
 				}
 			}
+			this.isReachBottom = true
 		},
 		GoRimDetail(item) {
 			if (this.rimActiveIndex == 0) {
@@ -683,8 +688,9 @@ export default {
 			}
 		},
 		onClickItemRim(index) {
+			this.isReachBottom = false
+			this.page = 1
 			this.rimActiveIndex = index
-			this.pgae = 1
 			this.rimList = []
 			if (this.rimActiveIndex == 0) {
 				this.getRimList_hotel()

+ 189 - 63
pages/home3/home3.vue

@@ -6,10 +6,11 @@
 
 		<!-- 顶部图片区域 -->
 		<view class="header">
-			<swiper class="header_swiper" circular :interval="3000">
+			<swiper class="header_swiper" autoplay circular :interval="3000">
 				<swiper-item v-for="banner in headerImgList" :key="banner.id" @click="handleClickBanner(banner)">
 					<img mode="aspectFill" class="img" :src="banner.imageUrl" />
-					<img mode="aspectFill" class="img2" :src="banner.logoUrl" />
+					<img v-if="banner.logoUrl.indexOf('2.png') != -1" mode="aspectFill" class="img2" :src="banner.logoUrl" />
+					<img v-if="banner.logoUrl.indexOf('1.png') != -1" mode="aspectFill" class="img3" :src="banner.logoUrl" />
 				</swiper-item>
 			</swiper>
 		</view>
@@ -26,7 +27,7 @@
 				<!-- 关键词搜索和民宿级别区域 -->
 				<view class="search_center">
 					<view class="center_input">
-						<input type="text" v-model="keywords" placeholder="民宿/地名/关键词" placeholder-style="color:#A6A6A6;font-weight:400;" />
+						<input type="text" v-model="keywords" placeholder="民宿/地名/关键词" placeholder-style="color:#808080;font-weight:400;" />
 					</view>
 					<img class="img" src="../../static/index/right2.png" />
 					|
@@ -74,29 +75,33 @@
 							<img src="https://chtech.ncjti.edu.cn/hotelReservation/image/13.png" />
 						</view>
 					</view>
-					<view class="body_list">
-						<!-- 每一个民宿区域 -->
-						<view class="list_item" v-for="(item, index) in hotelList_you" :key="index" @click="goPageDetail(item)">
-							<image class="item-img" :src="item.coverImg" mode="scaleToFill"></image>
-							<view class="descrition">
-								<text class="title">{{ item.hotel_name }}</text>
-								<text class="type">
-									{{ item.hTypeName }} &nbsp;&nbsp;
-									<text class="type_level" v-if="item.type == 1">银宿级</text>
-									<text class="type_level" v-if="item.type == 2">金宿级</text>
-									<text class="type_level" v-if="item.type == 3">白金级</text>
-								</text>
-								<text class="distance" v-if="showdDistance">距您直线{{ item.distance }}公里</text>
-								<view class="detail">
-									<img class="img" src="../../static/index/hotel.png" />
-									<view class="price_home">
-										<text class="txt1">¥{{ item.min_price }}</text>
-										<text class="txt2">起</text>
+
+					<swiper class="body_swiper" indicator-dots circular indicator-color="#BBD8FE" indicator-active-color="#1E7DFB" interval="3000" v-if="hotelList_you.length">
+						<swiper-item v-for="(ele, index) in hotelList_you" :key="index">
+							<view class="swiper_box">
+								<view class="list_item" v-for="(item, index2) in ele" :key="item.id" @click="goPageDetail(item)">
+									<image class="item-img" :src="item.coverImg" mode="scaleToFill"></image>
+									<view class="descrition">
+										<text class="title">{{ item.hotel_name }}</text>
+										<text class="type">
+											{{ item.hTypeName }} &nbsp;&nbsp;
+											<text class="type_level" v-if="item.type == 1">银宿级</text>
+											<text class="type_level" v-if="item.type == 2">金宿级</text>
+											<text class="type_level" v-if="item.type == 3">白金级</text>
+										</text>
+										<text class="distance" v-if="showdDistance">距您直线{{ item.distance }}公里</text>
+										<view class="detail">
+											<img class="img" src="../../static/index/hotel.png" />
+											<view class="price_home">
+												<text class="txt1">¥{{ item.min_price }}</text>
+												<text class="txt2">起</text>
+											</view>
+										</view>
 									</view>
 								</view>
 							</view>
-						</view>
-					</view>
+						</swiper-item>
+					</swiper>
 				</uv-skeletons>
 
 				<!-- 精选攻略区域 -->
@@ -271,7 +276,7 @@
 		</uv-popup>
 
 		<!-- 等级介绍弹窗区域 -->
-		<uv-popup ref="popup_level" mode="center" :closeOnClickOverlay="false" bgColor="none">
+		<!-- <uv-popup ref="popup_level" mode="center" :closeOnClickOverlay="false" bgColor="none">
 			<view class="popupLevel">
 				<view class="level_header">
 					<view class="">民宿等级</view>
@@ -285,7 +290,7 @@
 					<view class="btn read" @click="handleCloseLevelPop">已读</view>
 				</view>
 			</view>
-		</uv-popup>
+		</uv-popup> -->
 	</view>
 </template>
 
@@ -442,9 +447,9 @@ export default {
 		// 获取特产列表
 		this.getGoodsList()
 
-		let isTip = uni.getStorageSync('isTip')
+		// let isTip = uni.getStorageSync('isTip')
 
-		!isTip && this.$refs.popup_level.open()
+		// !isTip && this.$refs.popup_level.open()
 	},
 	methods: {
 		async getHeaderImgList() {
@@ -649,7 +654,9 @@ export default {
 						let lng = ele.hpositionWens.split(',')[1]
 						ele.distance = this.calculateDistance(lat, lng)
 					})
+					this.hotelList_you = this.changeList(this.hotelList_you, 2)
 				}
+
 				this.loading = false
 			}
 		},
@@ -724,14 +731,14 @@ export default {
 		},
 		handleChooseLv() {
 			uni.showActionSheet({
-				itemList: ['白金', '金宿', '银宿'],
+				itemList: ['白金', '金宿', '银宿'],
 				success: (res) => {
 					if (res.tapIndex === 0) {
-						this.level = '白金'
+						this.level = '白金'
 					} else if (res.tapIndex === 1) {
-						this.level = '金宿'
+						this.level = '金宿'
 					} else if (res.tapIndex === 2) {
-						this.level = '银宿'
+						this.level = '银宿'
 					}
 				}
 			})
@@ -799,13 +806,13 @@ export default {
 		changeDot(e) {
 			this.current = e.detail.current
 		},
-		handleCloseLevelPop() {
-			this.$refs.popup_level.close()
-		},
-		handleNoTip() {
-			uni.setStorageSync('isTip', true)
-			this.$refs.popup_level.close()
-		},
+		// handleCloseLevelPop() {
+		// 	this.$refs.popup_level.close()
+		// },
+		// handleNoTip() {
+		// 	uni.setStorageSync('isTip', true)
+		// 	this.$refs.popup_level.close()
+		// },
 		// 点击顶部轮播图广告回调
 		handleClickBanner(banner) {
 			// console.log(banner)
@@ -816,35 +823,52 @@ export default {
 					})
 					break
 				case '小程序':
-					if (banner.jumpDirection == '民宿') {
-						uni.navigateTo({
-							url: `/pages/detail/detail?id=${banner.jumpPoint}&distance=&town=${banner.townId}`
-						})
-					} else if (banner.jumpDirection == '商品') {
-						if (banner.jumpPoint == '首页') {
+					let openid = uni.getStorageSync('openid')
+					let tokenId = uni.getStorageSync('tokenId')
+
+					if (openid && tokenId) {
+						if (banner.jumpDirection == '民宿') {
 							uni.navigateTo({
-								url: '/packageShang/pages/tabbar/home'
+								url: `/pages/detail/detail?id=${banner.jumpPoint}&distance=&town=${banner.townId}`
 							})
-						} else {
+						} else if (banner.jumpDirection == '商品') {
+							if (banner.jumpPoint == '首页') {
+								uni.navigateTo({
+									url: '/packageShang/pages/tabbar/home'
+								})
+							} else {
+								uni.navigateTo({
+									url: `/packageShang/pages/goods/goods?id=${banner.jumpPoint}`
+								})
+							}
+						} else if (banner.jumpDirection == '攻略') {
+							if (banner.jumpPoint == '首页') {
+								uni.switchTab({
+									url: '/pages/community/community'
+								})
+							} else {
+								uni.navigateTo({
+									url: `/pagesSub/tweetDetail/tweetDetail?id=${banner.jumpPoint}&townId=${banner.townId}`
+								})
+							}
+						} else if (banner.jumpDirection == '优惠券') {
 							uni.navigateTo({
-								url: `/packageShang/pages/goods/goods?id=${banner.jumpPoint}`
+								url: `/pagesSub/couponCenter/couponCenter?id=${banner.jumpPoint}`
 							})
 						}
-					} else if (banner.jumpDirection == '攻略') {
-						if (banner.jumpPoint == '首页') {
-							uni.navigateTo({
-								url: '/pages/community/community'
-							})
-						} else {
+					} else {
+						uni.showToast({
+							title: '请先登录',
+							icon: 'none',
+							mask: true
+						})
+						setTimeout(() => {
 							uni.navigateTo({
-								url: `/pagesSub/tweetDetail/tweetDetail?id=${banner.jumpPoint}&townId=${banner.townId}`
+								url: '/pages/login/login'
 							})
-						}
-					} else if (banner.jumpDirection == '优惠券') {
-						uni.navigateTo({
-							url: `/pagesSub/couponCenter/couponCenter?id=${banner.jumpPoint}`
-						})
+						}, 1500)
 					}
+
 					break
 				default:
 					uni.previewImage({
@@ -883,9 +907,16 @@ export default {
 				position: absolute;
 				top: 175rpx;
 				left: 38rpx;
-				width: 200rpx;
+				width: 208rpx;
 				height: 200rpx;
-				border: 1rpx solid skyblue;
+			}
+
+			.img3 {
+				position: absolute;
+				top: 240rpx;
+				left: 38rpx;
+				width: 305rpx;
+				height: 80rpx;
 			}
 		}
 	}
@@ -907,7 +938,7 @@ export default {
 
 	.content {
 		z-index: 1;
-		margin: -102rpx auto 0;
+		margin: -20rpx auto 0;
 		width: 690rpx;
 		border-radius: 12rpx 12rpx 0 0;
 		background-color: #f2f2f2;
@@ -925,7 +956,7 @@ export default {
 				justify-content: space-between;
 				align-items: center;
 				height: 89rpx;
-				color: #a6a6a6;
+				color: #808080;
 				font-size: 32rpx;
 				border-bottom: 1rpx solid #e6e6e6;
 
@@ -967,6 +998,7 @@ export default {
 					flex: 1;
 					margin-left: 24rpx;
 					font-weight: 400;
+					color: #808080;
 				}
 
 				.active {
@@ -1091,6 +1123,100 @@ export default {
 				}
 			}
 
+			.body_swiper {
+				height: 520rpx;
+				border-radius: 12rpx;
+
+				.swiper_box {
+					display: flex;
+					justify-content: space-around;
+
+					.list_item {
+						width: 335rpx;
+						box-sizing: border-box;
+
+						.item-img {
+							width: 100%;
+							height: 223rpx;
+							border-radius: 18rpx 18rpx 0 0;
+							box-sizing: border-box;
+						}
+
+						.descrition {
+							display: flex;
+							flex-direction: column;
+							width: 100%;
+							border-radius: 0 0 18rpx 18rpx;
+							box-sizing: border-box;
+							background: rgba(255, 255, 255, 1);
+							margin-top: -10rpx;
+
+							.title {
+								font-size: 28rpx;
+								font-weight: 600;
+								padding: 20rpx 20rpx 10rpx;
+								color: rgba(0, 0, 0, 1);
+								overflow: hidden;
+								white-space: nowrap;
+								text-overflow: ellipsis;
+							}
+
+							.type {
+								padding: 5rpx 20rpx;
+								height: 40rpx;
+								font-size: 24rpx;
+								color: #a6a6a6;
+
+								.type_level {
+									margin-left: 20rpx;
+								}
+							}
+
+							.distance {
+								padding: 10rpx 20rpx;
+								font-size: 24rpx;
+								color: #a6a6a6;
+							}
+
+							.detail {
+								display: flex;
+								flex-direction: row;
+								justify-content: space-between;
+								align-items: center;
+								padding: 0 20rpx 20rpx 20rpx;
+								color: rgba(0, 0, 0, 1);
+
+								.img {
+									width: 40rpx;
+									height: 40rpx;
+								}
+
+								.price_home {
+									.txt1 {
+										font-size: 36rpx;
+										font-weight: 600;
+										color: rgba(255, 87, 51, 1);
+									}
+
+									.txt2 {
+										font-size: 24rpx;
+										font-weight: 400;
+										color: #a6a6a6;
+									}
+								}
+
+								.score {
+									font-size: 24rpx;
+									font-weight: 400;
+									padding-top: 10rpx;
+									color: rgba(166, 166, 166, 1);
+								}
+							}
+						}
+					}
+				}
+			}
+
 			.body_strategy {
 				display: flex;
 				box-sizing: border-box;

+ 3 - 3
pagesSub/couponCenter/couponCenter.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<!-- 优惠券列表区域 -->
-		<view class="body">
+		<view class="body" v-if="list.length">
 			<!-- 每一张优惠券区域 -->
 			<view class="body_item" v-for="item in list" :key="item.id">
 				<img src="../../static/my/couponTitle.png" />
@@ -102,13 +102,13 @@ export default {
 				}
 			})
 			// console.log(res);
-			if (res.code === 200 && res.page.pageList) {
+			if (res.code === 200 && res.page.pageList.length) {
 				res.page.pageList.forEach((ele) => {
 					ele.hotelIds = ele.hotelIds.split(',')
 				})
 				if (this.bannerId) {
 					const result = res.page.pageList.find((ele) => ele.id == this.bannerId)
-					this.list = result || []
+					this.list = [result] || []
 				} else {
 					this.list = [...this.list, ...res.page.pageList]
 					this.total = res.page.total

+ 4 - 4
pagesSub/home/home.vue

@@ -39,7 +39,7 @@
 							<view class="item_rate">
 								<view class="rate_left">{{ item.scoreHotel || '5.0' }}</view>
 							</view>
-							<view class="item_distance">距您直线{{ item.distance }}公里</view>
+							<view class="item_distance" v-if="item.distance">距您直线{{ item.distance }}公里</view>
 							<view class="item_info">
 								<view class="info_count">剩{{ item.roomNumber }}间</view>
 								<view class="info_price">
@@ -135,11 +135,11 @@ export default {
 	onLoad(options) {
 		// console.log(options)
 		this.keywords = options.keywords
-		if (!options.level || options.level === '白金') {
+		if (!options.level || options.level === '白金') {
 			this.current = 0
-		} else if (options.level === '金宿') {
+		} else if (options.level === '金宿') {
 			this.current = 1
-		} else if (options.level === '银宿') {
+		} else if (options.level === '银宿') {
 			this.current = 2
 		}
 		uni.setNavigationBarTitle({

+ 1 - 0
pagesSub/newsDetail/newsDetail.vue

@@ -21,6 +21,7 @@ export default {
 	onLoad(options) {
 		this.info = JSON.parse(decodeURIComponent(options.info))
 		// this.info.content = this.info.content.replace(/data-src/g, 'src')
+		// this.info.content = this.info.content.replace(/iframe/g, 'video')
 	}
 }
 </script>