You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
888 B
34 lines
888 B
import { ref } from 'vue'
|
|
import { BEST, ESCALATOR, STRAIGHT } from '@/views/Nav/methodsList'
|
|
|
|
export const useChangeNavMethod = callback => {
|
|
const methodIdx = ref(0)
|
|
//切换导航路线
|
|
function handleControl(method, index) {
|
|
methodIdx.value = index
|
|
selectedWayMethods(method)
|
|
}
|
|
|
|
//选择路线 0:最佳路线 1: 扶梯模式 2: 电梯模式
|
|
function selectedWayMethods(method) {
|
|
switch (method) {
|
|
case BEST:
|
|
//最佳路线
|
|
window.Map_QM.ChangePathByGood(callback)
|
|
break
|
|
case ESCALATOR:
|
|
//扶梯模式
|
|
window.Map_QM.ChangePathByFt(callback)
|
|
break
|
|
case STRAIGHT:
|
|
//电梯模式
|
|
window.Map_QM.ChangePathByDt(callback)
|
|
break
|
|
default:
|
|
window.Map_QM.ChangePathByGood(callback)
|
|
break
|
|
}
|
|
}
|
|
|
|
return { methodIdx, handleControl, selectedWayMethods }
|
|
}
|
|
|