search.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view>
  3. <view class="search">
  4. <view class="box">
  5. <view class="icon">
  6. <uni-icons type="search" size="16" color="#BBBBBB"></uni-icons>
  7. </view>
  8. <view class="text">
  9. <input type="text" v-model="search_text" value="" placeholder="搜索" confirm-type="search"
  10. placeholder-style="font-size: 30rpx;color: #BBBBBB;" @input="get_list()"/>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="content">
  15. <view class="title">
  16. <view class="icon">
  17. <image src="./icon/title_icon.png" mode=""></image>
  18. </view>
  19. <view class="text">国家能源集团枣泉煤矿</view>
  20. </view>
  21. <view class="list">
  22. <view class="item" v-for="(item,index) in list" :key="index" @click="go_user_info(item.staff_num)">
  23. <view class="left">
  24. <view class="icon">{{item.name.charAt(0)}}</view>
  25. <view class="text">{{item.name}} {{item.dept_name}} {{item.duty_num}}</view>
  26. </view>
  27. <view class="right" @click.stop="phone(item.mobile)">
  28. <uni-icons type="phone"></uni-icons>
  29. </view>
  30. </view>
  31. <view v-if="list.length == 0" style="font-size: 32rpx;text-align: center;line-height: 400rpx;">暂无搜索结果
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. search_text: "",
  42. // 人员列表
  43. list: [
  44. ],
  45. };
  46. },
  47. methods: {
  48. get_list() {
  49. this.$api.user_search({
  50. content: this.search_text
  51. }).then((res) => {
  52. console.log(res)
  53. this.list = res.data.data
  54. })
  55. },
  56. go_user_info(staff_num){
  57. uni.navigateTo({
  58. url:"../personal_information/personal_information?staff_num=" + staff_num
  59. })
  60. },
  61. phone(mobile){
  62. if(mobile != null){
  63. uni.makePhoneCall({
  64. phoneNumber: mobile
  65. });
  66. }
  67. },
  68. }
  69. }
  70. </script>
  71. <style lang="scss">
  72. page {
  73. background-color: #F3F8F7;
  74. }
  75. .search {
  76. margin-bottom: 20rpx;
  77. background-color: #FFFFFF;
  78. box-sizing: border-box;
  79. padding: 25rpx 30rpx;
  80. .box {
  81. height: 80rpx;
  82. background-color: #F4F4F4;
  83. border-radius: 50rpx;
  84. display: flex;
  85. align-items: center;
  86. box-sizing: border-box;
  87. padding: 0 25rpx;
  88. .icon {
  89. margin-right: 10rpx;
  90. }
  91. .text {
  92. font-size: 30rpx;
  93. color: #BBBBBB;
  94. }
  95. }
  96. }
  97. .content {
  98. background-color: #FFFFFF;
  99. .title {
  100. height: 110rpx;
  101. display: flex;
  102. align-items: center;
  103. box-sizing: border-box;
  104. padding: 0 36rpx;
  105. border-bottom: 1rpx solid #F3F8F7;
  106. .icon {
  107. image {
  108. width: 48rpx;
  109. height: 36rpx;
  110. }
  111. }
  112. .text {
  113. margin-left: 20rpx;
  114. font-size: 36rpx;
  115. font-weight: 700;
  116. }
  117. }
  118. .list {
  119. box-sizing: border-box;
  120. padding: 0 20rpx;
  121. .item {
  122. height: 110rpx;
  123. display: flex;
  124. justify-content: space-between;
  125. align-items: center;
  126. margin-left: 58rpx;
  127. border-bottom: 1rpx solid #F3F8F7;
  128. .left{
  129. display: flex;
  130. .icon {
  131. width: 35rpx;
  132. text-align: center;
  133. line-height: 35rpx;
  134. border-radius: 50%;
  135. border: 1rpx solid #00A1E9;
  136. font-size: 24rpx;
  137. color: #00A1E9;
  138. }
  139. .text {
  140. margin-left: 18rpx;
  141. font-size: 30rpx;
  142. }
  143. }
  144. .right{
  145. }
  146. }
  147. }
  148. }
  149. </style>