Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严立
/
mini-shimao
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
92c2bff9
authored
Aug 27, 2020
by
严立
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
LL - 标题栏-地图
parent
832cc023
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
372 additions
and
125 deletions
app.js
app.json
component/navigation/navigation.js
component/navigation/navigation.wxml
component/navigation/navigation.wxss
pages/activity-detail/activity-detail.wxss
pages/appointment/appointment.js
pages/appointment/appointment.wxml
pages/guide/guide.js
pages/guide/guide.wxml
pages/guide/guide.wxss
pages/home/home.js
pages/home/home.wxml
pages/shop-detail/shop-detail.js
pages/shop-detail/shop-detail.wxml
pages/strategy/strategy.wxml
pages/strategy/strategy.wxss
app.js
View file @
92c2bff9
...
@@ -30,6 +30,17 @@ App({
...
@@ -30,6 +30,17 @@ App({
wx
.
setStorageSync
(
'unitProportion'
,
funcProportion
)
wx
.
setStorageSync
(
'unitProportion'
,
funcProportion
)
},
},
cssObjectToCssString
:
function
(
funcCssObject
)
{
let
funcCss
=
''
let
funcObjectKey
=
Object
.
keys
(
funcCssObject
)
for
(
let
i
=
0
,
l
=
funcObjectKey
.
length
;
i
<
l
;
i
++
)
{
funcCss
=
funcCss
+
funcObjectKey
[
i
]
+
': '
+
funcCssObject
[
funcObjectKey
[
i
]]
+
'; '
}
// console.log(funcCss)
return
funcCss
},
wxRequest
(
obj
)
{
wxRequest
(
obj
)
{
let
that
=
this
let
that
=
this
var
token
=
that
.
globalData
.
token
var
token
=
that
.
globalData
.
token
...
@@ -42,9 +53,9 @@ App({
...
@@ -42,9 +53,9 @@ App({
method
:
obj
.
method
||
"POST"
,
method
:
obj
.
method
||
"POST"
,
header
:
header
,
header
:
header
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
console
.
log
(
"接口:"
,
that
.
globalData
.
baseUrl
+
obj
.
url
);
//
console.log("接口:", that.globalData.baseUrl + obj.url);
console
.
log
(
"参数:"
,
JSON
.
stringify
(
obj
.
data
));
//
console.log("参数:", JSON.stringify(obj.data));
console
.
log
(
"返回:"
,
res
);
//
console.log("返回:", res);
let
code
=
res
.
data
.
code
*
1
;
let
code
=
res
.
data
.
code
*
1
;
if
(
200
==
code
&&
true
==
res
.
data
.
success
)
{
if
(
200
==
code
&&
true
==
res
.
data
.
success
)
{
...
...
app.json
View file @
92c2bff9
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
"l-button"
:
"../miniprogram_npm/lin-ui/button/index"
,
"l-button"
:
"../miniprogram_npm/lin-ui/button/index"
,
"l-card"
:
"../miniprogram_npm/lin-ui/card/index"
,
"l-card"
:
"../miniprogram_npm/lin-ui/card/index"
,
"l-capsule-bar"
:
"../miniprogram_npm/lin-ui/capsule-bar/index"
,
"l-capsule-bar"
:
"../miniprogram_npm/lin-ui/capsule-bar/index"
,
"l-dialog"
:
"../miniprogram_npm/lin-ui/dialog/index"
,
"l-icon"
:
"../miniprogram_npm/lin-ui/icon/index"
,
"l-icon"
:
"../miniprogram_npm/lin-ui/icon/index"
,
"l-list"
:
"../miniprogram_npm/lin-ui/list/index"
,
"l-list"
:
"../miniprogram_npm/lin-ui/list/index"
,
"l-price"
:
"../miniprogram_npm/lin-ui/price/index"
,
"l-price"
:
"../miniprogram_npm/lin-ui/price/index"
,
...
...
component/navigation/navigation.js
View file @
92c2bff9
let
App
=
getApp
()
Component
({
Component
({
/**
// 组件外部属性
* 组件的属性列表
*/
properties
:
{
properties
:
{
background
:
{
background
:
{
type
:
String
,
type
:
String
,
...
@@ -9,7 +9,7 @@ Component({
...
@@ -9,7 +9,7 @@ Component({
},
},
color
:
{
color
:
{
type
:
String
,
type
:
String
,
value
:
'
rgba(0, 0, 0, 1)
'
value
:
'
#000000
'
},
},
titleText
:
{
titleText
:
{
type
:
String
,
type
:
String
,
...
@@ -29,88 +29,215 @@ Component({
...
@@ -29,88 +29,215 @@ Component({
},
},
fontSize
:
{
fontSize
:
{
type
:
Number
,
type
:
Number
,
value
:
16
value
:
34
},
iconWidth
:
{
type
:
Number
,
value
:
58
},
},
iconHeight
:
{
iconHeight
:
{
type
:
Number
,
type
:
Number
,
value
:
19
value
:
19
},
},
iconWidth
:
{
type
:
Number
,
// 标题栏滚动指定位置动态变换颜色属性
value
:
58
// 优先级高于 background 属性
},
// {
// normal: {
// text: 'rgba(255, 255, 255, 1)',
// background: 'rgba(255, 255, 255, 0)'
// },
// change: {
// text: 'rgba(0, 0, 0, 1)',
// background: 'rgba(255, 255, 255, 1)'
// },
// scroll: '4%',
// }
scrollStyle
:
{
type
:
Object
,
value
:
{},
},
},
observers
:
{
// 当前页面滚动高度
'background'
:
function
()
{
// 配合动态变换颜色属性使用
this
.
setStyle
()
scrollHeight
:
{
type
:
Number
,
value
:
0
},
},
},
},
// 组件内部属性
data
:
{
statusHeight
:
0
,
titleHeight
:
0
,
statusCss
:
''
,
titleCss
:
''
,
textCss
:
''
,
iconCss
:
''
,
isScrollChange
:
false
,
},
// 生命周期
lifetimes
:
{
lifetimes
:
{
attached
:
function
(){
attached
:
function
()
{
var
that
=
this
this
.
setNavigationHeight
()
that
.
setNavSize
()
this
.
setNavigationStyle
()
that
.
setStyle
()
},
},
},
},
data
:
{
// 属性监听
observers
:
{
'background'
:
function
()
{
this
.
setNavigationStyle
()
},
},
'scrollHeight'
:
function
()
{
console
.
log
(
'this.data.scrollHeight'
,
this
.
data
.
scrollHeight
)
this
.
eventScroll
(
this
.
data
.
scrollHeight
)
},
},
// 自定方法
methods
:
{
methods
:
{
// 通过获取系统信息计算导航栏高度
/**
setNavSize
:
function
()
{
* 设置标题栏高度
var
that
=
this
* @function
let
sysinfo
=
wx
.
getSystemInfoSync
()
* @param
let
statusHeight
=
sysinfo
.
statusBarHeight
* @returns
let
isIOS
=
sysinfo
.
system
.
indexOf
(
'iOS'
)
>
-
1
*/
let
navHeight
setNavigationHeight
:
function
()
{
console
.
log
(
'setNavigationHeight'
,
this
.
data
.
titleText
)
if
(
isIOS
)
{
let
funcIsIOS
=
wx
.
getSystemInfoSync
().
system
.
indexOf
(
'iOS'
)
>
-
1
navHeight
=
44
;
let
funcStatusHeight
=
wx
.
getSystemInfoSync
().
statusBarHeight
let
funcTitleHeight
=
0
if
(
funcIsIOS
)
{
funcTitleHeight
=
44
}
else
{
}
else
{
navHeight
=
48
;
funcTitleHeight
=
48
}
this
.
setData
({
statusHeight
:
funcStatusHeight
,
titleHeight
:
funcTitleHeight
,
})
// 缓存标题栏高度信息
wx
.
setStorageSync
(
'navigationStatusHeight'
,
this
.
data
.
statusHeight
)
wx
.
setStorageSync
(
'navigationCapsuleHeight'
,
this
.
data
.
titleHeight
)
},
/**
* 设置标题栏样式
* @function
* @param
* @returns
*/
setNavigationStyle
:
function
()
{
console
.
log
(
'setNavigationStyle'
)
let
funcStatusStyle
=
{
'height'
:
this
.
data
.
statusHeight
+
'px'
,
'background'
:
this
.
data
.
background
,
'color'
:
this
.
data
.
color
,
}
let
funcTitleStyle
=
{
'height'
:
this
.
data
.
titleHeight
+
'px'
,
'background'
:
this
.
data
.
background
,
}
}
that
.
setData
({
status
:
statusHeight
,
if
(
Object
.
keys
(
this
.
data
.
scrollStyle
).
length
)
{
navHeight
:
navHeight
funcStatusStyle
[
'background'
]
=
this
.
data
.
isScrollChange
?
this
.
data
.
scrollStyle
.
change
.
background
:
this
.
data
.
scrollStyle
.
normal
.
background
funcTitleStyle
[
'background'
]
=
this
.
data
.
isScrollChange
?
this
.
data
.
scrollStyle
.
change
.
background
:
this
.
data
.
scrollStyle
.
normal
.
background
this
.
setData
({
backIcon
:
this
.
data
.
isScrollChange
?
this
.
data
.
scrollStyle
.
change
.
backIcon
:
this
.
data
.
scrollStyle
.
normal
.
backIcon
})
})
}
let
funcTextStyle
=
{
'font-size'
:
this
.
data
.
fontSize
+
'rpx'
,
'color'
:
this
.
data
.
color
,
}
let
funcIconStyle
=
{
'width'
:
this
.
data
.
iconWidth
+
'px'
,
'height'
:
this
.
data
.
iconHeight
+
'px'
,
}
wx
.
setStorageSync
(
'navigationStatusHeight'
,
this
.
data
.
status
)
this
.
setData
({
wx
.
setStorageSync
(
'navigationCapsuleHeight'
,
this
.
data
.
navHeight
)
statusCss
:
App
.
cssObjectToCssString
(
funcStatusStyle
),
},
titleCss
:
App
.
cssObjectToCssString
(
funcTitleStyle
),
setStyle
:
function
()
{
textCss
:
App
.
cssObjectToCssString
(
funcTextStyle
),
var
that
=
this
,
containerStyle
,
textStyle
,
iconStyle
;
iconCss
:
App
.
cssObjectToCssString
(
funcIconStyle
),
containerStyle
=
[
'background:'
+
that
.
data
.
background
].
join
(
';'
);
textStyle
=
[
'color:'
+
that
.
data
.
color
,
'font-size:'
+
that
.
data
.
fontSize
+
'px'
].
join
(
';'
);
iconStyle
=
[
'width: '
+
that
.
data
.
iconWidth
+
'px'
,
'height: '
+
that
.
data
.
iconHeight
+
'px'
].
join
(
';'
);
that
.
setData
({
containerStyle
:
containerStyle
,
textStyle
:
textStyle
,
iconStyle
:
iconStyle
})
})
},
},
// 返回事件
back
:
function
(){
/**
* 返回按钮事件
* @function
* @param
* @returns
*/
onBack
:
function
()
{
wx
.
navigateBack
({
wx
.
navigateBack
({
delta
:
1
delta
:
1
})
})
this
.
triggerEvent
(
'back'
,
{
back
:
1
})
this
.
triggerEvent
(
'back'
,
{
back
:
1
})
},
},
home
:
function
()
{
/**
* 主页按钮事件
* @function
* @param
* @returns
*/
onHome
:
function
()
{
this
.
triggerEvent
(
'home'
,
{});
this
.
triggerEvent
(
'home'
,
{});
},
/**
* 滚动事件
* @function
* @param
* @returns
*/
eventScroll
:
function
(
funcScrollHeight
)
{
// 如果没有定义动态变换参数则无视滚动事件
if
(
Object
.
keys
(
this
.
data
.
scrollStyle
).
length
===
0
)
return
let
funcChangeHeight
=
0
if
(
/^
[
0-9.
]
+%$/
.
test
(
this
.
data
.
scrollStyle
.
scroll
))
{
console
.
log
(
'[component navigation] scrollStyle type error'
)
return
}
if
(
/^
[
0-9.
]
+
(
px
)?
$/
.
test
(
this
.
data
.
scrollStyle
.
scroll
))
{
funcChangeHeight
=
Number
(
this
.
data
.
scrollStyle
.
scroll
.
replace
(
'px'
,
''
))
}
}
if
(
/^
[
0-9.
]
+rpx$/
.
test
(
this
.
data
.
scrollStyle
.
scroll
))
{
funcChangeHeight
=
Number
(
this
.
data
.
scrollStyle
.
scroll
.
replace
(
'rpx'
,
''
))
*
wx
.
getSystemInfoSync
().
windowWidth
/
750
}
if
(
funcScrollHeight
<=
funcChangeHeight
)
{
this
.
setData
({
color
:
this
.
data
.
scrollStyle
.
normal
.
color
,
background
:
this
.
data
.
scrollStyle
.
normal
.
background
,
isScrollChange
:
false
})
}
if
(
funcChangeHeight
<
funcScrollHeight
)
{
this
.
setData
({
color
:
this
.
data
.
scrollStyle
.
change
.
color
,
background
:
this
.
data
.
scrollStyle
.
change
.
background
,
isScrollChange
:
true
})
}
},
}
}
})
})
\ No newline at end of file
component/navigation/navigation.wxml
View file @
92c2bff9
<view class='nav' style='height: {{status + navHeight}}px'>
<view class="navigation">
<view id="status" class='status' style='height: {{status}}px;{{containerStyle}}'></view>
<!-- 状态栏 -->
<view id="navbar" class='navbar' style='height:{{navHeight}}px;{{containerStyle}}'>
<view id="status" class='status' style="{{statusCss}}"></view>
<view class='back-icon' wx:if="{{backIcon}}" bindtap='back'>
<!-- 标题栏 -->
<view id="navbar" class='title' style="{{titleCss}}">
<view class='back-icon' wx:if="{{backIcon}}" bindtap='onBack'>
<image src='{{backIcon}}'></image>
<image src='{{backIcon}}'></image>
</view>
</view>
<view class='home-icon' wx:if="{{homeIcon}}" bindtap='
h
ome'>
<view class='home-icon' wx:if="{{homeIcon}}" bindtap='
onH
ome'>
<image src='{{homeIcon}}'></image>
<image src='{{homeIcon}}'></image>
</view>
</view>
<view class='
nav
-icon' wx:if="{{titleImg}}">
<view class='
title
-icon' wx:if="{{titleImg}}">
<image src='{{titleImg}}' style='{{icon
Style
}}'></image>
<image src='{{titleImg}}' style='{{icon
Css
}}'></image>
</view>
</view>
<view class='
nav-title'
wx:if="{{titleText && !titleImg}}">
<view class='
title-text' style="{{titleCss}}"
wx:if="{{titleText && !titleImg}}">
<text style='{{text
Style
}}'>{{titleText}}</text>
<text style='{{text
Css
}}'>{{titleText}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
component/navigation/navigation.wxss
View file @
92c2bff9
.nav {
.nav
igation
{
z-index: 2000;
z-index: 2000;
}
}
.status {
.status {
background: red
;
width: 750rpx
;
}
}
.
navbar
{
.
title
{
background: green
;
position: relative
;
}
}
.navbar{
.back-icon,
position: relative
.home-icon {
}
z-index: 1900;
.back-icon, .home-icon{
width: 28px;
width: 28px;
height: 100%;
height: 100%;
position: absolute;
position: absolute;
...
@@ -21,27 +20,40 @@
...
@@ -21,27 +20,40 @@
top: 50%;
top: 50%;
display: flex;
display: flex;
}
}
.back-icon{
.back-icon {
left: 16px;
left: 16px;
}
}
.home-icon{
.home-icon {
left: 44px
left: 44px
}
}
.back-icon image{
.back-icon image {
width: 28px;
width: 28px;
height: 28px;
height: 28px;
margin: auto;
margin: auto;
}
}
.home-icon image{
.home-icon image {
width: 20px;
width: 20px;
height: 20px;
height: 20px;
margin: auto;
margin: auto;
}
}
.nav-title, .nav-icon{
.title-icon {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.title-text {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
position: absolute;
position: absolute;
transform: translate(-50%, -50%);
width: 750rpx;
left: 50%;
top: 50%;
font-size: 0;
font-weight: bold;
font-weight: bold;
}
}
\ No newline at end of file
pages/activity-detail/activity-detail.wxss
View file @
92c2bff9
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
}
}
.banner-wave image {
.banner-wave image {
display: block;
width: 750rpx;
width: 750rpx;
height: 60rpx;
height: 60rpx;
}
}
...
...
pages/appointment/appointment.js
View file @
92c2bff9
...
@@ -3,6 +3,8 @@ const app = getApp()
...
@@ -3,6 +3,8 @@ const app = getApp()
Page
({
Page
({
data
:
{
data
:
{
navigationTitle
:
'123213231'
,
formType
:
1
,
formType
:
1
,
appointmentDate
:
''
,
appointmentDate
:
''
,
appointmentEndDate
:
''
,
appointmentEndDate
:
''
,
...
@@ -26,7 +28,8 @@ Page({
...
@@ -26,7 +28,8 @@ Page({
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
this
.
setData
({
this
.
setData
({
formType
:
Number
(
options
.
type
)
formType
:
Number
(
options
.
type
),
navigationTitle
:
Number
(
options
.
type
)
===
1
?
'夜间入园预约'
:
'看房预约'
})
})
this
.
setReset
()
this
.
setReset
()
},
},
...
...
pages/appointment/appointment.wxml
View file @
92c2bff9
<l-toast l-image-class="toast-image"></l-toast>
<l-toast l-image-class="toast-image"></l-toast>
<!-- 首页 - 入园预约 / 房屋预约 -->
<!-- 首页 - 入园预约 / 房屋预约 -->
<navigation class="navigation" backIcon="/image/back-w.png"></navigation>
<navigation class="navigation"
titleText="{{navigationTitle}}" color="#FFFFFF"
backIcon="/image/back-w.png"></navigation>
<view class="appointment-complete row con-c align-c" wx:if="{{appointmentComplete}}">
<view class="appointment-complete row con-c align-c" wx:if="{{appointmentComplete}}">
<view class="appointment-complete-tip">
<view class="appointment-complete-tip">
...
...
pages/guide/guide.js
View file @
92c2bff9
...
@@ -15,6 +15,7 @@ Page({
...
@@ -15,6 +15,7 @@ Page({
selectionPoint
:
0
,
selectionPoint
:
0
,
isSave
:
false
,
isSave
:
false
,
winDialog
:
false
,
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
...
@@ -217,14 +218,26 @@ Page({
...
@@ -217,14 +218,26 @@ Page({
icon
:
'success'
,
icon
:
'success'
,
title
:
'地图已保存至相册'
,
title
:
'地图已保存至相册'
,
show
:
true
,
show
:
true
,
mask
:
true
})
})
return
return
}
}
this
.
setData
({
winDialog
:
true
})
},
onSaveMapConfirm
:
function
()
{
this
.
setData
({
winDialog
:
false
})
wx
.
lin
.
showToast
({
wx
.
lin
.
showToast
({
icon
:
'loading'
,
icon
:
'loading'
,
title
:
'正在下载...'
,
title
:
'正在下载...'
,
show
:
true
,
show
:
true
,
mask
:
true
,
duration
:
20000
,
duration
:
20000
,
})
})
...
@@ -235,21 +248,40 @@ Page({
...
@@ -235,21 +248,40 @@ Page({
wx
.
saveImageToPhotosAlbum
({
wx
.
saveImageToPhotosAlbum
({
filePath
:
result
.
tempFilePath
,
filePath
:
result
.
tempFilePath
,
success
:
(
result
)
=>
{
success
:
(
result
)
=>
{
wx
.
lin
.
hideToast
()
wx
.
lin
.
showToast
({
icon
:
'success'
,
title
:
'地图已保存至相册'
,
show
:
true
,
mask
:
true
})
this
.
setData
({
this
.
setData
({
isSave
:
true
isSave
:
true
})
})
},
},
fail
:
(
error
)
=>
{
fail
:
(
error
)
=>
{
console
.
log
(
error
)
wx
.
lin
.
showToast
({
wx
.
lin
.
hideToast
()
icon
:
'error'
,
title
:
'地图已保存失败'
,
show
:
true
,
mask
:
true
})
}
}
})
})
},
},
fail
:
(
error
)
=>
{
fail
:
(
error
)
=>
{
console
.
log
(
error
)
wx
.
lin
.
showToast
({
wx
.
lin
.
hideToast
()
icon
:
'error'
,
title
:
'地图下载失败'
,
show
:
true
,
mask
:
true
})
}
}
})
})
},
},
onSaveMapCancel
:
function
()
{
this
.
setData
({
winDialog
:
false
})
},
})
})
\ No newline at end of file
pages/guide/guide.wxml
View file @
92c2bff9
<l-toast></l-toast>
<l-toast l-bg-class="dialog-bg"></l-toast>
<l-dialog
l-bg-class="dialog-bg"
show="{{winDialog}}"
type="confirm"
title="是否保存完整地图?"
title-color="#000000"
content="保存后可在手机相册中查看"
confirm-text="保存"
confirm-color="#000000"
cancel-text="取消"
cancel-color="#000000"
bind:linconfirm="onSaveMapConfirm"
bind:lincancel="onSaveMapCancel"
>
</l-dialog>
<!-- 畅玩 - 活动列表 -->
<!-- 畅玩 - 活动列表 -->
<navigation class="navigation" titleText="智慧导览" backIcon="/image/back.png"></navigation>
<navigation class="navigation" titleText="智慧导览" backIcon="/image/back.png"></navigation>
...
@@ -35,3 +50,4 @@
...
@@ -35,3 +50,4 @@
<view class="save-map row con-c align-c" bindtap="onSaveMap">
<view class="save-map row con-c align-c" bindtap="onSaveMap">
<text>保存完整地图</text>
<text>保存完整地图</text>
</view>
</view>
pages/guide/guide.wxss
View file @
92c2bff9
...
@@ -95,3 +95,7 @@
...
@@ -95,3 +95,7 @@
color: #FFFFFF;
color: #FFFFFF;
}
}
.dialog-bg {
background: rgba(0, 0, 0, .6) !important;
}
\ No newline at end of file
pages/home/home.js
View file @
92c2bff9
...
@@ -10,9 +10,19 @@ let logicData = {
...
@@ -10,9 +10,19 @@ let logicData = {
Page
({
Page
({
data
:
{
data
:
{
// 导航栏相关属性
// 导航栏相关属性
navigationStyle
:
{
normal
:
{
color
:
'#FFFFFF'
,
background
:
'rgba(255, 255, 255, 0)'
},
change
:
{
color
:
'#000000'
,
background
:
'rgba(255, 255, 255, 1)'
},
scroll
:
'600rpx'
,
},
navigationScroll
:
0
,
navigationScroll
:
0
,
navigationLogoTop
:
0
,
navigationLogoTop
:
0
,
navigationAnimationShow
:
0
,
isNavigationLogoWhite
:
true
,
isNavigationLogoWhite
:
true
,
// banner 列表数据
// banner 列表数据
...
@@ -234,20 +244,15 @@ Page({
...
@@ -234,20 +244,15 @@ Page({
if
(
funcEvent
.
scrollTop
>=
this
.
data
.
bannerHeight
)
{
if
(
funcEvent
.
scrollTop
>=
this
.
data
.
bannerHeight
)
{
if
(
this
.
data
.
isNavigationLogoWhite
)
{
if
(
this
.
data
.
isNavigationLogoWhite
)
{
this
.
setData
({
this
.
setData
({
isNavigationLogoWhite
:
false
isNavigationLogoWhite
:
false
,
})
})
}
}
let
funcOpacity
=
(
funcEvent
.
scrollTop
-
this
.
data
.
bannerHeight
)
/
40
this
.
setData
({
navigationAnimationShow
:
funcOpacity
})
}
}
if
(
funcEvent
.
scrollTop
<
this
.
data
.
bannerHeight
&&
!
this
.
data
.
isNavigationLogoWhite
)
{
if
(
funcEvent
.
scrollTop
<
this
.
data
.
bannerHeight
&&
!
this
.
data
.
isNavigationLogoWhite
)
{
this
.
setData
({
this
.
setData
({
isNavigationLogoWhite
:
true
,
isNavigationLogoWhite
:
true
,
navigation
AnimationShow
:
0
navigation
Scroll
:
funcEvent
.
scrollTop
})
})
}
}
...
...
pages/home/home.wxml
View file @
92c2bff9
<navigation class="navigation"
background="{{'rgba(255, 255, 255, ' + navigationAnimationShow + ')'
}}" scrollHeight="{{navigationScroll}}"></navigation>
<navigation class="navigation"
scrollStyle="{{navigationStyle
}}" scrollHeight="{{navigationScroll}}"></navigation>
<view class="container">
<view class="container">
<image class="logo" src="/image/logo-w.png" hidden="{{!isNavigationLogoWhite}}" style="{{'top: ' + navigationLogoTop + 'px'}}"></image>
<image class="logo" src="/image/logo-w.png" hidden="{{!isNavigationLogoWhite}}" style="{{'top: ' + navigationLogoTop + 'px'}}"></image>
...
...
pages/shop-detail/shop-detail.js
View file @
92c2bff9
...
@@ -8,6 +8,35 @@ let logicData = {
...
@@ -8,6 +8,35 @@ let logicData = {
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'
,
},
navigationStyleBlack
:
{
normal
:
{
backIcon
:
'/image/back-w.png'
,
color
:
'#FFFFFF'
,
background
:
'rgba(255, 255, 255, 0)'
},
change
:
{
backIcon
:
'/image/back-w.png'
,
color
:
'#FFFFFF'
,
background
:
'#272734'
},
scroll
:
'600rpx'
,
},
navigationScroll
:
0
,
// banner 列表数据
// banner 列表数据
banner
:
[],
banner
:
[],
bannerIndex
:
0
,
bannerIndex
:
0
,
...
@@ -173,16 +202,19 @@ Page({
...
@@ -173,16 +202,19 @@ Page({
onPageScroll
:
function
(
funcEvent
)
{
onPageScroll
:
function
(
funcEvent
)
{
// console.log(funcEvent)
// console.log(funcEvent)
// 优化滚动事件触发频率
// 优化滚动事件触发频率
//
if (logicData.pageScrollLock) return
if
(
logicData
.
pageScrollLock
)
return
//
logicData.pageScrollLock = true
logicData
.
pageScrollLock
=
true
this
.
setData
({
navigationScroll
:
funcEvent
.
scrollTop
})
this
.
setSideButton
(
funcEvent
)
this
.
setSideButton
(
funcEvent
)
// 恢复滚动事件
// 恢复滚动事件
//
logicData.pageScrollTimer = setTimeout(function () {
logicData
.
pageScrollTimer
=
setTimeout
(
function
()
{
//
logicData.pageScrollLock = false
logicData
.
pageScrollLock
=
false
//
clearTimeout(logicData.pageScrollTimer)
clearTimeout
(
logicData
.
pageScrollTimer
)
// }, 2
0)
},
1
0
)
},
},
/**
/**
...
@@ -192,10 +224,6 @@ Page({
...
@@ -192,10 +224,6 @@ Page({
* @returns
* @returns
*/
*/
setSideButton
:
function
(
funcEvent
)
{
setSideButton
:
function
(
funcEvent
)
{
// 优化滚动事件触发频率
if
(
logicData
.
pageScrollLock
)
return
logicData
.
pageScrollLock
=
true
if
(
funcEvent
.
scrollTop
>=
this
.
data
.
sideHeight
)
{
if
(
funcEvent
.
scrollTop
>=
this
.
data
.
sideHeight
)
{
if
(
this
.
data
.
winSide
)
{
if
(
this
.
data
.
winSide
)
{
this
.
setData
({
this
.
setData
({
...
@@ -215,12 +243,6 @@ Page({
...
@@ -215,12 +243,6 @@ Page({
navigationAnimationShow
:
0
navigationAnimationShow
:
0
})
})
}
}
// 恢复滚动事件
logicData
.
pageScrollTimer
=
setTimeout
(
function
()
{
logicData
.
pageScrollLock
=
false
clearTimeout
(
logicData
.
pageScrollTimer
)
},
40
)
},
},
onBackTop
:
function
()
{
onBackTop
:
function
()
{
...
...
pages/shop-detail/shop-detail.wxml
View file @
92c2bff9
<!-- 畅玩 - 商店详情 -->
<!-- 畅玩 - 商店详情 -->
<navigation class="navigation" titleText="{{info.name}}" color="#ffffff" backIcon="/image/back-w.png"></navigation>
<navigation wx:if="{{!isBlack}}" class="navigation" titleText="{{info.name}}" color="#ffffff" scrollStyle="{{navigationStyle}}" scrollHeight="{{navigationScroll}}"></navigation>
<navigation wx:if="{{isBlack}}" class="navigation" titleText="{{info.name}}" color="#ffffff" scrollStyle="{{navigationStyleBlack}}" scrollHeight="{{navigationScroll}}"></navigation>
<view class="container">
<view class="container">
<view id="banner" class="banner">
<view id="banner" class="banner">
...
...
pages/strategy/strategy.wxml
View file @
92c2bff9
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<text>文中提及</text>
<text>文中提及</text>
</view>
</view>
<block wx:for="{{relation}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<block wx:for="{{relation}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="relation-item row con-b" data-id="{{item.id}}" bindtap="shopDetail">
<view class="relation-item row con-b
align-c
" data-id="{{item.id}}" bindtap="shopDetail">
<image mode="widthFix" src="{{item.cover}}"></image>
<image mode="widthFix" src="{{item.cover}}"></image>
<view class="relation-item-info col">
<view class="relation-item-info col">
<text>{{item.title}}</text>
<text>{{item.title}}</text>
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
<text>{{item.price}}</text>
<text>{{item.price}}</text>
</view>
</view>
<view class="relation-item-more row align-c">
<view class="relation-item-more row align-c">
<image src="/image/more.png"></image>
<image src="/image/more
-g
.png"></image>
</view>
</view>
</view>
</view>
</block>
</block>
...
...
pages/strategy/strategy.wxss
View file @
92c2bff9
...
@@ -95,6 +95,7 @@ rich-text {
...
@@ -95,6 +95,7 @@ rich-text {
left: 24rpx;
left: 24rpx;
width: 176rpx;
width: 176rpx;
height: 214rpx;
height: 214rpx;
border-radius: 2px;
overflow: hidden;
overflow: hidden;
}
}
...
@@ -105,18 +106,21 @@ rich-text {
...
@@ -105,18 +106,21 @@ rich-text {
.relation-item-info text:nth-child(1) {
.relation-item-info text:nth-child(1) {
font-size: 30rpx;
font-size: 30rpx;
font-weight: bold;
font-weight: bold;
line-height: 42rpx;
color:rgba(21, 25, 31, 1);
color:rgba(21, 25, 31, 1);
}
}
.relation-item-info text:nth-child(2) {
.relation-item-info text:nth-child(2) {
margin-top: 30rpx;
margin-top: 30rpx;
font-size: 26rpx;
font-size: 26rpx;
line-height: 36rpx;
color: #656E7B;
color: #656E7B;
}
}
.relation-item-info text:nth-child(3) {
.relation-item-info text:nth-child(3) {
margin-top:
20
rpx;
margin-top:
12
rpx;
font-size: 26rpx;
font-size: 26rpx;
line-height: 36rpx;
color: #656E7B;
color: #656E7B;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment