修改一些接口
This commit is contained in:
parent
82353d22f6
commit
e52fbd6aba
@ -26,9 +26,9 @@ export const defaultUser: IUser = {
|
||||
*/
|
||||
export const getUserInfo = (data: any) =>
|
||||
request({
|
||||
url: '/webapp/index.php?c=BcUser&a=login',
|
||||
url: '/webapp/index.php?c=BcUser&a=info',
|
||||
method: 'get',
|
||||
data
|
||||
params: data
|
||||
})
|
||||
|
||||
export const login = (data: any) =>
|
||||
|
@ -58,6 +58,7 @@ import { formatPrice } from '@/utils/chain.util'
|
||||
import { getUserInfo } from '@/api/User'
|
||||
import PricePickerModal, { SHOW_AMOUNT_MODAL } from '@/components/market/PricePickerModal.vue'
|
||||
import { EventBus, SHOW_CHAIN_MODAL } from '@/utils/event-bus'
|
||||
import { queryRechargeResult, queryWithdrawalResult } from '@/api/Market'
|
||||
|
||||
@Component({
|
||||
name: 'WalletPanel',
|
||||
@ -285,16 +286,16 @@ export default class WalletPanel extends Vue {
|
||||
|
||||
async updateGameCoins() {
|
||||
const data = { account: AppModule.accountId }
|
||||
// const res: any = await getUserInfo(data)
|
||||
const res: any = {
|
||||
errcode: 0, // 错误码
|
||||
errmsg: '', // 错误描述
|
||||
info: { // struct BcUserInfo, 用户信息
|
||||
account: '', // 账号
|
||||
gold: 1000, // 金币
|
||||
diamond: 2000 // 钻石
|
||||
}
|
||||
}
|
||||
const res: any = await getUserInfo(data)
|
||||
// const res: any = {
|
||||
// errcode: 0, // 错误码
|
||||
// errmsg: '', // 错误描述
|
||||
// info: { // struct BcUserInfo, 用户信息
|
||||
// account: '', // 账号
|
||||
// gold: 1000, // 金币
|
||||
// diamond: 2000 // 钻石
|
||||
// }
|
||||
// }
|
||||
if (res.info) {
|
||||
const info = res.info
|
||||
for (let i = 0, l = this.gameCoinList.length; i < l; i++) {
|
||||
@ -306,6 +307,11 @@ export default class WalletPanel extends Vue {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户选择的币的数量
|
||||
* @param data
|
||||
* @return {Promise<number>}
|
||||
*/
|
||||
pickAmount(data: any) {
|
||||
return new Promise<number>((resolve, reject) => {
|
||||
data.current = data.current || data.min
|
||||
@ -319,6 +325,40 @@ export default class WalletPanel extends Vue {
|
||||
EventBus.$emit(SHOW_AMOUNT_MODAL, data)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询token->game的订单
|
||||
* @param {string} txhash
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
async queryRechargeOrder(txhash: string) {
|
||||
const data: any = {
|
||||
account: AppModule.accountId,
|
||||
txhash
|
||||
}
|
||||
try {
|
||||
const res = await queryRechargeResult(data)
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询token->game的订单
|
||||
* @param {string} seqId
|
||||
* @return {Promise<void>}
|
||||
*/
|
||||
async queryWithdrawOrder(seqId: string) {
|
||||
const data: any = {
|
||||
account: AppModule.accountId,
|
||||
seq_id: seqId
|
||||
}
|
||||
try {
|
||||
const res = await queryWithdrawalResult(data)
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
@ -3,6 +3,9 @@
|
||||
<top-menu class="desk-top" :current-tab="currentTab"></top-menu>
|
||||
<section class="root">
|
||||
<div class="container">
|
||||
<div class="wrapper">
|
||||
<nft-type-bar :select-idx="nftType" @nft-type-changed="onNftTypeClicked" class="left-bar"></nft-type-bar>
|
||||
</div>
|
||||
<nft-list></nft-list>
|
||||
</div>
|
||||
</section>
|
||||
@ -15,9 +18,11 @@ import SearchPanel from '@/components/market/SearchPanel.vue'
|
||||
import SearchResult from '@/components/market/SearchResult.vue'
|
||||
import TopMenu from '@/components/market/TopMenu.vue'
|
||||
import NftList from '@/components/market/NftList.vue'
|
||||
import NftTypeBar from '@/components/market/NftTypeBar.vue'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
NftTypeBar,
|
||||
NftList,
|
||||
SearchResult,
|
||||
SearchPanel,
|
||||
@ -27,6 +32,13 @@ import NftList from '@/components/market/NftList.vue'
|
||||
export default class Official extends Vue {
|
||||
mobileFilterShow = false
|
||||
currentTab = 'official'
|
||||
nftType = 0
|
||||
|
||||
onNftTypeClicked(id: number) {
|
||||
console.log('nft type clicked: ', id)
|
||||
this.nftType = id
|
||||
}
|
||||
|
||||
showFilter(val: boolean) {
|
||||
this.mobileFilterShow = val
|
||||
}
|
||||
@ -41,10 +53,20 @@ export default class Official extends Vue {
|
||||
}
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-direction: column;
|
||||
width: 1440px;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
.wrapper{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
padding: 0 4%;
|
||||
.left-bar{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mobile-top {
|
||||
display: none;
|
||||
@ -56,6 +78,15 @@ export default class Official extends Vue {
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
.wrapper{
|
||||
margin-top: 80px;
|
||||
margin-bottom: -76px;
|
||||
padding: 0;
|
||||
.left-bar{
|
||||
flex-grow: 1;
|
||||
padding: 0 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.searchPanel {
|
||||
width: 100%;
|
||||
|
Loading…
x
Reference in New Issue
Block a user