diff --git a/components/kline/tradingView/datafeed.js b/components/kline/tradingView/datafeed.js
index 067a6dd..806f9fd 100644
--- a/components/kline/tradingView/datafeed.js
+++ b/components/kline/tradingView/datafeed.js
@@ -32,7 +32,17 @@ FeedBase.prototype.getSendSymbolName = function(symbolName) {
var name = symbolName.split('/')
return (name[0] + name[1]).toLocaleLowerCase()
}
-
+ FeedBase.prototype.defaultConfiguration = function defaultConfiguration() {
+ //设置默认配置
+ return {
+ supports_search: false,
+ supports_group_request: false,
+ supported_resolutions: ['1', '5', '15', '30', '60', '1D', '1W', '1M'],
+ supports_marks: false,
+ supports_timescale_marks: false,
+ supports_time: true
+ };
+ };
FeedBase.prototype.resolveSymbol = function(symbolName, onResolve, onError) {
onResolve({
"name": symbolName,
@@ -46,7 +56,11 @@ FeedBase.prototype.resolveSymbol = function(symbolName, onResolve, onError) {
"type": "bitcoin",
"volume_precision": 10,
"has_intraday": true,
- "intraday_multipliers": ['1', '5', '15', '30', '60', '240', '1440'], // 时间
+ "intraday_multipliers": ['1', '5', '15', '30', '60', '1D', '1W','1M'], // 时间
+ "supported_resolutions": ['1', '5', '15', '30', '60', '1D', '1W','1M'], // 时间
+ "supports_marks": false,
+ "supports_timescale_marks": false,
+ "supported_time": true,
"has_weekly_and_monthly": false,
"has_no_volume": false,
"regular_session": "24x7",
@@ -65,7 +79,7 @@ FeedBase.prototype.resolveSymbol = function(symbolName, onResolve, onError) {
const resolutionFormat = (resolution, name, to) => {
let req = `market.${name}.kline.${resolution}min`;
let minutes = resolution;
-
+ console.log(resolution)
if (resolution.includes('D')) {
if (resolution.length < 2) resolution = '1' + resolution;
req = `market.${name}.kline.${parseInt(resolution)}day`;
diff --git a/pages.json b/pages.json
index 00f4c09..18fadb4 100644
--- a/pages.json
+++ b/pages.json
@@ -62,6 +62,12 @@
"navigationStyle": "custom"
}
},
+ {
+ "path": "pages/markets/contractOrder",
+ "style": {
+ "navigationStyle": "custom"
+ }
+ },
// charity
{
diff --git a/pages/home/index.vue b/pages/home/index.vue
index c073d5b..c4b46da 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -42,19 +42,24 @@
+ width="123rpx" height="123rpx">
{{ i18n.Recharge }}
-
+
{{ i18n.Mine }}
+ width="123rpx" height="123rpx">
{{ i18n.Subcription }}
+
+
+ {{ i18n.Order }}
+
@@ -485,6 +490,9 @@
case 'subcription':
url = '/pages/subscription/index';
break;
+ case 'contractOrder':
+ url = '/pages/markets/contractOrder';
+ break;
default:
break;
}
@@ -828,15 +836,15 @@
}
.btnDiv {
- margin: 32rpx 48rpx;
+ margin: 32rpx 34rpx;
.item {
display: inline-block;
- width: 218rpx;
+ width: 172rpx;
text-align: center;
.img {
- margin: 0 36rpx 16rpx;
+ margin: 0 26rpx 16rpx;
}
}
}
diff --git a/pages/markets/contractOrder.vue b/pages/markets/contractOrder.vue
new file mode 100644
index 0000000..b1331ca
--- /dev/null
+++ b/pages/markets/contractOrder.vue
@@ -0,0 +1,753 @@
+
+
+ {{ i18n.contractOrder }}
+
+
+
+ {{ i18n.Position }}
+
+ {{ i18n.Closed }}
+
+ {{ i18n.CurrentEntrust }}
+
+ {{ i18n.Revoked }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.pair }}
+ {{item.openedPrice}}
+ {{ i18n.Bond }}
+ {{item.bondAmount}}
+ {{ i18n.StyPrice }}
+ {{item.winStopPrice}}
+
+ {{ i18n.Margincall }}
+
+
+
+
+ {{ i18n.AmountLeverage }}
+ {{item.hand}} * {{item.leverage}}
+ {{ i18n.Fee }}
+ {{item.fee}}
+ {{ i18n.StsPrice }}
+ {{item.lossStopPrice}}
+
+
+
+ {{ i18n.StopLimit }}
+
+
+
+
+
+ {{ i18n.CurrentPrice }}
+ {{latest[item.pair]}}
+
+ {{ i18n.ROE }}
+
+
+ {{getValue(item.direction=='buy'?(latest[item.pair]-item.openedPrice)*item.hand/item.bondAmount:(item.openedPrice-latest[item.pair])*item.hand/item.bondAmount)}}%
+
+
+ {{ i18n.ExpectProfit }}
+
+ {{getItem(item.direction=='buy'?(latest[item.pair]-item.openedPrice)*item.hand:(item.openedPrice-latest[item.pair])*item.hand)}}
+
+ 0
+
+
+ {{
+ i18n.close
+ }}
+
+
+
+
+ {{ i18n.ClosePrice }}
+ {{item.closedPrice}}
+ {{ i18n.ROE }}
+
+
+
+ {{getValue(item.profitAmount/item.bondAmount)}}%
+
+
+
+ {{ i18n.PL }}
+
+
+ {{getPrice(item.profitAmount)}}
+
+
+
+
+
+ {{ i18n.PL }}
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ i18n.StyPrice }}
+ {{ i18n.ExpectProfit }} {{ profit }}
+
+
+
+
+
+
+
+ {{ i18n.StsPrice }}
+ {{ i18n.ExpectLoss }} {{ loss }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ i18n.AmountTrue }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/static/home/img_Mine.png b/static/home/img_Mine.png
index d1c8605..26522c1 100644
Binary files a/static/home/img_Mine.png and b/static/home/img_Mine.png differ
diff --git a/static/home/img_Order.png b/static/home/img_Order.png
new file mode 100644
index 0000000..4faa9c9
Binary files /dev/null and b/static/home/img_Order.png differ
diff --git a/static/home/img_Subcription.png b/static/home/img_Subcription.png
index f48e5ca..4f264c1 100644
Binary files a/static/home/img_Subcription.png and b/static/home/img_Subcription.png differ
diff --git a/static/home/img_recharge.png b/static/home/img_recharge.png
index 6941dac..77164cc 100644
Binary files a/static/home/img_recharge.png and b/static/home/img_recharge.png differ
diff --git a/utils/language/en_US.js b/utils/language/en_US.js
index 603a9ee..95a237a 100644
--- a/utils/language/en_US.js
+++ b/utils/language/en_US.js
@@ -85,6 +85,7 @@ export default {
Recharge: 'Recharge',
Mine: 'Mine',
Subcription: 'Subcription',
+ Order: 'Order',
TodaySteps: "Today's steps",
ReceiveEarnings: "Receive yesterday's earnings",
WarmTips: 'Warm Tips',
@@ -159,6 +160,7 @@ export default {
SellPrice:'Sell Price',
open:'Open',
AmountTrue:'Amount',
+ contractOrder: 'Contract order'
},
// 捐赠页面相关
diff --git a/utils/language/vi_VN.js b/utils/language/vi_VN.js
index eb94074..4ffa2e5 100644
--- a/utils/language/vi_VN.js
+++ b/utils/language/vi_VN.js
@@ -83,6 +83,7 @@ export default {
Recharge: 'nạp điện',
Mine: 'khai thác mỏ',
Subcription: 'Đăng ký',
+ Order: 'Gọi món',
TodaySteps: 'các bước hôm nay',
ReceiveEarnings: 'Nhận thu nhập của ngày hôm qua',
WarmTips: 'Lời khuyên tử tế',
@@ -156,6 +157,7 @@ export default {
SellPrice: 'gia ban',
open: 'mở một vị trí',
AmountTrue:'lượng',
+ contractOrder: 'hợp đồng đặt hàng'
},
// 捐赠页面相关
diff --git a/utils/language/zh_TW.js b/utils/language/zh_TW.js
index bd87a11..36e93a6 100644
--- a/utils/language/zh_TW.js
+++ b/utils/language/zh_TW.js
@@ -84,6 +84,7 @@ export default {
Recharge: '充值',
Mine: '挖礦',
Subcription: '申購',
+ Order: '訂單',
TodaySteps: "今天的步数",
ReceiveEarnings: "領取昨天的收益",
WarmTips: '溫馨提示',
@@ -159,6 +160,7 @@ export default {
SellPrice:'賣價',
open:'開倉',
AmountTrue:'數量',
+ contractOrder: '合約訂單'
},
diff --git a/utils/websocket.js b/utils/websocket.js
index 661adc4..fe8157c 100644
--- a/utils/websocket.js
+++ b/utils/websocket.js
@@ -190,6 +190,14 @@ class WebSocketClass {
writeToScreen(massage) {
console.log(massage);
+ }
+ subLatest() {
+
+
+ this.publicSend('sub', 'latest', ['market.latest'], null)
+ }
+ unSubLatest() {
+ this.publicSend('un_sub', 'latest', ['market.latest'], null)
}
subPairsgroup() {
@@ -269,7 +277,8 @@ class WebSocketClass {
}
- publicSend(event, type, channel, date) {
+ publicSend(event, type, channel, date) {
+ console.log(this.id)
var data = {
event: event,
type: type,