Skip to content

Commit

Permalink
添加移动端MA显示、隐藏按钮
Browse files Browse the repository at this point in the history
  • Loading branch information
zcZhang123 committed Oct 28, 2019
1 parent be1e146 commit cbf9fc0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/components/mobileChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
<font class="mobile-tooltip-name">{{message.volumeMobile}}</font>
<font class="mobile-tooltip-data">{{this.toolTipData.volume}}</font>
</div>
<!-- 均线显示隐藏按钮-->
<!-- <div @click="showMA" class="mobile-ma-btn">均线</div> -->
<div v-show="showIndicatorMA" style="font-size:0.16rem; margin-top: 0.1rem;">
<font
v-for="MAitem in this.klineConfig.MA"
Expand Down Expand Up @@ -69,6 +67,7 @@
v-on:listenToChildEvent="changeCycle"
v-on:listenTipIndex="getTipDataIndex"
v-on:listenIndicatorChartOpenClose="getIndicatorOpenClose"
@listenShowMA="showMA"
:kline-config="klineConfig"
:chart-data-obj="chartDataObj"
></KLine>
Expand Down
13 changes: 12 additions & 1 deletion src/components/mobileKline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
<div class="indicator-font">
<font>{{message.indicator}}</font>
</div>
<div
@click="showMA"
:class="this.showIndicatorMA ? 'mobile-indicator-div-active' : 'mobile-indicator-div'"
>{{message.MA}}</div>
<div
@click="showIndicatorChart('MACD')"
:class="this.showIndicator ==='MACD' ? 'mobile-indicator-div-active' : 'mobile-indicator-div'"
Expand Down Expand Up @@ -216,7 +220,8 @@ export default {
showIndicatorDiv: false,
showIndicator: "",
watchLoading: true,
loadingTime: 0
loadingTime: 0,
showIndicatorMA: true //是否展示MA均线
};
},
props: {
Expand Down Expand Up @@ -430,6 +435,12 @@ export default {
this.showMinCycle = false;
this.showIndicatorDiv = !this.showIndicatorDiv;
},
// 点击显示、隐藏MA事件
showMA() {
this.showIndicatorMA = !this.showIndicatorMA;
this.$emit("listenShowMA", this.showIndicatorMA);
this.showIndicatorDiv = false;
},
showIndicatorChart(indicator) {
let dataZoom = this.kline.getMobileKlineDataZoom();
let indicatorData = {
Expand Down
1 change: 1 addition & 0 deletions src/i18n/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"buy": "Buy",
"sell": "Sell",
"indicator": "Indicator",
"MA": "MA",
"MACD": "MACD",
"Volume": "Volume",
"KDJ": "KDJ",
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
"buy": "买入",
"sell": "卖出",
"indicator": "指标",
"MACD": "MACD",
"Volume": "成交量",
"MA": "MA",
"MACD": "MACD",
"KDJ": "KDJ",
"RSI": "RSI",
"OBV": "OBV",
Expand Down

0 comments on commit cbf9fc0

Please sign in to comment.