修改游戏页面相关提示
This commit is contained in:
parent
46900f5783
commit
b9e9162580
@ -29,17 +29,17 @@
|
||||
"list": []
|
||||
},
|
||||
"miniprogram": {
|
||||
"current": 2,
|
||||
"current": 0,
|
||||
"list": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "支付返回",
|
||||
"pathName": "pages/gameInfo",
|
||||
"query": "id=1100309",
|
||||
"query": "id=7100715",
|
||||
"scene": 1038,
|
||||
"referrerInfo": {
|
||||
"appId": "wxbf333d56b4de3905",
|
||||
"extraData": "{ \"type\": \"item\", \"event_type\": \"pay_result\", \"success\": true, \"gid\": 1100309 }"
|
||||
"extraData": "{ \"type\": \"item\", \"event_type\": \"pay_result\", \"success\": true, \"gid\": 7100715 }"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -50,6 +50,7 @@
|
||||
收起
|
||||
</view>
|
||||
</view>
|
||||
<zanToptips/>
|
||||
</view>
|
||||
<gameBottomBar class="{{showAll? '' : 'hidden'}}" :config.sync="bottomActionCfg" @bottomMainTap.user="bottomMainTap"
|
||||
@bottomSecondTap.user="bottomSecondTap"/>
|
||||
@ -68,13 +69,15 @@
|
||||
import base from '../mixins/base';
|
||||
import tips from '../mixins/tips';
|
||||
import cfg from '../mixins/cfg';
|
||||
import zanToptips from '../components/zan-toptips'
|
||||
|
||||
export default class GameInfoPage extends wepy.page {
|
||||
mixins = [base, tips, cfg];
|
||||
components = {
|
||||
imageSwiper: imageSwiper,
|
||||
gameBottomBar: gameBottomBar,
|
||||
zActionSheet: zActionSheet
|
||||
zActionSheet: zActionSheet,
|
||||
zanToptips: zanToptips
|
||||
};
|
||||
data = {
|
||||
id: '',
|
||||
@ -167,7 +170,10 @@
|
||||
jcEvent.on(jcEvent.events.BUY_ITEM_RESULT, this, data => {
|
||||
this.zActionSheetCfg.hide = true;
|
||||
if (data.success) {
|
||||
this.showToast('开通成功', 2000, 'success');
|
||||
wepy.showModal({
|
||||
content: '购买成功',
|
||||
showCancel: false
|
||||
});
|
||||
self.zActionSheetCfg.hide = true;
|
||||
self.record.owned = true;
|
||||
self.bottomActionCfg.mainBtnIconClass = 'icon-merge';
|
||||
@ -176,7 +182,7 @@
|
||||
self.$apply();
|
||||
jcEvent.emit(jcEvent.events.UPDATE_GAME_STATUS, {gid: self.id});
|
||||
} else {
|
||||
this.showToast('开通失败', 2000)
|
||||
this.showTopTips('开通失败')
|
||||
}
|
||||
self.$apply();
|
||||
});
|
||||
@ -198,6 +204,9 @@
|
||||
this.zActionSheetCfg.showBuy = this.$showBuy();
|
||||
this.$apply();
|
||||
}
|
||||
showTopTips(msg, type = 'error') {
|
||||
this.$invoke('zanToptips', 'showZanTopTips', { content: msg, type: type})
|
||||
}
|
||||
async showBuyMenu() {
|
||||
this.zActionSheetCfg.params = `token=${this.$parent.getGlobalDate('gameToken')}&gid=${this.id}`;
|
||||
this.zActionSheetCfg.goldTitle = `金币开通(${this.$getExtCfg(this.record.category + '_price')})`;
|
||||
@ -234,7 +243,10 @@
|
||||
try {
|
||||
let res = await http.post(`/api/emulated/buy_game`, { gid: this.id });
|
||||
if (res.errcode === 0) {
|
||||
this.showToast('开通成功', 2000, 'success');
|
||||
wepy.showModal({
|
||||
content: '开通成功',
|
||||
showCancel: false
|
||||
});
|
||||
this.zActionSheetCfg.hide = true;
|
||||
this.$apply();
|
||||
jcEvent.emit(jcEvent.events.UPDATE_GAME_STATUS, {gid: this.id});
|
||||
@ -242,7 +254,7 @@
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('buy game error');
|
||||
this.showToast('开通失败', 2000);
|
||||
this.showTopTips('开通失败')
|
||||
}
|
||||
}
|
||||
async getRecord() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user