feat: 优化代码
This commit is contained in:
+27
-27
@@ -15,10 +15,10 @@
|
||||
<!-- 搜索 -->
|
||||
<view style="width: 200rpx;" @click="jumpSearch">
|
||||
<up-search
|
||||
shape="square"
|
||||
bgColor="#EEEEEEFF"
|
||||
color="#666666FF"
|
||||
:showAction="false"
|
||||
shape="square"
|
||||
bgColor="#EEEEEEFF"
|
||||
color="#666666FF"
|
||||
:showAction="false"
|
||||
placeholder="搜索"
|
||||
></up-search>
|
||||
</view>
|
||||
@@ -48,10 +48,10 @@
|
||||
<text>{{item.name}}</text>
|
||||
</view>
|
||||
<view class="item-container" v-if="item.foods && item.foods.length !==0">
|
||||
<view
|
||||
class="thumb-box"
|
||||
v-for="(item1, index1) in item.foods"
|
||||
:key="index1"
|
||||
<view
|
||||
class="thumb-box"
|
||||
v-for="(item1, index1) in item.foods"
|
||||
:key="index1"
|
||||
@click="jumpSearch(item1)"
|
||||
>
|
||||
<image class="item-menu-image" :src="item1.icon?item1.icon:'/static/common/def_img.jpg'" mode=""></image>
|
||||
@@ -74,7 +74,7 @@
|
||||
import { getCascadeCategory,getCarouselImage } from '@/api/common.js';
|
||||
import CustomTabBar from '@/components/custom-tab-bar.vue';
|
||||
import { APP_PAGE_TYPE } from '@/utils/enumUtils.js'
|
||||
|
||||
|
||||
export default {
|
||||
components:{CustomTabBar},
|
||||
data() {
|
||||
@@ -138,7 +138,7 @@
|
||||
}
|
||||
},
|
||||
jumpSearch(item){
|
||||
let path = "/pages/search/search";
|
||||
let path = "/pages/other_package/search/search";
|
||||
if(item && Object.keys(item).length !==0){
|
||||
path = path+"?keyword="+item.name;
|
||||
}
|
||||
@@ -180,7 +180,7 @@
|
||||
this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
|
||||
this.tabbarContentLoading = false;
|
||||
},
|
||||
|
||||
|
||||
// 获取一个目标元素的高度
|
||||
getElRect(elClass, dataVal) {
|
||||
new Promise((resolve, reject) => {
|
||||
@@ -235,7 +235,7 @@
|
||||
}
|
||||
|
||||
.sort_content{
|
||||
|
||||
|
||||
}
|
||||
.u-menu-wrap {
|
||||
flex: 1;
|
||||
@@ -244,7 +244,7 @@
|
||||
margin-top: 20rpx;
|
||||
height: calc(100vh - 356rpx);
|
||||
}
|
||||
|
||||
|
||||
.u-search-inner {
|
||||
background-color: rgb(234, 234, 234);
|
||||
border-radius: 100rpx;
|
||||
@@ -252,19 +252,19 @@
|
||||
align-items: center;
|
||||
padding: 10rpx 16rpx;
|
||||
}
|
||||
|
||||
|
||||
.u-search-text {
|
||||
font-size: 26rpx;
|
||||
color: $u-tips-color;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
|
||||
.u-tab-view {
|
||||
width: 200rpx;
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
}
|
||||
|
||||
|
||||
.u-tab-item {
|
||||
height: 110rpx;
|
||||
// background: #f6f6f6;
|
||||
@@ -277,7 +277,7 @@
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
|
||||
.u-tab-item-active {
|
||||
position: relative;
|
||||
color: #000;
|
||||
@@ -285,7 +285,7 @@
|
||||
font-weight: 600;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
|
||||
.u-tab-item-active::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
@@ -294,44 +294,44 @@
|
||||
left: 0;
|
||||
top: 39rpx;
|
||||
}
|
||||
|
||||
|
||||
.u-tab-view {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
.right-box {
|
||||
background-color: rgb(250, 250, 250);
|
||||
}
|
||||
|
||||
|
||||
.page-view {
|
||||
padding: 16rpx;
|
||||
}
|
||||
|
||||
|
||||
.class-item {
|
||||
margin-bottom: 30rpx;
|
||||
background-color: #fff;
|
||||
padding: 16rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
|
||||
.item-title {
|
||||
font-size: 26rpx;
|
||||
color: $u-main-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
.item-menu-name {
|
||||
font-weight: normal;
|
||||
font-size: 24rpx;
|
||||
color: $u-main-color;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
|
||||
.item-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
|
||||
.thumb-box {
|
||||
width: 33.333333%;
|
||||
display: flex;
|
||||
@@ -340,7 +340,7 @@
|
||||
flex-direction: column;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.item-menu-image {
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
|
||||
Reference in New Issue
Block a user