card.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view class="">
  3. <u-popup v-model="detailShow" mode="center" width="650" :closeable="true" border-radius="10" negative-top="300">
  4. <view style="padding: 60rpx 5rpx 10rpx;">
  5. <u-cell-group>
  6. <u-cell-item :icon-style="iconStyle" :border-top="false" :arrow="false" icon="account-fill"
  7. title="访客姓名:" :value="detailData.guestName"></u-cell-item>
  8. <u-cell-item :icon-style="iconStyle" :arrow="false" icon="bookmark-fill" title="身份证号:"
  9. :value="detailData.guestIdcard"></u-cell-item>
  10. <u-cell-item :icon-style="iconStyle" :arrow="false" icon="phone-fill" title="手机号:"
  11. :value="detailData.guestTel"></u-cell-item>
  12. <u-cell-item :icon-style="iconStyle" :arrow="false" icon="map-fill" title="访问区域:"
  13. :value="guestPosition(detailData)"></u-cell-item>
  14. <u-cell-item :icon-style="iconStyle" :arrow="false" icon="clock-fill" title="访问时间:"
  15. :value="detailData.interviewTime"></u-cell-item>
  16. <u-cell-item :icon-style="iconStyle" :arrow="false" icon="plus-people-fill" title="接待人:"
  17. :value="detailData.userName"></u-cell-item>
  18. <u-cell-item :icon-style="iconStyle" :border-bottom="false" :arrow="false" icon="error-circle-fill"
  19. title="访问目的:" :value="detailData.guestReason"></u-cell-item>
  20. </u-cell-group>
  21. </view>
  22. </u-popup>
  23. <view @click="showDetail(item)" class="data" v-for="(item, index) in list" :key="index">
  24. <view class="top">
  25. <view class="left">
  26. <view class="title ">
  27. <text class="text-bold">访客姓名:</text>
  28. <text>{{item.guestName}}</text>
  29. </view>
  30. </view>
  31. <view class="right">
  32. <text class="" v-if="item.auditStatus==1">已通过</text>
  33. <text class="text-orange" v-if="item.auditStatus==0">待审核</text>
  34. <text class="text-red" v-if="item.auditStatus==2">未通过</text>
  35. </view>
  36. </view>
  37. <view class="item">
  38. <view class="left">
  39. <view style="padding: 20rpx 30rpx 0;">
  40. <view class="content">
  41. <text class="padding-right-10">访问区域:</text>
  42. <text>{{guestPosition(item)}}</text>
  43. </view>
  44. <view class="content">
  45. <text class="padding-right-10">联系方式:</text>
  46. <text>{{item.guestTel}}</text>
  47. <image @click.stop="call(item.guestTel)" class="call" src="/static/call.png"></image>
  48. </view>
  49. <view class="content">
  50. <text class="padding-right-10">来访目的:</text>
  51. <text style="line-height: 50rpx;">{{item.guestReason}}</text>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="bottom">
  57. <!-- 待审核,显示取消工单 -->
  58. <view @click.stop="pass(item)" v-if="item.auditStatus==0"
  59. class="cu-btn sm round bg-blue margin-right-20">
  60. 审核通过
  61. </view>
  62. <view @click.stop="fail(item)" v-if="item.auditStatus==0" class="cu-btn sm round bg-blue">
  63. 审核不通过
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. export default {
  71. name: 'card',
  72. props: {
  73. list: {
  74. type: Array,
  75. default: () => {
  76. []
  77. }
  78. }
  79. },
  80. data() {
  81. return {
  82. detailShow:false,
  83. detailData:{},
  84. iconStyle:{
  85. color:"#1887ff"
  86. },
  87. };
  88. },
  89. onLoad() {
  90. },
  91. computed: {
  92. guestPosition() {
  93. return data => {
  94. return `${data.residentialName}-${data.buildingName}-${data.unitName}-${data.roomName}`
  95. }
  96. }
  97. },
  98. methods: {
  99. call(phone) {
  100. uni.makePhoneCall({
  101. phoneNumber: phone
  102. })
  103. },
  104. showDetail(item) {
  105. this.detailShow=true
  106. this.detailData=item
  107. },
  108. pass(item) {
  109. this.$emit('pass', item)
  110. },
  111. fail(item) {
  112. this.$emit('fail', item)
  113. }
  114. }
  115. };
  116. </script>
  117. <style lang="scss">
  118. .bg-blue {
  119. background-color: #59a5f0;
  120. color: #FFFFFF;
  121. }
  122. .data {
  123. width: 710rpx;
  124. background-color: #ffffff;
  125. margin: 20rpx auto;
  126. border-radius: 6rpx;
  127. box-sizing: border-box;
  128. padding: 20rpx;
  129. font-size: 28rpx;
  130. .top {
  131. display: flex;
  132. justify-content: space-between;
  133. padding-bottom: 20rpx;
  134. border-bottom: 1rpx solid #EEEEEE;
  135. .left {
  136. display: flex;
  137. align-items: center;
  138. .title {
  139. margin: 0 10rpx;
  140. font-size: 30rpx;
  141. }
  142. }
  143. .right {
  144. margin-right: 10rpx;
  145. }
  146. }
  147. .item {
  148. margin: 5rpx 0 20rpx 0;
  149. .content {
  150. // border-bottom: 1rpx dashed #DDDDDD;
  151. padding: 20rpx 0;
  152. .call {
  153. width: 36rpx;
  154. height: 36rpx;
  155. margin-left: 40rpx;
  156. margin-top: 10rpx;
  157. }
  158. }
  159. }
  160. .bottom {
  161. display: flex;
  162. margin-top: 30rpx;
  163. justify-content: flex-end;
  164. align-items: center;
  165. }
  166. }
  167. </style>