generated from Leo_Ding/web-template
1
This commit is contained in:
parent
ce2d1cfb9a
commit
4f548f2f9b
@ -32,7 +32,7 @@
|
||||
<span>南通市通州区互联网+智慧养老居家上门服务项目</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="paltform_list">
|
||||
<div class="paltform_list" v-if="currentPlatForm !== 'yunying'">
|
||||
<div value="CALL_CENTER" class="paltform_icon" @click="handleSelect('hujiao')">
|
||||
<div class="paltform_icon_1">
|
||||
<img :src="tel" alt="" srcset="" width="76" height="76" class="img">
|
||||
@ -52,6 +52,20 @@
|
||||
<p>运营平台</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="orgManage" v-else>
|
||||
<a-card style="width: 600px;margin:0 auto;height: 300px;">
|
||||
<div style="margin: 10px 0;color:#1677ff;cursor: pointer;">
|
||||
<span @click="currentPlatForm = 'jianguan'">{{ '< 返回' }}</span>
|
||||
</div>
|
||||
<h3>请选择您的管理组织</h3>
|
||||
<a-select ref="select" v-model:value="currentOrg" style="width: 100%"
|
||||
@change="handleChange" :defaultOpen="true">
|
||||
<a-select-option v-for="value in stationList" :value="value.id">{{
|
||||
value.name
|
||||
}}</a-select-option>
|
||||
</a-select>
|
||||
</a-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -69,6 +83,7 @@ import yunying from '@/assets/imgs/yunying.png'
|
||||
import { useAppStore, useRouterStore, useUserStore } from '@/store'
|
||||
import { template } from 'lodash-es'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import apis from '@/apis'
|
||||
import storage from '@/utils/storage'
|
||||
defineOptions({
|
||||
name: 'PlatForm',
|
||||
@ -76,19 +91,35 @@ defineOptions({
|
||||
const appStore = useAppStore()
|
||||
const routerStore = useRouterStore()
|
||||
const router = useRouter()
|
||||
const stationList = ref([])
|
||||
const currentPlatForm = ref('jianguan')
|
||||
const currentOrg = ref()
|
||||
// 在组件挂载前设置 body 类名
|
||||
onBeforeMount(() => {
|
||||
document.body.className = 'body-bg'
|
||||
})
|
||||
async function handleSelect(type) {
|
||||
storage.local.setItem('platform', type)
|
||||
// 加载完成
|
||||
if (appStore.complete) {
|
||||
goIndex()
|
||||
if (type === 'yunying') {
|
||||
currentPlatForm.value = 'yunying'
|
||||
try {
|
||||
const { data, success } = await apis.serviceMenu.getServiceSiteList({ pageSize: 100, current: 1 })
|
||||
if (success) {
|
||||
stationList.value = data.map(item => ({ id: item.id, name: item.name }))
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
} else {
|
||||
await appStore.init({ platform: type })
|
||||
goIndex()
|
||||
storage.local.setItem('platform', type)
|
||||
// 加载完成
|
||||
if (appStore.complete) {
|
||||
goIndex()
|
||||
} else {
|
||||
await appStore.init({ platform: type })
|
||||
goIndex()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
async function goIndex() {
|
||||
console.log('goIndex')
|
||||
@ -96,7 +127,7 @@ async function goIndex() {
|
||||
console.log(indexRoute)
|
||||
if (!indexRoute) return
|
||||
router.push(indexRoute)
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* 获取首页路由
|
||||
@ -115,6 +146,17 @@ function getFirstValidRoute() {
|
||||
}
|
||||
return indexRoute
|
||||
}
|
||||
async function handleChange(e) {
|
||||
storage.local.setItem('platform', 'yunying')
|
||||
storage.local.setItem('stationId', e)
|
||||
// 加载完成
|
||||
if (appStore.complete) {
|
||||
goIndex()
|
||||
} else {
|
||||
await appStore.init({ platform: 'yunying' })
|
||||
goIndex()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.body-bg {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user