|
|
@ -53,9 +53,8 @@ |
|
|
{{ $t("contract.d6") }} |
|
|
{{ $t("contract.d6") }} |
|
|
<van-icon @click="popshow=true" class="color-theme-1 m-l-xs" name="info-o"/> |
|
|
<van-icon @click="popshow=true" class="color-theme-1 m-l-xs" name="info-o"/> |
|
|
</view> |
|
|
</view> |
|
|
<view class="num color-light fn-right" style="margin-top:8px;">{{ |
|
|
<!-- <view class="num color-light fn-right" style="margin-top:8px;">{{accountInfo.riskRate || "0%"}} --> |
|
|
accountInfo.riskRate || "0%" |
|
|
<view class="num color-light fn-right" style="margin-top:8px;">{{riskRate || "0%"}} |
|
|
}} |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -311,7 +310,8 @@ |
|
|
:max="6" |
|
|
:max="6" |
|
|
:contract="1" |
|
|
:contract="1" |
|
|
> |
|
|
> |
|
|
<view class="fn-lg color-buy">{{ newPrice.price }}</view> |
|
|
<view class="fn-lg color-buy">{{ modifiedPrice }}</view> |
|
|
|
|
|
<!-- <view class="fn-lg color-buy">{{ newPrice.price }}</view> --> |
|
|
</sell-and-buy> |
|
|
</sell-and-buy> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -437,17 +437,19 @@ |
|
|
<view class="row d-flex m-y-xs justify-between fn-14 p-t-xs"> |
|
|
<view class="row d-flex m-y-xs justify-between fn-14 p-t-xs"> |
|
|
<view class="w-33 fn-left"> |
|
|
<view class="w-33 fn-left"> |
|
|
<view class="label">{{ $t("contract.g6") }}</view> |
|
|
<view class="label">{{ $t("contract.g6") }}</view> |
|
|
<view class="color-light">{{item.avg_price}}</view> |
|
|
<!-- <view class="color-light">{{item.avg_price}}</view> --> |
|
|
|
|
|
<view class="color-light">{{avg_price1(item.avg_price)}}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="w-33 fn-center"> |
|
|
<view class="w-33 fn-center"> |
|
|
<view class="label">{{ $t("first.c5") }}</view> |
|
|
<view class="label">{{ $t("first.c5") }}</view> |
|
|
<view class="color-light"> |
|
|
<view class="color-light"> |
|
|
<template>{{item.realtimePrice}}</template> |
|
|
<!-- <template>{{item.realtimePrice}}</template> --> |
|
|
|
|
|
<template>{{realtimePrice1(item.realtimePrice)}}</template> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="w-33 fn-right"> |
|
|
<view class="w-33 fn-right"> |
|
|
<view class="label">{{ $t("contract.b1") }}</view> |
|
|
<view class="label">{{ $t("contract.b1") }}</view> |
|
|
<view class="color-light">{{item.position_margin}}</view> |
|
|
<view class="color-light">{{avg_price1(item.position_margin)}}</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="row d-flex m-y-xs justify-between fn-14 p-t-xs"> |
|
|
<view class="row d-flex m-y-xs justify-between fn-14 p-t-xs"> |
|
|
@ -464,7 +466,7 @@ |
|
|
<view class="w-33 fn-right"> |
|
|
<view class="w-33 fn-right"> |
|
|
<view class="label">{{ $t("contract.a1") }}({{ $t("contract.d8") }})</view> |
|
|
<view class="label">{{ $t("contract.a1") }}({{ $t("contract.d8") }})</view> |
|
|
<view class="color-light"> |
|
|
<view class="color-light"> |
|
|
{{item.avail_position}} |
|
|
{{avg_price1(item.avail_position)}} |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -473,7 +475,9 @@ |
|
|
<view class="label">{{ $t("option.b6") }}</view> |
|
|
<view class="label">{{ $t("option.b6") }}</view> |
|
|
<view class="color-light" |
|
|
<view class="color-light" |
|
|
:class="item.unRealProfit>0?'increace':item.unRealProfit<0?'decreace':''"> |
|
|
:class="item.unRealProfit>0?'increace':item.unRealProfit<0?'decreace':''"> |
|
|
{{item.unRealProfit}} |
|
|
<!-- {{ item.unRealProfit}} --> |
|
|
|
|
|
{{avg_price1(item.unRealProfit)}} |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<!-- <view class="w-50 fn-center"> |
|
|
<!-- <view class="w-50 fn-center"> |
|
|
@ -483,7 +487,8 @@ |
|
|
<view class="w-50 fn-right"> |
|
|
<view class="w-50 fn-right"> |
|
|
<view class="label">{{ $t("contract.h0") }}</view> |
|
|
<view class="label">{{ $t("contract.h0") }}</view> |
|
|
<view class="color-light" :class="item.unRealProfit>0?'color-buy':'color-sell'"> |
|
|
<view class="color-light" :class="item.unRealProfit>0?'color-buy':'color-sell'"> |
|
|
{{item.profitRate}} |
|
|
<!-- {{item.profitRate}} --> |
|
|
|
|
|
{{avg_price1(item.profitRate)}} |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -921,6 +926,22 @@ export default { |
|
|
// #ifdef APP-PLUS |
|
|
// #ifdef APP-PLUS |
|
|
return plus.os.name |
|
|
return plus.os.name |
|
|
// #endif |
|
|
// #endif |
|
|
|
|
|
}, |
|
|
|
|
|
modifiedPrice(){ |
|
|
|
|
|
if (this.newPrice.price) { |
|
|
|
|
|
let price = this.newPrice.price; |
|
|
|
|
|
let parts = price.split("."); |
|
|
|
|
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
|
|
|
|
|
return parts.join(","); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
riskRate(){ |
|
|
|
|
|
if (this.accountInfo.riskRate) { |
|
|
|
|
|
let price = this.accountInfo.riskRate; |
|
|
|
|
|
let parts = price.split("."); |
|
|
|
|
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
|
|
|
|
|
return parts.join(","); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
@ -1003,6 +1024,22 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
avg_price1(item){ |
|
|
|
|
|
if (item) { |
|
|
|
|
|
let price = item.toString(); |
|
|
|
|
|
let parts = price.split("."); |
|
|
|
|
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
|
|
|
|
|
return parts.join(","); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
realtimePrice1(item){ |
|
|
|
|
|
if (item) { |
|
|
|
|
|
let price = item; |
|
|
|
|
|
let parts = price.split("."); |
|
|
|
|
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
|
|
|
|
|
return parts.join(","); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
onRefresh() { |
|
|
onRefresh() { |
|
|
if (this.refreshing) return; |
|
|
if (this.refreshing) return; |
|
|
this.refreshing = true; |
|
|
this.refreshing = true; |
|
|
@ -1311,9 +1348,23 @@ export default { |
|
|
}; |
|
|
}; |
|
|
Contract.contractAccount(data, {loading: !boo, toast: false}).then((res) => { |
|
|
Contract.contractAccount(data, {loading: !boo, toast: false}).then((res) => { |
|
|
// console.info(res) |
|
|
// console.info(res) |
|
|
|
|
|
// res.data.account_equity = (parseInt(res.data.account_equity)).toFixed(2) |
|
|
|
|
|
// res.data.usable_balance = (res.data.usable_balance).toFixed(2) |
|
|
|
|
|
|
|
|
res.data.account_equity = (parseInt(res.data.account_equity)).toFixed(2) |
|
|
res.data.account_equity = (parseInt(res.data.account_equity)).toFixed(2) |
|
|
res.data.usable_balance = (res.data.usable_balance).toFixed(2) |
|
|
var parts1 = res.data.account_equity.split("."); |
|
|
|
|
|
parts1[0] = parts1[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
|
|
|
|
|
res.data.account_equity = parts1.join(","); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res.data.usable_balance = res.data.usable_balance.toFixed(2).toString(); |
|
|
|
|
|
var parts = res.data.usable_balance.split("."); |
|
|
|
|
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
|
|
|
|
|
res.data.usable_balance = parts.join(","); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.accountInfo = res.data; |
|
|
this.accountInfo = res.data; |
|
|
|
|
|
console.log(res.data,'12345612'); |
|
|
if (!boo) { |
|
|
if (!boo) { |
|
|
// this.form.lever_rate = res.data.lever_rate; |
|
|
// this.form.lever_rate = res.data.lever_rate; |
|
|
if (this.form.lever_rate) { |
|
|
if (this.form.lever_rate) { |
|
|
@ -1470,6 +1521,15 @@ export default { |
|
|
socketMessage() { |
|
|
socketMessage() { |
|
|
// 节流防抖 |
|
|
// 节流防抖 |
|
|
let buyFun = lodash.throttle((data) => { |
|
|
let buyFun = lodash.throttle((data) => { |
|
|
|
|
|
// data.forEach((item) => { |
|
|
|
|
|
// let price = item.price.toString(); |
|
|
|
|
|
// let parts = price.split("."); |
|
|
|
|
|
// parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
|
|
|
|
|
// item.price = parts.join(","); |
|
|
|
|
|
// }); |
|
|
|
|
|
// data.forEach((item) => { |
|
|
|
|
|
// item.price = (parseFloat(item.price)).toString().replace("." , ","); |
|
|
|
|
|
// }); |
|
|
this.buyList = data; |
|
|
this.buyList = data; |
|
|
}, 500); |
|
|
}, 500); |
|
|
let sellFun = lodash.throttle((data) => { |
|
|
let sellFun = lodash.throttle((data) => { |
|
|
|