跳转到广告游戏时,获取最新的分享人数
This commit is contained in:
parent
0d71b0a182
commit
baa020f8cb
@ -193,5 +193,8 @@ export default class extends wepy.app {
|
||||
updateVip(vip) {
|
||||
this.globalData.vip = vip;
|
||||
}
|
||||
getShareCount(cb) {
|
||||
sdkManage.getAchievInviteeNum(cb);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -151,7 +151,7 @@ var SDKManage = function() {
|
||||
}
|
||||
}
|
||||
if (cb) {
|
||||
cb();
|
||||
cb(invitee_nums);
|
||||
}
|
||||
};
|
||||
jcshare.getAchievInviteeNum(callback);
|
||||
@ -167,7 +167,7 @@ var SDKManage = function() {
|
||||
this.logincbarr = [
|
||||
this.gamelogin.bind(this),
|
||||
// this.wxGetUseInfo.bind(this),
|
||||
// this.checkSharedata.bind(this),
|
||||
this.checkSharedata.bind(this),
|
||||
// redis 配置
|
||||
this.getGameConfig.bind(this)
|
||||
// 获取分享配置
|
||||
|
@ -127,7 +127,7 @@
|
||||
},
|
||||
actionSheetGold() {
|
||||
if (this.score < this.record.score) {
|
||||
this.requestAd('金币不足, ')
|
||||
this.requestAd('金币不足')
|
||||
} else {
|
||||
this.buyGame();
|
||||
}
|
||||
|
@ -290,5 +290,29 @@
|
||||
this.noData = false;
|
||||
this.noMore = true;
|
||||
}
|
||||
onShareAppMessage() {
|
||||
let self = this;
|
||||
let account = wepy.getStorageSync('account');
|
||||
return {
|
||||
title: '来玩啊',
|
||||
path: `/pages/index?isShare=1&inviter_id=${account.account_id}`,
|
||||
imageUrl: 'https://resource.kingsome.cn/dalmatian/wapp/share.jpg',
|
||||
success: function (res) {
|
||||
wepy.getShareInfo({
|
||||
shareTicket: res.shareTickets[0]
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
fail: function (res) {
|
||||
// 分享失败
|
||||
console.log(res)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -28,10 +28,11 @@
|
||||
padding: 10px;
|
||||
font-size:18px;
|
||||
color:#777;
|
||||
|
||||
flex-flow:column;
|
||||
line-height:32px;
|
||||
}
|
||||
.msg-action-bar {
|
||||
height: 80rpx;
|
||||
height: 100rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
border-top: 1rpx solid #e5e5e5;
|
||||
@ -57,7 +58,8 @@
|
||||
<view class="background-view"></view>
|
||||
<view class="msg-box">
|
||||
<view class="msg-title">
|
||||
<text>{{text}}是否跳转到爆冰达人,领取3金币?</text>
|
||||
<text>{{text}}</text>
|
||||
<text>是否跳转到爆冰达人,领取3金币?</text>
|
||||
</view>
|
||||
<view class="msg-action-bar">
|
||||
<view class="msg-action-btn" @tap="cancel"><text>取消</text></view>
|
||||
@ -66,7 +68,7 @@
|
||||
target="miniProgram"
|
||||
open-type="navigate"
|
||||
app-id="wxc02bad35ad26165e"
|
||||
path="?aid={{aid}}&version=product&share_count=0"
|
||||
path="?aid={{aid}}&version=product&share_count={{shareCount}}"
|
||||
extra-data=""
|
||||
version="release"
|
||||
>
|
||||
@ -87,7 +89,8 @@
|
||||
components = {};
|
||||
data = {
|
||||
text: '',
|
||||
aid: '11'
|
||||
aid: '11',
|
||||
shareCount: 0
|
||||
};
|
||||
methods = {
|
||||
cancel: function() {
|
||||
@ -99,6 +102,10 @@
|
||||
this.text = decodeURIComponent(params.text);
|
||||
this.aid = decodeURIComponent(params.aid);
|
||||
console.log(`aid : ${this.aid}`);
|
||||
let self = this;
|
||||
this.$parent.getShareCount(count => {
|
||||
self.shareCount = count;
|
||||
});
|
||||
this.$apply();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user