MCPcopy Create free account
hub / github.com/CoderOpen/waimai / addressToLine

Function addressToLine

front/components/amap-wx/js/util.js:74–90  ·  view source on GitHub ↗

* 地址转地铁线路

(address, type)

Source from the content-addressed store, hash-verified

72 * 地址转地铁线路
73 */
74 addressToLine(address, type) {
75 let addr = address.split(';');
76 let dt = '';
77 addr.forEach(elm => {
78 let color = '#cccccc';
79 if (type === typecode[0].id) {
80 color = this.lineColor(elm)
81 } else if (type === typecode[1].id) {
82 color = '#4075cb'
83 }
84 let style = 'margin:5px 0;margin-right:5px;padding:0 5px;background:' + color +
85 ';font-size:12px;color:#fff;border-radius:3px;';
86 dt += `<div style=\'${style}\'>${elm}</div>`;
87
88 });
89 return `<div style="display:flex;flex-wrap: wrap;">${dt}</div>`;
90 },
91 /**
92 * 数据处理
93 */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected