优化代码

This commit is contained in:
zhongshilong 2025-04-30 10:20:09 +08:00
parent 22e73abe34
commit b03827da53
3 changed files with 14 additions and 12 deletions

View File

@ -181,7 +181,7 @@
title: '購買1G以上算力才可交易', title: '購買1G以上算力才可交易',
icon:"none" icon:"none"
}) })
this.loading = false this.loading = false
return return
} }
let cobj = this.checkTypeAndValue(this.detail.investCoin,this.value) let cobj = this.checkTypeAndValue(this.detail.investCoin,this.value)
@ -190,7 +190,7 @@
title: cobj.message, title: cobj.message,
icon:"none" icon:"none"
}) })
this.loading = false this.loading = false
return return
} }
uni.showLoading({ uni.showLoading({
@ -202,13 +202,16 @@
type: this.detail.optionType, type: this.detail.optionType,
name: this.userInfo.email, name: this.userInfo.email,
money: this.value, money: this.value,
money_wallet: this.userInfo.wallet.address money_wallet: this.userInfo.wallet.address,
createTimes: this.$moment().valueOf()
} }
_pushBuyInfo({ _pushBuyInfo({
'buyinfo': data, 'buyinfo': data,
...this.detail,
money: this.value, money: this.value,
...this.detail createTimes:data.createTimes,
}).then((res) => { }).then((res) => {
uni.hideLoading()
let toast = { let toast = {
type: "success", type: "success",
position: 'bottom', position: 'bottom',
@ -223,8 +226,6 @@
...toast, ...toast,
complete: () => { complete: () => {
uni.$emit('updateView', {}) uni.$emit('updateView', {})
uni.hideLoading()
this.loading = false
uni.navigateBack() uni.navigateBack()
} }
}); });

View File

@ -53,8 +53,8 @@
coins: ['USDT','BNB', 'ETH', 'BTC'], coins: ['USDT','BNB', 'ETH', 'BTC'],
scrollHeight: 0, scrollHeight: 0,
search: { search: {
size: 10, page: 1,
listrow: 1, listrow: 10,
totalPage: 0, totalPage: 0,
}, },
optionsType: ['CALL', 'PUT'], optionsType: ['CALL', 'PUT'],
@ -97,6 +97,7 @@
}) })
this.loading = true this.loading = true
let search = { let search = {
'type':this.coins[this.coinIndex],
...this.search ...this.search
} }
delete search.totalPage delete search.totalPage
@ -113,7 +114,7 @@
this.incomes = this.incomes.concat(res.data.data) this.incomes = this.incomes.concat(res.data.data)
} }
this.list = this.incomes.map(item => { this.list = this.incomes.map(item => {
return item.info return {...item.info,'money':item.money}
}) })
this.search.totalPage = Math.ceil(res.data.total / this.search.page) this.search.totalPage = Math.ceil(res.data.total / this.search.page)
uni.hideLoading() uni.hideLoading()

View File

@ -340,7 +340,7 @@ export function _getaccountorder(data){
export function _myIncome(data){ export function _myIncome(data){
return jyRequest.get({ return jyRequest.get({
url:`/api/quantify/getlist` // 获取收益列表 url:`/api/quantify/getlist?${data}` // 获取收益列表
}) })
} }