From 8c90faef7a871cc79631ee4ff61cfc63c8cbeca3 Mon Sep 17 00:00:00 2001 From: yanyan Date: Fri, 10 May 2024 16:19:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E6=9C=89=E4=B8=80=E4=B8=AA=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E6=97=B6=EF=BC=8C=E7=9B=B4=E6=8E=A5=E6=BC=94=E7=BB=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subpkg/list/list.vue | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/subpkg/list/list.vue b/subpkg/list/list.vue index 8e7bfc6..4146bdb 100644 --- a/subpkg/list/list.vue +++ b/subpkg/list/list.vue @@ -145,12 +145,30 @@ this.showVerify = true this.item = item } else { - uni.navigateTo({ - url: '/subpkg/role/role?guid=' + item.guid + '&name=' + item.name - }) + this.getRoleList(item.guid,item.name); + // uni.navigateTo({ + // url: '/subpkg/role/role?guid=' + item.guid + '&name=' + item.name + // }) } } }, + async getRoleList(guid,name) { + + const { + data: res + } = await uni.$http.post('/small/project/role/listAll',{sceneId: guid,name:""}) + if (!res.success) return uni.$showMsg() + console.log(res.data.length ) + if (res.data.length === 1) { + uni.navigateTo({ + url: '/subpkg/practice/practice?roleId='+res.data[0].roleId+'&sceneId='+guid + }) + } else { + uni.navigateTo({ + url: '/subpkg/role/role?guid=' + guid + '&name=' + name + }) + } + }, close() { this.showVerify = false }, @@ -166,9 +184,10 @@ icon: 'none' }) } - uni.navigateTo({ - url: '/subpkg/role/role?guid=' + this.item.guid + '&name=' + this.item.name - }) + this.getRoleList(this.item.guid,this.item.name); + // uni.navigateTo({ + // url: '/subpkg/role/role?guid=' + this.item.guid + '&name=' + this.item.name + // }) }, input(e) { clearTimeout(this.timer)