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

23
manifest.json

@ -1,9 +1,9 @@
{ {
"name" : "samehome", "name" : "Same home",
"appid" : "__UNI__C4028F6", "appid" : "__UNI__C4028F6",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "101", "versionCode" : 100,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "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" : { "h5" : {
"publicPath" : "/", "publicPath" : "/",
@ -95,7 +110,7 @@
"proxy" : { "proxy" : {
"/api" : { "/api" : {
"ws" : false, "ws" : false,
"target" : "https://sapi.payairs.com", "target" : "https://api.gream.ltd",
"changeOrigin" : true, "changeOrigin" : true,
"secure" : false, "secure" : false,
"pathRewrite" : { "pathRewrite" : {

9
pages/markets/contractOrder.vue

@ -284,9 +284,14 @@
// //
getValue(e){ getValue(e){
let data = e*100 let data = e*100
data = parseFloat(data.toPrecision(10)) data = parseFloat(data)
data = String(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) { getPrice(s) {

Loading…
Cancel
Save