From 158c32b93ec5813c022e1355afb8e12c58945379 Mon Sep 17 00:00:00 2001 From: yanyan Date: Wed, 28 Feb 2024 11:26:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subpkg/role/role.vue | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/subpkg/role/role.vue b/subpkg/role/role.vue index fcc5c40..1519555 100644 --- a/subpkg/role/role.vue +++ b/subpkg/role/role.vue @@ -3,12 +3,13 @@ - + 请选择您在“{{sceneName}}”演练中的角色: - {{item.name}} + {{item.name}} + 更多角色 @@ -86,12 +87,27 @@ } = await uni.$http.post('/small/project/role/listAll',{sceneId: this.sceneId}) if (!res.success) return uni.$showMsg() + res.data.forEach(item=>{ + this.$set(item, 'choose', 'false') + }) this.roleList = res.data //uni.$showMsg('数据请求成功!') }, + chooseRole(item){ + if (item.choose === "true") { + this.$set(item, 'choose', 'false') + this.roleId = '' + } else if(item.choose === "false"){ + this.$set(item, 'choose', 'true') + this.roleId = item.guid + } + }, startPractice(item) { + if (this.roleId === "") { + return uni.$showMsg('请先选择一个角色') + } uni.navigateTo({ - url: '/subpkg/practice/practice?roleId='+item.guid + url: '/subpkg/practice/practice?roleId='+this.roleId }) }, back(){ @@ -288,5 +304,9 @@ line-height: 3.0; letter-spacing: 2px; } +.change_color{ + background:rgba(0, 153, 255, 1.0); + } + \ No newline at end of file