Commit f3a8a69a by 严立

标题栏修改

parent 9b7ee1c6
...@@ -93,7 +93,6 @@ Component({ ...@@ -93,7 +93,6 @@ Component({
this.setNavigationStyle() this.setNavigationStyle()
}, },
'scrollHeight': function () { 'scrollHeight': function () {
console.log('this.data.scrollHeight', this.data.scrollHeight)
this.eventScroll(this.data.scrollHeight) this.eventScroll(this.data.scrollHeight)
}, },
}, },
...@@ -107,7 +106,6 @@ Component({ ...@@ -107,7 +106,6 @@ Component({
* @returns * @returns
*/ */
setNavigationHeight: function () { setNavigationHeight: function () {
console.log('setNavigationHeight', this.data.titleText)
let funcIsIOS = wx.getSystemInfoSync().system.indexOf('iOS') > -1 let funcIsIOS = wx.getSystemInfoSync().system.indexOf('iOS') > -1
let funcStatusHeight = wx.getSystemInfoSync().statusBarHeight let funcStatusHeight = wx.getSystemInfoSync().statusBarHeight
let funcTitleHeight = 0 let funcTitleHeight = 0
...@@ -134,7 +132,6 @@ Component({ ...@@ -134,7 +132,6 @@ Component({
* @returns * @returns
*/ */
setNavigationStyle: function () { setNavigationStyle: function () {
console.log('setNavigationStyle')
let funcStatusStyle = { let funcStatusStyle = {
'height': this.data.statusHeight + 'px', 'height': this.data.statusHeight + 'px',
'background': this.data.background, 'background': this.data.background,
......
const app = getApp() const app = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
Page({ Page({
data: { data: {
// 导航栏相关属性
navigationStyle: {
normal: {
backIcon: '/image/back-w.png',
color: '#FFFFFF',
background: 'rgba(255, 255, 255, 0)'
},
change: {
backIcon: '/image/back.png',
color: '#000000',
background: 'rgba(255, 255, 255, 1)'
},
scroll: '600rpx',
},
navigationScroll: 0,
// banner 列表数据 // banner 列表数据
banner: [], banner: [],
bannerIndex: 0, bannerIndex: 0,
...@@ -123,6 +144,22 @@ Page({ ...@@ -123,6 +144,22 @@ Page({
stateText: text, stateText: text,
isSubmit: state == 1 ? true : false, isSubmit: state == 1 ? true : false,
}) })
},
onPageScroll: function (funcEvent) {
// console.log(funcEvent)
// 优化滚动事件触发频率
if (logicData.pageScrollLock) return
logicData.pageScrollLock = true
this.setData({
navigationScroll: funcEvent.scrollTop
})
} // 恢复滚动事件
logicData.pageScrollTimer = setTimeout(function () {
logicData.pageScrollLock = false
clearTimeout(logicData.pageScrollTimer)
}, 10)
},
}) })
\ No newline at end of file
<!-- 畅玩 - 活动详情 --> <!-- 畅玩 - 活动详情 -->
<navigation class="navigation" titleText="主题活动" color="#ffffff" backIcon="/image/back-w.png"></navigation> <navigation class="navigation" titleText="主题活动" color="#ffffff" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<view class="container"> <view class="container">
<view id="banner" class="banner"> <view id="banner" class="banner">
...@@ -24,14 +24,17 @@ ...@@ -24,14 +24,17 @@
</view> </view>
<view class="detail-other col"> <view class="detail-other col">
<view class="row align-c"> <view class="row align-c">
<image src="/image/icon/g-time.png"></image>
<text>活动时间</text> <text>活动时间</text>
<text>{{info.date}}</text> <text>{{info.date}}</text>
</view> </view>
<view style="height:auto;" class="row"> <view style="height:auto;" class="row">
<image src="/image/icon/g-location.png"></image>
<text>活动地址</text> <text>活动地址</text>
<text style="height:auto;">{{info.address}}</text> <text style="height:auto;">{{info.address}}</text>
</view> </view>
<view class="row align-c"> <view class="row align-c">
<image src="/image/icon/g-custom.png"></image>
<text>报名名额</text> <text>报名名额</text>
<text>{{info.quota}}人</text> <text>{{info.quota}}人</text>
</view> </view>
......
...@@ -79,7 +79,13 @@ ...@@ -79,7 +79,13 @@
margin-top: 24rpx; margin-top: 24rpx;
} }
.detail-other view text:nth-child(1) { .detail-other view image:nth-child(1) {
width: 40rpx;
height: 40rpx;
margin-right: 8rpx;
}
.detail-other view text:nth-child(2) {
width: 120rpx; width: 120rpx;
height: 42rpx; height: 42rpx;
margin-right: 32rpx; margin-right: 32rpx;
...@@ -89,8 +95,8 @@ ...@@ -89,8 +95,8 @@
line-height: 42rpx; line-height: 42rpx;
} }
.detail-other view text:nth-child(2) { .detail-other view text:nth-child(3) {
width: 518rpx; width: 470rpx;
height: 40rpx; height: 40rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: 400; font-weight: 400;
......
.navigation { .navigation {
position: relative; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
} }
.container { .container {
margin-top: 120rpx;
background: linear-gradient(#ffffff, #F2F2F2); background: linear-gradient(#ffffff, #F2F2F2);
} }
......
.navigation { .navigation {
position: relative; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
} }
.container {
margin-top: 120rpx;
}
.title { .title {
width: 670rpx; width: 670rpx;
margin-top: 60rpx; margin-top: 60rpx;
......
.navigation { .navigation {
position: relative; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
} }
.container {
margin-top: 120rpx;
}
.title { .title {
width: 750rpx; width: 750rpx;
height: 150rpx; height: 150rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment