From baa020f8cb9c97079e6468704ceb4acfa2240d4a Mon Sep 17 00:00:00 2001 From: zhl Date: Mon, 4 Mar 2019 12:19:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=88=B0=E5=B9=BF=E5=91=8A?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E6=97=B6=EF=BC=8C=E8=8E=B7=E5=8F=96=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E5=88=86=E4=BA=AB=E4=BA=BA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.wpy | 3 +++ src/jcfw/SDKManage.js | 4 ++-- src/pages/gameInfo.wpy | 2 +- src/pages/index.wpy | 24 ++++++++++++++++++++++++ src/pages/jumppage.wpy | 17 ++++++++++++----- 5 files changed, 42 insertions(+), 8 deletions(-) diff --git a/src/app.wpy b/src/app.wpy index d44e58a..43cb89f 100644 --- a/src/app.wpy +++ b/src/app.wpy @@ -193,5 +193,8 @@ export default class extends wepy.app { updateVip(vip) { this.globalData.vip = vip; } + getShareCount(cb) { + sdkManage.getAchievInviteeNum(cb); + } } diff --git a/src/jcfw/SDKManage.js b/src/jcfw/SDKManage.js index 7137150..a888e1c 100755 --- a/src/jcfw/SDKManage.js +++ b/src/jcfw/SDKManage.js @@ -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) // 获取分享配置 diff --git a/src/pages/gameInfo.wpy b/src/pages/gameInfo.wpy index 1613759..1f87e33 100644 --- a/src/pages/gameInfo.wpy +++ b/src/pages/gameInfo.wpy @@ -127,7 +127,7 @@ }, actionSheetGold() { if (this.score < this.record.score) { - this.requestAd('金币不足, ') + this.requestAd('金币不足') } else { this.buyGame(); } diff --git a/src/pages/index.wpy b/src/pages/index.wpy index 2919d6e..e7d5619 100644 --- a/src/pages/index.wpy +++ b/src/pages/index.wpy @@ -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) + } + } + } } diff --git a/src/pages/jumppage.wpy b/src/pages/jumppage.wpy index 4563e14..1e1dd3d 100644 --- a/src/pages/jumppage.wpy +++ b/src/pages/jumppage.wpy @@ -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 @@ - {{text}}是否跳转到爆冰达人,领取3金币? + {{text}} + 是否跳转到爆冰达人,领取3金币? 取消 @@ -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(); }