默认提交
Showing
6 changed files
with
119 additions
and
33 deletions
... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
14 | <span class="tt">重播</span> | 14 | <span class="tt">重播</span> |
15 | </button> | 15 | </button> |
16 | <button open-type="share" class="btn btn2 ani-scl"> | 16 | <button open-type="share" class="btn btn2 ani-scl"> |
17 | <span class="t1 iconfont iconplane"></span> | 17 | <span class="t1 iconfont iconwechat"></span> |
18 | <span class="tt">分享</span> | 18 | <span class="tt">分享</span> |
19 | </button> | 19 | </button> |
20 | </view> | 20 | </view> | ... | ... |
... | @@ -92,6 +92,10 @@ Page({ | ... | @@ -92,6 +92,10 @@ Page({ |
92 | } | 92 | } |
93 | }, | 93 | }, |
94 | 94 | ||
95 | /** | ||
96 | * 点击item详情 | ||
97 | * @param {*} evt | ||
98 | */ | ||
95 | onDetailHandler(evt) { | 99 | onDetailHandler(evt) { |
96 | let curItem = getBindtapData(evt); | 100 | let curItem = getBindtapData(evt); |
97 | let videoCode = curItem.videoCode || "" | 101 | let videoCode = curItem.videoCode || "" |
... | @@ -106,6 +110,62 @@ Page({ | ... | @@ -106,6 +110,62 @@ Page({ |
106 | }, | 110 | }, |
107 | 111 | ||
108 | /** | 112 | /** |
113 | * 点击banner详情 | ||
114 | * @param {*} evt | ||
115 | */ | ||
116 | onBannerHandler(evt) { | ||
117 | let curItem = getBindtapData(evt); | ||
118 | console.log("curItem:", curItem); | ||
119 | let { | ||
120 | bannerType, | ||
121 | videoCode, | ||
122 | bigImage, | ||
123 | gzhArticle | ||
124 | } = curItem; | ||
125 | |||
126 | |||
127 | switch (bannerType) { | ||
128 | |||
129 | case "video": | ||
130 | if (videoCode) { | ||
131 | app.router.push({ | ||
132 | path: "detail", | ||
133 | query: { | ||
134 | c: videoCode | ||
135 | } | ||
136 | }) | ||
137 | } | ||
138 | break; | ||
139 | |||
140 | case "image": | ||
141 | if (bigImage) { | ||
142 | let current = bigImage; | ||
143 | let urls = [bigImage]; | ||
144 | wx.previewImage({ | ||
145 | current: current, | ||
146 | urls: urls | ||
147 | }) | ||
148 | } | ||
149 | break; | ||
150 | |||
151 | case "article": | ||
152 | if (gzhArticle) { | ||
153 | app.router.push({ | ||
154 | path: "webview", | ||
155 | query: { | ||
156 | url: gzhArticle, | ||
157 | } | ||
158 | }) | ||
159 | } | ||
160 | break; | ||
161 | |||
162 | default: | ||
163 | break; | ||
164 | } | ||
165 | |||
166 | }, | ||
167 | |||
168 | /** | ||
109 | * 到个人列表页面 | 169 | * 到个人列表页面 |
110 | */ | 170 | */ |
111 | toPersonalList(evt) { | 171 | toPersonalList(evt) { | ... | ... |
... | @@ -21,16 +21,17 @@ | ... | @@ -21,16 +21,17 @@ |
21 | 21 | ||
22 | .banner { | 22 | .banner { |
23 | position: relative; | 23 | position: relative; |
24 | line-height: 140px; | 24 | line-height: 0px; |
25 | $swiperHei: 320px; | ||
25 | 26 | ||
26 | .swiper { | 27 | .swiper { |
27 | width: 750px; | 28 | width: 750px; |
28 | height: 280px; | 29 | height: $swiperHei; |
29 | margin: 0 auto; | 30 | margin: 0 auto; |
30 | 31 | ||
31 | .swiper-image { | 32 | .swiper-image { |
32 | width: 750px; | 33 | width: 750px; |
33 | height: 280px; | 34 | height: $swiperHei; |
34 | } | 35 | } |
35 | } | 36 | } |
36 | 37 | ||
... | @@ -38,7 +39,7 @@ | ... | @@ -38,7 +39,7 @@ |
38 | position: absolute; | 39 | position: absolute; |
39 | bottom: 0px; | 40 | bottom: 0px; |
40 | width: 750px; | 41 | width: 750px; |
41 | height: 80px; | 42 | height: 110px; |
42 | line-height: 80px; | 43 | line-height: 80px; |
43 | left: 0; | 44 | left: 0; |
44 | right: 0; | 45 | right: 0; | ... | ... |
... | @@ -13,13 +13,13 @@ | ... | @@ -13,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}}"> | 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}}"> |
14 | <block wx:for="{{bannerList}}" wx:key="{{index}}"> | 14 | <block wx:for="{{bannerList}}" wx:key="{{index}}"> |
15 | <swiper-item> | 15 | <swiper-item> |
16 | <image bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" class="swiper-image" src="{{item.imageUrl}}" mode="aspectFill" /> | 16 | <image bindtap="onBannerHandler" data-data="{{item}}" data-index="{{index}}" class="swiper-image" src="{{item.imageUrl}}" mode="aspectFill" /> |
17 | <view wx:if="{{curBanner && curBanner.bannerTitle}}" class="tit"> | ||
18 | {{curBanner && curBanner.bannerTitle || ""}} | ||
19 | </view> | ||
17 | </swiper-item> | 20 | </swiper-item> |
18 | </block> | 21 | </block> |
19 | </swiper> | 22 | </swiper> |
20 | <view wx:if="{{curBanner && curBanner.bannerTitle}}" class="tit"> | ||
21 | {{curBanner && curBanner.bannerTitle || ""}} | ||
22 | </view> | ||
23 | <!-- <view class="tit">名字</view> --> | 23 | <!-- <view class="tit">名字</view> --> |
24 | </view> | 24 | </view> |
25 | <view class="content"> | 25 | <view class="content"> | ... | ... |
1 | let app = getApp(); | 1 | let app = getApp(); |
2 | Page({ | 2 | Page({ |
3 | data: { | 3 | data: { |
4 | isShow: false, // 控制组件显示隐藏 | 4 | isOverShare: true, |
5 | url: '' | 5 | isShow: false, // 控制组件显示隐藏 |
6 | }, | 6 | url: '', |
7 | onLoad: function (options = {}) { | 7 | }, |
8 | let url = options.url; | 8 | onShareAppMessage(res) { |
9 | if (url) { | 9 | if (res.from === 'button') { |
10 | this.setData({ | 10 | // 来自页面内转发按钮 |
11 | url: url, | 11 | } |
12 | isShow: true | 12 | let url = encodeURIComponent(this.data.url); |
13 | }) | 13 | let path = `/pages/webview/webview?url=${url}`; |
14 | } else { | 14 | return { |
15 | wx.showToast({ | 15 | title: "家有儿孙", |
16 | title: '未找到页面地址', | 16 | path: path, |
17 | title: 'none', | 17 | // imageUrl: '' |
18 | }); | 18 | } |
19 | } | 19 | }, |
20 | } | 20 | onLoad(options = {}) { |
21 | wx.showLoading(); | ||
22 | let url = decodeURIComponent(options.url); | ||
23 | if (url) { | ||
24 | this.setData({ | ||
25 | url: url, | ||
26 | isShow: true | ||
27 | }) | ||
28 | |||
29 | } else { | ||
30 | wx.showToast({ | ||
31 | title: '未找到页面地址', | ||
32 | title: 'none', | ||
33 | }); | ||
34 | wx.hideLoading(); | ||
35 | } | ||
36 | }, | ||
37 | loadSucc() { | ||
38 | wx.hideLoading(); | ||
39 | } | ||
21 | }) | 40 | }) | ... | ... |
1 | <view class="loading-wrap"> | 1 | <!-- <navbar navbar-data='{{navbarData}}'></navbar> |
2 | <view class="loading"> | 2 | <view class="nav-bar-space" style='height: {{barHeight}}px'></view> --> |
3 | <view class="icon"></view> | 3 | <view class="loading-wrap"></view> |
4 | <view class="text">加载中...</view> | 4 | <view class="page"> |
5 | </view> | 5 | <view class="app__bgc bgc"></view> |
6 | <view class="app__bg bg"></view> | ||
7 | <view class="app__content main"> | ||
8 | <view class="top-space"></view> | ||
9 | <view class="content"> | ||
10 | <web-view wx:if="{{isShow}}" src="{{url}}" bindload="loadSucc" /> | ||
11 | </view> | ||
12 | </view> | ||
6 | </view> | 13 | </view> |
7 | <web-view wx:if="{{isShow}}" src="{{url}}" bindload="loadSucc"/> | ... | ... |
-
Please register or sign in to post a comment