移除一些中文注释
This commit is contained in:
parent
58e8eaff6d
commit
895b577151
@ -21,7 +21,6 @@ export const defaultUser: IUser = {
|
|||||||
account: ''
|
account: ''
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 获取用户信息
|
|
||||||
* @param data {account: string, token: string}
|
* @param data {account: string, token: string}
|
||||||
*/
|
*/
|
||||||
export const getUserInfo = (data: any) =>
|
export const getUserInfo = (data: any) =>
|
||||||
|
@ -139,6 +139,13 @@ export default class ChainManager {
|
|||||||
return balance
|
return balance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get amount of mystery boxes
|
||||||
|
* this method can get amount of general erc721 also
|
||||||
|
* @param {string} address
|
||||||
|
* @param {number} chainId
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
public async getNftBalance(address: string, chainId: number) {
|
public async getNftBalance(address: string, chainId: number) {
|
||||||
const coinInstance = await this.getInstance(address, chainId, MYSTERY_BOX_ABI)
|
const coinInstance = await this.getInstance(address, chainId, MYSTERY_BOX_ABI)
|
||||||
const balance = await coinInstance.methods.balanceOf(AppModule.accountId).call()
|
const balance = await coinInstance.methods.balanceOf(AppModule.accountId).call()
|
||||||
@ -172,6 +179,15 @@ export default class ChainManager {
|
|||||||
return nftId
|
return nftId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open one mystery box
|
||||||
|
* @param {string} address address of mystery box contract on current chain
|
||||||
|
* @param {string} boxId nftid of mystery box
|
||||||
|
* @param {number[]} tokenIds
|
||||||
|
* @param {string} nonce
|
||||||
|
* @param {string} signature
|
||||||
|
* @return {Promise<any>}
|
||||||
|
*/
|
||||||
public async openMysteryBox(
|
public async openMysteryBox(
|
||||||
address: string,
|
address: string,
|
||||||
boxId: string,
|
boxId: string,
|
||||||
@ -184,7 +200,6 @@ export default class ChainManager {
|
|||||||
return proxyInstance.methods.openBox(boxId, tokenIds, nonce, signature).send({ gas: 1000000 })
|
return proxyInstance.methods.openBox(boxId, tokenIds, nonce, signature).send({ gas: 1000000 })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转账
|
|
||||||
public async transferToAccount({ to, amount, chainId, address } : {
|
public async transferToAccount({ to, amount, chainId, address } : {
|
||||||
to: string
|
to: string
|
||||||
amount: number
|
amount: number
|
||||||
|
@ -409,7 +409,6 @@ export class Blockchain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取某种币的余额
|
|
||||||
* @param {string} address
|
* @param {string} address
|
||||||
* @param {string | null} account
|
* @param {string | null} account
|
||||||
* @return {Promise<any>}
|
* @return {Promise<any>}
|
||||||
@ -420,7 +419,6 @@ export class Blockchain {
|
|||||||
return await coinInstance.methods.balanceOf(account).call()
|
return await coinInstance.methods.balanceOf(account).call()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转账
|
|
||||||
public async transferToAccount(account: string, amount: number, address: string) {
|
public async transferToAccount(account: string, amount: number, address: string) {
|
||||||
const amountBN = this.web3.utils.toBN(this.web3.utils.toWei(amount + ''))
|
const amountBN = this.web3.utils.toBN(this.web3.utils.toWei(amount + ''))
|
||||||
const coinInstance: any = await this.getContractInstance(address)
|
const coinInstance: any = await this.getContractInstance(address)
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
</el-slider>
|
</el-slider>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="general-btn btn cancel-btn" @click="cancelSelect">取 消</button>
|
<button class="general-btn btn cancel-btn" @click="cancelSelect">Cancel</button>
|
||||||
<button class="general-btn btn confirm-btn" @click="confirmSelect">确 定</button>
|
<button class="general-btn btn confirm-btn" @click="confirmSelect">Confirm</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -337,7 +337,6 @@ export default class WalletPanel extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户选择的币的数量
|
|
||||||
* @param data
|
* @param data
|
||||||
* @return {Promise<number>}
|
* @return {Promise<number>}
|
||||||
*/
|
*/
|
||||||
@ -356,7 +355,7 @@ export default class WalletPanel extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询token->game的订单
|
* query token->game
|
||||||
* @param {string} txhash
|
* @param {string} txhash
|
||||||
* @return {Promise<void>}
|
* @return {Promise<void>}
|
||||||
*/
|
*/
|
||||||
@ -387,7 +386,7 @@ export default class WalletPanel extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询token->game的订单
|
* query token->game
|
||||||
* @param {string} seqId
|
* @param {string} seqId
|
||||||
* @return {Promise<void>}
|
* @return {Promise<void>}
|
||||||
*/
|
*/
|
||||||
|
@ -5,7 +5,7 @@ export enum NftType{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0:正常状态 1:出售中 2:出租中
|
* 0:Normal 1:Sell 2:Rent
|
||||||
*/
|
*/
|
||||||
export enum NftState {
|
export enum NftState {
|
||||||
NORMAL = 0,
|
NORMAL = 0,
|
||||||
@ -34,7 +34,6 @@ export interface INftData{
|
|||||||
level: number
|
level: number
|
||||||
job?: string
|
job?: string
|
||||||
quality: number
|
quality: number
|
||||||
// 所有者地址
|
|
||||||
owner?: string
|
owner?: string
|
||||||
state: NftState
|
state: NftState
|
||||||
mintTime: number
|
mintTime: number
|
||||||
|
@ -118,7 +118,7 @@ export default class Official extends Vue {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.checkOrderHistory()
|
this.checkOrderHistory()
|
||||||
// if (process.env.NODE_ENV === 'development') {
|
// if (process.env.NODE_ENV === 'development') {
|
||||||
window.showModal = this.showTestModal
|
// window.showModal = this.showTestModal
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,102 +320,102 @@ export default class Official extends Vue {
|
|||||||
this.rewardModal.show()
|
this.rewardModal.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
showTestModal() {
|
// showTestModal() {
|
||||||
const nftList = [{
|
// const nftList = [{
|
||||||
token_id: '501007316659010037',
|
// token_id: '501007316659010037',
|
||||||
owner_address: '0x42448c6a38c08637218d8327b748f213fc2c0231',
|
// owner_address: '0x42448c6a38c08637218d8327b748f213fc2c0231',
|
||||||
owner_name: '',
|
// owner_name: '',
|
||||||
item_id: '30600',
|
// item_id: '30600',
|
||||||
type: '1',
|
// type: '1',
|
||||||
state: '0',
|
// state: '0',
|
||||||
hide_attr: 1,
|
// hide_attr: 1,
|
||||||
is_genesis: false,
|
// is_genesis: false,
|
||||||
image: 'https://www.cebg.games/res/avatars/30600.png',
|
// image: 'https://www.cebg.games/res/avatars/30600.png',
|
||||||
currency_list: [],
|
// currency_list: [],
|
||||||
transaction_recrod: [],
|
// transaction_recrod: [],
|
||||||
info:
|
// info:
|
||||||
{
|
// {
|
||||||
name: 'Canoe',
|
// name: 'Canoe',
|
||||||
attr: [],
|
// attr: [],
|
||||||
job: 1,
|
// job: 1,
|
||||||
level: 1,
|
// level: 1,
|
||||||
quality: 1,
|
// quality: 1,
|
||||||
hp: 200,
|
// hp: 200,
|
||||||
speed: 6,
|
// speed: 6,
|
||||||
atk: 32,
|
// atk: 32,
|
||||||
def: 7,
|
// def: 7,
|
||||||
advanced_count: 0,
|
// advanced_count: 0,
|
||||||
lucky: 0,
|
// lucky: 0,
|
||||||
success_rate: 0
|
// success_rate: 0
|
||||||
},
|
// },
|
||||||
mint_time: '1650529475'
|
// mint_time: '1650529475'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
token_id: '501007316776010040',
|
// token_id: '501007316776010040',
|
||||||
owner_address: '0x42448c6a38c08637218d8327b748f213fc2c0231',
|
// owner_address: '0x42448c6a38c08637218d8327b748f213fc2c0231',
|
||||||
owner_name: '',
|
// owner_name: '',
|
||||||
item_id: '30100',
|
// item_id: '30100',
|
||||||
type: '1',
|
// type: '1',
|
||||||
state: '0',
|
// state: '0',
|
||||||
hide_attr: 1,
|
// hide_attr: 1,
|
||||||
is_genesis: false,
|
// is_genesis: false,
|
||||||
image: 'https://www.cebg.games/res/avatars/30100.png',
|
// image: 'https://www.cebg.games/res/avatars/30100.png',
|
||||||
currency_list: [],
|
// currency_list: [],
|
||||||
transaction_recrod: [],
|
// transaction_recrod: [],
|
||||||
info:
|
// info:
|
||||||
{
|
// {
|
||||||
name: 'Hill',
|
// name: 'Hill',
|
||||||
attr: [],
|
// attr: [],
|
||||||
job: 1,
|
// job: 1,
|
||||||
level: 1,
|
// level: 1,
|
||||||
quality: 1,
|
// quality: 1,
|
||||||
hp: 195,
|
// hp: 195,
|
||||||
speed: 6,
|
// speed: 6,
|
||||||
atk: 35,
|
// atk: 35,
|
||||||
def: 6,
|
// def: 6,
|
||||||
advanced_count: 0,
|
// advanced_count: 0,
|
||||||
lucky: 0,
|
// lucky: 0,
|
||||||
success_rate: 0
|
// success_rate: 0
|
||||||
},
|
// },
|
||||||
mint_time: '1650529592'
|
// mint_time: '1650529592'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
token_id: '501007319181010046',
|
// token_id: '501007319181010046',
|
||||||
owner_address: '0x42448c6a38c08637218d8327b748f213fc2c0231',
|
// owner_address: '0x42448c6a38c08637218d8327b748f213fc2c0231',
|
||||||
owner_name: '',
|
// owner_name: '',
|
||||||
item_id: '30300',
|
// item_id: '30300',
|
||||||
type: '1',
|
// type: '1',
|
||||||
state: '0',
|
// state: '0',
|
||||||
hide_attr: 1,
|
// hide_attr: 1,
|
||||||
is_genesis: true,
|
// is_genesis: true,
|
||||||
image: 'https://www.cebg.games/res/avatars/30300_1.png',
|
// image: 'https://www.cebg.games/res/avatars/30300_1.png',
|
||||||
currency_list: [],
|
// currency_list: [],
|
||||||
transaction_recrod: [],
|
// transaction_recrod: [],
|
||||||
info:
|
// info:
|
||||||
{
|
// {
|
||||||
name: 'Aoi',
|
// name: 'Aoi',
|
||||||
attr: [],
|
// attr: [],
|
||||||
job: 3,
|
// job: 3,
|
||||||
level: 1,
|
// level: 1,
|
||||||
quality: 1,
|
// quality: 1,
|
||||||
hp: 120,
|
// hp: 120,
|
||||||
speed: 5,
|
// speed: 5,
|
||||||
atk: 20,
|
// atk: 20,
|
||||||
def: 10,
|
// def: 10,
|
||||||
advanced_count: 0,
|
// advanced_count: 0,
|
||||||
lucky: 0,
|
// lucky: 0,
|
||||||
success_rate: 0
|
// success_rate: 0
|
||||||
},
|
// },
|
||||||
mint_time: '1650531993'
|
// mint_time: '1650531993'
|
||||||
}]
|
// }]
|
||||||
const cardList: INftData[] = []
|
// const cardList: INftData[] = []
|
||||||
nftList.forEach(o => cardList.push(parseNftData(o)))
|
// nftList.forEach(o => cardList.push(parseNftData(o)))
|
||||||
const data = {
|
// const data = {
|
||||||
title: 'Test data',
|
// title: 'Test data',
|
||||||
cardList
|
// cardList
|
||||||
}
|
// }
|
||||||
this.showRewardModal(data)
|
// this.showRewardModal(data)
|
||||||
}
|
// }
|
||||||
|
|
||||||
toPage(pageNo: number) {
|
toPage(pageNo: number) {
|
||||||
console.log('to page: ', pageNo)
|
console.log('to page: ', pageNo)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user