Huanyuyuehui/pages/shop/index.vue

179 lines
5.7 KiB
Vue
Raw Normal View History

2024-03-24 15:23:25 +08:00
<template>
<view class="content">
2024-03-24 18:34:07 +08:00
<view class="top-tab" :style="`padding-top:`+navtop">
2024-03-24 15:23:25 +08:00
<view class="tab-location">
2024-03-24 15:49:14 +08:00
深圳
2024-03-24 15:23:25 +08:00
<view class="iconfont icon-dingwei"></view>
</view>
商家联盟
2024-03-24 17:43:25 +08:00
<view class="tab-sao iconfont icon-saoma" @tap='handleBorcode'></view>
2024-03-24 15:23:25 +08:00
</view>
<view class="content-map" >
2024-03-24 15:33:16 +08:00
<map class="map" :latitude="22.547" :longitude="114.085947"></map>
2024-03-24 18:34:07 +08:00
2024-03-24 15:23:25 +08:00
</view>
<view class="content-type">
2024-03-24 18:34:07 +08:00
<!-- <cover-image src="../annex/static/vipBg.png" style="position: absolute;
top: -20px;"></cover-image> -->
2024-03-24 15:23:25 +08:00
<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>
2024-03-24 17:43:00 +08:00
<text class="type-item-text">休闲娱乐</text>
2024-03-24 15:23:25 +08:00
</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">
2024-03-24 17:43:00 +08:00
<image class="type-item-img" src="@/static/images/shop/tab9.png" mode=""></image>
2024-03-24 15:23:25 +08:00
<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">
2024-03-24 15:41:18 +08:00
<view :class="current==0?'action':''" @click="selectCurrent(0)">全部商家</view>
<view :class="current==1?'action':''" @click="selectCurrent(1)">附近商家</view>
2024-03-24 15:23:25 +08:00
</view>
2024-03-25 10:42:01 +08:00
<view class="list-container" v-if="false">
2024-03-24 15:23:25 +08:00
<view class="list-item" v-for="(item,index) in 20" :key='index'>
2024-03-24 17:43:00 +08:00
<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>
2024-03-24 15:23:25 +08:00
</view>
2024-03-24 15:41:18 +08:00
<view class="list-item-right" @click="navtoDetail()">
2024-03-24 15:23:25 +08:00
<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>
2024-03-25 10:42:01 +08:00
<view class="list-container" v-else>
<view class="list-fail">
<image :src="`${domain}/static/images/noCart.png`"></image>
<view>暂无商家去看看其他的吧</view>
</view>
</view>
2024-03-24 15:23:25 +08:00
</view>
2024-03-24 17:43:00 +08:00
<!--自定义底部tab栏-->
<customTab :newData="newData" :activeRouter="activeRouter"></customTab>
2024-03-24 15:23:25 +08:00
</view>
</template>
<script>
2024-03-25 10:42:01 +08:00
import { HTTP_REQUEST_URL } from '@/config/app';
2024-03-24 17:43:00 +08:00
import { getNavigation } from '@/api/public.js';
import customTab from '@/components/customTab';
2024-03-24 15:23:25 +08:00
export default {
components:{
2024-03-24 17:43:00 +08:00
customTab,
2024-03-24 15:23:25 +08:00
},
data(){
return{
2024-03-25 10:42:01 +08:00
domain: HTTP_REQUEST_URL,
newData: {},
activeRouter: '',
2024-03-24 15:41:18 +08:00
tabList:[],
current:0,
2024-03-24 18:34:07 +08:00
navtop:0,
2024-03-24 15:23:25 +08:00
}
},
onLoad(){
},
2024-03-24 17:43:00 +08:00
onShow(){
this.getNav();
},
created(options) {
2024-03-24 18:34:07 +08:00
let statusBarHeight= uni.getSystemInfoSync().statusBarHeight+"px";
this.navtop=statusBarHeight;
2024-03-24 17:43:00 +08:00
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
let curRoute = routes[routes.length - 1].route //获取当前页面路由
this.activeRouter = '/' + curRoute
},
2024-03-24 15:23:25 +08:00
methods:{
2024-03-24 17:43:00 +08:00
getNav(){
getNavigation().then(res => {
this.newData = res.data
if (this.newData.status && this.newData.status.status) {
uni.hideTabBar()
} else {
uni.showTabBar()
}
})
},
2024-03-24 17:43:25 +08:00
handleBorcode() {
// 从相机和相册扫码
// #ifdef APP-PLUS
uni.scanCode({
scanType:['qrCode'],
success: function (res) {
console.log('二维码信息:' + res);
}
});
// #endif
2024-03-24 17:43:00 +08:00
},
2024-03-24 15:41:18 +08:00
selectCurrent(val){
this.current=val;
},
navtoDetail(){
uni.navigateTo({
url:'/pages/shop_details/index'
})
}
2024-03-24 15:23:25 +08:00
}
}
</script>
<style lang="less" scoped>
@import url("css/shop.css");
</style>