嘉兴绿城濮院
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.
 
 
 
 

40 lines
1.1 KiB

import { ref } from 'vue'
import { NavMethods, methodsList } from '@/views/Nav/methodsList'
/**
*
*
* @param {Function} callback
*/
export const useChangeNavMethod = (callback: ({ direction, wayList }: { direction: Direction; wayList: Shop[] }) => void) => {
const methodIdx = ref(0)
//切换导航路线
function handleControl(method: NavMethods, index: number) {
methodIdx.value = index
selectedWayMethods(method)
}
//选择路线 0:最佳路线 1: 扶梯模式 2: 电梯模式
function selectedWayMethods(method: NavMethods) {
switch (method) {
case NavMethods.BEST:
//最佳路线
window.Map_QM.ChangePathByGood(callback)
break
case NavMethods.ESCALATOR:
//扶梯模式
window.Map_QM.ChangePathByFt(callback)
break
case NavMethods.STRAIGHT:
//电梯模式
window.Map_QM.ChangePathByDt(callback)
break
default:
window.Map_QM.ChangePathByGood(callback)
break
}
}
return { methodsList, methodIdx, handleControl, selectedWayMethods }
}