feat:完善其余页面
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
export function useConsultation() {
|
||||
const isOpen = useState('consultation-open', () => false)
|
||||
const context = useState('consultation-context', () => ({
|
||||
title: '预约免费 GEO 诊断',
|
||||
source: '全站咨询入口',
|
||||
industry: ''
|
||||
}))
|
||||
const form = useState('consultation-form', () => ({
|
||||
name: '',
|
||||
company: '',
|
||||
contact: '',
|
||||
industry: '',
|
||||
need: '',
|
||||
message: '',
|
||||
consent: false
|
||||
}))
|
||||
|
||||
function openConsultation(payload = {}) {
|
||||
context.value = {
|
||||
title: payload.title || '预约免费 GEO 诊断',
|
||||
source: payload.source || '全站咨询入口',
|
||||
industry: payload.industry || ''
|
||||
}
|
||||
|
||||
if (payload.industry) form.value.industry = payload.industry
|
||||
isOpen.value = true
|
||||
}
|
||||
|
||||
function closeConsultation() {
|
||||
isOpen.value = false
|
||||
}
|
||||
|
||||
return {
|
||||
isOpen,
|
||||
context,
|
||||
form,
|
||||
openConsultation,
|
||||
closeConsultation
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user