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)