Browse Source

合并

master
j1ack 3 years ago
parent
commit
5474eec50a
  1. 114
      components/entrustOrderList/entrustOrderList.vue
  2. 23
      manifest.json
  3. 9
      pages/markets/contractOrder.vue

114
components/entrustOrderList/entrustOrderList.vue

@ -2,7 +2,7 @@
<view class="entrustOrderList">
<!-- 四个tab -->
<view class="tab">
<view class="item" :class="{ select: type === 1 }" @click="onChangeType(1)">{{ i18n.Position }}
</view>
<view class="item" :class="{ select: type === 2 }" @click="onChangeType(2)">{{ i18n.Closed }}
@ -23,7 +23,7 @@
<view class="closeBtn" v-show="type === 0" @click="closeItem(item,index)">{{
i18n.close
}}</view>
</view>
<view class="infoBody">
@ -48,41 +48,42 @@
<view class="value">{{item.fee}}</view>
<view class="title" v-show="type == 1||type == 2">{{ i18n.StsPrice }}</view>
<view class="value" v-show="type == 1||type == 2">{{item.lossStopPrice}}</view>
<!-- <view class="title" v-show="type === 1">{{ i18n.do }}</view> -->
<view class="closeBtn" v-show="type === 1" @click="getStopLimit(item)">
<view class="closeBtn" v-show="type === 1" @click="getStopLimit(item)">
{{ i18n.StopLimit }}
</view>
</view>
<!-- Current Entrust Position-->
<view class="right" v-show="type === 0 || type === 1">
<view class="title">{{ i18n.CurrentPrice }}</view>
<view class="value" style="color:#F4506A;">{{marketDetail.close}}</view>
<!-- <view class="title" v-show="type === 0">{{ i18n.status }}</view>
<!-- <view class="title" v-show="type === 0">{{ i18n.status }}</view>
<view class="value" v-show="type === 0">
{{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}}
</view> -->
<view class="title" v-show="type === 1">{{ i18n.ROE }}</view>
<view class="value" v-show="type === 1" :style="
<view class="value" v-show="type === 1"
:style="
getValue(item.direction=='buy'
?(marketDetail.close-item.openedPrice)*item.hand/item.bondAmount:(item.openedPrice-marketDetail.close)*item.hand/item.bondAmount)>=0?'color:#00E8A2;':'color:#F4506A'">
<!-- {{getValue(item.profitAmount/item.bondAmount)}}% -->
{{getValue(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand/item.bondAmount:(item.openedPrice-marketDetail.close)*item.hand/item.bondAmount)}}%
<!-- {{getValue(item.profitAmount/item.bondAmount)}}% -->
{{getValue(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand/item.bondAmount:(item.openedPrice-marketDetail.close)*item.hand/item.bondAmount)}}%
</view>
<view class="title" v-show="type === 1||type === 2">{{ i18n.ExpectProfit }}</view>
<view class="value" v-show="type === 1"
:style="parseFloat(getItem(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand:(item.openedPrice-marketDetail.close)*item.hand))>=0?'color:#00E8A2':'color:#F4506A'">
{{getItem(item.direction=='buy'?(marketDetail.close-item.openedPrice)*item.hand:(item.openedPrice-marketDetail.close)*item.hand)}}
</view>
<view class="value" style="color:#00E8A2;" v-show="type === 2">0</view>
<!-- <view class="title" v-show="type === 1">{{ i18n.do }}</view> -->
<view class="closeBtn" v-show="type === 1" @click="closeItem(item,index)">{{
i18n.close
}}</view>
</view>
<!-- Closed -->
<view class="right" v-show="type === 2">
@ -90,10 +91,11 @@
<view class="value" style="color:#00E8A2;">{{item.closedPrice}}</view>
<view class="title">{{ i18n.ROE }}</view>
<view class="value">
<!-- {{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}} -->
<view class="value" :style="(item.profitAmount/item.bondAmount)*100>=0?'color:#00E8A2;':'color:#F4506A'">
{{getValue(item.profitAmount/item.bondAmount)}}%
</view>
<!-- {{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}} -->
<view class="value"
:style="(item.profitAmount/item.bondAmount)*100>=0?'color:#00E8A2;':'color:#F4506A'">
{{getValue(item.profitAmount/item.bondAmount)}}%
</view>
</view>
<view class="title">{{ i18n.PL }}</view>
@ -105,13 +107,13 @@
</view>
<!-- Revoked -->
<view class="right" v-show="type === 3">
<!-- <view class="title">{{ i18n.status }}</view>
<!-- <view class="title">{{ i18n.status }}</view>
<view class="value" style="color:#F4506A;">
{{item.status=='undone'?i18n.undone:item.status=='opened'?i18n.opened:item.status=='revoked'?i18n.revoked:i18n.closed}}
</view> -->
<view class="title">{{ i18n.PL }}</view>
<view class="value" style="color:#00E8A2;">
0
0
</view>
</view>
</view>
@ -155,13 +157,13 @@
</view>
</view>
</u-modal>
<!-- 追加保证金 -->
<u-modal :show="stopModalShowZui" :confirmText="i18n.Confirm" :cancelText="i18n.Cancel" :showCancelButton="true"
:title="i18n.Margincall" :content='i18n.WarmTipsText' @confirm="stopConfirm" @cancel="stopModalShowZui = false"
confirmColor="#00E8A2" cancelColor="#96959E">
:title="i18n.Margincall" :content='i18n.WarmTipsText' @confirm="stopConfirm"
@cancel="stopModalShowZui = false" confirmColor="#00E8A2" cancelColor="#96959E">
<view class="stopModel">
<view class="title">
<text class="left">{{ i18n.AmountTrue }}</text>
@ -175,7 +177,7 @@
</view>
</view>
</u-modal>
<u-empty :text="i18n.Dataisempty" mode="data" v-if="!list.length"></u-empty>
</view>
@ -237,7 +239,7 @@
closeModalShow: false,
stopModalShow: false,
type: 1,
stopModalShowZui:false,
stopModalShowZui: false,
test: 0,
dealList: [{
dealType: 'long'
@ -291,23 +293,35 @@
},
methods: {
//
getValue(e){
let data = e*100
data = parseFloat(data.toPrecision(10))
data = String(data)
return data.substring(0, data.indexOf(".") + 3);
getValue(e) {
let data = e * 100
data = parseFloat(data)
data = String(data)
if (data.indexOf(".") != -1) {
return data.substring(0, data.indexOf(".") + 3);
} else {
return data
}
},
//
getPrice(s) {
var i=s;
var i = s;
/*
js 数字精度问题
*/
i = parseFloat(i.toPrecision(10))
i = parseFloat(i)
i = String(i)
return i.substring(0, i.indexOf(".") + 5);
// return i.substring(0, i.indexOf(".") + 5);
if (i.indexOf(".") != -1) {
return i.substring(0, i.indexOf(".") + 5);
} else {
return i
}
},
stopModalChange() {
if (this.stopLimitData.direction === 'buy') {
if (this.styValue)
@ -341,14 +355,14 @@
this.loss = 0
},
//
Margincall(i){
this.stopLimitData = i
this.stopModalShowZui=true
this.styValue = 0;
this.stsValue = 0;
this.profit = 0
this.loss = 0
},
Margincall(i) {
this.stopLimitData = i
this.stopModalShowZui = true
this.styValue = 0;
this.stsValue = 0;
this.profit = 0
this.loss = 0
},
//
closeItem(item, i) {
this.itemData = item
@ -380,7 +394,7 @@
* @param {*} type
*/
onChangeType(type = 0) {
this.list=[];
this.list = [];
this.type = type
if (this.type == 0) {
this.status = 'undone'
@ -429,7 +443,7 @@
* stop确认弹窗
*/
stopConfirm() {
if(this.stopModalShow){
if (this.stopModalShow) {
if (this.styValue < 0 || this.stsValue < 0) {
uni.showToast({
title: this.i18n.lessThan,
@ -451,8 +465,8 @@
}, 800)
});
}
if(this.stopModalShowZui){
if (this.stopModalShowZui) {
if (this.styValue < 0) {
uni.showToast({
title: this.i18n.lessThan,
@ -472,9 +486,9 @@
this.getContractOrderList()
}, 800)
});
}
},
/**
* styValue值变化
@ -530,10 +544,11 @@
</script>
<style scoped lang="scss">
.righttype3{
.righttype3 {
position: absolute;
right: 115rpx;
}
.closeBtn {
display: inline-block;
// width: 98rpx;
@ -547,6 +562,7 @@
color: rgb(0, 232, 162);
margin-top: 22rpx;
}
/deep/ .u-empty {
top: 500% !important;
}

23
manifest.json

@ -1,9 +1,9 @@
{
"name" : "samehome",
"name" : "Same home",
"appid" : "__UNI__C4028F6",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "101",
"versionCode" : 100,
"transformPx" : false,
/* 5+App */
"app-plus" : {
@ -84,7 +84,22 @@
}
}
},
"nativePlugins" : {}
"nativePlugins" : {
"HF-Step" : {
"__plugin_info__" : {
"name" : "原生计步器(Android和IOS)",
"description" : "计步器,原生计步器插件,安卓,IOS",
"platforms" : "Android,iOS",
"url" : "https://ext.dcloud.net.cn/plugin?id=6632",
"android_package_name" : "com.samehome",
"ios_bundle_id" : "com.samehome",
"isCloud" : true,
"bought" : 1,
"pid" : "6632",
"parameters" : {}
}
}
}
},
"h5" : {
"publicPath" : "/",
@ -95,7 +110,7 @@
"proxy" : {
"/api" : {
"ws" : false,
"target" : "https://sapi.payairs.com",
"target" : "https://api.gream.ltd",
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {

9
pages/markets/contractOrder.vue

@ -284,9 +284,14 @@
//
getValue(e){
let data = e*100
data = parseFloat(data.toPrecision(10))
data = parseFloat(data)
data = String(data)
return data.substring(0, data.indexOf(".") + 3);
if(data.indexOf(".")!=-1){
return data.substring(0, data.indexOf(".") + 3);
}else{
return data;
}
},
//
getPrice(s) {

Loading…
Cancel
Save