diff --git a/src/app.wpy b/src/app.wpy index 291694a..d6bfe6c 100644 --- a/src/app.wpy +++ b/src/app.wpy @@ -210,5 +210,10 @@ export default class extends wepy.app { updateUserInfo(allInfo) { return sdkManage.updateUser(allInfo); } + log(eventName, param) { + setTimeout(function() { + sdkManage.uploadLog(eventName, param); + }); + } } diff --git a/src/common/global.js b/src/common/global.js index 186523b..a42f73a 100644 --- a/src/common/global.js +++ b/src/common/global.js @@ -1,7 +1,7 @@ const env = 'test'; //product, test export default { env: env, - apiBase: env === 'test'? 'https://ghost-test.kingsome.cn' : 'https://ghost.kingsome.cn', + apiBase: env === 'test'? 'http://192.168.100.228' : 'https://ghost.kingsome.cn', cdnBase: 'https://h5games-al.kingsome.cn/emulator-static/', version: '1.0.0', gameTypes: ['射击','格斗', '角色扮演','动作角色扮演', diff --git a/src/components/z-action-sheet.wpy b/src/components/z-action-sheet.wpy index 6411e49..aba444f 100644 --- a/src/components/z-action-sheet.wpy +++ b/src/components/z-action-sheet.wpy @@ -58,6 +58,7 @@ app-id="wx815bf59d472c0a63" path="/pages/product?{{config.params}}" extra-data="" + @tap = 'buyProductTap' version="{{config.payVer}}" >促销开通(购买产品后自动开通游戏) @@ -85,6 +86,9 @@ }, goldTap(e) { this.$emit('goldTap') + }, + buyProductTap(e) { + this.$emit('buyProductTap'); } } } diff --git a/src/jcfw/SDKManage.js b/src/jcfw/SDKManage.js index e824d37..2910119 100755 --- a/src/jcfw/SDKManage.js +++ b/src/jcfw/SDKManage.js @@ -210,8 +210,10 @@ var SDKManage = function() { reject(err); }) }) - }; + this.uploadLog = function(eventName, param) { + jcfw.gamelog.logButtonClick(eventName, param); + } }; diff --git a/src/pages/game.wpy b/src/pages/game.wpy index 32866a3..34dbad1 100644 --- a/src/pages/game.wpy +++ b/src/pages/game.wpy @@ -48,6 +48,7 @@ }; onLoad(params) { + this.$parent.log('game_play_page_onload', params); this.gid = params.gid; this.link = decodeURIComponent(params.link); let account = wepy.getStorageSync('account'); @@ -82,11 +83,13 @@ let shareImg = this.share_image; let url = `/pages/index?isShare=1&inviter_id=${account.account_id}`; if (this.roomId) { + this.$parent.log('create_room', {gid: this.gid, roomId: this.roomId}); url = `/pages/index?isShare=1&inviter_id=${account.account_id}&roomId=${this.roomId}&gid=${this.gid}&togame=1&t=${Date.now()}`; } else { let shareObj = this.$getShareCfg(); shareStr = shareObj.str; shareImg = shareObj.image + this.$parent.log('onShareAppMessage', {page: 'game', gid: this.gid, shareUrl: url}); } return { title: shareStr, diff --git a/src/pages/gameInfo.wpy b/src/pages/gameInfo.wpy index 2707bc0..d5d8c4f 100644 --- a/src/pages/gameInfo.wpy +++ b/src/pages/gameInfo.wpy @@ -54,7 +54,7 @@ - + diff --git a/src/pages/search.wpy b/src/pages/search.wpy index 37ce3f9..e3034c1 100644 --- a/src/pages/search.wpy +++ b/src/pages/search.wpy @@ -126,6 +126,7 @@ this.getRecords(); }, gameTap(gid, e) { + this.$parent.log('search_game_tap', {gid: gid}); wepy.navigateTo({ url: '/pages/gameInfo?id=' + gid }) @@ -149,6 +150,7 @@ } async onLoad(options) { + this.$parent.log('search_page_onload', options); this.getRecords(); this.typeArr.unshift('所有类型') let self = this; @@ -232,9 +234,11 @@ onShareAppMessage() { let account = wepy.getStorageSync('account'); let shareObj = this.$getShareCfg(); + const shareUrl = `/pages/index?isShare=1&inviter_id=${account.account_id}` + this.$parent.log('onShareAppMessage', {page: 'search', shareUrl: shareUrl}); return { title: shareObj.str, - path: `/pages/index?isShare=1&inviter_id=${account.account_id}`, + path: shareUrl, imageUrl: shareObj.image, success: function (res) { wepy.getShareInfo({