适配app

master
gongfuxiang 2023-11-24 00:41:26 +08:00
parent 725897e9e4
commit 9c4bf00e39
3 changed files with 14 additions and 18 deletions

View File

@ -30,8 +30,8 @@
<style scoped>
/* iconfont.css全局注册需要将src切换成绝对路径 */
/* @/static/icon/ */
/* @import url('@/static/icon/iconfont.css'); */
@import url('https://at.alicdn.com/t/c/font_4227145_r2jv37yqfec.css');
@import url('@/static/icon/iconfont.css');
/* @import url('https://at.alicdn.com/t/c/font_4227145_r2jv37yqfec.css'); */
.iconfont {
display: inline-block;

View File

@ -4,10 +4,6 @@
.home-top-nav-content {
background-repeat: no-repeat;
background-size: 100% auto;
min-height: calc(var(--status-bar-height) + 130rpx);
/* #ifdef H5 */
min-height: calc(var(--status-bar-height) + 160rpx);
/* #endif */
padding-top: calc(var(--status-bar-height) + 5px);
}
@ -34,7 +30,7 @@
*/
/* #ifdef H5 || MP-TOUTIAO || APP */
.nav-top-right-icon {
top: -34px;
top: calc(var(--status-bar-height) + 10px);
right: 28rpx;
z-index: 12;
line-height: 28px;
@ -83,13 +79,13 @@
background-size: 100% auto;
background-position: top;
padding-bottom: 24rpx;
/* #ifdef H5 || APP */
/* #ifdef H5 */
padding-top: 15rpx !important;
padding-bottom: 15rpx !important;
/* #endif */
}
/* #ifdef H5 || MP-TOUTIAO || APP */
/* #ifdef H5 || MP-TOUTIAO */
.search-content-fixed .nav-top-right-icon {
top: 11px !important;
}

View File

@ -1,8 +1,8 @@
<template>
<view :class="theme_view">
<view :class="(plugins_mourning_data_is_app ? ' grayscale' : '') + (is_single_page == 1 ? ' single-page-top' : '')">
<!-- 顶部内容 -->
<view v-if="load_status == 1" class="home-top-nav-content pr" :style="top_content_bg_color + top_content_style">
<!-- 顶部内容如果没有轮播则使用矮的浮动导航背景样式则使用高的背景样式 -->
<view v-if="load_status == 1" class="home-top-nav-content pr" :style="(banner_list.length > 0 ? top_content_bg_color : top_content_search_bg_color) + top_content_style">
<!-- 顶部背景图片 -->
<view class="pa top-0 left-0 right-0">
<image class="bg-img wh-auto" mode="widthFix" :src="static_url + 'nav-top.png'"></image>
@ -26,11 +26,11 @@
<view v-if="common_app_is_enable_search == 1" class="search-content-input dis-inline-block va-m" :style="top_content_search_style">
<!-- 是否开启搜索框前面icon扫一扫 -->
<block v-if="is_home_search_scan == 1">
<component-search propPlaceholder="输入商品名称搜索" propPlaceholderClass="cr-grey-c" propIconColor="#999" propBgColor="#fff" <!-- #ifndef H5 -->
<component-search propPlaceholder="输入商品名称搜索" propPlaceholderClass="cr-grey-c" propIconColor="#999" propBgColor="#fff"
<!-- #ifndef H5 -->
@onicon="search_icon_event" propIcon="icon-mendian-sousuosm" :propIsIconOnEvent="true"
<!-- #endif -->
></component-search
>
></component-search>
</block>
<block v-else>
<component-search propPlaceholder="输入商品名称搜索" propPlaceholderClass="cr-grey-c" propIconColor="#999" propBgColor="#fff"></component-search>
@ -489,13 +489,13 @@
};
//
if (this.load_status == 0 && data.banner_list && data.banner_list.length > 0) {
if ((data.banner_list[0]['bg_color'] || null) != null) {
if (this.load_status == 0) {
if (data.banner_list && data.banner_list.length > 0 && (data.banner_list[0]['bg_color'] || null) != null) {
upd_data['top_content_bg_color'] = 'background: linear-gradient(180deg, ' + data.banner_list[0].bg_color + ' 0%, #f5f5f5 80%);';
upd_data['top_content_search_bg_color'] = 'background: linear-gradient(180deg, ' + data.banner_list[0].bg_color + ' 0%, #f5f5f5 460%);';
} else {
upd_data['top_content_bg_color'] = 'background: linear-gradient(180deg, ' + this.theme_color + ' 0%, #f5f5f5 80%);';
upd_data['top_content_search_bg_color'] = 'background: linear-gradient(180deg, ' + this.theme_color + ' 0%, #f5f5f5 460%);';
upd_data['top_content_bg_color'] = 'background: linear-gradient(180deg, ' + theme_color + ' 0%, #f5f5f5 80%);';
upd_data['top_content_search_bg_color'] = 'background: linear-gradient(180deg, ' + theme_color + ' 0%, #f5f5f5 460%);';
}
}