teamList.vue 6.2 KB

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