Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
walk_daka_wx
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
穆启卓
walk_daka_wx
Commits
c82fc79e
Commit
c82fc79e
authored
May 30, 2019
by
穆启卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
步数组队加广告
parent
5d672834
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
48 deletions
+39
-48
app.js
app.js
+2
-0
config.js
config.js
+2
-2
index.js
pages/index/index.js
+31
-41
index.wxml
pages/index/index.wxml
+1
-3
index.wxss
pages/index/index.wxss
+2
-1
project.config.json
project.config.json
+1
-1
No files found.
app.js
View file @
c82fc79e
...
...
@@ -54,6 +54,7 @@ App({
userAuth
:
false
,
// 用户信息授权(为了拿unionId)
unionAuth
:
false
,
// unionId授权: 如果为false是需要授权,true是不需要
stepAuth
:
false
,
// 步数授权
iphoneX
:
''
,
// 手机类型,例如‘iPhone x’
},
onLaunch
(
options
)
{
...
...
@@ -157,6 +158,7 @@ App({
app
.
globalData
.
platform
=
info
.
platform
app
.
globalData
.
sWidth
=
info
.
screenWidth
app
.
globalData
.
wHeight
=
info
.
windowHeight
app
.
globalData
.
iphoneX
=
info
.
model
.
indexOf
(
'iPhone X'
)
>
-
1
;
if
(
info
.
screenHeight
/
info
.
screenWidth
>=
812
/
375
)
{
app
.
globalData
.
ifIphoneX
=
true
...
...
config.js
View file @
c82fc79e
...
...
@@ -4,8 +4,8 @@
// const host = 'miniapp-testapi.wxatech.com';
const
host
=
'miniapp-api.wxatech.com'
;
const
content
=
'game-bsdk'
;
// 步数打卡
//
const content = 'game-team_walk'; // 组队打卡
//
const content = 'game-bsdk'; // 步数打卡
const
content
=
'game-team_walk'
;
// 组队打卡
let
appName
=
''
;
let
appTitle
=
''
;
...
...
pages/index/index.js
View file @
c82fc79e
...
...
@@ -24,6 +24,7 @@ Page({
appTitle
:
''
,
bottomAdId
:
''
,
videoAdId
:
''
,
iphoneX
:
''
,
},
onShow
()
{
...
...
@@ -37,7 +38,8 @@ Page({
this
.
setData
({
scene
:
app
.
globalData
.
scene
,
appName
:
config
.
appName
,
appTitle
:
config
.
appTitle
appTitle
:
config
.
appTitle
,
iphoneX
:
app
.
globalData
.
iphoneX
});
this
.
getAdId
();
},
...
...
@@ -617,27 +619,19 @@ Page({
method
:
'POST'
,
success
:
res2
=>
{
if
(
res2
.
data
.
code
===
0
)
{
if
(
this
.
data
.
targetSteps
)
{
wx
.
showToast
({
title
:
'视频错误,请尝试其他方式赚取步数'
,
icon
:
'none'
,
duration
:
2000
});
this
.
data
.
bubbleList
.
forEach
(
item
=>
{
if
(
item
.
task_type
===
2
)
{
item
.
can_watch
=
false
;
}
});
this
.
setData
({
bubbleList
:
this
.
data
.
bubbleList
});
}
else
{
wx
.
showToast
({
title
:
'报名后将获取步数'
,
icon
:
'none'
,
duration
:
2000
});
}
wx
.
showToast
({
title
:
'视频错误,请尝试其他方式赚取步数'
,
icon
:
'none'
,
duration
:
2000
});
this
.
data
.
bubbleList
.
forEach
(
item
=>
{
if
(
item
.
task_type
===
2
)
{
item
.
can_watch
=
false
;
}
});
this
.
setData
({
bubbleList
:
this
.
data
.
bubbleList
});
}
}
});
...
...
@@ -656,30 +650,26 @@ Page({
method
:
'POST'
,
success
:
res2
=>
{
if
(
res2
.
data
.
code
===
0
)
{
let
earnStep
=
0
;
this
.
data
.
bubbleList
.
forEach
(
item
=>
{
if
(
item
.
task_type
===
2
)
{
earnStep
=
item
.
bonus_step
;
}
});
this
.
setData
({
bubbleList
:
this
.
data
.
bubbleList
});
if
(
this
.
data
.
targetSteps
)
{
wx
.
showToast
({
title
:
'获取步数成功'
,
icon
:
'none'
,
duration
:
2000
});
let
earnStep
=
0
;
this
.
data
.
bubbleList
.
forEach
(
item
=>
{
if
(
item
.
task_type
===
2
)
{
item
.
can_watch
=
false
;
earnStep
=
item
.
bonus_step
;
}
});
this
.
setData
({
bubbleList
:
this
.
data
.
bubbleList
});
this
.
dynamicDrawCanvas
(
this
.
data
.
currentSteps
+
earnStep
,
this
.
data
.
targetSteps
/
300
);
}
else
{
wx
.
showToast
({
title
:
'报名后将获取步数'
,
icon
:
'none'
,
duration
:
2000
this
.
setData
({
currentSteps
:
this
.
data
.
currentSteps
+
earnStep
});
}
wx
.
showModal
({
content
:
`恭喜增加
${
earnStep
}
步数成功`
,
showCancel
:
false
});
}
}
});
...
...
pages/index/index.wxml
View file @
c82fc79e
...
...
@@ -55,9 +55,7 @@
</view>
</view>
</view>
<view class="ad-container" wx:if="{{bottomAdId}}">
<ad unit-id="{{bottomAdId}}" binderror="bindAdError" bindclose="bindAdClose"></ad>
</view>
<ad class="ad-container" style="{{iphoneX ? 'bottom: 42rpx;' : ''}}" wx:if="{{bottomAdId}}" unit-id="{{bottomAdId}}" binderror="bindAdError" bindclose="bindAdClose"></ad>
<!-- 活动说明弹窗 -->
<view class="activity-explain-popup-bg" catchtouchmove wx:if="{{activityExplainShow}}">
<view class="activity-explain-popup-container">
...
...
pages/index/index.wxss
View file @
c82fc79e
...
...
@@ -239,9 +239,10 @@ page {
}
.ad-container {
height: 252rpx;
padding: 0 30rpx;
box-sizing: border-box;
position: fixed;
left: 0;
right: 0;
bottom: 0;
}
.ad-container ad {
...
...
project.config.json
View file @
c82fc79e
...
...
@@ -13,7 +13,7 @@
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.6.6"
,
"appid"
:
"wx
035eac0d4d63b3e4
"
,
"appid"
:
"wx
41d6ac4f57b878d2
"
,
"projectname"
:
"walk_daka"
,
"debugOptions"
:
{
"hidedInDevtools"
:
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment