根据定位判断显示内容

This commit is contained in:
赵毅 2025-09-09 17:33:35 +08:00
parent 56c189f406
commit e13cf87f87
3 changed files with 600 additions and 182 deletions

View File

@ -0,0 +1,386 @@
page {
background-color: #fff;
}
.header {
display: flex;
align-items: center;
position: relative;
z-index: 1;
}
.header_tit {
flex: 1;
text-align: center;
position: relative;
z-index: 0;
}
.header .u-icon {
position: relative;
z-index: 2;
padding: 20rpx;
margin-left: 10rpx;
}
.localBox {
font-size: 26rpx;
color: #222222;
box-sizing: border-box;
width: 100%;
padding-bottom: 20rpx;
background-color: #f6f7fb;
}
.localBoxItem{
width: 100%;
display: flex;
align-items: center;
padding: 0 20rpx;
background-color: #fff;
}
.local {
display: flex;
width: auto;
white-space: nowrap;
}
#local {
height: 30rpx;
width: 28.08rpx;
margin-right: 17rpx;
}
.u-icon {
margin-left: 10rpx;
}
.search {
flex: 1;
padding: 20rpx 0;
margin-left: 15rpx;
}
.searchBox {
width: 93%;
height: 70rpx;
background: #f6f7fb;
border-radius: 100rpx;
display: flex;
box-sizing: border-box;
align-items: center;
padding-left: 30rpx;
padding-right: 30rpx;
}
.searchBox image {
width: 30rpx;
height: 30rpx;
margin-right: 16rpx;
}
.swiperBox {
height: 350rpx;
width: 100%;
position: relative;
}
.swiper {
height: 350rpx;
width: 100%;
/* position: relative; */
}
.navList {
display: flex;
flex-wrap: wrap;
box-sizing: border-box;
height: 350rpx;
width: 100%;
padding: 30rpx 20rpx;
background-color: #fff;
margin-top: 20rpx;
}
.navItem {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 116rpx;
height: 105rpx;
margin-right: 34rpx;
margin-bottom: 43rpx;
}
.navItemImg {
width: 70rpx;
height: 70rpx;
display: flex;
justify-content: center;
align-items: center;
}
.navItem image {
width: 70rpx;
height: 70rpx;
}
.navItem:nth-child(5n) {
margin-right: 0;
}
.dot {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20rpx;
position: absolute;
left: 50%;
bottom: 25rpx;
transform: translateX(-50%);
}
.dotItem {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background-color: #E6E6E6;
margin-right: 5rpx;
}
.actives {
width: 20rpx;
height: 8rpx;
background: #FF370B;
border-radius: 10rpx 10rpx 10rpx 10rpx;
}
.scrollBox {
background-color: #f6f7fb;
padding-bottom: 25rpx;
padding-top: 20rpx;
}
.scrollView {
display: flex;
align-items: center;
flex-wrap: nowrap;
padding: 0 14rpx;
}
.scroll-viewItem {
display: flex;
white-space: nowrap;
height: 54rpx;
background: #FFFFFF;
border-radius: 10rpx 10rpx 10rpx 10rpx;
border: 1rpx solid #FFFFFF;
padding: 10rpx 18rpx;
margin-right: 10rpx;
position: relative;
display: flex;
align-items: center;
}
.scroll-viewItem image {
width: 22rpx;
height: 22rpx;
position: absolute;
left: 7rpx;
top: 5rpx;
}
.btnList {
width: 389rpx;
height: 119rpx;
background: #FFFFFF;
border-radius: 100rpx 100rpx 100rpx 100rpx;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 200rpx;
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
}
.btnList_after {
width: 389rpx;
height: 119rpx;
filter: blur(8.600000381469727rpx);
background: rgba(0, 0, 0, 0.3);
border-radius: 100rpx 100rpx 100rpx 100rpx;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 200rpx;
border-radius: 100rpx 100rpx 100rpx 100rpx;
}
.btn_left {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #000000;
}
.btn_left image {
width: 47.97rpx;
height: 44.79rpx;
margin-bottom: 6rpx;
}
.btn_right {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #000000;
}
.btn_right image {
height: 47rpx;
width: 47rpx;
margin-bottom: 6rpx;
}
.line {
width: 1rpx;
height: 82rpx;
border-image: linear-gradient(90deg, rgba(255, 255, 255, 1), rgba(215, 215, 215, 1), rgba(255, 255, 255, 1)) 1 1;
}
.lines {
background-color: #f5f7f9;
height: 40rpx;
width: 100%;
}
.merchantList {
padding: 0 20rpx;
width: 100%;
box-sizing: border-box;
}
.merchantItem {
display: flex;
padding-top: 30px;
padding-bottom: 30rpx;
border-bottom: 1rpx solid #EBEBEB;
;
}
.merchantItem_left {
width: 180rpx;
height: 180rpx;
border-radius: 20rpx 20rpx 20rpx 20rpx;
overflow: hidden;
margin-right: 24rpx;
}
.merchantItem_left image {
width: 100%;
height: 100%;
}
.merchantItem_right {
flex: 1;
}
.merchantItem_right_tit {
display: flex;
align-items: center;
justify-content: space-between;
}
.merchantItem_right_tit_left {
font-size: 30rpx;
color: #222222;
}
.merchantItem_right_tit_right {
font-size: 24rpx;
color: #555555;
}
.merchantItem_right_con {
margin-top: 14rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.merchangtItem_tag {
font-size: 22rpx;
color: #555555;
padding: 5rpx 12rpx;
white-space: nowrap;
background: rgba(255, 81, 42, 0.1);
border-radius: 100rpx 100rpx 100rpx 100rpx;
display: inline-block;
margin-top: 20rpx;
margin-right: 10rpx;
}
.startList {
display: flex;
align-items: center;
}
.startList image {
width: 22rpx;
height: 22rpx;
margin-right: 3rpx;
}
.merchantItem_right_con_right {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #000000;
}
.merchantItem_right_con_right image {
width: 32rpx;
height: 28.59rpx;
margin-bottom: 6rpx;
}
.merchantItem_right_add {
font-size: 24rpx;
color: #999999;
margin-top: 14rpx;
}
.empty {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-weight: normal;
font-size: 28rpx;
color: #999999;
margin-top: 110rpx;
width: 100%;
}
.empty image {
width: 366rpx;
height: 226rpx;
margin-bottom: 27rpx;
}

View File

@ -1,3 +1,23 @@
.not_found_404 {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 80vh;
}
.not_found_text {
font-size: 80rpx;
font-weight: bold;
color: #000;
}
.not_found_desc {
font-size: 40rpx;
font-weight: 400;
color: #000;
}
.container { .container {
background-color: #f9f9f9; background-color: #f9f9f9;
} }

View File

@ -1,216 +1,228 @@
<template> <template>
<view class="container" :style="{ marginTop: top + 'px' }" v-if="loading"> <view>
<view class="white_container"> <view v-if="currentCity && currentCity.cityName && currentCity.cityName != '衡水市'">
<!-- 城市信息部分 --> <view class="not_found_404">
<view class="searchBox" :style="{ height: localHeight + 'px' }"> <text class="not_found_text">404</text>
<view class="searchBox_add" @tap="map"> <text class="not_found_desc">当前城市暂未开通服务</text>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/Index_add.png" mode="widthFix" /> </view>
<view> </view>
{{ currentCity.cityName || '选择城市' }} <view v-else>
</view> <view class="container" :style="{ marginTop: top + 'px' }" v-if="loading">
</view> <view class="white_container">
<!-- 城市信息部分 -->
<!-- 搜索框 --> <view class="searchBox" :style="{ height: localHeight + 'px' }">
<view class="search2" v-if="isShowSearch"> <view class="searchBox_add" @tap="map">
<view class="searchBox2"> <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/Index_add.png" mode="widthFix" />
<image <view>
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png" {{ currentCity.cityName || '选择城市' }}
mode="aspectFill"></image>
<view class="hot-word-container">
<view class="hot-word-scroll" :style="{ transform: 'translateY(' + scrollPosition + 'rpx)' }">
<view v-for="(word, index) in hotWord" :key="index" class="hot-word-item"
@click="handleHotWordClick(word)">
{{ word }}
</view>
</view> </view>
</view> </view>
<input class="search_input" placeholder='请输入内容' confirm-type='search' @input="searchInput"
@confirm="searchInput" :value="selectKeyWord" />
</view>
</view>
</view>
<!-- 功能导航区 -->
<view class="function-nav" v-if="showNav">
<view class="function-item" @click="goToShop">
<view class="icon-box">
<image class="iconImg" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/index_shop.png"
mode="widthFix" />
</view>
<text>店铺管理</text>
</view>
<view class="function-item" @click="goToOrder">
<view class="icon-box">
<image class="iconImg" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/index_order.png"
mode="widthFix" />
</view>
<text>供应商订单</text>
</view>
<view class="function-item" @click="goToWuye">
<view class="icon-box">
<image class="iconImg" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/index_wuye.png"
mode="widthFix" />
</view>
<text>物业管理</text>
</view>
</view>
<!-- 轮播图 -->
<view class="swiper">
<swiper @animationfinish="swipers" autoplay circular>
<!-- <swiper-item v-for="(item, index) in bannerList" :key="index" @click="headerServerClick(item)"> -->
<swiper-item v-for="(item, index) in bannerList" :key="index">
<image :src="item.pic_src" mode="aspectFill" />
</swiper-item>
</swiper>
<view class="cirList"> <!-- 搜索框 -->
<view :class="['cir', currentIdx == index ? 'active' : '']" v-for="(item, index) in bannerList" :key="index"> <view class="search2" v-if="isShowSearch">
</view> <view class="searchBox2">
</view> <image
</view> src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"></image>
<!-- 宫格列表 --> <view class="hot-word-container">
<view class="tabList"> <view class="hot-word-scroll" :style="{ transform: 'translateY(' + scrollPosition + 'rpx)' }">
<u-grid :col="rowNum" :border="false"> <view v-for="(word, index) in hotWord" :key="index" class="hot-word-item"
<u-grid-item v-for="(item, index) in tabList" @click="headerServerClick(item)" :key="index"> @click="handleHotWordClick(word)">
<image class="grid_Pic" :src="item.icon_src" mode=""></image> {{ word }}
<text>{{ item.title }}</text> </view>
</u-grid-item> </view>
</u-grid> </view>
</view> <input class="search_input" placeholder='请输入内容' confirm-type='search' @input="searchInput"
</view> @confirm="searchInput" :value="selectKeyWord" />
</view>
<!-- 广告横幅 -->
<view class="serverList1">
<view class="serverList1_left">
<!-- <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/index_ad_left.jpg" mode="aspectFit" /> -->
<image :src="serverLeft" mode="aspectFit" />
</view>
<view class="serverList1_right">
<view :class="['serverItemRight', `serverItemRight${index + 1}`]" @tap="headerServerClick(item)"
v-for="(item, index) in serverRightList" :key="index">
<image :src="item.pic_src" mode="" />
<!-- <view>{{ item.ad_position }}</view> -->
</view>
</view>
</view>
<view class="white_container margin_top20 padding_bottom32">
<view v-if="!currentCity.district" class="Tit">定位错误 未知区域</view>
<view v-else class="Tit">
<view class="local">{{ currentCity.district }}</view>附近
<view class="Tit_desc">一刻钟便利生活圈</view>
</view>
<view class="serverList">
<view class="serverList_left">
<swiper>
<swiper-item v-for="(item, index) in homeLeftList" :key="index" @click="headerServerClick(item)">
<image :src="item.pic_src" alt="" />
<!-- <view>{{ item.ad_position }}</view> -->
</swiper-item>
</swiper>
</view>
<view class="serverList_right">
<view class="serverList_right1">
<view :class="['serverItem', `serverItem${index + 1}`]" @click="headerServerClick2(item)"
v-for="(item, index) in homeRightList1" :key="index">
<view class="serverTit">{{ item.title }}</view>
<image v-if="item.pic_src" :src="item.pic_src" mode="" />
<!-- <view>{{ item.ad_position }}</view> -->
</view> </view>
</view> </view>
<view class="serverList_right2"> <!-- 功能导航区 -->
<view :class="['serverItem', `serverItem${index + 4}`]" @click="headerServerClick2(item)" <view class="function-nav" v-if="showNav">
v-for="(item, index) in homeRightList2" :key="index"> <view class="function-item" @click="goToShop">
<view class="serverTit">{{ item.title }}</view> <view class="icon-box">
<image class="iconImg" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/index_shop.png"
mode="widthFix" />
</view>
<text>店铺管理</text>
</view>
<view class="function-item" @click="goToOrder">
<view class="icon-box">
<image class="iconImg" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/index_order.png"
mode="widthFix" />
</view>
<text>供应商订单</text>
</view>
<view class="function-item" @click="goToWuye">
<view class="icon-box">
<image class="iconImg" src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/index_wuye.png"
mode="widthFix" />
</view>
<text>物业管理</text>
</view>
</view>
<!-- 轮播图 -->
<view class="swiper">
<swiper @animationfinish="swipers" autoplay circular>
<!-- <swiper-item v-for="(item, index) in bannerList" :key="index" @click="headerServerClick(item)"> -->
<swiper-item v-for="(item, index) in bannerList" :key="index">
<image :src="item.pic_src" mode="aspectFill" />
</swiper-item>
</swiper>
<view class="cirList">
<view :class="['cir', currentIdx == index ? 'active' : '']" v-for="(item, index) in bannerList"
:key="index">
</view>
</view>
</view>
<!-- 宫格列表 -->
<view class="tabList">
<u-grid :col="rowNum" :border="false">
<u-grid-item v-for="(item, index) in tabList" @click="headerServerClick(item)" :key="index">
<image class="grid_Pic" :src="item.icon_src" mode=""></image>
<text>{{ item.title }}</text>
</u-grid-item>
</u-grid>
</view>
</view>
<!-- 广告横幅 -->
<view class="serverList1">
<view class="serverList1_left">
<!-- <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/index_ad_left.jpg" mode="aspectFit" /> -->
<image :src="serverLeft" mode="aspectFit" />
</view>
<view class="serverList1_right">
<view :class="['serverItemRight', `serverItemRight${index + 1}`]" @tap="headerServerClick(item)"
v-for="(item, index) in serverRightList" :key="index">
<image :src="item.pic_src" mode="" /> <image :src="item.pic_src" mode="" />
<!-- <view>{{ item.ad_position }}</view> --> <!-- <view>{{ item.ad_position }}</view> -->
</view> </view>
</view> </view>
</view> </view>
</view>
<!-- <view class="merchant" @click="headershopEnterClick">商户申请入驻</view> -->
</view>
<!-- <view class="white_container margin_top20 main padding_bottom32"> <view class="white_container margin_top20 padding_bottom32">
<view v-if="!currentCity.district" class="Tit">定位错误 未知区域</view>
<view v-else class="Tit">
<view class="local">{{ currentCity.district }}</view>附近
<view class="Tit_desc">一刻钟便利生活圈</view>
</view>
<view class="serverList">
<view class="serverList_left">
<swiper>
<swiper-item v-for="(item, index) in homeLeftList" :key="index" @click="headerServerClick(item)">
<image :src="item.pic_src" alt="" />
<!-- <view>{{ item.ad_position }}</view> -->
</swiper-item>
</swiper>
</view>
<view class="serverList_right">
<view class="serverList_right1">
<view :class="['serverItem', `serverItem${index + 1}`]" @click="headerServerClick2(item)"
v-for="(item, index) in homeRightList1" :key="index">
<view class="serverTit">{{ item.title }}</view>
<image v-if="item.pic_src" :src="item.pic_src" mode="" />
<!-- <view>{{ item.ad_position }}</view> -->
</view>
</view>
<view class="serverList_right2">
<view :class="['serverItem', `serverItem${index + 4}`]" @click="headerServerClick2(item)"
v-for="(item, index) in homeRightList2" :key="index">
<view class="serverTit">{{ item.title }}</view>
<image :src="item.pic_src" mode="" />
<!-- <view>{{ item.ad_position }}</view> -->
</view>
</view>
</view>
</view>
<!-- <view class="merchant" @click="headershopEnterClick">商户申请入驻</view> -->
</view>
<!-- <view class="white_container margin_top20 main padding_bottom32">
<image v-for="(item, index) in bottomList" :key="index" class="list_pic" :src="item.pic_src" mode=""> <image v-for="(item, index) in bottomList" :key="index" class="list_pic" :src="item.pic_src" mode="">
</image> </image>
</view> --> </view> -->
<!-- 分类标签栏 --> <!-- 分类标签栏 -->
<view class="category-tabs"> <view class="category-tabs">
<view class="tabs-container"> <view class="tabs-container">
<scroll-view scroll-x enable-flex class="tabs-scroll" :scroll-into-view="activeCategoryId"> <scroll-view scroll-x enable-flex class="tabs-scroll" :scroll-into-view="activeCategoryId">
<view class="tab-item" v-for="item in categoryList1" :key="item.id" :id="'category-' + item.id" <view class="tab-item" v-for="item in categoryList1" :key="item.id" :id="'category-' + item.id"
:class="{ activeTab: currentCategoryId === item.id }" @click="switchCategory(item.id)"> :class="{ activeTab: currentCategoryId === item.id }" @click="switchCategory(item.id)">
{{ item.cate_name }} {{ item.cate_name }}
</view>
</scroll-view>
<view class="dropdown-btn" :class="{ active: showDropdown }" @click="toggleDropdown">
<u-icon v-if="!showDropdown" name="arrow-down" class="dropdown-icon"></u-icon>
<u-icon v-else name="arrow-up" class="dropdown-icon active"></u-icon>
</view>
</view> </view>
</scroll-view>
<view class="dropdown-btn" :class="{ active: showDropdown }" @click="toggleDropdown">
<u-icon v-if="!showDropdown" name="arrow-down" class="dropdown-icon"></u-icon>
<u-icon v-else name="arrow-up" class="dropdown-icon active"></u-icon>
</view>
</view>
<!-- 分类下拉列表 --> <!-- 分类下拉列表 -->
<view class="category-dropdown" v-if="showDropdown"> <view class="category-dropdown" v-if="showDropdown">
<view class="dropdown-title">商品分类</view> <view class="dropdown-title">商品分类</view>
<view class="category-grid"> <view class="category-grid">
<view class="category-grid-item" v-for="item in categoryList" :key="item.id" <view class="category-grid-item" v-for="item in categoryList" :key="item.id"
:class="{ activeTab: currentCategoryId === item.id }" @click="selectCategoryFromDropdown(item.id)"> :class="{ activeTab: currentCategoryId === item.id }" @click="selectCategoryFromDropdown(item.id)">
{{ item.cate_name }} {{ item.cate_name }}
</view>
</view>
</view> </view>
</view>
</view>
<!-- 商家列表展示 --> <!-- 商家列表展示 -->
<view class="merchantList" :class="{ merchantList2: merchatList.length < 3 }"> <view class="merchantList" :class="{ merchantList2: merchatList.length < 3 }">
<view class="overlay" v-if="showDropdown"></view> <view class="overlay" v-if="showDropdown"></view>
<view class="merchantItem" v-for="item in merchatList" :key="item.id" @click="Info(item)"> <view class="merchantItem" v-for="item in merchatList" :key="item.id" @click="Info(item)">
<view class="merchantItem_left"> <view class="merchantItem_left">
<image :src="item.showImg" mode="aspectFill"></image> <image :src="item.showImg" mode="aspectFill"></image>
</view>
<view class="merchantItem_right">
<view class="merchantItem_right_tit">
<view class="merchantItem_right_tit_left">
{{ item.merchant_name }}
</view> </view>
<view class="merchantItem_right_tit_right"> <view class="merchantItem_right">
{{ item.distances }} <view class="merchantItem_right_tit">
</view> <view class="merchantItem_right_tit_left">
</view> {{ item.merchant_name }}
<view class="merchantItem_right_con"> </view>
<view class="merchantItem_right_con_left"> <view class="merchantItem_right_tit_right">
<view class="startList"> {{ item.distances }}
<image v-for="index in 5" :key="index" :src="index < item.rating </view>
? 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_start1.png'
: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_start2.png'
" mode="aspectFill"></image>
</view> </view>
<view class="merchangtItem_tag" v-if="item.refund_property_fee_ratio"> <view class="merchantItem_right_con">
买单返物业费 <view class="merchantItem_right_con_left">
<view class="startList">
<image v-for="index in 5" :key="index" :src="index < item.rating
? 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_start1.png'
: 'https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_start2.png'
" mode="aspectFill"></image>
</view>
<view class="merchangtItem_tag" v-if="item.refund_property_fee_ratio">
买单返物业费
</view>
<view class="merchangtItem_tag" v-if="item.refund_user_points_ratio">
买单返积分
</view>
</view>
<view class="merchantItem_right_con_right" @click="toJump(item)">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_review.png"
mode="aspectFill"></image>
点评
</view>
</view> </view>
<view class="merchangtItem_tag" v-if="item.refund_user_points_ratio"> <view class="merchantItem_right_add">
买单返积分 {{ item.comAddress }}
</view> </view>
</view> </view>
<view class="merchantItem_right_con_right" @click="toJump(item)">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/local_review.png"
mode="aspectFill"></image>
点评
</view>
</view>
<view class="merchantItem_right_add">
{{ item.comAddress }}
</view> </view>
</view> </view>
</view> </view>
<view class="more" v-if="flag">下拉加载后续10条共计{{ bottomTotal }}</view>
<nav-footer />
</view> </view>
</view> </view>
<view class="more" v-if="flag">下拉加载后续10条共计{{ bottomTotal }}</view>
<nav-footer />
</view> </view>
</template> </template>