|
@@ -1,5 +1,19 @@
|
|
|
<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>
|
|
@@ -8,7 +22,7 @@
|
|
|
<view class=" search-wrap">
|
|
|
<view class="search flex justify-space-between align-item-center flex-between" @click="search">
|
|
|
<view class="left flex">
|
|
|
- <uni-icons type="search" size="24" color="#9199af"></uni-icons>
|
|
|
+ <image class="dSLComVueTopLeftImg" style="width: 30rpx;height: 30rpx;flex: none;" src="@/static/image/card/search.png"></image>
|
|
|
<text class="search-val"> {{searchVal?searchVal:'搜索美食'}}</text>
|
|
|
</view>
|
|
|
|
|
@@ -20,29 +34,24 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="tag-type">
|
|
|
- <uni-tag :circle="true" :text="item.iname" :inverted="inverted"
|
|
|
- style="width: 61px;text-align: center; margin-left: 20px;" v-for='item in jobs' @click="change(item)" />
|
|
|
+ <uni-tag :circle="true" v-for='item in jobs' :text="item.iname" type=''
|
|
|
+ style="width: 61px;text-align: center; margin-left: 20px;" @click="change(item)" />
|
|
|
</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 :up="upOption" :down="downOption" ref="mescrollRef" @init="mescrollInit" @up="upCallback"
|
|
|
- @down="downCallback" :top="250">
|
|
|
+ <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="left">
|
|
|
- <view class='cover'>
|
|
|
- <u--image radius='4' :showLoading="true" :src="item.coverImage" width="80px"
|
|
|
- height="80px"></u--image>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="right">
|
|
|
- <view class='cover'>
|
|
|
- <u--image radius='4' :showLoading="true" :src="item.indoorImage" width="80px"
|
|
|
+ <view style='width:100vw;' class="left flex">
|
|
|
+ <view v-for='item1 in item.foodDishesInfoList' @click.stop='previewImg(item1)' style='margin:10rpx;'>
|
|
|
+ <u--image radius='4' :showLoading="true" :src="item1.dishImage" width="80px"
|
|
|
height="80px"></u--image>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class='flex row2'>
|
|
@@ -55,7 +64,7 @@
|
|
|
<text class="text" v-for='item1 in item.labels'> {{item1}}</text>
|
|
|
</view>
|
|
|
<view class='address flex justify-space-between'>
|
|
|
- <view class='flex'>
|
|
|
+ <view style='width:60vw;' class='flex'>
|
|
|
<view class='iconfont applet-dizhi'></view>
|
|
|
<view class="detailedAddress">
|
|
|
{{item.detailedAddress}}
|
|
@@ -63,8 +72,8 @@
|
|
|
<!-- <view>{{item.province}}{{item.city}}{{item.area}}</view> -->
|
|
|
|
|
|
</view>
|
|
|
- <view style="color: #888;">
|
|
|
- {{item.distance}}km
|
|
|
+ <view style="color: #888;width:40vw;text-align:right;">
|
|
|
+ {{item.distance1>1000?item.distance:item.distance1}} {{item.distance1>1000?'km':'m'}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -83,6 +92,8 @@
|
|
|
var qqmapsdk = new QQMapWX({
|
|
|
key: 'HQ6BZ-RMALQ-TGF5H-BXJQB-UFYN3-Q5BYM'
|
|
|
});
|
|
|
+
|
|
|
+ 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";
|
|
|
import {
|
|
@@ -90,7 +101,8 @@
|
|
|
} from '@/util/util.js'
|
|
|
export default {
|
|
|
components: {
|
|
|
- MoteLinesDivide
|
|
|
+ MoteLinesDivide,
|
|
|
+ uniTag
|
|
|
},
|
|
|
mixins: [MescrollMixin],
|
|
|
data() {
|
|
@@ -120,31 +132,38 @@
|
|
|
}, {
|
|
|
name: '距离最近',
|
|
|
value: '2'
|
|
|
- }, {
|
|
|
- name: '最多点赞',
|
|
|
- value: '3'
|
|
|
- }, {
|
|
|
- name: '我的收藏',
|
|
|
- value: '4'
|
|
|
- }],
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // name: '最多点赞',
|
|
|
+ // value: '3'
|
|
|
+ // }, {
|
|
|
+ // name: '我的收藏',
|
|
|
+ // value: '4'
|
|
|
+ // },
|
|
|
+ ],
|
|
|
jobs: [{
|
|
|
id: 1,
|
|
|
iname: '海鲜',
|
|
|
+ checked:false
|
|
|
},
|
|
|
{
|
|
|
id: 2,
|
|
|
- iname: '自助'
|
|
|
+ iname: '自助',
|
|
|
+ checked:false
|
|
|
}, {
|
|
|
id: 3,
|
|
|
iname: '烧烤',
|
|
|
+ checked:false
|
|
|
},
|
|
|
{
|
|
|
id: 4,
|
|
|
iname: '火锅',
|
|
|
+ checked:false
|
|
|
},
|
|
|
{
|
|
|
id: 5,
|
|
|
- iname: '家常菜'
|
|
|
+ iname: '家常菜',
|
|
|
+ checked:false
|
|
|
}
|
|
|
],
|
|
|
upOption: {
|
|
@@ -167,9 +186,23 @@
|
|
|
onShow() {
|
|
|
//判断是否有定位权限
|
|
|
this.searchVal = uni.getStorageSync("search_val")
|
|
|
- this.isdingwei()
|
|
|
+ if(this.detailedAddress=='正在定位...'){
|
|
|
+ this.isdingwei()
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ leftClick(){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pageA/food/fondMap"
|
|
|
+ })
|
|
|
+ },
|
|
|
+ previewImg(item){
|
|
|
+ uni.previewImage({
|
|
|
+ current: 0,
|
|
|
+ urls: [item.dishImage],
|
|
|
+ loop:true,
|
|
|
+ })
|
|
|
+ },
|
|
|
toShop(val){
|
|
|
uni.navigateTo({
|
|
|
url: "/pageA/food/menu?val="+JSON.stringify(val)
|
|
@@ -340,28 +373,20 @@
|
|
|
that.totalPage = res.data.total;
|
|
|
})
|
|
|
if (that.handleList.length > 0) {
|
|
|
- for (var i = 0; i < that.handleList.length; i++) {
|
|
|
-
|
|
|
- that.handleList[i].latitude = that.handleList[i].location.split(',')[0]
|
|
|
- that.handleList[i].longitude = that.handleList[i].location.split(',')[1]
|
|
|
- var data = await that.getDistance(that.handleList[i].latitude, that.handleList[i].longitude)
|
|
|
- that.handleList[i].distance = (data.distance / 1000).toFixed(2)
|
|
|
- if (that.handleList[i].label) {
|
|
|
- that.handleList[i].labels = that.handleList[i].label.split(",")
|
|
|
- }
|
|
|
- // if (i == that.handleList.length - 1) {
|
|
|
- // setTimeout(() => {
|
|
|
- // console.log(that.handleList)
|
|
|
- // that.findList = that.handleList
|
|
|
- // that.loading = false
|
|
|
- // that.$nextTick(() => {
|
|
|
- // that.mescroll.endBySize(that.curPageLen, that.totalPage)
|
|
|
- // });
|
|
|
-
|
|
|
- // uni.hideLoading()
|
|
|
- // }, 100)
|
|
|
- // }
|
|
|
- }
|
|
|
+ // for (var i = 0; i < that.handleList.length; i++) {
|
|
|
+
|
|
|
+ // that.handleList[i].latitude = that.handleList[i].location.split(',')[0]
|
|
|
+ // that.handleList[i].longitude = that.handleList[i].location.split(',')[1]
|
|
|
+ // var data = await that.getDistance(that.handleList[i].latitude, that.handleList[i].longitude)
|
|
|
+ // that.handleList[i].distance1 = JSON.parse(JSON.stringify(data.distance))
|
|
|
+ // that.handleList[i].distance = (data.distance / 1000).toFixed(2)
|
|
|
+ // 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)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
that.findList = that.handleList
|
|
|
|
|
|
} else {
|
|
@@ -431,6 +456,7 @@
|
|
|
margin: 10rpx;
|
|
|
border-radius: 20rpx;
|
|
|
padding: 20rpx;
|
|
|
+ font-size:32rpx;
|
|
|
.row2{
|
|
|
margin: 20rpx 0;
|
|
|
}
|
|
@@ -465,6 +491,7 @@
|
|
|
|
|
|
.applet-dizhi {
|
|
|
color: #393733;
|
|
|
+ font-size:38rpx;
|
|
|
}
|
|
|
|
|
|
.group {
|
|
@@ -544,5 +571,8 @@
|
|
|
}
|
|
|
.tag-type{
|
|
|
background: #fff;
|
|
|
+ uni-tag{
|
|
|
+ margin-left:20rpx !important;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|