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
909e7a61
authored
2020-01-19 21:38:03 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
默认提交
1 parent
d39dd07e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
20 deletions
src/component/shortcut/shortcut.wxml
src/component/shortcut2/shortcut2.wxml
src/http/fetch-api.js
src/pages/detail/detail.js
src/pages/detail/detail.wxml
src/pages/index/index.wxml
src/component/shortcut/shortcut.wxml
View file @
909e7a6
<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">
...
...
src/component/shortcut2/shortcut2.wxml
View file @
909e7a6
...
...
@@ -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">
...
...
src/http/fetch-api.js
View file @
909e7a6
...
...
@@ -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
);
...
...
src/pages/detail/detail.js
View file @
909e7a6
...
...
@@ -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
.
queryAdConfigure
().
then
((
result
)
=>
{
this
.
queryVideoDetail
().
then
((
result
)
=>
{
// wifi下自动播放
// wx.getNetworkType({
// success(res) {
// const networkType = res.networkType;
// if (networkType == "wifi") {
// _this.onReplayHandler();
// }
// }
// })
_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
)
});
});
},
/**
* 视频详情
*/
...
...
src/pages/detail/detail.wxml
View file @
909e7a6
...
...
@@ -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>
...
...
src/pages/index/index.wxml
View file @
909e7a6
...
...
@@ -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}}">
...
...
Please
register
or
sign in
to post a comment