Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
home-with-kids-mp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
cc0811b6
authored
2019-12-04 18:42:07 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
默认提交
1 parent
c300a523
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
17 deletions
src/pages/detail/detail.wxml
src/pages/index/index.js
src/pages/index/index.scss
src/pages/index/index.wxml
src/pages/webview/webview.js
src/pages/webview/webview.wxml
src/pages/detail/detail.wxml
View file @
cc0811b
...
...
@@ -14,7 +14,7 @@
<span class="tt">重播</span>
</button>
<button open-type="share" class="btn btn2 ani-scl">
<span class="t1 iconfont icon
plane
"></span>
<span class="t1 iconfont icon
wechat
"></span>
<span class="tt">分享</span>
</button>
</view>
...
...
src/pages/index/index.js
View file @
cc0811b
...
...
@@ -92,6 +92,10 @@ Page({
}
},
/**
* 点击item详情
* @param {*} evt
*/
onDetailHandler
(
evt
)
{
let
curItem
=
getBindtapData
(
evt
);
let
videoCode
=
curItem
.
videoCode
||
""
...
...
@@ -106,6 +110,62 @@ Page({
},
/**
* 点击banner详情
* @param {*} evt
*/
onBannerHandler
(
evt
)
{
let
curItem
=
getBindtapData
(
evt
);
console
.
log
(
"curItem:"
,
curItem
);
let
{
bannerType
,
videoCode
,
bigImage
,
gzhArticle
}
=
curItem
;
switch
(
bannerType
)
{
case
"video"
:
if
(
videoCode
)
{
app
.
router
.
push
({
path
:
"detail"
,
query
:
{
c
:
videoCode
}
})
}
break
;
case
"image"
:
if
(
bigImage
)
{
let
current
=
bigImage
;
let
urls
=
[
bigImage
];
wx
.
previewImage
({
current
:
current
,
urls
:
urls
})
}
break
;
case
"article"
:
if
(
gzhArticle
)
{
app
.
router
.
push
({
path
:
"webview"
,
query
:
{
url
:
gzhArticle
,
}
})
}
break
;
default
:
break
;
}
},
/**
* 到个人列表页面
*/
toPersonalList
(
evt
)
{
...
...
src/pages/index/index.scss
View file @
cc0811b
...
...
@@ -21,16 +21,17 @@
.banner
{
position
:
relative
;
line-height
:
140px
;
line-height
:
0px
;
$swiperHei
:
320px
;
.swiper
{
width
:
750px
;
height
:
280px
;
height
:
$swiperHei
;
margin
:
0
auto
;
.swiper-image
{
width
:
750px
;
height
:
280px
;
height
:
$swiperHei
;
}
}
...
...
@@ -38,7 +39,7 @@
position
:
absolute
;
bottom
:
0px
;
width
:
750px
;
height
:
8
0px
;
height
:
11
0px
;
line-height
:
80px
;
left
:
0
;
right
:
0
;
...
...
src/pages/index/index.wxml
View file @
cc0811b
...
...
@@ -13,13 +13,13 @@
<swiper bindchange="onBannerChangeHandler" class="swiper" indicator-color="rgba(0,0,0,.3)" indicator-active-color="rgba(255,255,255,1)" indicator-dots="{{true}}" autoplay="{{true}}" interval="{{5000}}" duration="{{500}}">
<block wx:for="{{bannerList}}" wx:key="{{index}}">
<swiper-item>
<image bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" class="swiper-image" src="{{item.imageUrl}}" mode="aspectFill" />
</swiper-item>
</block>
</swiper>
<image bindtap="onBannerHandler" data-data="{{item}}" data-index="{{index}}" class="swiper-image" src="{{item.imageUrl}}" mode="aspectFill" />
<view wx:if="{{curBanner && curBanner.bannerTitle}}" class="tit">
{{curBanner && curBanner.bannerTitle || ""}}
</view>
</swiper-item>
</block>
</swiper>
<!-- <view class="tit">名字</view> -->
</view>
<view class="content">
...
...
src/pages/webview/webview.js
View file @
cc0811b
let
app
=
getApp
();
Page
({
data
:
{
isOverShare
:
true
,
isShow
:
false
,
// 控制组件显示隐藏
url
:
''
url
:
''
,
},
onLoad
:
function
(
options
=
{})
{
let
url
=
options
.
url
;
onShareAppMessage
(
res
)
{
if
(
res
.
from
===
'button'
)
{
// 来自页面内转发按钮
}
let
url
=
encodeURIComponent
(
this
.
data
.
url
);
let
path
=
`/pages/webview/webview?url=
${
url
}
`
;
return
{
title
:
"家有儿孙"
,
path
:
path
,
// imageUrl: ''
}
},
onLoad
(
options
=
{})
{
wx
.
showLoading
();
let
url
=
decodeURIComponent
(
options
.
url
);
if
(
url
)
{
this
.
setData
({
url
:
url
,
isShow
:
true
})
}
else
{
wx
.
showToast
({
title
:
'未找到页面地址'
,
title
:
'none'
,
});
wx
.
hideLoading
();
}
},
loadSucc
()
{
wx
.
hideLoading
();
}
})
...
...
src/pages/webview/webview.wxml
View file @
cc0811b
<view class="loading-wrap">
<view class="loading">
<view class="icon"></view>
<view class="text">加载中...</view>
<!-- <navbar navbar-data='{{navbarData}}'></navbar>
<view class="nav-bar-space" style='height: {{barHeight}}px'></view> -->
<view class="loading-wrap"></view>
<view class="page">
<view class="app__bgc bgc"></view>
<view class="app__bg bg"></view>
<view class="app__content main">
<view class="top-space"></view>
<view class="content">
<web-view wx:if="{{isShow}}" src="{{url}}" bindload="loadSucc" />
</view>
</view>
</view>
<web-view wx:if="{{isShow}}" src="{{url}}" bindload="loadSucc"/>
...
...
Please
register
or
sign in
to post a comment