diff --git a/src/common/global.js b/src/common/global.js index 4d8fd94..186523b 100644 --- a/src/common/global.js +++ b/src/common/global.js @@ -1,8 +1,8 @@ -const env = 'product'; //product, test +const env = 'test'; //product, test export default { env: env, apiBase: env === 'test'? 'https://ghost-test.kingsome.cn' : 'https://ghost.kingsome.cn', - cdnBase: 'http://h5games-al.kingsome.cn/emulator-static/', + cdnBase: 'https://h5games-al.kingsome.cn/emulator-static/', version: '1.0.0', gameTypes: ['射击','格斗', '角色扮演','动作角色扮演', '赛车', '动作游戏','策略战棋', '其他', diff --git a/src/mixins/tips.js b/src/mixins/tips.js index 3e56f2d..150539d 100644 --- a/src/mixins/tips.js +++ b/src/mixins/tips.js @@ -2,13 +2,13 @@ import wepy from 'wepy' export default class testMixin extends wepy.mixin { - showToast (title, duration) { + showToast (title, duration, type = 'loading') { if (!duration) { duration = 15000 } wepy.showToast({ title: title, - icon: 'loading', + icon: type, duration: duration }) } diff --git a/src/pages/gameInfo.wpy b/src/pages/gameInfo.wpy index b3659d7..5909d1a 100644 --- a/src/pages/gameInfo.wpy +++ b/src/pages/gameInfo.wpy @@ -167,11 +167,13 @@ jcEvent.on(jcEvent.events.BUY_ITEM_RESULT, this, data => { this.zActionSheetCfg.hide = true; if (data.success) { - this.showToast('开通成功', 2000); + this.showToast('开通成功', 2000, 'success'); + self.zActionSheetCfg.hide = true; self.record.owned = true; self.bottomActionCfg.mainBtnIconClass = 'icon-merge'; self.bottomActionCfg.mainBtnTitle = '开始游戏'; self.bottomActionCfg.primary = true; + self.$apply(); jcEvent.emit(jcEvent.events.UPDATE_GAME_STATUS, {gid: self.id}); } else { this.showToast('开通失败', 2000) @@ -232,7 +234,9 @@ try { let res = await http.post(`/api/emulated/buy_game`, { gid: this.id }); if (res.errcode === 0) { - this.showToast('开通成功', 2000); + this.showToast('开通成功', 2000, 'success'); + this.zActionSheetCfg.hide = true; + this.$apply(); jcEvent.emit(jcEvent.events.UPDATE_GAME_STATUS, {gid: this.id}); this.getRecord(); } diff --git a/src/pages/index.wpy b/src/pages/index.wpy index c883a44..2c89b02 100644 --- a/src/pages/index.wpy +++ b/src/pages/index.wpy @@ -156,7 +156,7 @@ }) jcEvent.on(jcEvent.events.BUY_VIP_RESULT, this, data => { if (data.success) { - this.showToast('购买成功', 2000); + this.showToast('购买成功', 2000, 'success'); this.getUserInfo(); } else { this.showToast('购买失败', 2000);