商品分类商品模式支持一级分类商品展示、导航搜索和首页logo优化

master
gongfuxiang 2023-07-16 15:30:29 +08:00
parent a97e2a0fa8
commit acf20edc8c
7 changed files with 30 additions and 19 deletions

View File

@ -2,7 +2,7 @@
<view>
<view class="search-content pr">
<view class="search-icon dis-inline-block pa" @tap="search_icon_event">
<uni-icons :type="propIcon" size="12" :color="propIconColor"></uni-icons>
<uni-icons :type="propIcon" size="24rpx" :color="propIconColor"></uni-icons>
</view>
<input type="text" confirm-type="search" class="round wh-auto dis-block" :placeholder="propPlaceholder" :placeholder-class="propPlaceholderClass" :value="propDefaultValue" @confirm="search_input_event" :style="'color:'+propTextColor+';background:'+propBgColor+';'+((propBrColor || null) != null ? 'border:1px solid '+propBrColor+';' : '')">
</view>
@ -103,17 +103,17 @@
</script>
<style>
.search-content .search-icon {
line-height: 12px;
left: 10px;
top: calc(50% - 11px);
line-height: 24rpx;
left: 20rpx;
top: calc(50% - 22rpx);
z-index: 1;
padding: 5px;
padding: 10rpx;
}
.search-content input {
font-size: 12px;
padding: 0 15px 0 38px;
font-size: 24rpx;
padding: 0 30rpx 0 76rpx;
box-sizing: border-box;
height: 30px;
line-height: 30px;
height: 60rpx;
line-height: 60rpx;
}
</style>

View File

@ -74,7 +74,6 @@
client: app.globalData.get_config('config.common_app_user_base_popup_client', []),
integral_time: parseInt(app.globalData.get_config('config.common_app_user_base_popup_integral_time', 1800))
});
console.log(this.pages, this.client)
} else {
app.globalData.is_config(this, 'init_config');
}

View File

@ -84,7 +84,7 @@
});
// #ifndef MP-KUAISHOU
//
// is_buy
if ((this.params.is_buy || 0) == 1 && this.home_extraction_address_position == 1) {
uni.navigateTo({
url: '/pages/common/open-setting-location/open-setting-location'
@ -95,7 +95,7 @@
onShow() {
// #ifndef MP-KUAISHOU
//
// is_buyis_buy
if (this.home_extraction_address_position == 1) {
//
if (this.is_first == 0) {

View File

@ -105,6 +105,9 @@
right: 0;
background: #f5f5f5;
}
.goods-right-content.category-one-subset-content {
width: 100%;
}
.goods-right-content .word-list {
position: sticky;
top: 0;

View File

@ -40,7 +40,7 @@
</scroll-view>
</view>
<!-- 二级导航 -->
<view class="left-nav bg-white ht-auto">
<view v-if="category_one_subset_count > 0" class="left-nav bg-white ht-auto">
<scroll-view :scroll-y="true" class="ht-auto">
<view :class="((common_site_type != 1) ? 'left-content-actual' : '')">
<view :class="'text-size-sm item tc cr-base cp oh ' + (nav_active_item_two_index == -1 ? 'nav-active cr-main border-color-main' : '')" :data-index="nav_active_index" :data-itemtwoindex="-1" :data-itemthreeindex="-1" @tap="nav_event">
@ -57,7 +57,7 @@
</scroll-view>
</view>
<!-- 商品列表 -->
<view class="goods-right-content pa bs-bb padding-top-main padding-horizontal-main">
<view :class="'goods-right-content pa bs-bb padding-top-main padding-horizontal-main '+(category_one_subset_count > 0 ? '' : 'category-one-subset-content')">
<scroll-view :scroll-y="true" class="ht-auto goods-list" :scroll-top="scroll_top" @scroll="scroll_event" @scrolltolower="scroll_lower" lower-threshold="60">
<view :class="((common_site_type != 1) ? 'right-content-actual' : '')+' pr'">
<!-- 三级导航 -->
@ -331,6 +331,7 @@
scroll_top_old: 0,
cart_status: false,
goods_choose_data: {},
category_one_subset_count: 0,
//
category_show_level: 0,
//
@ -418,14 +419,21 @@
var data = res.data.data;
var index = this.nav_active_index;
var temp_category = data.category || [];
//
var category_one_subset_count = 0;
//
var tabbar_params = this.tabbar_params;
if(temp_category.length > 0 && (tabbar_params || null) != null && (tabbar_params.id || null) != null) {
if(temp_category.length > 0) {
for(var i in temp_category) {
if(temp_category[i]['id'] == tabbar_params.id) {
//
if((tabbar_params || null) != null && (tabbar_params.id || null) != null && temp_category[i]['id'] == tabbar_params.id) {
index = i;
break;
}
//
if((temp_category[i]['items'] || null) != null && temp_category[i]['items'].length > 0) {
category_one_subset_count++;
}
}
}
//
@ -433,6 +441,7 @@
category_list: temp_category,
data_content: temp_category[index] || null,
nav_active_index: index,
category_one_subset_count: category_one_subset_count,
plugins_label_data: (data.plugins_label_data || null) == null || (data.plugins_label_data.base || null) == null || (data.plugins_label_data.data || null) == null || data.plugins_label_data.data.length <= 0 ? null : data.plugins_label_data,
}
//

View File

@ -12,7 +12,7 @@
}
.home-top-nav-logo {
text-align: left;
padding: 2px 250rpx 0 20rpx;
padding: 2px 250rpx 10rpx 20rpx;
height: 37px;
/* #ifdef H5 || MP-TOUTIAO || APP */
padding-top: 0;
@ -20,7 +20,7 @@
}
.home-top-nav-logo-image {
width: 240rpx;
height: 70rpx !important;
height: 100% !important;
}
.home-top-nav-logo-title {
font-weight: bold;

View File

@ -7,7 +7,7 @@
<!-- #ifndef MP-TOUTIAO -->
<view class="home-top-nav-logo">
<block v-if="is_logo_use_text == 0 && (application_logo || null) != null">
<image :src="application_logo" mode="aspectFit" class="home-top-nav-logo-image"></image>
<image :src="application_logo" mode="heightFix" class="home-top-nav-logo-image"></image>
</block>
<block v-else>
<view class="home-top-nav-logo-title cr-white single-text">{{application_title}}</view>