teamList.vue 5.8 KB

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