|
@ -20,7 +20,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view id="kline" :windowWidth="width" :change:windowWidth="KlineJs.setWidth" :windowHeight="height" |
|
|
<view id="kline" :windowWidth="width" :change:windowWidth="KlineJs.setWidth" :windowHeight="height" |
|
|
:change:windowHeight="KlineJs.setHeight" :symbol="symbol" |
|
|
:change:windowHeight="KlineJs.setHeight" :symbol="symbol" |
|
|
:change:symbol="KlineJs.setSymbol" :index_activeCycle="index_activeCycle" :change:index_activeCycle="KlineJs.changindex_activeCycle"></view> |
|
|
:change:symbol="KlineJs.setSymbol" :language="language" :change:language="KlineJs.changlanguage" :index_activeCycle="index_activeCycle" :change:index_activeCycle="KlineJs.changindex_activeCycle"></view> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -106,7 +106,8 @@ |
|
|
return { |
|
|
return { |
|
|
chartHeight: 0, |
|
|
chartHeight: 0, |
|
|
chartWidth: 0, |
|
|
chartWidth: 0, |
|
|
chartSymbol:'btc' |
|
|
chartSymbol:'btc', |
|
|
|
|
|
language:'en' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
//该生命周期慢于不是renderjs的生命周期 |
|
|
//该生命周期慢于不是renderjs的生命周期 |
|
@ -129,6 +130,9 @@ |
|
|
}, |
|
|
}, |
|
|
changindex_activeCycle(index_activeCycle){ |
|
|
changindex_activeCycle(index_activeCycle){ |
|
|
this.initChart(index_activeCycle) |
|
|
this.initChart(index_activeCycle) |
|
|
|
|
|
}, |
|
|
|
|
|
changlanguage(language){ |
|
|
|
|
|
this.language=language |
|
|
} |
|
|
} |
|
|
, |
|
|
, |
|
|
initChart(index_activeCycle) { |
|
|
initChart(index_activeCycle) { |
|
@ -143,12 +147,7 @@ |
|
|
chartConfig.time_frames=[] |
|
|
chartConfig.time_frames=[] |
|
|
// 初始化 TradingView |
|
|
// 初始化 TradingView |
|
|
console.log(window.TradingView.version()) |
|
|
console.log(window.TradingView.version()) |
|
|
const language = uni.getStorageSync("language")|| 'en_US'; |
|
|
|
|
|
if(language.indexOf('zh')>-1){ |
|
|
|
|
|
chartConfig.locale=language |
|
|
|
|
|
}else{ |
|
|
|
|
|
chartConfig.locale=language.split('_')[0] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
widgetObj = new widget(chartConfig) |
|
|
widgetObj = new widget(chartConfig) |
|
|