Huanyuyuehui/pages/shop/index.vue

158 lines
5.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="content">
<view class="top-tab">
<view class="tab-location">
深圳
<view class="iconfont icon-dingwei"></view>
</view>
商家联盟
</view>
<view class="content-map" >
<map class="map" :latitude="22.547" :longitude="114.085947"></map>
</view>
<view class="content-type">
<view class="type-item">
<image class="type-item-img" src="@/static/images/shop/tab1.png" mode=""></image>
<text class="type-item-text">餐饮美食</text>
</view>
<view class="type-item">
<image class="type-item-img" src="@/static/images/shop/tab2.png" mode=""></image>
<text class="type-item-text">丽人美妆</text>
</view>
<view class="type-item">
<image class="type-item-img" src="@/static/images/shop/tab3.png" mode=""></image>
<text class="type-item-text">休闲娱乐</text>
</view>
<view class="type-item">
<image class="type-item-img" src="@/static/images/shop/tab4.png" mode=""></image>
<text class="type-item-text">运动健身</text>
</view>
<view class="type-item">
<image class="type-item-img" src="@/static/images/shop/tab5.png" mode=""></image>
<text class="type-item-text">婚庆服务</text>
</view>
<view class="type-item">
<image class="type-item-img" src="@/static/images/shop/tab6.png" mode=""></image>
<text class="type-item-text">亲子</text>
</view>
<view class="type-item">
<image class="type-item-img" src="@/static/images/shop/tab7.png" mode=""></image>
<text class="type-item-text">教育培训</text>
</view>
<view class="type-item">
<image class="type-item-img" src="@/static/images/shop/tab8.png" mode=""></image>
<text class="type-item-text">汽车服务</text>
</view>
<view class="type-item">
<image class="type-item-img" src="@/static/images/shop/tab9.png" mode=""></image>
<text class="type-item-text">家装</text>
</view>
<view class="type-item">
<image class="type-item-img" src="@/static/images/shop/tab10.png" mode=""></image>
<text class="type-item-text">生活服务</text>
</view>
</view>
<view class="content-list">
<view class="list-tab">
<view :class="current==0?'action':''" @click="selectCurrent(0)">全部商家</view>
<view :class="current==1?'action':''" @click="selectCurrent(1)">附近商家</view>
</view>
<view class="list-container">
<view class="list-item" v-for="(item,index) in 20" :key='index'>
<view class="list-item-left" v-if="index==1">
<image src="@/static/images/shop/1.jpg" mode=""></image>
</view>
<view class="list-item-left" v-else-if="index==2">
<image src="@/static/images/shop/2.jpg" mode=""></image>
</view>
<view class="list-item-left" v-else-if="index==3">
<image src="@/static/images/shop/3.png" mode=""></image>
</view>
<view class="list-item-left" v-else>
<image src="@/static/images/shop/4.jpg" mode=""></image>
</view>
<view class="list-item-right" @click="navtoDetail()">
<view class="item-title">
特色餐厅(福田店)
</view>
<view class="item-content">
<view class="right-center-left">
<view class="center-left-score">
<text class="iconfont icon-kongxinxing"></text>
<!-- <text class="iconfont icon-kongxinxing">★</text> -->
<text>4.7分</text>
</view>
<view class="center-left-time">营业时间12:00-24:00</view>
</view>
<view class="right-center-right">
去选购
</view>
</view>
<view class="item-address">
<view class="address">深圳市福田区购物公园cocopark购物中心</view>
<view class="distance">100.23km</view>
</view>
</view>
</view>
</view>
</view>
<!--自定义底部tab栏-->
<customTab :newData="newData" :activeRouter="activeRouter"></customTab>
</view>
</template>
<script>
import { getNavigation } from '@/api/public.js';
import customTab from '@/components/customTab';
export default {
components:{
customTab,
},
data(){
return{
newData: {},
activeRouter: '',
tabList:[],
current:0,
}
},
onLoad(){
},
onShow(){
this.getNav();
},
created(options) {
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
let curRoute = routes[routes.length - 1].route //获取当前页面路由
this.activeRouter = '/' + curRoute
},
methods:{
getNav(){
getNavigation().then(res => {
this.newData = res.data
if (this.newData.status && this.newData.status.status) {
uni.hideTabBar()
} else {
uni.showTabBar()
}
})
},
created(options) {
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
let curRoute = routes[routes.length - 1].route //获取当前页面路由
this.activeRouter = '/' + curRoute
},
selectCurrent(val){
this.current=val;
},
navtoDetail(){
uni.navigateTo({
url:'/pages/shop_details/index'
})
}
}
}
</script>
<style lang="less" scoped>
@import url("css/shop.css");
</style>