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