游戏详情页面底部button根据不同条件显示不同的颜色

This commit is contained in:
zhl 2019-02-21 10:24:09 +08:00
parent 791588894e
commit 917bf27fdb
2 changed files with 6 additions and 2 deletions

View File

@ -33,7 +33,7 @@
</style>
<template>
<view class="vote-bottom-action-bar {{ config.hide ? 'hidden' : ''}}">
<view class="vote-bottom-main zan-btn zan-btn--small zan-btn--primary" @tap="mainBtnTap"><i class="{{config.mainBtnIconClass}}"></i>{{config.mainBtnTitle}}</view>
<view class="vote-bottom-main zan-btn zan-btn--small {{config.primary ? 'zan-btn--primary' : 'zan-btn--warn'}}" @tap="mainBtnTap"><i class="{{config.mainBtnIconClass}}"></i>{{config.mainBtnTitle}}</view>
<view class="vote-bottom-second zan-btn zan-btn--small" @tap="secondBtnTap"><i class="{{config.secondBtnIconClass}}"></i>{{config.secondBtnTitle}}</view>
</view>
</template>
@ -47,7 +47,8 @@
mainBtnIconClass: '',
mainBtnTitle: '',
secondBtnIconClass: '',
secondBtnTitle: ''
secondBtnTitle: '',
primary: false
}
}
data = {

View File

@ -81,6 +81,7 @@
hide: false,
mainBtnIconClass: 'icon-cart',
mainBtnTitle: '开通游戏',
primary: false,
secondBtnIconClass: 'icon-coin-yen',
secondBtnTitle: '领取金币'
}
@ -195,9 +196,11 @@
if (this.record.owned) {
this.bottomActionCfg.mainBtnIconClass = 'icon-merge';
this.bottomActionCfg.mainBtnTitle = '开始游戏';
this.bottomActionCfg.primary = true;
} else {
this.bottomActionCfg.mainBtnIconClass = 'icon-cart';
this.bottomActionCfg.mainBtnTitle = '开通游戏';
this.bottomActionCfg.primary = false;
}
if (this.record.taglist) {
this.tagList = this.record.taglist.split(',');