Browse Source

合并

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

84
components/entrustOrderList/entrustOrderList.vue

@ -50,7 +50,7 @@
<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>
@ -59,16 +59,17 @@
<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>
@ -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>
@ -160,8 +162,8 @@
<!-- 追加保证金 --> <!-- 追加保证金 -->
<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>
@ -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,21 +293,33 @@
}, },
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() {
@ -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,
@ -452,7 +466,7 @@
}); });
} }
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,
@ -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