蟑螂恶霸 3 years ago
parent
commit
3fa459dd71
  1. 11
      subpkg/list/list.vue
  2. 27
      subpkg/role/role.vue

11
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)
},

27
subpkg/role/role.vue

@ -3,12 +3,13 @@
<view class="wrap">
<view class="secbar"> <span class="back" @click="back()"></span></view>
<view class="mainwrap3">
<img src="/static/images/bg_role.jpg" alt="" />
<img src="/static/images/bg_role.jpg" alt=""/>
<view class="role_wrap">
<view class="<strong>contit</strong>">请选择您在<font style="color:#fd6d1f;">{{sceneName}}</font>演练中的角色</view>
<view class="role_box">
<block class="role-item" v-for="(item,i) in roleList" :key="i">
<span @click="startPractice(item)">{{item.name}}</span>
<span :class="item.choose === 'true' ? 'change_color':''" @click="chooseRole(item)">{{item.name}}</span>
<!-- <span class="spanitem" @click="chooseRole(item)">{{item.name}}</span> -->
</block>
</view>
<view class="more_role" @click="showMoreRole()"><a>更多角色</a></view>
@ -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);
}
</style>
Loading…
Cancel
Save