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
8739c417
authored
2019-12-23 17:05:07 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
默认提交
1 parent
7de4346d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
19 deletions
src/app.js
src/http/api.js
src/pages/reward/reward.js
src/pages/reward/reward.scss
src/pages/reward/reward.wxml
src/app.js
View file @
8739c41
...
...
@@ -8,12 +8,22 @@ let store = require('./utils/stroage');
require
(
'./http/mock-data'
);
App
({
api
:
api
,
get
:
fetchApi
.
fetch
,
post
:
(
params
)
=>
{
params
.
method
=
'post'
;
return
fetchApi
.
fetch
(
params
);
},
api
:
api
,
stat
:
(
data
)
=>
{
let
params
=
{}
params
.
mode
=
'log'
;
params
.
mode
=
'log'
;
params
.
sid
=
false
;
params
.
url
=
api
.
stat
;
params
.
data
=
data
;
params
.
method
=
"POST"
;
return
fetchApi
.
fetch
(
params
);
},
config
:
config
,
router
:
router
,
store
:
store
,
...
...
@@ -33,6 +43,11 @@ App({
this
.
globalData
.
statusBarHeight
=
wx
.
getSystemInfoSync
().
statusBarHeight
;
this
.
globalData
.
barHeight
=
height
;
this
.
share
();
this
.
stat
({
classify
:
"minipro"
,
action
:
"detail_page"
,
primaryCode
:
""
,
})
},
globalData
:
{
share
:
false
,
...
...
src/http/api.js
View file @
8739c41
...
...
@@ -8,9 +8,12 @@ module.exports = {
videoList
:
'/video/list'
,
// 视频列表
videoAcccout
:
'/video/account'
,
// 帐号下的视频
videoDetail
:
'/video/detail'
,
// 视频详情
rewardDetail
:
'/hide/order'
,
// 获得打赏视频
rewardOrder
:
'/hide/order'
,
// 打赏成功获取视频
rewardDetail
:
'/hide/detail'
,
// 获得隐藏视频详情
videoMore
:
'/video/more'
,
// 更多推荐
accountDetail
:
'/account/detail'
,
// 帐号详情
wxPay
:
'/wx/pay'
,
// 帐号详情
stat
:
'/dot'
,
// 打点
/**
* 通用接口
...
...
src/pages/reward/reward.js
View file @
8739c41
...
...
@@ -13,22 +13,28 @@ Page({
indexInfo
:
{},
userInfo
:
{},
rewardList
:
[{
price
:
6
price
:
6
,
packet
:
"SIX_PACKET"
},
{
price
:
18
price
:
18
,
packet
:
"EIGHTEEN_PACKET"
},
{
price
:
66
price
:
66
,
packet
:
"SIXTY_SIX_PACKET"
},
{
price
:
88
price
:
88
,
packet
:
"EIGHTY_EIGHT_PACKET"
},
{
price
:
168
price
:
168
,
packet
:
"ONE_SIXTY_EIGHT_PACKET"
},
{
price
:
388
price
:
388
,
packet
:
"THREE_EIGHTY_EIGHT_PACKET"
},
]
},
...
...
@@ -51,14 +57,14 @@ Page({
* 到达底部
* 做加载更多操作
*/
onReachBottom
()
{
if
(
this
.
data
.
dataList
.
length
<
this
.
data
.
total
)
{
this
.
setData
({
page
:
this
.
data
.
page
+
1
});
this
.
queryDataList
();
}
},
//
onReachBottom() {
//
if (this.data.dataList.length < this.data.total) {
//
this.setData({
//
page: this.data.page + 1
//
});
//
this.queryDataList();
//
}
//
},
// 重置页面列表 点击搜索条件时需要
resetPage
()
{
...
...
@@ -69,6 +75,22 @@ Page({
},
/**
*
*/
onRewardHandler
(
evt
)
{
let
curItem
=
getBindtapData
(
evt
);
console
.
log
(
"curItem:"
,
curItem
);
app
.
post
({
url
:
app
.
api
.
wxPay
,
data
:
curItem
}).
then
((
result
)
=>
{
console
.
log
(
"wxPay result:"
,
result
);
}).
catch
((
err
)
=>
{
});
},
/**
* 请求DataList
*/
queryDataList
()
{
...
...
src/pages/reward/reward.scss
View file @
8739c41
...
...
@@ -19,10 +19,31 @@
position
:
relative
;
.portrait
{
text-align
:
center
;
position
:
relative
;
width
:
207px
;
margin
:
0
auto
;
&
-bg
{
text-align
:
center
;
position
:
absolute
;
width
:
207px
;
top
:
-3px
;
}
// 头像
.avatar
{
margin
:
0
auto
;
position
:
relative
;
display
:
block
;
width
:
201px
;
height
:
201px
;
border-radius
:
50%
;
overflow
:
hidden
}
.
avatar-avatar
:
:
after
{
border-radius
:
205px
;
}
}
...
...
@@ -38,7 +59,7 @@
&
-item
{
width
:
320px
;
margin-bottom
:
12px
;
margin-bottom
:
12px
;
}
}
}
...
...
src/pages/reward/reward.wxml
View file @
8739c41
...
...
@@ -7,10 +7,11 @@
<view class="content">
<view class="portrait">
<image class="portrait-bg" mode="widthFix" src="../../image/reward/reward-portrait-bg.png" />
<!-- <open-data class="avatar" type="userAvatarUrl"></open-data> -->
</view>
<view class="reward">
<view class="reward-wrap">
<image class="reward-wrap-item" wx:for="{{rewardList}}" wx:key="{{index}}" mode="widthFix" src="{{'../../image/reward/m-'+item.price+'.png'}}" />
<image
bindtap="onRewardHandler" data-data="{{item}}"
class="reward-wrap-item" wx:for="{{rewardList}}" wx:key="{{index}}" mode="widthFix" src="{{'../../image/reward/m-'+item.price+'.png'}}" />
</view>
</view>
</view>
...
...
Please
register
or
sign in
to post a comment