预售尚未开始时, 点击购买按钮后提示
This commit is contained in:
parent
d977afbc92
commit
534753db3c
@ -34,7 +34,6 @@
|
|||||||
import { Component, Vue } from 'vue-property-decorator'
|
import { Component, Vue } from 'vue-property-decorator'
|
||||||
import { ISpineData } from '@/utils/SpineRender'
|
import { ISpineData } from '@/utils/SpineRender'
|
||||||
import SpineView from '@/components/main/SpineView.vue'
|
import SpineView from '@/components/main/SpineView.vue'
|
||||||
import 'videojs-contrib-hls'
|
|
||||||
import { getBrowser } from '@/utils/browser.util'
|
import { getBrowser } from '@/utils/browser.util'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -169,9 +169,10 @@ export default class extends Vue {
|
|||||||
this.presaleStatus = res.presale_info.state || 0
|
this.presaleStatus = res.presale_info.state || 0
|
||||||
this.presaleTitle = res.presale_info.title
|
this.presaleTitle = res.presale_info.title
|
||||||
this.countdown = res.presale_info.countdown
|
this.countdown = res.presale_info.countdown
|
||||||
if (this.presaleStatus === 2 && this.countdown > 0) {
|
if (this.presaleStatus === 1 && this.countdown > 0) {
|
||||||
this.beginCountdown()
|
this.beginCountdown()
|
||||||
}
|
}
|
||||||
|
AppModule.updatePresaleStat(this.presaleStatus)
|
||||||
AppModule.updateCanBuy(this.presaleStatus === 2 &&
|
AppModule.updateCanBuy(this.presaleStatus === 2 &&
|
||||||
this.numberRest > 0 &&
|
this.numberRest > 0 &&
|
||||||
!this.buyed
|
!this.buyed
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Vue } from 'vue-property-decorator'
|
import { Component, Vue } from 'vue-property-decorator'
|
||||||
import 'videojs-contrib-hls'
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
name: 'VideoSection',
|
name: 'VideoSection',
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<div v-if="data.id" class="anim-border">
|
<div v-if="data.id" class="anim-border">
|
||||||
<img class="card-main-img" :src="require(`@/assets/main/card/${data.skelName}.png`)" alt=""/>
|
<img class="card-main-img" :src="require(`@/assets/main/card/${data.skelName}.png`)" alt=""/>
|
||||||
<div class="name-label" :class="{'bottom': !data.showBuy}">{{data.name}}</div>
|
<div class="name-label" :class="{'bottom': !data.showBuy}">{{data.name}}</div>
|
||||||
<div class="info-div" v-if="data.showBuy" @click="buyItem" :class="{'gray': data.stopBuy}">
|
<div class="info-div" v-if="data.showBuy" @click="buyItem" :class="{'gray': !canBuy}">
|
||||||
<img class='buy-icon' src="@/assets/main/card/icon_buy.png" alt=""/>
|
<img class='buy-icon' src="@/assets/main/card/icon_buy.png" alt=""/>
|
||||||
<div class="price-label">
|
<div class="price-label">
|
||||||
<span :class="{'price': data.price !== data.priceDiscount}">{{priceDiscountShow}} {{data.currency}}</span>
|
<span :class="{'price': data.price !== data.priceDiscount}">{{priceDiscountShow}} {{data.currency}}</span>
|
||||||
@ -46,6 +46,10 @@ export default class extends Vue {
|
|||||||
return AppModule.walletConnected
|
return AppModule.walletConnected
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get canBuy() {
|
||||||
|
return !this.data.showBuy && AppModule.presaleStatus === 2
|
||||||
|
}
|
||||||
|
|
||||||
get priceDiscountShow() {
|
get priceDiscountShow() {
|
||||||
const v = Math.pow(10, this.data.decimals!)
|
const v = Math.pow(10, this.data.decimals!)
|
||||||
return (this.data.priceDiscount! / v).toFixed(3)
|
return (this.data.priceDiscount! / v).toFixed(3)
|
||||||
@ -61,6 +65,14 @@ export default class extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async buyItem() {
|
async buyItem() {
|
||||||
|
if (!this.canBuy) {
|
||||||
|
Message({
|
||||||
|
message: 'Can`t buy current time',
|
||||||
|
type: 'warning',
|
||||||
|
duration: 5 * 1000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
if (!this.accountId) {
|
if (!this.accountId) {
|
||||||
return await this.bc.connect()
|
return await this.bc.connect()
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ class App extends VuexModule implements IAppState {
|
|||||||
public walletConnected = false;
|
public walletConnected = false;
|
||||||
public accountId = ''
|
public accountId = ''
|
||||||
public chainId = 0
|
public chainId = 0
|
||||||
|
public presaleStatus = 0
|
||||||
public canBuy = false
|
public canBuy = false
|
||||||
|
|
||||||
@Action
|
@Action
|
||||||
@ -56,6 +57,11 @@ class App extends VuexModule implements IAppState {
|
|||||||
this.UPDATE_CANBUY(val)
|
this.UPDATE_CANBUY(val)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Action
|
||||||
|
public updatePresaleStat(val: number) {
|
||||||
|
this.UPDATE_PRESALE_STAT(val)
|
||||||
|
}
|
||||||
|
|
||||||
@Mutation
|
@Mutation
|
||||||
private TOGGLE_DEVICE(device: DeviceType) {
|
private TOGGLE_DEVICE(device: DeviceType) {
|
||||||
this.device = device
|
this.device = device
|
||||||
@ -87,6 +93,11 @@ class App extends VuexModule implements IAppState {
|
|||||||
this.canBuy = val
|
this.canBuy = val
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Mutation
|
||||||
|
private UPDATE_PRESALE_STAT(val: number) {
|
||||||
|
this.presaleStatus = val
|
||||||
|
}
|
||||||
|
|
||||||
public get hexChainId() {
|
public get hexChainId() {
|
||||||
return '0x' + this.chainId.toString(16)
|
return '0x' + this.chainId.toString(16)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user