909e7a61 by simon

默认提交

1 parent d39dd07e
1 <view class="comp"> 1 <view class="comp">
2 <view wx:for="{{types}}" wx:key="{{index}}" data-data="{{item}}" bindtap="onTapHandler" class="btn point"> 2 <view wx:for="{{types}}" wx:key="index" data-data="{{item}}" bindtap="onTapHandler" class="btn point">
3 <span class="iconfont {{typeIconMap[item+''] }}"></span> 3 <span class="iconfont {{typeIconMap[item+''] }}"></span>
4 </view> 4 </view>
5 <view wx:for="{{pics}}" wx:key="{{index}}" data-data="{{item}}" bindtap="onTapHandler" class="btn"> 5 <view wx:for="{{pics}}" wx:key="index" data-data="{{item}}" bindtap="onTapHandler" class="btn">
6 <image mode="aspectFit" src="{{'../../image/shortcut/'+item+'.png'}}" class="pics ani-tada" /> 6 <image mode="aspectFit" src="{{'../../image/shortcut/'+item+'.png'}}" class="pics ani-tada" />
7 </view> 7 </view>
8 <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"> 8 <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 @@ ...@@ -2,7 +2,7 @@
2 <!-- <view wx:for="{{types}}" wx:key="{{index}}" data-data="{{item}}" bindtap="onTapHandler" class="btn point"> 2 <!-- <view wx:for="{{types}}" wx:key="{{index}}" data-data="{{item}}" bindtap="onTapHandler" class="btn point">
3 <span class="iconfont {{typeIconMap[item+''] }}"></span> 3 <span class="iconfont {{typeIconMap[item+''] }}"></span>
4 </view> --> 4 </view> -->
5 <view wx:for="{{pics}}" wx:key="{{index}}" data-data="{{item}}" bindtap="onTapHandler" class="btn"> 5 <view wx:for="{{pics}}" wx:key="index" data-data="{{item}}" bindtap="onTapHandler" class="btn">
6 <image mode="aspectFit" src="{{'../../image/shortcut/'+item+'.png'}}" class="pics" /> 6 <image mode="aspectFit" src="{{'../../image/shortcut/'+item+'.png'}}" class="pics" />
7 </view> 7 </view>
8 <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"> 8 <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() { ...@@ -50,6 +50,7 @@ function login() {
50 url: baseUrl + '/login', 50 url: baseUrl + '/login',
51 sid: false, 51 sid: false,
52 data: { 52 data: {
53 appid: config.APPID,
53 code: Store.getItem('wxcode') 54 code: Store.getItem('wxcode')
54 }, 55 },
55 method: 'POST', 56 method: 'POST',
...@@ -58,7 +59,7 @@ function login() { ...@@ -58,7 +59,7 @@ function login() {
58 code, 59 code,
59 content 60 content
60 } = res2.data; 61 } = res2.data;
61 console.log("res2:",res2); 62 console.log("res2:", res2);
62 if (code == 200 && content.sessionId) { 63 if (code == 200 && content.sessionId) {
63 console.log("content:", content); 64 console.log("content:", content);
64 Store.setItem('sessionId', content.sessionId); 65 Store.setItem('sessionId', content.sessionId);
......
...@@ -23,8 +23,10 @@ Page({ ...@@ -23,8 +23,10 @@ Page({
23 vidHeight: 0, // 视频高度 23 vidHeight: 0, // 视频高度
24 isVideoEnded: false, 24 isVideoEnded: false,
25 detailData: {}, // 详情列表 25 detailData: {}, // 详情列表
26 adConfigure: {}, //广告位配置
26 }, 27 },
27 onShareAppMessage(res) { 28 onShareAppMessage(res) {
29 console.log("res:", res);
28 if (res.from === 'button') { 30 if (res.from === 'button') {
29 // 来自页面内转发按钮 31 // 来自页面内转发按钮
30 } else { 32 } else {
...@@ -52,30 +54,22 @@ Page({ ...@@ -52,30 +54,22 @@ Page({
52 }) 54 })
53 }, 55 },
54 onLoad(options) { 56 onLoad(options) {
55
56
57 let _this = this; 57 let _this = this;
58 this.setData({ 58 this.setData({
59 options 59 options
60 }); 60 });
61
62 this.queryAdConfigure().then((result) => {
61 this.queryVideoDetail().then((result) => { 63 this.queryVideoDetail().then((result) => {
62 // wifi下自动播放
63 // wx.getNetworkType({
64 // success(res) {
65 // const networkType = res.networkType;
66 // if (networkType == "wifi") {
67 // _this.onReplayHandler();
68 // }
69 // }
70 // })
71 _this.onReplayHandler(); 64 _this.onReplayHandler();
72 }).catch((err) => {});; 65 }).catch((err) => {});;
73 this.initData(); 66 this.initData();
67 });
68
74 wx.aldstat.sendEvent('进入页面', { 69 wx.aldstat.sendEvent('进入页面', {
75 '页面名字': '视频详情页' 70 '页面名字': '视频详情页'
76 }); 71 });
77 72
78
79 if (wx.createRewardedVideoAd) { 73 if (wx.createRewardedVideoAd) {
80 rewardedVideoAd = wx.createRewardedVideoAd({ 74 rewardedVideoAd = wx.createRewardedVideoAd({
81 adUnitId: 'adunit-3e849f70e28e6c21' 75 adUnitId: 'adunit-3e849f70e28e6c21'
...@@ -90,7 +84,6 @@ Page({ ...@@ -90,7 +84,6 @@ Page({
90 console.log('onClose event emit', res) 84 console.log('onClose event emit', res)
91 }) 85 })
92 } 86 }
93
94 this.checkShowVideoAd(); 87 this.checkShowVideoAd();
95 }, 88 },
96 89
...@@ -220,6 +213,14 @@ Page({ ...@@ -220,6 +213,14 @@ Page({
220 // }); 213 // });
221 }, 214 },
222 215
216 onShareVideoEnd() {
217 app.stat({
218 classify: "share",
219 action: "detail_page_button_end_share",
220 primaryCode: this.data.detailData.videoCode,
221 });
222 },
223
223 onShareFriend() { 224 onShareFriend() {
224 app.stat({ 225 app.stat({
225 classify: "share", 226 classify: "share",
...@@ -271,6 +272,27 @@ Page({ ...@@ -271,6 +272,27 @@ Page({
271 }); 272 });
272 }, 273 },
273 274
275
276 /**广告配置 */
277 queryAdConfigure() {
278 return new Promise((resolve, reject) => {
279 app.post({
280 sid: false,
281 url: app.api.adConfigure,
282 data: {}
283 }).then((result) => {
284 this.setData({
285 adConfigure: result
286 })
287 app.globalData.adConfigure = result;
288
289 resolve(result);
290 }).catch((err) => {
291 reject(err)
292 });
293 });
294 },
295
274 /** 296 /**
275 * 视频详情 297 * 视频详情
276 */ 298 */
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
13 <span class="t1 iconfont iconrefresh"></span> 13 <span class="t1 iconfont iconrefresh"></span>
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 bindtap="onShareVideoEnd" open-type="share" class="btn btn2 ani-scl">
17 <span class="t1 iconfont iconwechat"></span> 17 <span class="t1 iconfont iconwechat"></span>
18 <span class="tt">分享</span> 18 <span class="tt">分享</span>
19 </button> 19 </button>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
60 <view class="more"> 60 <view class="more">
61 <view class="more-title">-- 更多推荐欣赏 --</view> 61 <view class="more-title">-- 更多推荐欣赏 --</view>
62 <view class="more-list"> 62 <view class="more-list">
63 <view bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" wx:for="{{dataList}}" wx:key="{{index}}" class="more-list-item"> 63 <view bindtap="onDetailHandler" data-data="{{item}}" data-index="{{index}}" wx:for="{{dataList}}" wx:key="index" class="more-list-item">
64 <view class="tit">{{item.videoName}}</view> 64 <view class="tit">{{item.videoName}}</view>
65 <image class="poster" src="{{item.thumbnail}}" /> 65 <image class="poster" src="{{item.thumbnail}}" />
66 </view> 66 </view>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 <view class="top-space"></view> 6 <view class="top-space"></view>
7 <van-sticky> 7 <van-sticky>
8 <van-tabs ellipsis="{{ false }}" active="{{ active }}" bind:click="onVanTabsHandler" bind:disabled="onClickDisabled"> 8 <van-tabs ellipsis="{{ false }}" active="{{ active }}" bind:click="onVanTabsHandler" bind:disabled="onClickDisabled">
9 <van-tab data-data="{{item}}" data-tt="{{item}}" wx:for="{{tabList}}" wx:key="{{index}}" title="{{item.tabName}}" disabled="{{item.type==2}}"></van-tab> 9 <van-tab wx:for="{{tabList}}" wx:key="index" title="{{item.tabName}}" disabled="{{item.type==2}}"></van-tab>
10 </van-tabs> 10 </van-tabs>
11 </van-sticky> 11 </van-sticky>
12 <view class="banner" wx:if="{{bannerList && bannerList.length>0}}"> 12 <view class="banner" wx:if="{{bannerList && bannerList.length>0}}">
......