helprecords.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="container">
  3. <view class="list" v-for="(item,index) in list" :key='index'>
  4. <view class="list-top">
  5. 救援者姓名:{{item.to_name}}
  6. </view>
  7. <view class="list-phone">
  8. 手机号:{{item.to_phone}}
  9. </view>
  10. <view class="list-time">
  11. 救援时间:{{item.add_time}}
  12. </view>
  13. <view class="list-type" v-if="item.status == 1">
  14. 已接受
  15. </view>
  16. <view class="list-type" v-if="item.status == 0">
  17. 未接受
  18. </view>
  19. <view class="list-type" v-if="item.status == 2">
  20. 已拒绝
  21. </view>
  22. <view class="list-box">
  23. <view class="box-item" @click="tocall(item.to_phone)">
  24. <image src="../../static/icon/call.png" mode="" class="call"></image>
  25. 拨打电话
  26. </view>
  27. </view>
  28. </view>
  29. <empty v-if="list.length === 0"></empty>
  30. <uni-load-more :status="loadingType"></uni-load-more>
  31. </view>
  32. </template>
  33. <script>
  34. import { getseek } from '@/api/index.js';
  35. import empty from '@/components/empty';
  36. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  37. export default {
  38. components: {
  39. empty,
  40. uniLoadMore
  41. },
  42. data() {
  43. return{
  44. page:1,
  45. limit:10,
  46. list:[],
  47. loadingType: 'more',
  48. }
  49. },
  50. onLoad() {
  51. this.loadData();
  52. },
  53. // 下拉加载
  54. onReachBottom() {
  55. this.loadData();
  56. },
  57. methods:{
  58. tocall(num){
  59. console.log(num);
  60. uni.makePhoneCall({
  61. phoneNumber: num //仅为示例
  62. });
  63. },
  64. async loadData() {
  65. let obj = this;
  66. if (obj.loadingType === 'noMore') {
  67. //防止重复加载
  68. return;
  69. }
  70. // 修改当前对象状态为加载中
  71. obj.loadingType = 'loading';
  72. getseek({
  73. page: obj.page,
  74. limit: obj.limit
  75. }).then(({ data }) => {
  76. obj.list = obj.list.concat(data);
  77. obj.page++;
  78. if (obj.limit == data.length) {
  79. obj.loadingType = 'more';
  80. } else {
  81. obj.loadingType = 'noMore';
  82. }
  83. })
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss">
  89. .container{
  90. line-height: 1;
  91. .list{
  92. width: 710rpx;
  93. background: #FFFFFF;
  94. box-shadow: 0px 5rpx 5rpx 0px rgba(35, 24, 21, 0.06);
  95. border-radius: 10rpx;
  96. margin: 20rpx auto 0;
  97. padding: 30rpx;
  98. .list-top{
  99. font-size: 28rpx;
  100. font-weight: 500;
  101. color: #333333;
  102. line-height: 36px;
  103. }
  104. .list-phone{
  105. font-size: 24rpx;
  106. font-weight: 500;
  107. color: #666666;
  108. margin-top: 20rpx;
  109. }
  110. .list-time{
  111. font-size: 24rpx;
  112. font-weight: 500;
  113. color: #666666;
  114. margin-top: 20rpx;
  115. }
  116. .list-type{
  117. font-size: 28rpx;
  118. font-weight: 500;
  119. color: #C9101B;
  120. margin-top: 20rpx;
  121. }
  122. .list-box{
  123. display: flex;
  124. justify-content: center;
  125. padding: 0 40rpx;
  126. margin-top: 20rpx;
  127. .box-item{
  128. width: 210rpx;
  129. height: 65rpx;
  130. background: #C9101B;
  131. border-radius: 30rpx;
  132. display: flex;
  133. align-items: center;
  134. justify-content: center;
  135. font-size: 28rpx;
  136. font-weight: 500;
  137. color: #FFFFFF;
  138. .call{
  139. width: 28rpx;
  140. height: 40rpx;
  141. margin-right: 10rpx;
  142. }
  143. }
  144. .box-item1{
  145. width: 210rpx;
  146. height: 65rpx;
  147. background: #FF4F4F;
  148. border-radius: 30rpx;
  149. display: flex;
  150. align-items: center;
  151. justify-content: center;
  152. font-size: 28rpx;
  153. font-weight: 500;
  154. color: #FFFFFF;
  155. .veo{
  156. width: 40rpx;
  157. height: 40rpx;
  158. margin-right: 10rpx;
  159. }
  160. }
  161. }
  162. }
  163. }
  164. </style>