909e7a61 by simon

默认提交

1 parent d39dd07e
<view class="comp">
<view wx:for="{{types}}" wx:key="{{index}}" data-data="{{item}}" bindtap="onTapHandler" class="btn point">
<view wx:for="{{types}}" wx:key="index" data-data="{{item}}" bindtap="onTapHandler" class="btn point">
<span class="iconfont {{typeIconMap[item+''] }}"></span>
</view>
<view wx:for="{{pics}}" wx:key="{{index}}" data-data="{{item}}" bindtap="onTapHandler" class="btn">
<view wx:for="{{pics}}" wx:key="index" data-data="{{item}}" bindtap="onTapHandler" class="btn">
<image mode="aspectFit" src="{{'../../image/shortcut/'+item+'.png'}}" class="pics ani-tada" />
</view>
<button class="contact" wx:if="{{contact}}" open-type="contact" show-message-card="true" send-message-title="家有儿孙" end-message-path="/pages/index/index" send-message-img="https://kdcdn.oss-cn-shenzhen.aliyuncs.com/weapp/jyes/assets/logo.jpg" bindcontact="handleContact">
......
......@@ -2,7 +2,7 @@
<!-- <view wx:for="{{types}}" wx:key="{{index}}" data-data="{{item}}" bindtap="onTapHandler" class="btn point">
<span class="iconfont {{typeIconMap[item+''] }}"></span>
</view> -->
<view wx:for="{{pics}}" wx:key="{{index}}" data-data="{{item}}" bindtap="onTapHandler" class="btn">
<view wx:for="{{pics}}" wx:key="index" data-data="{{item}}" bindtap="onTapHandler" class="btn">
<image mode="aspectFit" src="{{'../../image/shortcut/'+item+'.png'}}" class="pics" />
</view>
<button class="contact" wx:if="{{contact}}" open-type="contact" show-message-card="true" send-message-title="家有儿孙" end-message-path="/pages/index/index" send-message-img="https://kdcdn.oss-cn-shenzhen.aliyuncs.com/weapp/jyes/assets/logo.jpg" bindcontact="handleContact">
......
......@@ -50,6 +50,7 @@ function login() {
url: baseUrl + '/login',
sid: false,
data: {
appid: config.APPID,
code: Store.getItem('wxcode')
},
method: 'POST',
......@@ -58,7 +59,7 @@ function login() {
code,
content
} = res2.data;
console.log("res2:",res2);
console.log("res2:", res2);
if (code == 200 && content.sessionId) {
console.log("content:", content);
Store.setItem('sessionId', content.sessionId);
......
......@@ -23,8 +23,10 @@ Page({
vidHeight: 0, // 视频高度
isVideoEnded: false,
detailData: {}, // 详情列表
adConfigure: {}, //广告位配置
},
onShareAppMessage(res) {
console.log("res:", res);
if (res.from === 'button') {
// 来自页面内转发按钮
} else {
......@@ -52,30 +54,22 @@ Page({
})
},
onLoad(options) {
let _this = this;
this.setData({
options
});
this.queryVideoDetail().then((result) => {
// wifi下自动播放
// wx.getNetworkType({
// success(res) {
// const networkType = res.networkType;
// if (networkType == "wifi") {
// _this.onReplayHandler();
// }
// }
// })
_this.onReplayHandler();
}).catch((err) => {});;
this.initData();
this.queryAdConfigure().then((result) => {
this.queryVideoDetail().then((result) => {
_this.onReplayHandler();
}).catch((err) => {});;
this.initData();
});
wx.aldstat.sendEvent('进入页面', {
'页面名字': '视频详情页'
});
if (wx.createRewardedVideoAd) {
rewardedVideoAd = wx.createRewardedVideoAd({
adUnitId: 'adunit-3e849f70e28e6c21'
......@@ -90,7 +84,6 @@ Page({
console.log('onClose event emit', res)
})
}
this.checkShowVideoAd();
},
......@@ -220,6 +213,14 @@ Page({
// });
},
onShareVideoEnd() {
app.stat({
classify: "share",
action: "detail_page_button_end_share",
primaryCode: this.data.detailData.videoCode,
});
},
onShareFriend() {
app.stat({
classify: "share",
......@@ -271,6 +272,27 @@ Page({
});
},
/**广告配置 */
queryAdConfigure() {
return new Promise((resolve, reject) => {
app.post({
sid: false,
url: app.api.adConfigure,
data: {}
}).then((result) => {
this.setData({
adConfigure: result
})
app.globalData.adConfigure = result;
resolve(result);
}).catch((err) => {
reject(err)
});
});
},
/**
* 视频详情
*/
......
......@@ -13,7 +13,7 @@
<span class="t1 iconfont iconrefresh"></span>
<span class="tt">重播</span>
</button>
<button open-type="share" class="btn btn2 ani-scl">
<button bindtap="onShareVideoEnd" open-type="share" class="btn btn2 ani-scl">
<span class="t1 iconfont iconwechat"></span>
<span class="tt">分享</span>
</button>
......@@ -60,7 +60,7 @@
<view class="more">
<view class="more-title">-- 更多推荐欣赏 --</view>
<view class="more-list">
<view bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" wx:for="{{dataList}}" wx:key="{{index}}" class="more-list-item">
<view bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" wx:for="{{dataList}}" wx:key="index" class="more-list-item">
<view class="tit">{{item.videoName}}</view>
<image class="poster" src="{{item.thumbnail}}" />
</view>
......
......@@ -6,7 +6,7 @@
<view class="top-space"></view>
<van-sticky>
<van-tabs ellipsis="{{ false }}" active="{{ active }}" bind:click="onVanTabsHandler" bind:disabled="onClickDisabled">
<van-tab data-data="{{item}}" data-tt="{{item}}" wx:for="{{tabList}}" wx:key="{{index}}" title="{{item.tabName}}" disabled="{{item.type==2}}"></van-tab>
<van-tab wx:for="{{tabList}}" wx:key="index" title="{{item.tabName}}" disabled="{{item.type==2}}"></van-tab>
</van-tabs>
</van-sticky>
<view class="banner" wx:if="{{bannerList && bannerList.length>0}}">
......