cc0811b6 by simon

默认提交

1 parent c300a523
......@@ -14,7 +14,7 @@
<span class="tt">重播</span>
</button>
<button open-type="share" class="btn btn2 ani-scl">
<span class="t1 iconfont iconplane"></span>
<span class="t1 iconfont iconwechat"></span>
<span class="tt">分享</span>
</button>
</view>
......
......@@ -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) {
......
......@@ -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: 80px;
height: 110px;
line-height: 80px;
left: 0;
right: 0;
......
......@@ -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" />
<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 wx:if="{{curBanner && curBanner.bannerTitle}}" class="tit">
{{curBanner && curBanner.bannerTitle || ""}}
</view>
<!-- <view class="tit">名字</view> -->
</view>
<view class="content">
......
let app = getApp();
Page({
data: {
isShow: false, // 控制组件显示隐藏
url: ''
},
onLoad: function (options = {}) {
let url = options.url;
if (url) {
this.setData({
url: url,
isShow: true
})
} else {
wx.showToast({
title: '未找到页面地址',
title: 'none',
});
}
}
data: {
isOverShare: true,
isShow: false, // 控制组件显示隐藏
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();
}
})
......
<view class="loading-wrap">
<view class="loading">
<view class="icon"></view>
<view class="text">加载中...</view>
</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"/>
......