import { DRIVER, ADMIN } from '@/config/constants' export const clone = (obj) => { return JSON.parse(JSON.stringify(obj)) } export const validate = (field, message) => { if (!field || !field.trim()) { uni.showToast({ title: message, icon: 'error', }) return false } return true } export const showErr = (err) => { uni.showToast({ title: err, icon: 'error' }) } export const isDriver = () => { return getApp().globalData.userType === DRIVER } export const isAdmin = () => { return getApp().globalData.userType === ADMIN }