index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <script setup>
  2. import {
  3. ref
  4. } from "vue";
  5. import {
  6. onLoad,
  7. onUnload,
  8. onPullDownRefresh,
  9. onReachBottom,
  10. onPageScroll
  11. } from "@dcloudio/uni-app";
  12. import {
  13. getContactList,
  14. } from "@/api/work/contact.js";
  15. let searchInfo = ref({
  16. unitName: null,
  17. departName: null,
  18. });
  19. let contactList = ref([]);
  20. let listTotal = ref(0);
  21. function getList() {
  22. getContactList(searchInfo.value).then(res => {
  23. contactList.value = res.data.list;
  24. listTotal.value = res.data?.list.length ?? 0
  25. })
  26. };
  27. let popupShow = ref(false);
  28. let popupTitle = ref(null);
  29. let callShow = ref(false);
  30. function showPopup(text) {
  31. callShow.value = true;
  32. popupTitle.value = text
  33. popupShow.value = true
  34. }
  35. function hidePopup() {
  36. popupShow.value = false
  37. callShow.value = false
  38. }
  39. function pasteItem() {
  40. uni.setClipboardData({
  41. data: popupTitle.value
  42. });
  43. }
  44. function callItem() {
  45. plus.device.dial(popupTitle.value, true);
  46. }
  47. onLoad(() => {
  48. getList();
  49. })
  50. </script>
  51. <template>
  52. <view class="container">
  53. <page-title>联系人</page-title>
  54. <view class="cards-list">
  55. <view class="card card-only">
  56. <view class="card-search-item">
  57. <view class="card-item-name">行业单位</view>
  58. <input v-model="searchInfo.unitName" class="card-item-input" style="direction: rtl;"
  59. placeholder="请填写行业单位" placeholder-style="color: #D8D8D8;text-align: right;font-size:28rpx;"
  60. maxlength="20" />
  61. </view>
  62. <view class="card-search-item">
  63. <view class="card-item-name">所在科室</view>
  64. <input v-model="searchInfo.departName" class="card-item-input" style="direction: rtl;"
  65. placeholder="请填写科室" placeholder-style="color: #D8D8D8;text-align: right;font-size:28rpx;"
  66. maxlength="20" />
  67. </view>
  68. </view>
  69. <view class="search-btn" @click="getList()">搜索</view>
  70. <view class="card card-only" v-for="(item,index) in contactList" :key="index">
  71. <!-- <card-title :numerator="index+1" :denominator="listTotal"></card-title> -->
  72. <view class="one-only-card">
  73. <text class="card-name-num">{{(index+1<10?'0'+(index+1):index+1)}}</text>
  74. <view class="card-item ">
  75. <!-- <view class="card-item-name">行业单位</view> -->
  76. <view class="card-item-content only-item">{{item.unitName || "--"}}</view>
  77. </view>
  78. <view class="card-item spe-item" v-if="item.departName">
  79. <!-- <view class="card-item-name">科室</view> -->
  80. <view class="card-item-content spe-item-content">{{item.departName || "--"}}</view>
  81. </view>
  82. </view>
  83. <view class="line" style="margin-top: 14rpx;"></view>
  84. <view class="card-item-layer" style="margin-top: 15rpx;" v-if="item.zrrName || item.zrrTel">
  85. <view class="card-item" v-if="item.zrrName || item.zrrTel">
  86. <view class="card-item-name">项目负责人</view>
  87. <view class="card-item-content">{{item.zrrName || "--"}}</view>
  88. </view>
  89. <view class="card-item" @click="showPopup(item.zrrTel)" v-if="item.zrrName || item.zrrTel">
  90. <view class="card-item-name">联系人电话</view>
  91. <view class="card-item-content zrrTel">{{item.zrrTel || "--"}}</view>
  92. </view>
  93. </view>
  94. <view class="line" v-if="item.leadName || item.leadTel"></view>
  95. <view class="card-item-layer" v-if="item.leadName || item.leadTel">
  96. <view class="card-item" v-if="item.leadName || item.leadTel">
  97. <view class="card-item-name">分管领导人</view>
  98. <view class="card-item-content">{{item.leadName || "--"}}</view>
  99. </view>
  100. <view class="card-item" @click="showPopup(item.leadTel)" v-if="item.leadName || item.leadTel">
  101. <view class="card-item-name">联系人电话</view>
  102. <view class="card-item-content zrrTel">{{item.leadTel || "--"}}</view>
  103. </view>
  104. </view>
  105. <view class="line" v-if="item.ptName || item.telPt"></view>
  106. <view class="card-item-layer" v-if="item.ptName || item.telPt">
  107. <view class="card-item" v-if="item.ptName || item.telPt">
  108. <view class="card-item-name">平台管理人</view>
  109. <view class="card-item-content">{{item.ptName || "--"}}</view>
  110. </view>
  111. <view class="card-item" @click="showPopup(item.telPt)" v-if="item.ptName || item.telPt">
  112. <view class="card-item-name">联系人电话</view>
  113. <view class="card-item-content zrrTel">{{item.telPt || "--"}}</view>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. <u-popup :show="popupShow" @close="hidePopup()" mode="bottom" :round="20" closeOnClickOverlay>
  119. <view class="popup-content">
  120. <view class="popup-item popup-title">{{popupTitle}}</view>
  121. <view class="popup-item" @click="pasteItem()">复制</view>
  122. <view class="popup-item" v-show="callShow" @click="callItem()">拨打</view>
  123. <view class="popup-item popup-close" @click="hidePopup()">关闭</view>
  124. </view>
  125. </u-popup>
  126. </view>
  127. </template>
  128. <style lang="scss" scoped>
  129. .zrrTel {
  130. color: #1763E7 !important;
  131. }
  132. .leadTel {
  133. color: #16AD49 !important;
  134. }
  135. .ptTel {
  136. color: #FF530F !important;
  137. }
  138. .card-item-layer {
  139. width: 100%;
  140. padding: 16rpx 0;
  141. display: flex;
  142. justify-content: flex-start;
  143. align-items: flex-start;
  144. flex-direction: column;
  145. gap: 10rpx;
  146. }
  147. .search-btn {
  148. display: flex;
  149. justify-content: center;
  150. align-items: center;
  151. margin: auto;
  152. margin-top: 32rpx;
  153. width: 328rpx;
  154. height: 72rpx;
  155. background: #002F69;
  156. border-radius: 38rpx;
  157. font-size: 36rpx;
  158. color: #FFFFFF;
  159. font-weight: 500;
  160. }
  161. .card-search-item {
  162. width: 100%;
  163. display: flex;
  164. justify-content: space-between;
  165. align-items: center;
  166. gap: 20rpx;
  167. .card-item-name {
  168. font-weight: 500;
  169. font-size: 28rpx;
  170. color: #B5B5B5;
  171. }
  172. .card-item-input {
  173. flex-grow: 1;
  174. }
  175. .card-item-content {
  176. font-weight: 500;
  177. font-size: 28rpx;
  178. color: #333333;
  179. }
  180. }
  181. .popup-content {
  182. text-align: center;
  183. border-radius: 20rpx 20rpx 0 0;
  184. background-color: #f3f3f3;
  185. .popup-item {
  186. height: 100rpx;
  187. line-height: 100rpx;
  188. color: #343437;
  189. font-size: 32rpx;
  190. background-color: #fff;
  191. border-bottom: 2rpx solid #EAF0FA;
  192. }
  193. .popup-title {
  194. color: #9E9E9E;
  195. border-radius: 20rpx 20rpx 0 0;
  196. }
  197. .popup-close {
  198. margin-top: 20rpx;
  199. border-top: 2rpx solid #EAF0FA;
  200. }
  201. }
  202. .line {
  203. width: 100%;
  204. height: 2rpx;
  205. border-top: 2rpx dashed #DDDDDD;
  206. }
  207. .card-name-num {
  208. width: 64rpx;
  209. height: 64rpx;
  210. min-width: 64rpx;
  211. border-radius: 4rpx;
  212. border: 2rpx solid #F4F4F4;
  213. font-size: 24rpx;
  214. color: #B5B5B5;
  215. display: flex;
  216. align-items: center;
  217. justify-content: center;
  218. }
  219. .one-only-card {
  220. width: 100%;
  221. display: flex;
  222. justify-content: space-between;
  223. gap: 16rpx;
  224. .only-item {
  225. font-weight: 500 !important;
  226. font-size: 28rpx !important;
  227. color: #002F69 !important;
  228. }
  229. .spe-item {
  230. text-align: right;
  231. .spe-item-content {
  232. font-weight: 500 !important;
  233. font-size: 28rpx !important;
  234. color: #6C90C1 !important;
  235. }
  236. }
  237. }
  238. </style>