商品分类商品模式支持一级分类商品展示、导航搜索和首页logo优化
parent
a97e2a0fa8
commit
acf20edc8c
|
|
@ -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>
|
||||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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_buy,仅页面进入才需要校验is_buy进入位置选择页面
|
||||
if (this.home_extraction_address_position == 1) {
|
||||
// 首次不请求数据
|
||||
if (this.is_first == 0) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
// 指定分类则重新读取列表数据
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue