Commit c82fc79e by 穆启卓

步数组队加广告

parent 5d672834
......@@ -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
......
......@@ -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 = '';
......
......@@ -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
});
}
}
});
......
......@@ -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">
......
......@@ -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 {
......
......@@ -13,7 +13,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.6.6",
"appid": "wx035eac0d4d63b3e4",
"appid": "wx41d6ac4f57b878d2",
"projectname": "walk_daka",
"debugOptions": {
"hidedInDevtools": []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment