Commit 9ebc7272c0ecb22b0654f7280cf0d4768119360b

Authored by 前端开发-罗建龙
1 parent b3983c67

优化顶部样式

Showing 1 changed file with 8 additions and 2 deletions
pages/index/index/index.js
@@ -92,6 +92,7 @@ Page({ @@ -92,6 +92,7 @@ Page({
92 is_full_screen_navigation_index: -1, //广告轮播满屏下标 92 is_full_screen_navigation_index: -1, //广告轮播满屏下标
93 nav_title: '首页', 93 nav_title: '首页',
94 nav_frontColor: "#000", 94 nav_frontColor: "#000",
  95 + old_nav_frontColor: "",
95 nav_backgroundColor: "#fff", 96 nav_backgroundColor: "#fff",
96 nav_type: 1, //导航类型 97 nav_type: 1, //导航类型
97 searchbox_transparent: 1, //搜索框背景是否透明 98 searchbox_transparent: 1, //搜索框背景是否透明
@@ -739,7 +740,7 @@ Page({ @@ -739,7 +740,7 @@ Page({
739 backgroundColor: temp_data.top_color, // 必写项 740 backgroundColor: temp_data.top_color, // 必写项
740 }) 741 })
741 th.setData({ 742 th.setData({
742 - // nav_frontColor: top_w_color, // 必写项 743 + nav_frontColor: top_w_color, // 必写项
743 nav_backgroundColor: temp_data.top_color, // 必写项 744 nav_backgroundColor: temp_data.top_color, // 必写项
744 }) 745 })
745 } 746 }
@@ -1011,6 +1012,11 @@ Page({ @@ -1011,6 +1012,11 @@ Page({
1011 onPageScroll: function (e) { 1012 onPageScroll: function (e) {
1012 //满屏模式监听 1013 //满屏模式监听
1013 let num = e.scrollTop 1014 let num = e.scrollTop
  1015 + if (!this.data.old_nav_frontColor) {
  1016 + this.setData({
  1017 + old_nav_frontColor:this.data.nav_frontColor
  1018 + })
  1019 + }
1014 if (this.data.is_full_screen_navigation) { 1020 if (this.data.is_full_screen_navigation) {
1015 let nav_type = this.data.nav_type 1021 let nav_type = this.data.nav_type
1016 if (num >= 100 && nav_type) { 1022 if (num >= 100 && nav_type) {
@@ -1025,7 +1031,7 @@ Page({ @@ -1025,7 +1031,7 @@ Page({
1025 this.setData({ 1031 this.setData({
1026 nav_type: 1, 1032 nav_type: 1,
1027 searchbox_transparent: 1, 1033 searchbox_transparent: 1,
1028 - nav_frontColor: '#000' 1034 + nav_frontColor: this.data.old_nav_frontColor
1029 }) 1035 })
1030 // this.data.nav_type = 1 1036 // this.data.nav_type = 1
1031 } 1037 }