feat(scene): 首页场所入口跳转选择页并回显所选场景

This commit is contained in:
ozh 2026-08-18 17:34:13 +08:00
parent 8af15703f0
commit cc6dec3970
1 changed files with 17 additions and 3 deletions

View File

@ -21,10 +21,10 @@
@click="goConfig"
/>
<view class="site-row" @click="goConfig">
<view class="site-row" @click="goSceneSelect">
<view class="site-left">
<up-icon name="list" size="18" color="#26c996" />
<text class="site-text">请选择场所</text>
<text class="site-text">{{ sceneName || '请选择场所' }}</text>
</view>
<up-icon name="arrow-right" size="14" color="#26c996" />
</view>
@ -42,14 +42,28 @@
<script>
import { ROUTES } from '@/constants/routes'
import { navigateTo } from '@/utils/navigation'
import { getCurrentScene } from '@/store/scene'
export default {
data() {
return {
noticeText: '点击选择场所后可进入设备配置流程'
noticeText: '点击选择场所后可进入设备配置流程',
sceneName: ''
}
},
onShow() {
this.refreshScene()
},
methods: {
//
refreshScene() {
const scene = getCurrentScene()
this.sceneName = scene ? scene.name : ''
},
//
goSceneSelect() {
navigateTo(ROUTES.SCENE_SELECT)
},
//
goAdd() {
navigateTo(ROUTES.DEVICE_ADD)