第一次上传

This commit is contained in:
Ls
2026-03-09 16:39:03 +08:00
commit 3d9efaf15c
924 changed files with 326227 additions and 0 deletions

View File

@@ -0,0 +1,686 @@
<template>
<view class="search-page">
<!-- 顶部导航栏 - 橙色背景 -->
<view class="nav-bar">
<view class="nav-content">
<view class="nav-back" @click="Service.GoPageBack()">
<image class="back-icon" src="/static/icons/back.svg" mode="aspectFit" />
</view>
<view class="search-input-wrapper" >
<image class="search-icon" src="https://img.icons8.com/ios-glyphs/30/999999/search--v1.png"
mode="aspectFit" />
<input class="search-input" v-model="searchKeyword" placeholder="搜索商家或商品"
placeholder-class="search-placeholder" @input="onSearchInput" @confirm="onSearch" focus />
<!-- <image v-if="searchKeyword" class="clear-icon"
src="https://img.icons8.com/ios-glyphs/30/999999/close-window--v1.png" mode="aspectFit"
@click="clearSearch" /> -->
</view>
<!-- <text class="search-btn" @click="onSearch">搜索</text> -->
</view>
</view>
<!-- 搜索内容区域 -->
<view class="content-wrapper">
<!-- 搜索历史 - 无搜索内容时显示 -->
<view v-if="hasSearched" class="search-history-section">
<!-- 搜索历史 -->
<view v-if="searchHistory.length > 0" class="history-section">
<view class="section-header">
<text class="section-title">搜索历史</text>
<image class="delete-icon" src="https://img.icons8.com/ios-glyphs/30/999999/delete--v1.png"
mode="aspectFit" @click="clearHistory" />
</view>
<view class="history-tags">
<view v-for="(item, index) in searchHistory" :key="index" class="history-tag"
@click="searchFromHistory(item)">
<text class="history-tag-text">{{ item }}</text>
</view>
</view>
</view>
<!-- 热门搜索 -->
<view class="hot-section">
<view class="section-header">
<text class="section-title">热门搜索</text>
</view>
<view class="hot-tags">
<view v-for="(item, index) in hotSearches" :key="index" class="hot-tag"
@click="searchFromHistory(item)">
<text class="hot-tag-text" :class="{ 'top-tag': index < 3 }">{{ item }}</text>
</view>
</view>
</view>
</view>
<!-- 搜索结果 - 有搜索内容时显示 -->
<view class="search-results-section">
<!-- 搜索建议 - 输入时显示 -->
<!-- <view class="suggestions-section">
<view v-for="(item, index) in searchSuggestions" :key="index" class="suggestion-item"
@click="searchFromHistory(item)">
<image class="suggestion-icon" src="https://img.icons8.com/ios-glyphs/30/999999/search--v1.png"
mode="aspectFit" />
<text class="suggestion-text">{{ item }}</text>
</view>
</view> -->
<!-- 搜索结果列表 -->
<view class="results-list">
<!-- 商家列表 -->
<view class="shop-list">
<view v-for="shop in goodsList" :key="shop.merchId" class="shop-card" @click="Service.GoPage('/pages/community/merchantDetail?merchId='+shop.merchId)">
<!-- 左侧图片 -->
<image class="shop-image" :src="Service.GetMateUrlByImg(shop.logo)" mode="aspectFill" />
<!-- 右侧信息 -->
<view class="shop-info">
<!-- 店名 -->
<view class="shop-header">
<text class="shop-name">{{ shop.name }}</text>
</view>
<!-- 评分和销量 -->
<view class="shop-info-left">
<view class="shop-rating">
<text class="rating-score">{{ shop.score }}</text>
<text class="rating-unit">分</text>
</view>
<text class="shop-type">堂食店</text>
<text class="shop-sales">月售{{ shop.sale }}</text>
</view>
<!-- 距离、用时、人均价格 - 同一行 -->
<view class="shop-info-row">
<!-- 距离和用时 - 左侧 -->
<view class="shop-info-left">
<view class="distance-wrapper">
<text class="ri-map-pin-2-line location-icon"></text>
<text class="distance-text">{{ formatDistance(shop.distance ) }}</text>
</view>
</view>
<!-- 人均价格 - 右侧 -->
<view class="shop-avg-price-inline">
<text class="avg-price-small">¥</text>
<text class="avg-price-value-small">{{ shop.price }}</text>
<text class="avg-price-text-small">人均</text>
</view>
</view>
<!-- 底部标签 -->
<view class="shop-bottom-tags">
<text v-for="(tag, index) in shop.tips" :key="index" class="shop-tag" style="font-size: 24rpx;"
:class="getTagClass(tag)">
{{ tag }}
</text>
</view>
<!-- 右上角标签 -->
<view class="shop-badges" style="top: 24rpx;" >
<text v-if="shop.code=='Discounts'" class="badge-partner" style="font-size: 24rpx;">联盟商家</text>
<text v-else class="badge-coop" style="font-size: 24rpx;" >合作商家</text>
</view>
</view>
</view>
</view>
</view>
<!-- 空状态 -->
<up-loadmore :status="status" />
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import {
ref
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app'
import { Service } from "@/Service/Service"
import { vpMerchService } from '@/Service/vp/vpMerchService'
// 搜索关键词
const searchKeyword = ref('')
// 是否已搜索
const hasSearched = ref(false)
// 是否显示搜索结果
const showResults = ref(false)
// 搜索结果
const searchResults = ref([])
// 搜索历史
const searchHistory = ref(['汉堡', '奶茶', '炸鸡', '披萨'])
// 热门搜索
const hotSearches = ref(['汉堡王', '肯德基', '麦当劳', '星巴克', '必胜客', '喜茶', '奈雪的茶', '瑞幸咖啡'])
// 模拟商家数据
const mockShops = [{
id: 1,
name: '河南省许昌市汉堡王(宏安店)',
cover: 'https://img.icons8.com/color/96/000000/burger.png',
rating: '4.8',
sales: '2000+',
distance: '500m',
time: '25分钟',
avgPrice: '25.0',
coupons: ['12%积分', '可用券'],
badgeType: 'partner' // 只使用一个类型标签
}
]
let longitude=ref(0)
let latitude=ref(0)
let status=ref('nomore')
let goodsList=ref<Array<any>>([])
let page=ref(1)
// 页面加载
onLoad((data : any) => {
console.log(data);
searchKeyword.value = data.search
getLocation()
})
// 搜索建议
const searchSuggestions = ref([])
const getLocation = () => {
uni.getLocation({
type: 'wgs84',
success: function (res) {
longitude.value = res.longitude
latitude.value = res.latitude
getdata()
},
fail: function (e) {
console.log(e);
}
});
}
const getdata = () => {
goodsList.value=[]
status.value = 'loadmore'
page.value = 1
getList()
}
const getList = () => {
if (status.value !== 'loadmore') {
return
}
status.value = 'loading'
vpMerchService.GetMerchList('', searchKeyword.value, longitude.value, latitude.value, page.value).then(res => {
goodsList.value=[...goodsList.value,...res.data.merchList]
status.value = res.data.merchList.length == 10 ? 'loadmore' : 'nomore'
page.value++
})
}
// 输入搜索关键词
const onSearchInput = () => {
if (searchKeyword.value.trim()) {
// 模拟搜索建议
searchSuggestions.value = hotSearches.value.filter(item =>
item.toLowerCase().includes(searchKeyword.value.toLowerCase())
).slice(0, 5)
} else {
searchSuggestions.value = []
}
}
// 执行搜索
const onSearch = () => {
const keyword = searchKeyword.value.trim()
if (!keyword) {
uni.showToast({
title: '请输入搜索关键词',
icon: 'none'
})
return
}
getdata()
// // 保存到搜索历史
// if (!searchHistory.value.includes(keyword)) {
// searchHistory.value.unshift(keyword)
// if (searchHistory.value.length > 10) {
// searchHistory.value = searchHistory.value.slice(0, 10)
// }
// }
// // 执行搜索 - 使用模拟数据
// // hasSearched.value = true
// showResults.value = true
// // 过滤模拟数据
// searchResults.value = mockShops.filter(shop =>
// shop.name.toLowerCase().includes(keyword.toLowerCase())
// )
// // 如果没有匹配结果,显示所有数据(方便演示)
// if (searchResults.value.length === 0) {
// searchResults.value = mockShops
// }
}
// 从历史/热门搜索
const searchFromHistory = (keyword) => {
searchKeyword.value = keyword
onSearch()
}
// 清除搜索
const clearSearch = () => {
searchKeyword.value = ''
searchSuggestions.value = []
showResults.value = false
}
// 清除搜索历史
const clearHistory = () => {
uni.showModal({
title: '提示',
content: '确定清空搜索历史吗?',
success: (res) => {
if (res.confirm) {
searchHistory.value = []
}
}
})
}
// 获取标签样式类
const getTagClass = (tagText:any) => {
const tagMap = {
'12%积分': 'tag-points',
'15%积分': 'tag-points',
'可用积分': 'tag-points-available',
'可用券': 'tag-coupon'
}
return tagMap[tagText] || 'tag-points'
}
// 格式化距离
const formatDistance = (distance : any) => {
if (distance < 1000) {
return `${distance}m`
}
return `${(distance / 1000).toFixed(1)}km`
}
</script>
<style lang="scss" scoped>
.search-page {
min-height: 100vh;
background: #F5F5F5;
}
/* 顶部导航栏 */
.nav-bar {
background: linear-gradient(135deg, #FF6B00, #FF9500);
height: calc(var(--status-bar-height) + 146rpx);
position: relative;
z-index: 1;
}
.nav-content {
position: absolute;
left: 0;
right: 0;
top: 90rpx;
height: 88rpx;
display: flex;
align-items: center;
padding: 0 24rpx;
}
.nav-back {
width: 64rpx;
height: 64rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.back-icon {
width: 48rpx;
height: 48rpx;
padding: 8rpx;
}
.search-input-wrapper {
width: 60%;
background: #FFFFFF;
border-radius: 20px;
height: 36px;
display: flex;
align-items: center;
padding: 0 12px;
margin: 0 8px;
}
.search-icon {
width: 16px;
height: 16px;
margin-right: 8px;
}
.search-input {
flex: 1;
font-size: 14px;
color: #222222;
height: 36px;
}
.search-placeholder {
color: #999999;
}
.clear-icon {
width: 16px;
height: 16px;
margin-left: 8px;
}
.search-btn {
font-size: 15px;
color: #FFFFFF;
font-weight: 500;
flex-shrink: 0;
padding: 0 8px;
}
/* 搜索内容区域 */
.content-wrapper {
position: relative;
z-index: 2;
background: #FAFAFA;
min-height: calc(100vh - var(--status-bar-height) - 60px);
}
/* 搜索历史和热门搜索 */
.search-history-section {
padding: 16px;
}
.history-section,
.hot-section {
margin-bottom: 24px;
}
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
}
.section-title {
font-size: 16px;
font-weight: 600;
color: #333333;
}
.delete-icon {
width: 20px;
height: 20px;
padding: 4px;
}
.history-tags,
.hot-tags {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.history-tag,
.hot-tag {
background: #FFFFFF;
border: 1px solid #E0E0E0;
border-radius: 4px;
padding: 6px 12px;
}
.history-tag-text,
.hot-tag-text {
font-size: 14px;
color: #333333;
}
.hot-tag .top-tag {
color: #FF6B00;
font-weight: 500;
}
/* 搜索建议 */
.suggestions-section {
background: #FFFFFF;
margin: 16px;
border-radius: 8px;
overflow: hidden;
}
.suggestion-item {
display: flex;
align-items: center;
padding: 12px 16px;
border-bottom: 1px solid #F0F0F0;
}
.suggestion-item:last-child {
border-bottom: none;
}
.suggestion-icon {
width: 16px;
height: 16px;
margin-right: 12px;
opacity: 0.5;
}
.suggestion-text {
font-size: 14px;
color: #333333;
}
/* 搜索结果 */
.search-results-section {
padding: 16px 0;
}
.results-list {
background: transparent;
}
/* 商家列表 */
.shop-list {
padding: 0 10px;
}
.shop-card {
background: #FFFFFF;
border: 1px solid #E0E0E0;
border-radius: 8px;
padding: 12px;
margin-bottom: 10px;
display: flex;
gap: 12px;
position: relative;
}
/* 商家图片 */
.shop-image {
width: 100px;
height: 100px;
border-radius: 6px;
flex-shrink: 0;
background: #F5F5F5;
}
/* 商家信息 */
.shop-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
/* 店名 */
.shop-header {
margin-bottom: 6px;
padding-right: 60px;
}
.shop-name {
font-size: 16px;
font-weight: bold;
color: #333333;
word-wrap: break-word;
word-break: break-all;
line-height: 1.4;
}
/* 左侧信息:评分、类型、销量 */
.shop-info-left {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 4px;
}
.shop-rating {
display: flex;
align-items: baseline;
}
.rating-score {
font-size: 14px;
font-weight: 600;
color: #FF9800;
}
.rating-unit {
font-size: 10px;
color: #FF9800;
margin-left: 2px;
}
.shop-info-left .shop-type {
font-size: 12px;
color: #4CAF50;
font-weight: 500;
}
.shop-info-left .shop-sales {
font-size: 12px;
color: #666666;
}
/* 距离、用时、人均价格 - 同一行 */
.shop-info-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 4px;
}
.distance-wrapper {
display: flex;
align-items: center;
gap: 4px;
}
.location-icon {
font-size: 12px;
color: #999999;
}
.distance-text {
font-size: 12px;
color: #666666;
}
.time-text {
font-size: 12px;
color: #666666;
margin-left: 8px;
}
/* 人均价格 - 小号内联样式 */
.shop-avg-price-inline {
display: inline-flex;
align-items: baseline;
}
.avg-price-small {
font-size: 11px;
color: #FF6B00;
font-weight: 600;
}
.avg-price-value-small {
font-size: 15px;
color: #FF6B00;
font-weight: 700;
line-height: 1;
}
.avg-price-text-small {
font-size: 11px;
color: #FF6B00;
margin-left: 2px;
}
/* 底部标签 */
.shop-bottom-tags {
display: flex;
flex-wrap: wrap;
gap: 4px;
}
/* 无搜索结果 */
.no-results {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 80px 20px;
}
.no-results-icon {
width: 80px;
height: 80px;
margin-bottom: 16px;
opacity: 0.5;
}
.no-results-text {
font-size: 16px;
color: #333333;
margin-bottom: 8px;
}
.no-results-hint {
font-size: 14px;
color: #999999;
}
</style>

View File

@@ -0,0 +1,324 @@
<template>
<view>
<view :style="{'height':topHeight+'rpx'}"
style=" position: fixed; top: 0; z-index: 2; width: 100%; background-color: #fff; ">
<view class="" :style="{'margin-top':top+'rpx','height':height+'rpx','line-height':height+'rpx'}"
style=" margin-left: 40rpx; display: flex; align-items: center;">
<img :src="Service.GetIconImg('/static/index/index/location.png')" style="width: 40rpx; height: 40rpx;"
alt="" />
<text style="margin-left: 15rpx; font-size: 26rpx; font-weight: 600; ">许昌市魏都区</text>
</view>
</view>
<view class="" :style="{ 'margin-top':topHeight+20+'rpx' } ">
<view class="" style="margin: 40rpx 20rpx">
<up-swiper imgMode='heightFix' indicatorStyle="right: 20px" :list="swiperList" height='140'
@change="e => current = e.current" :autoplay="false">
<template #indicator style="right: 36rpx;">
<view class="indicator">
<view class="indicator__dot" v-for="(item, index) in swiperList" :key="index"
:class="[index === current && 'indicator__dot--active']">
</view>
</view>
</template>
</up-swiper>
</view>
</view>
<view class="" style="margin-top: 40rpx; background-color: #fff; padding: 20rpx; ">
<view class=""
style=" margin: 40rpx 0; display: flex; align-items: center; justify-content: space-between;">
<view class="" style=" display: flex;align-items: center; font-weight: 600; font-size: 38rpx;">
<up-icon name="bell-fill" color="#333333" size="20"></up-icon>
<text style="margin-left: 20rpx;">社区公告</text>
</view>
<view class="" @click="Service.GoPage('/pages/community/noticeList')"
style="display: flex;align-items: center;">
<text style="color: #666666;margin-right: 10rpx; font-size: 28rpx; ">查看更多</text>
<up-icon name="arrow-right" size="14" color='#666666' :bold='true'></up-icon>
</view>
</view>
<view class="" @click="Service.GoPage('/pages/article/articleCom')"
style=" padding: 20rpx; margin: 20rpx 0; border-radius: 20rpx; box-shadow: 0 0 10rpx 4rpx #e2e2e2; ">
<view class="" style="display: flex; align-items: center; ">
<view class="tag"
style=" color: #fff; border-radius: 12rpx; background-color: #FF6B35; padding: 4rpx 20rpx; ">
<img :src="Service.GetIconImg('/static/index/community/top.png')"
style="width: 30rpx; height: 30rpx; " alt="" />
<text style="margin-left: 10rpx;">置顶</text>
</view>
<text style="font-size: 32rpx; font-weight: 600;">【重要】社区发帖规范更新通知</text>
</view>
<view class=""
style=" margin: 16rpx 0; color: #666666; font-size: 26rpx; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; ">
为营造健康社区环境,即日起发帖需实名认证。请各位用户知悉并配合执行新的发帖规范。
</view>
<view class="" style=" font-size: 22rpx; color: #999999; display: flex; align-items: center;">
<text>2小时前</text>
<text style="margin: 0 15rpx;">·</text>
<view class="" style="display: flex;align-items: center;">
<img :src="Service.GetIconImg('/static/index/community/see.png')"
style="width: 30rpx; height: 30rpx; " alt="" />
<text style="margin-left: 10rpx;">1200人阅读</text>
</view>
</view>
</view>
</view>
<view class="" style="margin-top: 40rpx; background-color: #fff; padding: 20rpx; ">
<view class="" style=" display: flex; align-items: center; justify-content: space-between;">
<view class="" style=" font-weight: 600; ">
附近商家推荐
</view>
</view>
<view class=""
style=" display: flex; align-items: center; justify-content: space-around; background-color: #fff; padding: 30rpx 20rpx">
<view v-for="(item, index) in tabList" @click="chooseTab(index)"
style="display: flex; flex-direction: column; align-items: center; justify-content: center;"
:key="index">
<view class="" :class="{tabimgActive:index==tabCurrent,tabimg: index!=tabCurrent }"
style=" border-radius: 50%; display: flex; align-items: center; justify-content: center; height: 80rpx; width: 80rpx; ">
<img :src="Service.GetIconImg( index==tabCurrent? item.imged:item.img)"
style="width: 45rpx; height: 45rpx; "></img>
</view>
<view :class="{tabActivefont:index==tabCurrent,tabfont:index!=tabCurrent}"
style="font-size: 26rpx; margin-top: 15rpx;" class="">
{{item.name}}
</view>
</view>
</view>
<view class="" style=" display: flex; align-items: center; justify-content: space-between;">
<view class="" style=" font-weight: 600; ">
</view>
<view class="" @click="Service.GoPage('/pages/community/merchantCom')"
style="display: flex;align-items: center;">
<text style="color: #666666;margin-right: 10rpx; font-size: 28rpx; ">查看更多</text>
<up-icon name="arrow-right" size="14" color='#666666' :bold='true'></up-icon>
</view>
</view>
<view class=""
style="padding: 20rpx; margin-top: 20rpx; border-radius: 20rpx; box-shadow: 0 0 10rpx 4rpx #e2e2e2;">
<view class="" style="display: flex; ">
<img :src="Service.GetMateUrlByImg('/static/dele/dele1.jpg')"
style=" border-radius: 20rpx; width: 140rpx; height: 140rpx;" alt="" />
<view class=""
style=" flex: 1; margin-left: 20rpx; display: flex; flex-direction: column; justify-content: space-between; ">
<view class="" style="display: flex; align-items: center;">
<view class="" style="font-weight: 700; font-size: 32rpx;">
老北京炸酱面
</view>
<view class="tag"
style=" margin-left: 15rpx; color: #fff; border-radius: 12rpx; background-color: #FF6B35; padding: 4rpx 20rpx; ">
新店
</view>
</view>
<view class="" style="display: flex;align-items: center;">
<up-rate count="1" activeColor='#FF6B35' size='16' :readonly='true'></up-rate>
<text style="color: #666666; font-size: 26rpx;">3.8</text>
<text style="margin-left: 10rpx;color: #666666; font-size: 26rpx; ">月售892单</text>
</view>
<view class="" style="display: flex; align-items: center; justify-content: space-between; ">
<view class="" style="display: flex;align-items: center;">
<up-icon name="map" color="#666666" size="18"></up-icon>
<text style="color: #666666; margin-left: 12rpx; font-size: 26rpx;">0.8km</text>
</view>
<view class="" style="margin-right: 20rpx;">
<text style="font-size: 28rpx;font-weight: 600; color: #FF6B35; "> ¥58/人 </text>
</view>
</view>
</view>
</view>
<view class="" style="margin: 20rpx; margin-bottom: 0; ">
<up-scroll-list :indicator='false'>
<view v-for="(item, index) in scrollList" :key="index"
style="display: flex; flex-direction: column; justify-content: center; align-items: center;">
<img :src="Service.GetIconImg(item.img)" alt=""
style="width: 100rpx; height: 100rpx; border-radius: 20rpx; " />
<view class="" style="font-size: 24rpx; color: #666666; margin-top: 10rpx; ">
{{item.name}}
</view>
</view>
</up-scroll-list>
</view>
</view>
</view>
<view class="" style="margin-top: 40rpx; background-color: #fff; padding: 20rpx; ">
<view class=""
style=" margin: 10rpx 0; display: flex; align-items: center; justify-content: space-between;">
<view class="" style="font-weight: 600; width: 70%; font-size: 32rpx;">
<up-notice-bar bgColor='#fff' color='#FF6B35' :text="notice"></up-notice-bar>
</view>
<view class="" @click="Service.GoPage('/pages/article/newsList')"
style="display: flex;align-items: center;">
<text style="color: #666666;margin-right: 10rpx; font-size: 28rpx; ">查看更多</text>
<up-icon name="arrow-right" size="14" color='#666666' :bold='true'></up-icon>
</view>
</view>
<view class="" @click="Service.GoPage('/pages/article/news')"
style="display: flex; margin-top: 20rpx; border-radius: 20rpx; ">
<image :src="Service.GetMateUrlByImg('/static/dele/dele1.jpg')" mode="aspectFill"
style=" border-radius: 20rpx; width: 190rpx; height: 150rpx;" alt="" />
<view class=""
style=" flex: 1; margin-left: 20rpx; display: flex; flex-direction: column; justify-content: space-between; ">
<view class="" style=" ">
<view class=""
style="font-weight: 700; font-size: 32rpx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
老北京炸酱面
</view>
</view>
<view class=""
style="color: #666666; font-size: 26rpx; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; ">
老北京炸酱面是北京市传统小吃,属北京菜系,在京津冀地区广为流传。该菜品以面条为主料,搭配炸酱与时令菜码拌制而成,核心酱料选用肥瘦相间的五花肉丁,配以干黄酱和甜面酱混合炒制,经慢火熬煮形成深褐色酱料
</view>
<view class="" style=" ">
<text style="color: #666666; font-size: 26rpx;">2026-10-15</text>
</view>
</view>
</view>
</view>
<view class="" style="width: 100%; height: 100rpx; ">
</view>
</view>
</template>
<script setup lang="ts">
import { onShow, onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import { Service } from "@/Service/Service"
// 导航栏
let topHeight = ref()
let height = ref()
let top = ref()
let current = ref(0)
let swiperList = ref(
[
'/static/dele/dele1.jpg',
'/static/dele/dele2.jpg'
]
)
let notice = ref('uview-plus UI众多组件覆盖开发过程的各个需求组件功能丰富多端兼容。让您快速集成开箱即用')
let tabCurrent = ref(0)
let tabList = ref(
[
{
name: '美食',
img: '/static/index/index/food.png',
imged: '/static/index/index/fooded.png'
},
{
name: '饮品',
img: '/static/index/index/cofe.png',
imged: '/static/index/index/cofed.png'
},
{
name: '超市',
img: '/static/index/index/shop.png',
imged: '/static/index/index/shoped.png'
},
{
name: '美妆',
img: '/static/index/index/good.png',
imged: '/static/index/index/gooded.png'
},
{
name: '医疗',
img: '/static/index/index/medical.png',
imged: '/static/index/index/medicaled.png'
}
]
)
let scrollList = ref([
{
name: '牛肉面',
img: '/static/dele/dele1.jpg'
}
])
onLoad(() => {
let res = wx.getMenuButtonBoundingClientRect()
topHeight.value = (res.top + res.height + 5) * 2
height.value = res.height * 2
top.value = res.top * 2
});
onShow(() => {
});
const chooseTab = (e) => {
tabCurrent.value = e
}
</script>
<style lang="scss">
page {
background-color: #f5f5f5;
}
.indicator {
@include flex(row);
justify-content: center;
&__dot {
height: 6px;
width: 6px;
border-radius: 100px;
background-color: rgba(255, 255, 255, 0.35);
margin: 0 5px;
transition: background-color 0.3s;
&--active {
background-color: #ffffff;
}
}
}
.tag {
display: flex;
align-items: center;
justify-content: center;
width: fit-content;
font-size: 24rpx;
}
.tabimgActive {
background-color: var(--nav-mian);
}
.tabimg {
background-color: #F5F5F5;
}
.tabActivefont {
color: var(--nav-mian);
}
.tabfont {
color: #333333
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B