Commit 2818a609385413d741121de12f86e440205d1a0e
1 parent
350ffe9c
其他公交公司用的公交电子站牌页面组件
1、修正解析远端数据的小bug
Showing
4 changed files
with
11 additions
and
10 deletions
front-end/h5/src/components/core/plugins/bsth/othergj/linechart/chart/models/eBusStopData.js
| @@ -52,7 +52,8 @@ class RouteData { | @@ -52,7 +52,8 @@ class RouteData { | ||
| 52 | 52 | ||
| 53 | get lastStationName () { | 53 | get lastStationName () { |
| 54 | let length = this._stationDataList.length | 54 | let length = this._stationDataList.length |
| 55 | - return length > 0 ? this._stationDataList[length - 1] : '' | 55 | + // console.log(this._stationDataList) |
| 56 | + return length > 0 ? this._stationDataList[length - 1].name : '' | ||
| 56 | } | 57 | } |
| 57 | } | 58 | } |
| 58 | 59 |
front-end/h5/src/components/core/plugins/bsth/othergj/linechart/chart/models/eBusStopGpsData.js
| @@ -154,19 +154,19 @@ class EBusStopGpsData { | @@ -154,19 +154,19 @@ class EBusStopGpsData { | ||
| 154 | let currentStopIndex = currentStopIndexList[0] // 当前站点索引(默认取第一个) | 154 | let currentStopIndex = currentStopIndexList[0] // 当前站点索引(默认取第一个) |
| 155 | for (let i = currentStopIndex; i >= 0; i--) { | 155 | for (let i = currentStopIndex; i >= 0; i--) { |
| 156 | // 计算离当前站点最近的一班车的报站信息 | 156 | // 计算离当前站点最近的一班车的报站信息 |
| 157 | - let info = info['lineRoute'][i] | ||
| 158 | - if (info['laststop'] && info['laststop'] === info['stationCode']) { | 157 | + let lineRouteInfo = info['lineRoute'][i] |
| 158 | + if (lineRouteInfo['laststop'] && lineRouteInfo['laststop'] === lineRouteInfo['stationCode']) { | ||
| 159 | let stops = currentStopIndex - i // 距离几站 | 159 | let stops = currentStopIndex - i // 距离几站 |
| 160 | if (stops >= 2) { | 160 | if (stops >= 2) { |
| 161 | this._arrivalInfo = stops + "站" | 161 | this._arrivalInfo = stops + "站" |
| 162 | } else if (stops === 1) { | 162 | } else if (stops === 1) { |
| 163 | - if (info['state'] === '1') { // 本站前一站进站 | 163 | + if (lineRouteInfo['state'] === '1') { // 本站前一站进站 |
| 164 | this._arrivalInfo = "1站" | 164 | this._arrivalInfo = "1站" |
| 165 | } else { // 本站前一站出站 | 165 | } else { // 本站前一站出站 |
| 166 | this._arrivalInfo = "即将进站" | 166 | this._arrivalInfo = "即将进站" |
| 167 | } | 167 | } |
| 168 | } else { | 168 | } else { |
| 169 | - if (info['state'] === '1') { // 本站进站 | 169 | + if (lineRouteInfo['state'] === '1') { // 本站进站 |
| 170 | this._arrivalInfo = "即将进站" | 170 | this._arrivalInfo = "即将进站" |
| 171 | } else { // 本站出站 | 171 | } else { // 本站出站 |
| 172 | this._arrivalInfo = "等待发车" | 172 | this._arrivalInfo = "等待发车" |
front-end/h5/src/components/core/plugins/bsth/othergj/linechart/chart/othergj-eBusStop-line-chart.js
| @@ -259,8 +259,7 @@ export default { | @@ -259,8 +259,7 @@ export default { | ||
| 259 | <stop offset="100%" stop-color={this.chart_line_gradient_color_start} /> | 259 | <stop offset="100%" stop-color={this.chart_line_gradient_color_start} /> |
| 260 | </linearGradient> | 260 | </linearGradient> |
| 261 | </defs> | 261 | </defs> |
| 262 | - | ||
| 263 | - <g class="lineInfo"></g> | 262 | + s |
| 264 | <g class="lineRouteGpsInfo" transform={ "translate(" + this.left_part_width + ",0)" }> | 263 | <g class="lineRouteGpsInfo" transform={ "translate(" + this.left_part_width + ",0)" }> |
| 265 | <g class="line-wrap"></g> | 264 | <g class="line-wrap"></g> |
| 266 | <g class="gps-wrap"></g> | 265 | <g class="gps-wrap"></g> |
| @@ -269,6 +268,7 @@ export default { | @@ -269,6 +268,7 @@ export default { | ||
| 269 | <path d={downLinePathD} style={{ 'fill': this.down_line_s_color }}></path> | 268 | <path d={downLinePathD} style={{ 'fill': this.down_line_s_color }}></path> |
| 270 | </g> | 269 | </g> |
| 271 | </g> | 270 | </g> |
| 271 | + <g class="lineInfo"></g> | ||
| 272 | <g class="emptyInfo"></g> | 272 | <g class="emptyInfo"></g> |
| 273 | </svg> | 273 | </svg> |
| 274 | { | 274 | { |
front-end/h5/src/components/core/plugins/index.js
| @@ -361,7 +361,7 @@ export const pluginsList = [ | @@ -361,7 +361,7 @@ export const pluginsList = [ | ||
| 361 | { | 361 | { |
| 362 | i18nTitle: { | 362 | i18nTitle: { |
| 363 | 'en-US': 'MhgjEBusStopLineChartList', | 363 | 'en-US': 'MhgjEBusStopLineChartList', |
| 364 | - 'zh-CN': '电子站牌单线路模拟图2list' | 364 | + 'zh-CN': '电子站牌单线路模拟图列表2' |
| 365 | }, | 365 | }, |
| 366 | title: '电子站牌单线路模拟图2list', | 366 | title: '电子站牌单线路模拟图2list', |
| 367 | icon: 'list', | 367 | icon: 'list', |
| @@ -378,14 +378,14 @@ export const pluginsList = [ | @@ -378,14 +378,14 @@ export const pluginsList = [ | ||
| 378 | title: '电子站牌单线路模拟图3', | 378 | title: '电子站牌单线路模拟图3', |
| 379 | icon: 'list', | 379 | icon: 'list', |
| 380 | component: OthergjEBusStopLineChart, | 380 | component: OthergjEBusStopLineChart, |
| 381 | - visible: true, | 381 | + visible: false, |
| 382 | name: OthergjEBusStopLineChart.name | 382 | name: OthergjEBusStopLineChart.name |
| 383 | }, | 383 | }, |
| 384 | 384 | ||
| 385 | { | 385 | { |
| 386 | i18nTitle: { | 386 | i18nTitle: { |
| 387 | 'en-US': 'OthergjEBusStopLineChartList', | 387 | 'en-US': 'OthergjEBusStopLineChartList', |
| 388 | - 'zh-CN': '电子站牌单线路模拟图3list' | 388 | + 'zh-CN': '电子站牌单线路模拟图列表3' |
| 389 | }, | 389 | }, |
| 390 | title: '电子站牌单线路模拟图3list', | 390 | title: '电子站牌单线路模拟图3list', |
| 391 | icon: 'list', | 391 | icon: 'list', |