diff --git a/components/entrustOrderList/entrustOrderList.vue b/components/entrustOrderList/entrustOrderList.vue index 804fb29..9993b3b 100644 --- a/components/entrustOrderList/entrustOrderList.vue +++ b/components/entrustOrderList/entrustOrderList.vue @@ -15,7 +15,7 @@ - {{item.direction}} + {{item.direction}} {{item.timestr}} {{ i18n.CloseTime }} {{item.timestr2}} @@ -38,7 +38,7 @@ {{ i18n.AmountLeverage }} - {{getHand(item)}} + {{item.hand}} * {{item.leverage}} {{ i18n.Fee }} {{item.fee}} {{ i18n.StsPrice }} @@ -47,7 +47,7 @@ {{ i18n.CurrentPrice }} - {{item.currentPrice}} + {{marketDetail.close}} {{ i18n.status }} {{item.status}} {{ i18n.do }} @@ -100,22 +100,22 @@ {{ i18n.StyPrice }} - {{ i18n.ExpectProfit }} {{ stopLimitData.winStopPrice }} + {{ i18n.ExpectProfit }} {{ profit }} - + {{ i18n.StsPrice }} - {{ i18n.ExpectLoss }} {{ stopLimitData.lossStopPrice }} + {{ i18n.ExpectLoss }} {{ loss }} - + @@ -199,6 +199,8 @@ itemData: {}, // 设置止盈数据 stopLimitData: {}, + profit:0, + loss:0 } }, computed: { @@ -230,6 +232,20 @@ timer2 = null; }, methods: { + stopModalChange(){ + if(this.stopLimitData.direction==='buy'){ + if(this.styValue) + this.profit=this.getItem((this.styValue-this.stopLimitData.openedPrice)*this.stopLimitData.hand) + if(this.stsValue) + this.loss=this.getItem((this.stsValue-this.stopLimitData.openedPrice)*this.stopLimitData.hand) + + }else{ + if(this.styValue) + this.profit=this.getItem((this.stopLimitData.openedPrice-this.styValue)*this.stopLimitData.hand) + if(this.stsValue) + this.loss=this.getItem((this.stopLimitData.openedPrice-this.stsValue)*this.stopLimitData.hand) + } + }, getItem(i) { i = parseFloat(i.toPrecision(10)) i = String(i) @@ -239,20 +255,12 @@ getStopLimit(i) { this.stopLimitData = i this.stopModalShow = true + this.styValue=0; + this.stsValue=0; + this.profit=0 + this.loss=0 }, - getHand(e) { - let i = e.leverage * e.hand - // i = '' + i - // i = parseFloat(i) - // let eformat = i.toExponential() // 转换为标准的科学计数法形式(字符串) - // let tmpArray = eformat.match(/\d(?:\.(\d*))?e([+-]\d+)/) // 分离出小数值和指数值 - // let number = i.toFixed(Math.max(0, (tmpArray[1] || '').length - tmpArray[2])) - i = parseFloat(i.toPrecision(10)) - // number = String(number) - i = String(i) - // return number.substring(0, number.indexOf(".") + 9); - return i.substring(0, i.indexOf(".") + 9); - }, + // 获取撤销订单 closeItem(item, i) { this.itemData = item @@ -268,7 +276,7 @@ this.list = res.data for (var i = 0; i < this.list.length; i++) { if (this.list[i].addTime) { - this.list[i].timestr = this.$index.getformatyymmddhhmmss(this.list[ + this.list[i].timestr = this.$index.formatyymmddhhmmss(this.list[ i].addTime) } if (this.list[i].closedTime) { @@ -451,10 +459,14 @@ margin-bottom: 30rpx; .header { - .dealType { + .buy { color: #00E8A2; margin-right: 28rpx; } + .sell { + color: #F4506A; + margin-right: 28rpx; + } .time { margin-right: 16rpx; diff --git a/components/positionList/positionList.vue b/components/positionList/positionList.vue index dd3e973..749f3fb 100644 --- a/components/positionList/positionList.vue +++ b/components/positionList/positionList.vue @@ -7,7 +7,7 @@ {{ parseFloat(item.price).toFixed(item.baseCoinScale) }} - {{ item.size }} + {{ getItem(parseFloat(item.size)) }} @@ -19,7 +19,7 @@ {{ parseFloat(item.price).toFixed(item.baseCoinScale) }} - {{ item.size }} + {{ getItem(parseFloat(item.size))}} @@ -62,6 +62,22 @@ export default { }, }, methods: { + getItem(i) { + i = String(i) + var max=8 + if(i.replace('.','').length>max){ + if(i.indexOf('.')){ + max+=1 + } + i=i.substring(0,max) + }else{ + if(!i.indexOf('.')){ + i+='.' + } + i=i+new Array(max-i.replace('.','').length).fill('0').join('') + } + return i; + }, depthClick(e) { this.popoverVisible = !this.popoverVisible; }, @@ -118,7 +134,7 @@ export default { .num { display: block; width: 50%; - text-align: center; + text-align: left; padding-right: 10rpx; z-index: 1; } @@ -158,7 +174,7 @@ export default { .num { display: block; width: 50%; - text-align: center; + text-align: left; padding-right: 10rpx; z-index: 1; } diff --git a/manifest.json b/manifest.json index d813aab..4b70a82 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "samehome", - "appid" : "__UNI__C4028F6", + "appid" : "__UNI__0CF38A0", "description" : "", "versionName" : "1.0.0", "versionCode" : "101", diff --git a/pages/markets/kLine.vue b/pages/markets/kLine.vue index bdddd0e..011074d 100644 --- a/pages/markets/kLine.vue +++ b/pages/markets/kLine.vue @@ -348,7 +348,14 @@