完善充值流程
This commit is contained in:
parent
44a7766427
commit
da65418be2
2024
src/components/assets/assetsHeader copy.vue
Normal file
2024
src/components/assets/assetsHeader copy.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -351,7 +351,7 @@
|
||||
</div>
|
||||
<div class="item-amount">
|
||||
<img src="@/assets/img/marketplace/icon_diamond.png" alt="">
|
||||
<span>499950</span>
|
||||
<span>{{ brickworkAmount * 50 }}</span>
|
||||
</div>
|
||||
<div class="item-amount-input">
|
||||
<div class="left">
|
||||
@ -365,8 +365,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="conform-btn" @click="conformBtn">
|
||||
<span v-if="confirmRecharge?.goods_id == 1006">{{ priceAmount ? confirmRecharge.price : 0 }}</span>
|
||||
<span v-else>{{ confirmRecharge?.price }}</span>
|
||||
<span>{{ brickworkAmount }}</span>
|
||||
<!-- <img src="@/assets/img/marketplace/icon_USDT.png" alt=""> -->
|
||||
<img :src="icon_usdc" alt="">
|
||||
</div>
|
||||
@ -566,7 +565,7 @@ const activeIndex = ref(0)
|
||||
const rechargeList = ref()
|
||||
const rechargeHistoryList = ref()
|
||||
const confirmRecharge = ref()
|
||||
const brickworkAmount = ref(0)
|
||||
const brickworkAmount = ref(1)
|
||||
const priceAmount = ref(0)
|
||||
|
||||
// 打开充值弹窗
|
||||
@ -589,15 +588,14 @@ const getRechargeGoods = async () => {
|
||||
}
|
||||
|
||||
const handleInput = (e) => {
|
||||
// console.log(brickworkAmount.value, e)
|
||||
if(Number(brickworkAmount.value) >9999) {
|
||||
brickworkAmount.value = 9999
|
||||
toRaw(confirmRecharge.value).price = 9999
|
||||
toRaw(confirmRecharge.value).diamond = brickworkAmount.value
|
||||
toRaw(confirmRecharge.value).diamond = brickworkAmount.value*50
|
||||
} else {
|
||||
toRaw(confirmRecharge.value).price = brickworkAmount.value
|
||||
toRaw(confirmRecharge.value).diamond = brickworkAmount.value
|
||||
priceAmount.value = brickworkAmount.value
|
||||
toRaw(confirmRecharge.value).diamond = brickworkAmount.value*50
|
||||
// priceAmount.value = brickworkAmount.value
|
||||
}
|
||||
|
||||
}
|
||||
@ -605,24 +603,25 @@ const handleInput = (e) => {
|
||||
const rechargeDecrease = async () => {
|
||||
if(brickworkAmount.value == 0) return false
|
||||
brickworkAmount.value--
|
||||
priceAmount.value--
|
||||
if(confirmRecharge.value.goods_id == 1006) {
|
||||
toRaw(confirmRecharge.value).price = priceAmount.value
|
||||
toRaw(confirmRecharge.value).diamond = brickworkAmount.value
|
||||
// priceAmount.value--
|
||||
if(confirmRecharge.value.goods_id == 1001) {
|
||||
toRaw(confirmRecharge.value).price = brickworkAmount.value
|
||||
toRaw(confirmRecharge.value).diamond = brickworkAmount.value*50
|
||||
}
|
||||
}
|
||||
const rechargeIncrease = async () => {
|
||||
brickworkAmount.value++
|
||||
priceAmount.value++
|
||||
if(confirmRecharge.value.goods_id == 1006) {
|
||||
toRaw(confirmRecharge.value).price = priceAmount.value
|
||||
toRaw(confirmRecharge.value).diamond = brickworkAmount.value
|
||||
// priceAmount.value++
|
||||
if(confirmRecharge.value.goods_id == 1001) {
|
||||
toRaw(confirmRecharge.value).price = brickworkAmount.value
|
||||
toRaw(confirmRecharge.value).diamond = brickworkAmount.value*50
|
||||
}
|
||||
}
|
||||
|
||||
// 充值
|
||||
const conformBtn = async () => {
|
||||
return
|
||||
console.log(toRaw(confirmRecharge.value))
|
||||
// return
|
||||
// if(localWalletStore.walletType == 3) {
|
||||
let address = localWalletStore.address
|
||||
if(toRaw(confirmRecharge.value).price == 0) {
|
||||
@ -633,12 +632,11 @@ const conformBtn = async () => {
|
||||
// return
|
||||
try {
|
||||
const bc = new BlockChain()
|
||||
let res = await bc.mall.execBuyItem(Number(toRaw(confirmRecharge.value).goods_id), Number(toRaw(confirmRecharge.value).goods_id) == 1006 ? brickworkAmount.value : 0)
|
||||
let res = await bc.mall.execBuyItem(Number(toRaw(confirmRecharge.value).goods_id), Number(toRaw(confirmRecharge.value).diamond))
|
||||
// console.log(res)
|
||||
if(res) {
|
||||
activeIndex.value = 0
|
||||
brickworkAmount.value = 0
|
||||
priceAmount.value = 0
|
||||
brickworkAmount.value = 1
|
||||
// priceAmount.value = 0
|
||||
await dataInfo()
|
||||
loadingDialogVisible.value = false
|
||||
message.success('Top-Up Successful')
|
||||
@ -716,7 +714,6 @@ const dataInfo = async () => {
|
||||
watch(localWalletStore,() => {
|
||||
// console.log('localWalletStore.token',localWalletStore.address,localWalletStore.token)
|
||||
if(!localWalletStore.token) {
|
||||
nftList.value = []
|
||||
cecInfo.value = {
|
||||
total: 0,
|
||||
available: '',
|
||||
|
@ -26,7 +26,7 @@ export class BitgetWallet{
|
||||
}
|
||||
|
||||
get installed() {
|
||||
console.log('bitget install: ', window.bitkeep, window.bitkeep.ethereum)
|
||||
// console.log('bitget install: ', window.bitkeep, window.bitkeep.ethereum)
|
||||
return !!window.bitkeep && !!window.bitkeep.ethereum;
|
||||
}
|
||||
|
||||
|
@ -320,9 +320,8 @@ const closeCartBox = () => {
|
||||
|
||||
watch(() => route.path,(newPath, oldPath) => {
|
||||
let routerPath = newPath.split('/')
|
||||
if(routerPath[1] == 'marketplace' || routerPath[1] == 'detail') {
|
||||
// if(routerPath[1] == 'marketplace') {
|
||||
console.log(toRaw(marketplaceStore.detailData))
|
||||
// if(routerPath[1] == 'marketplace' || routerPath[1] == 'detail') {
|
||||
if(routerPath[1] == 'marketplace') {
|
||||
isCart.value = true
|
||||
} else {
|
||||
isCart.value = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user