diff --git a/subpkg/list/list.vue b/subpkg/list/list.vue index 4a82d53..4d9f6e3 100644 --- a/subpkg/list/list.vue +++ b/subpkg/list/list.vue @@ -41,6 +41,7 @@ pageSize:10 }, total:0, + search: false, isloading:false, //轮播图数据列表 swiperList: [], @@ -77,7 +78,12 @@ res.rows.forEach(item=>{ item.uploadPath = uni.$http.baseUrl +item.uploadPath }) - this.sceneList =[...this.sceneList,...res.rows] + if (this.search) { + this.sceneList = res.rows + this.search = false + } else { + this.sceneList =[...this.sceneList,...res.rows] + } this.total = res.total // uni.$showMsg('数据请求成功!') }, @@ -92,7 +98,8 @@ clearTimeout(this.timer) this.timer = setTimeout(() => { - this.name = e + this.queryObj.name = e + this.search = true this.getSceneList() }, 500) }, diff --git a/subpkg/role/role.vue b/subpkg/role/role.vue index fcc5c40..6afc6ce 100644 --- a/subpkg/role/role.vue +++ b/subpkg/role/role.vue @@ -3,12 +3,13 @@ - + 请选择您在“{{sceneName}}”演练中的角色: - {{item.name}} + {{item.name}} + 更多角色 @@ -86,12 +87,28 @@ } = 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.roleList.forEach(item=>{this.$set(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 +305,9 @@ line-height: 3.0; letter-spacing: 2px; } +.change_color{ + background:rgba(138, 162, 254, 1.0); + } + \ No newline at end of file