From 68f76cd2a8d58ff2ff5a1d0fb35e204a5593ea33 Mon Sep 17 00:00:00 2001 From: zhl Date: Thu, 7 Mar 2019 13:10:51 +0800 Subject: [PATCH] =?UTF-8?q?iOS=E4=B8=8A=E5=A2=9E=E5=8A=A0=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E6=98=BE=E7=A4=BA=E8=B4=AD=E4=B9=B0=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/z-action-sheet.wpy | 6 ++--- src/mixins/base.js | 5 ++++ src/mixins/cfg.js | 42 +++++++++++++++++++++++++++---- src/pages/gameInfo.wpy | 8 +++--- src/pages/index.wpy | 14 ++++++----- src/pages/jumppage.wpy | 2 +- 6 files changed, 59 insertions(+), 18 deletions(-) diff --git a/src/components/z-action-sheet.wpy b/src/components/z-action-sheet.wpy index 87ef483..5727673 100644 --- a/src/components/z-action-sheet.wpy +++ b/src/components/z-action-sheet.wpy @@ -12,7 +12,6 @@ z-index: 101; } .z-action-sheet { - height: 285rpx; bottom: 0; left: 0; right: 0; @@ -53,7 +52,7 @@ {{config.goldTitle}} - = countCfg; + } + return result; + } else { + return true; + } + } else { + return false; + } + } } diff --git a/src/pages/gameInfo.wpy b/src/pages/gameInfo.wpy index 07f6ed0..3a09a23 100644 --- a/src/pages/gameInfo.wpy +++ b/src/pages/gameInfo.wpy @@ -99,7 +99,8 @@ zActionSheetCfg: { hide: true, goldTitle: '金币开通', - params: '' + params: '', + showBuy: false }, vip: false }; @@ -136,7 +137,7 @@ this.zActionSheetCfg.hide = true; }, actionSheetGold() { - if (this.score < this.$getPrice(this.record.category)) { + if (this.score < this.$getExtCfg(this.record.category+'_price')) { this.requestAd('金币不足') } else { this.buyGame(); @@ -188,11 +189,12 @@ this.showAll = !cfg ? false : !cfg.hide_main; this.getUserInfo(); this.vip = this.$parent.isVip(); + this.zActionSheetCfg.showBuy = this.$showBuy(); this.$apply(); } async showBuyMenu() { this.zActionSheetCfg.params = `token=${this.$parent.getGlobalDate('gameToken')}&gid=${this.id}`; - this.zActionSheetCfg.goldTitle = `金币开通(${this.$getPrice(this.record.category)})`; + this.zActionSheetCfg.goldTitle = `金币开通(${this.$getExtCfg(this.record.category + '_price')})`; this.zActionSheetCfg.hide = false; } playGame(multip) { diff --git a/src/pages/index.wpy b/src/pages/index.wpy index f896d45..6b00ce4 100644 --- a/src/pages/index.wpy +++ b/src/pages/index.wpy @@ -11,7 +11,7 @@ {{expire_str}} - { - let cfg = wepy.getStorageSync('cfg'); - this.showAll = !cfg ? false : !cfg.hide_main; + this.showAll = this.$showAll(); + this.showBuy = !!this.vip_btn_title && this.$showBuy(); this.$apply(); }) jcEvent.on(jcEvent.events.BUY_VIP_RESULT, this, data => { @@ -200,7 +201,7 @@ if (!cfg._getrewardtype) { wepy.hideShareMenu(); } - this.showAll = !cfg ? false : !cfg.hide_main; + this.showAll = this.$showAll(); let userInfo = this.$parent.getUserInfo(); console.log(userInfo); if (userInfo) { @@ -241,6 +242,7 @@ this.my_game_list = res.records; this.showMyGame = this.my_game_list.length > 0; this.$apply(); + wepy.setStorageSync('game_count', this.my_game_list.length); } catch (err) { console.log('error get recent games'); } @@ -271,7 +273,7 @@ this.vip_btn_title = '激活'; this.vipImg = image.vip_s; } - + this.showBuy = !!this.vip_btn_title && this.$showBuy(); } this.$apply(); diff --git a/src/pages/jumppage.wpy b/src/pages/jumppage.wpy index 35f1372..d75aeee 100644 --- a/src/pages/jumppage.wpy +++ b/src/pages/jumppage.wpy @@ -107,7 +107,7 @@ onLoad(params) { this.text = decodeURIComponent(params.text); this.aid = decodeURIComponent(params.aid); - this.ad_price = this.$getPrice('ad'); + this.ad_price = this.$getExtCfg('ad_price'); console.log(`aid : ${this.aid}`); let self = this; this.$parent.getShareCount(count => {