teamList.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <view>
  3. <u-navbar title="团队成员" title-color="#101010" ></u-navbar>
  4. <view class="top">
  5. <view class="search">
  6. <view class="searchBox">
  7. <u-search shape="square" placeholder="搜索授权用户" maxlength="12" v-model="testName" :show-action="false"
  8. :animation="true"></u-search>
  9. <u-button type="primary" size="mini" @click="testBtn">搜素</u-button>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="bodyMain">
  14. <view class="list" >
  15. <view class="item"
  16. v-for="(item,index) in list"
  17. v-show="showqueryName(item) "
  18. @click="gotoUrl('/pages/team/teamInfo?id='+item.id)"
  19. :key="index">
  20. <view class="icon">
  21. <image class="img" v-if="item.image" :src="item.image" mode=""></image>
  22. <image class="img" v-else src="@/assets/img/默认头像.png" mode=""></image>
  23. </view>
  24. <view class="body">
  25. <view class="line1">
  26. <view class="title">
  27. {{item.name}} <span class="tag" :class="'role'+item.role">{{item.roleName}}</span>
  28. </view>
  29. </view>
  30. <view class="line2">
  31. <view class="value">
  32. {{item.phone}}
  33. </view>
  34. </view>
  35. </view>
  36. <view class="openId":class="{
  37. openIdOk:item.openId
  38. }">
  39. {{item.openId?'已登录':'未登录'}}
  40. <u-icon name="arrow-right" size="24" color="#BBBBBB" ></u-icon>
  41. </view>
  42. </view>
  43. </view>
  44. <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
  45. </view>
  46. <view class="floating-button">
  47. <view class="button" @click="gotoUrl('/pages/team/teamAdd')" >
  48. <image class="img" src="@/assets/img/team/index0.svg" mode=""></image>
  49. 添加人员
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import * as API from '@/apis/pagejs/pagesTeam.js'
  56. export default {
  57. data() {
  58. return {
  59. list:[],
  60. listForm:{
  61. pageIndex: 1,
  62. pageSize: 99,
  63. recordsTotal: 1,
  64. status:0,
  65. roleName:"XJ,XJADMIN",
  66. roleName:"XJ",
  67. },
  68. testName: "",
  69. queryName: "",
  70. lockId:"",
  71. lockName:"",
  72. current:0,
  73. tabslist:[
  74. {
  75. name: '待处理'
  76. }, {
  77. name: '已处理'
  78. }
  79. ]
  80. };
  81. },
  82. onLoad(op) {
  83. },
  84. onShow(){
  85. this.getList()
  86. },
  87. methods: {
  88. showqueryName(item){
  89. if(this.queryName){
  90. var name=item.name
  91. return name.indexOf(this.queryName)!=-1
  92. }else{
  93. return true
  94. }
  95. },
  96. roleNamesShow(str){
  97. var sz=str.split(",")
  98. var rsz=[]
  99. sz.forEach(item=>{
  100. if(item.indexOf('巡检')!=-1){
  101. rsz.push(item)
  102. }
  103. })
  104. return rsz.join(',')
  105. },
  106. submit(){
  107. },
  108. testBtn() {
  109. this.queryName = this.testName
  110. },
  111. getList(bl) {
  112. if(bl){
  113. this.listForm.pageIndex = 1
  114. }
  115. uni.showLoading({
  116. title: "加载中",
  117. mask: true,
  118. })
  119. API.teamMembers(this.listForm).then((res) => {
  120. var list = res.data.memberList
  121. list=list.sort((item1,item2)=>{
  122. if(item1.role<item2.role){
  123. return -1
  124. }else {
  125. return 1
  126. }
  127. })
  128. this.list= list
  129. uni.hideLoading();
  130. }).catch(error => {
  131. uni.hideLoading();
  132. uni.showToast({
  133. title: error,
  134. icon: "none"
  135. })
  136. })
  137. },
  138. }
  139. }
  140. </script>
  141. <style lang="scss" scoped>
  142. .bodyMain{
  143. padding-bottom: 120rpx;
  144. }
  145. .list {
  146. padding: 0rpx 32rpx;
  147. background-color: rgba(255,255,255,1);
  148. .item {
  149. display: flex;
  150. border-bottom: 2rpx solid rgba(232, 232, 232, 1);
  151. padding: 12rpx 0;
  152. margin: 12rpx 0;
  153. .icon{
  154. display: flex;
  155. align-items: center;
  156. margin-right: 8rpx;
  157. }
  158. .img {
  159. width: 72rpx;
  160. height: 72rpx;
  161. }
  162. .openId{
  163. display: flex;
  164. white-space: pre;
  165. align-items: center;
  166. color: red;
  167. }
  168. .openIdOk{
  169. color: #19be6b;
  170. }
  171. .body {
  172. margin: 0 12rpx;
  173. width: 100%;
  174. .line1,
  175. .line2 {
  176. display: flex;
  177. justify-content: space-between;
  178. }
  179. .line2 {
  180. color: rgba(119,119,119,1);
  181. font-size: 24rpx;
  182. margin-top: 8rpx;
  183. }
  184. .line1 {
  185. .title {
  186. color: rgba(51, 51, 51, 1);
  187. font-size: 32rpx;
  188. font-weight: bold;
  189. }
  190. .status {
  191. background-color: rgba(255, 61, 0, 1);
  192. font-size: 24rpx;
  193. color:#fff;
  194. padding: 2rpx 8rpx;
  195. //border-radius: 8rpx;
  196. }
  197. .status0 {
  198. background-color: rgba(255, 61, 0, 1);
  199. }
  200. .status1 {
  201. background-color: #007aff;
  202. }
  203. .status2 {
  204. background-color: #ff9900;
  205. }
  206. .status3 {
  207. background-color: #19be6b;
  208. }
  209. .status4 {
  210. border: 2rpx solid rgba(255, 61, 0, 1);
  211. color: rgba(255, 61, 0, 1);
  212. }
  213. }
  214. .errorDesc{
  215. margin: 8rpx 0;
  216. width: 480rpx;
  217. color: #777777;
  218. font-size: 24rpx;
  219. overflow: hidden;
  220. text-overflow: ellipsis;
  221. white-space: nowrap; /* 禁止换行,强制单行 */
  222. }
  223. }
  224. }
  225. .item:last-child {
  226. border-bottom:0px solid rgba(232,232,232,1);
  227. }
  228. }
  229. .top{
  230. border-bottom: 2rpx solid #e8e8e8;
  231. }
  232. .search {
  233. padding: 16rpx 32rpx;
  234. background: #fff;
  235. .searchBox {
  236. display: flex;
  237. align-items: center;
  238. background: #F2F2F2;
  239. padding: 2rpx 16rpx;
  240. border-radius: 16rpx;
  241. justify-content: space-between;
  242. }
  243. }
  244. .floating-button {
  245. z-index: 999;
  246. position: fixed;
  247. bottom: 0;
  248. width: 100%;
  249. display: flex;
  250. height: 120rpx;
  251. justify-content: center;
  252. background-color: rgba(255,255,255,1);
  253. .button{
  254. margin-top: 24rpx;
  255. border-radius: 50px;
  256. height: 80rpx;
  257. width: 80%;
  258. display: flex;
  259. align-items: center;
  260. justify-content: center;
  261. padding:12rpx;
  262. background-color: rgba(22,119,255,1);
  263. color: rgba(255,255,255,1);
  264. font-size: 36rpx;
  265. }
  266. .img{
  267. width: 40rpx;
  268. height: 40rpx;
  269. margin-right: 8rpx;
  270. }
  271. }
  272. .tag{
  273. border-radius: 2pt;
  274. background-color: #8bc34a;
  275. color: rgba(255,255,255,1);
  276. font-size: 24rpx;
  277. line-height: 24rpx;
  278. padding:2rpx 8rpx;
  279. margin-left: 8rpx;
  280. }
  281. .role0{
  282. background-color: #FFC107;
  283. }
  284. .role1{
  285. background-color: rgba(22,119,255,1);
  286. }
  287. .role2{
  288. background-color: #19be6b;
  289. }
  290. .role3{
  291. background-color: #9E9E9E;
  292. }
  293. .role4{
  294. background-color: #9C27B0;
  295. }
  296. .role5{
  297. background-color: #8BC34A;
  298. }
  299. </style>