achao 1 سال پیش
والد
کامیت
fa3cf05671

+ 1 - 1
uni_applet/App.vue

@@ -30,7 +30,7 @@
 		background-color: #F2F6F9;
 	}
 	.content{
-		padding-bottom:150rpx;
+		// padding-bottom:0rpx;
 	}
 	.wrap{
 		background:#fff;

+ 3 - 2
uni_applet/pageA/food/fondMap.vue

@@ -6,7 +6,7 @@
 		<view class="floatBtn" :style="{bottom:(currentHeight+20)+'px'}" @click="onControltap">
 			<view class="header-avatar">
 			<image class="cover-image" src="@/static/image/food/dw.png"></image>
-			</view>
+			</view> 
 		</view>
 		<bab-Touchbox :minHeight="0.25" :maxHeight="0.7" :touchHeight="40" @currentHeight="setScrollHeight"
 			@maxtHeight="setScrollViewHeight">
@@ -244,7 +244,7 @@
 					})
 				})
 			},
-			async getStationList() {debugger
+			async getStationList() {
 				this.mapList = []
 				const data = await this.getList()
 				console.log('queryStationInfos,信息列表显示总数据', data);
@@ -314,6 +314,7 @@
 			},
 			setScrollHeight(val) { // 实时返回的滑动组件高度
 				this.currentHeight = val
+				console.log(this.currentHeight)
 			},
 			setScrollViewHeight(val) { //最大高度
 				this.scrollViewHeight = val

+ 163 - 156
uni_applet/pages/food/food.vue

@@ -1,59 +1,51 @@
 <template>
 	<view class="content">
-		<u-navbar
-		            title="美食推荐"
-		            :safeAreaInsetTop="true"
-					placeholder='true'
-					fixed
-		        >
-		            <view
-		                class="u-nav-slot"
-		                slot="left"
-						@click='leftClick'
-		            >
-		               <view class="iconfont applet-colors-ditu"></view>
-		            </view>
-		        </u-navbar>
-		<view class="flex content1">
-			<view @click='placeSelect' class='address flex'>
-				<view class='detailedAddress'>{{detailedAddress}}</view>
-				<view class='iconfont applet-xiala'></view>
+		<u-navbar title="美食推荐" :safeAreaInsetTop="true" placeholder='true' fixed>
+			<view class="u-nav-slot" slot="left" @click='leftClick'>
+				<view class="iconfont applet-colors-ditu"></view>
 			</view>
-			<view class=" search-wrap">
-				<view class="search flex justify-space-between align-item-center flex-between" @click="search">
-					<view class="left flex">
-						<image class="dSLComVueTopLeftImg" style="width: 30rpx;height: 30rpx;flex: none;" src="@/static/image/card/search.png"></image>
-						<text class="search-val"> {{searchVal?searchVal:'搜索美食'}}</text>
+		</u-navbar>
+			<mescroll-uni :up="upOption" :down="downOption" ref="mescrollRef" @init="mescrollInit"
+				@up="upCallback" @down="downCallback" :top="200">
+				
+				<view class="flex content1">
+					<view @click='placeSelect' class='address flex'>
+						<view class='detailedAddress'>{{detailedAddress}}</view>
+						<view class='iconfont applet-xiala'></view>
 					</view>
-
-					<view class="right">
-						<image style='width:32rpx;height:32rpx;' v-if="searchVal" @click.stop="delSearchVal"
-							src="@/static/image/card/searchdel.png" mode="widthFix"></image>
+					<view class="search-wrap">
+						<view class="search flex justify-space-between align-item-center flex-between" @click="search">
+							<view class="left flex">
+								<image class="dSLComVueTopLeftImg" style="width: 40rpx;height: 40rpx"
+									src="@/static/image/card/search.png"></image>
+								<text class="search-val"> {{searchVal?searchVal:'搜索美食'}}</text>
+							</view>
+				
+							<view class="right">
+								<image style='width:32rpx;height:32rpx;' v-if="searchVal" @click.stop="delSearchVal"
+									src="@/static/image/card/searchdel.png" mode="widthFix"></image>
+							</view>
+						</view>
 					</view>
 				</view>
-			</view>
-		</view>
-		<view class="tag-type head">
-			<view v-for='item in jobs' @click="change(item)" class="item" :class="item.checked?'item-active':''">
-				{{item.iname}}
-			</view>
-		</view>
-		<scroll-view scroll-x="true" scroll-with-animation="true" class='list-type'>
-			<view v-for='item in searchTypes' @click='changetype(item)'
-				:class='searchType==item.value?"Semibold active":"Regular"' class="typeitem">{{item.name}}</view>
-		</scroll-view>
-		<view>
-			<mescroll-uni height="1200" :up="upOption" :down="downOption" ref="mescrollRef" @init="mescrollInit" @up="upCallback"
-				@down="downCallback" >
-				<view class='findItem' v-for='item in findList' @click="toShop(item)">
-					<view style='align-items: flex-start;' class='flex'>
+				<view class="tag-type head">
+					<view v-for='item in jobs' @click="change(item)" class="item" :class="item.checked?'item-active':''">
+						{{item.iname}}
+					</view>
+				</view>
+				<scroll-view scroll-x="true" scroll-with-animation="true" class='list-type'>
+					<view v-for='item in searchTypes' @click='changetype(item)'
+						:class='searchType==item.value?"Semibold active":"Regular"' class="typeitem">{{item.name}}</view>
+				</scroll-view>
+				<view class='findItem' v-for='item in findList' @click="toShop(item)" v-if="item.foodDishesInfoList&&item.foodDishesInfoList.length!=0">
+					<view style='align-items: flex-start;' class='flex' >
 						<view style='width:100vw;' class="left flex">
-							 <!-- @click.stop='previewImg(item1)' -->
-							<view v-for='item1 in item.foodDishesInfoList' style='margin:10rpx;'>
-								<u--image  radius='4' :showLoading="true" :src="item1.dishImage" width="80px"
-									height="80px"></u--image>
+							<!-- @click.stop='previewImg(item1)' -->
+							<view v-for='item1 in item.foodDishesInfoList' class="img">
+								<u--image radius='4' :showLoading="true" :src="item1.dishImage" width="150rpx"
+									height="150rpx" ></u--image>
 							</view>
-								
+
 						</view>
 					</view>
 					<view class='flex row2'>
@@ -72,16 +64,16 @@
 								{{item.detailedAddress}}
 							</view>
 							<!-- <view>{{item.province}}{{item.city}}{{item.area}}</view> -->
-							
+
 						</view>
-						<view style="color: #888;width:40vw;text-align:right;">
-							{{item.distance1>1000?item.distance:item.distance1}} {{item.distance1>1000?'km':'m'}}
+						<view style="color: #999;width:40vw;text-align:right;">
+							距离{{item.distance1>1000?item.distance:item.distance1}} {{item.distance1>1000?'km':'m'}}
 						</view>
 					</view>
 				</view>
 			</mescroll-uni>
 			<!-- <mescroll-body ref="mescrollRef" :up="upOption" :down="downOption" @init="mescrollInit" @up="upCallback" @down="downCallback"></mescroll-body> -->
-		</view>
+
 		<!-- <view class='group' @click='group'>
 			<button class="tuan">团</button>
 		</view> -->
@@ -91,7 +83,7 @@
 <script>
 	var that;
 	var GDMapWX = require('@/js_sdk/js-amap/amap-wx.130.js');
-	
+
 	import uniTag from '@/uni_modules/uni-tag/components/uni-tag/uni-tag.vue';
 	import MoteLinesDivide from "@/components/text-over-flow/text-over-flow.vue"
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
@@ -107,7 +99,7 @@
 		data() {
 			return {
 				place: '',
-				searchVal:  "",
+				searchVal: "",
 				current: 0,
 				mescroll: null,
 				findList: [],
@@ -126,43 +118,43 @@
 					textColor: '#bbb'
 				},
 				searchTypes: [{
-					name: '默认排序',
-					value: '1'
-				}, {
-					name: '距离最近',
-					value: '2'
-				},
-				// {
-				// 	name: '最多点赞',
-				// 	value: '3'
-				// }, {
-				// 	name: '我的收藏',
-				// 	value: '4'
-				// },
+						name: '默认排序',
+						value: '1'
+					}, {
+						name: '距离最近',
+						value: '2'
+					},
+					// {
+					// 	name: '最多点赞',
+					// 	value: '3'
+					// }, {
+					// 	name: '我的收藏',
+					// 	value: '4'
+					// },
 				],
 				jobs: [{
 						id: 1,
 						iname: '海鲜',
-						checked:false
+						checked: false
 					},
 					{
 						id: 2,
 						iname: '自助',
-						checked:false
+						checked: false
 					}, {
 						id: 3,
 						iname: '烧烤',
-						checked:false
+						checked: false
 					},
 					{
 						id: 4,
 						iname: '火锅',
-						checked:false
+						checked: false
 					},
 					{
 						id: 5,
 						iname: '家常菜',
-						checked:false
+						checked: false
 					},
 					{
 						id: 6,
@@ -200,29 +192,29 @@
 		onShow() {
 			//判断是否有定位权限
 			this.searchVal = uni.getStorageSync("search_val")
-			if(this.detailedAddress=='正在定位...'){
+			if (this.detailedAddress == '正在定位...') {
 				this.isdingwei()
 			}
 		},
 		methods: {
-			leftClick(){
+			leftClick() {
 				uni.navigateTo({
 					url: "/pageA/food/fondMap"
 				})
 			},
-			previewImg(item){
+			previewImg(item) {
 				uni.previewImage({
-					current: 0,    
+					current: 0,
 					urls: [item.dishImage],
-					loop:true,
+					loop: true,
 				})
 			},
-			toShop(val){
+			toShop(val) {
 				uni.navigateTo({
-					url: "/pageA/food/menu?val="+JSON.stringify(val)
+					url: "/pageA/food/menu?val=" + JSON.stringify(val)
 				})
 			},
-			delSearchVal(){
+			delSearchVal() {
 				this.searchVal = ''
 				that.mescroll.resetUpScroll()
 			},
@@ -252,36 +244,21 @@
 					}
 					this.longitude = _obj.longitude
 					this.latitude = _obj.latitude
-					var amapPluginInstance = new GDMapWX.AMapWX({	
-									key: '6bafe91754a563ff2b7c02542c1ef4e8'
-								});
-							   amapPluginInstance.getRegeo({
-							      success: function(res){
-									  console.log(res)
-									  		that.detailedAddress = res[0].desc
-									  		that.mescroll.resetUpScroll()
-							        //成功回调
-							      },
-							      fail: function(info){
-							        //失败回调
-							        console.log(info)
-							      }
-							    })
-					// qqmapsdk.reverseGeocoder({
-					// 	location: _obj,
-					// 	success: function(res) {
-					// 		console.log(res)
-					// 		that.detailedAddress = res.result.formatted_addresses.recommend
-					// 		that.mescroll.resetUpScroll()
-					// 	},
-					// 	fail: function(error) {
-					// 		console.error(error);
-					// 	},
-					// 	complete: function(res) {
-					// 		// console.log(res);
-					// 	}
-
-					// })
+					var amapPluginInstance = new GDMapWX.AMapWX({
+						key: '6bafe91754a563ff2b7c02542c1ef4e8'
+					});
+					amapPluginInstance.getRegeo({
+						success: function(res) {
+							console.log(res)
+							that.detailedAddress = res[0].desc
+							that.mescroll.resetUpScroll()
+							//成功回调
+						},
+						fail: function(info) {
+							//失败回调
+							console.log(info)
+						}
+					})
 
 				})
 			},
@@ -386,8 +363,8 @@
 					searchType: this.searchType,
 					searchKeyWord: this.searchVal,
 					place: this.detailedAddress,
-					userLongitude:this.longitude,
-					userLatitude:this.latitude,
+					userLongitude: this.longitude,
+					userLatitude: this.latitude,
 				}, failres => {
 					uni.showToast({
 						icon: "none",
@@ -413,12 +390,12 @@
 						if (that.handleList[i].label) {
 							that.handleList[i].labels = that.handleList[i].label.split(",")
 						}
-						if(that.handleList[i].foodDishesInfoList){
-							that.handleList[i].foodDishesInfoList = that.handleList[i].foodDishesInfoList.splice(0,3)
+						if (that.handleList[i].foodDishesInfoList) {
+							that.handleList[i].foodDishesInfoList = that.handleList[i].foodDishesInfoList.splice(0, 4)
 						}
 					}
 					that.findList = that.handleList
-					
+
 				} else {
 					uni.hideLoading()
 				}
@@ -446,27 +423,30 @@
 			// color: #9199af;
 			// background: #f9d27d;
 			border-radius: 50rpx;
-			padding: 10rpx 0 10rpx 30rpx;
+			padding: 15rpx 0 15rpx 30rpx;
 			box-sizing: border-box;
 			margin-right: 20rpx;
+		
 		}
 
 		.left {
 			width: 80%;
 
 			text {
-				height: 46rpx;
 				white-space: nowrap;
 				overflow: scroll;
 				position: relative;
 				margin-left: 20rpx;
-				color: #9199af;
+				color: #BBBBBB;
+				display: flex;
+				    align-items: center;
 			}
 		}
 
 		.right {
 			// width:14%;
-			margin-right: 20rpx
+			// margin-right: 20rpx
+			display: flex;
 		}
 	}
 
@@ -475,6 +455,12 @@
 		background: rgb(249, 249, 249);
 		// border: 1px solid #f9d27d;
 		border-radius: 50rpx;
+		.left{
+			align-items: center;
+		}
+		.search-val{
+			color:#BBBBBB;
+		}
 	}
 
 	.address {
@@ -483,24 +469,24 @@
 
 	.findItem {
 		background: #fff;
-		margin: 10rpx;
+		margin: 20rpx;
 		border-radius: 20rpx;
 		padding: 20rpx;
-		font-size:32rpx;
-		.row2{
+		font-size: 32rpx;
+
+		.row2 {
 			margin: 20rpx 0;
 		}
-		.left {
-			margin-right: 20rpx;
 
-			.cover {
-				border-radius: 8rpx;
-			}
+		.left {
+			// background: red;
 		}
 
 		.name {
 			color: #333;
 			margin-left: 10rpx;
+			font-weight: 700;
+			font-size: 36rpx;
 		}
 
 		.description {
@@ -509,19 +495,26 @@
 		}
 
 		.address {
-			margin-top: 20rpx;
+			margin-top: 30rpx;
 			width: 100%;
 			color: #393733;
 		}
+		.img{
+			margin: 10rpx;
+		}
 	}
 
 	.applet-dianpu1 {
-		color: #999999;
+		color: #393733;
+		font-size: 50rpx;
+		
 	}
 
 	.applet-dizhi {
 		color: #393733;
-		font-size:38rpx;
+		font-size: 40rpx;
+		position: relative;
+		top: -2rpx;
 	}
 
 	.group {
@@ -538,8 +531,7 @@
 		color: #fff;
 	}
 
-	.applet-colors-tianjia2 {
-	}
+	.applet-colors-tianjia2 {}
 
 	// .text {
 	// 	font-size: 26rpx;
@@ -548,41 +540,42 @@
 	// 	opacity: 0.5;
 	// 	margin-right: 56rpx;
 	// }
-	.head{
+	.head {
 		white-space: nowrap;
 		overflow-x: scroll;
 		padding-left: 20rpx;
 		width: calc(100vw);
-				
+
 		box-sizing: border-box;
-		
-			.item {
-				display: inline-block;
-				background: #e9eaec;
-				color: #566068;
-				padding: 10rpx 26rpx;
-				margin-right: 20rpx;
-				border-radius: 20rpx;
-				font-size: 24rpx;
-			}
+
+		.item {
+			display: inline-block;
+			background: #F0F0F0;
+			color: #999;
+			padding: 10rpx 26rpx;
+			margin-right: 20rpx;
+			border-radius: 50rpx;
+			font-size: 24rpx;
+		}
 	}
+
 	.tag-type {
-		.text{
+		.text {
 			border-radius: 4px;
-			background-color: rgba(253, 242, 229, 1);
-			color: rgba(233, 87, 0, 1);
+			background-color: #FDF2E5;
+			color: #E95700;
 			margin-right: 30rpx;
-			padding: 10rpx 20rpx;
+			padding: 10rpx 26rpx;
 			font-size: 24rpx;
 		}
-		
+
 	}
 
 	.list-type {
 		background: #fff;
 		width: 100vw;
 		padding-top: 5px;
-		height: 86rpx;
+		height: 88rpx;
 		overflow-x: scroll;
 		white-space: nowrap;
 	}
@@ -598,6 +591,7 @@
 
 	.typeitem.active {
 		color: #eaad1a;
+		font-size: 32rpx;
 	}
 
 	.typeitem.active:after {
@@ -607,22 +601,35 @@
 		height: 3px;
 		bottom: 0;
 		background: #eaad1a;
-		width: 18px;
+		width: 44rpx;
 		left: 50%;
 		transform: translateX(-50%);
 	}
-	.detailedAddress{
+
+	.detailedAddress {
 		width: 70vw;
 		overflow: hidden;
 		text-overflow: ellipsis;
+		white-space: nowrap;
+		color:#999 ;
+		line-height: 40rpx;
 	}
-	.tag-type{
+
+	.tag-type {
 		background: #fff;
-		uni-tag{
-			margin-left:20rpx !important;
+
+		uni-tag {
+			margin-left: 20rpx !important;
 		}
 	}
-	.applet-colors-ditu{
+
+	.applet-colors-ditu {
 		font-size: 40rpx;
 	}
+	/deep/.mescroll-upwarp {
+		padding: 30rpx 0;
+	}
+	.applet-xiala{
+		margin: 0 16rpx 0 -4px;
+	}
 </style>

+ 7 - 6
uni_applet/uni_modules/bab-Touchbox/components/bab-Touchbox/bab-Touchbox.vue

@@ -92,11 +92,11 @@
 				  //#endif
 				// console.log(screenY)
 				// 这里特殊处理 解决:在滑动框内如果存在滚动元素,则会出现滑动时滑动框和内部滚动同时滑的问题
-				if (this.touchHeight !== 0) {
-					if (screenY - this.fixboxtop > this.touchHeight) {
-						return false;
-					}
-				}
+				// if (this.touchHeight !== 0) {
+				// 	if (screenY - this.fixboxtop > this.touchHeight) {
+				// 		return false;
+				// 	}
+				// }
 				this.isend = false
 				if (this.isfirst) {
 					this.isfirst = false
@@ -105,7 +105,8 @@
 				this.fixboxtop = screenY - this.tapboxtop
 				if (this.fixboxtop > this.firsttop) { // 往下滑 不允许
 					this.fixboxtop = this.firsttop
-				} else { // 往上滑
+				} else { 
+					// 往上滑
 					if (this.fixboxtop <= this.windowHeight * (1 - this.maxHeight)) {
 						this.fixboxtop = this.windowHeight * (1 - this.maxHeight)
 					}