footList.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="footList">
  3. <view class="tips">
  4. 提示:号码很火哦,下单太慢可能会被别人捡走
  5. </view>
  6. <view class="list">
  7. <view class="li" v-for="(item,index) in boxList" :key="index" @tap="ListClick(item.mobile_id)">
  8. <view class="number">{{item.no}}</view>
  9. <view class="Operator">{{item.brand}} {{item.city}}</view>
  10. <view class="money">¥{{item.amount}}</view>
  11. <view class="btn" @tap.stop="deleteMet(item.mobile_user_history_id)">删除</view>
  12. </view>
  13. <u-loadmore :status="status" />
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. list: 15,
  22. page: 1,
  23. boxList:[],
  24. status: 'loadmore',
  25. }
  26. },
  27. onReachBottom() {
  28. // 下拉加载
  29. this.status = 'loading';
  30. this.page = ++ this.page;
  31. let obj={
  32. page:this.page,
  33. limit:this.list,
  34. }
  35. this.$http.history(obj).then(res=>{
  36. // console.log(res)
  37. if(res.data.code==1){
  38. if(obj.page<res.data.data.per_page || obj.page == res.data.data.per_page){
  39. let arr=this.boxList.concat(res.data.data.data)
  40. this.boxList=arr;
  41. console.log(this.boxList)
  42. }
  43. this.status = 'nomore'
  44. }else{
  45. this.status = 'nomore'
  46. }
  47. })
  48. },
  49. onLoad() {
  50. this.listMet()
  51. },
  52. methods: {
  53. // 号码详情
  54. ListClick(id){
  55. console.log(id)
  56. uni.navigateTo({
  57. url: '/pageA/order/order?id='+id,
  58. })
  59. },
  60. listMet(){
  61. let obj={
  62. page:this.page,
  63. limit:this.list,
  64. }
  65. this.$http.history(obj).then(res=>{
  66. console.log(res)
  67. if(res.data.code==1){
  68. this.boxList=res.data.data.data
  69. if(res.data.data.total<this.list){
  70. this.status = 'nomore'
  71. }
  72. }
  73. })
  74. },
  75. deleteMet(id){
  76. this.$http.delete({id:id})
  77. .then(res=>{
  78. console.log(res)
  79. if(res.data.code==1){
  80. uni.showToast({
  81. title: '删除成功',
  82. duration: 2000
  83. });
  84. this.page==1
  85. this.listMet()
  86. }else{
  87. uni.showToast({
  88. title: res.data.msg,
  89. duration: 2000,
  90. icon: 'none'
  91. });
  92. }
  93. })
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. page{
  100. background-color: #F1F1F1;
  101. }
  102. .footList{
  103. .tips{
  104. background-color: #FF9D50;
  105. padding: 8rpx 0;
  106. font-size: 24rpx;
  107. text-align: center;
  108. }
  109. .list{
  110. margin-top: 20rpx;
  111. .li{
  112. position: relative;
  113. box-sizing: border-box;
  114. padding: 20rpx;
  115. background-color: #fff;
  116. margin-bottom: 20rpx;
  117. box-shadow: 0rpx 2rpx 8rpx #f1f2fb;
  118. .number{
  119. font-size: 30rpx;
  120. font-weight: 700;
  121. }
  122. .Operator{
  123. font-size: 24rpx;
  124. color: #696969;
  125. margin-top: 20rpx;
  126. }
  127. .money{
  128. position: absolute;
  129. right: 200rpx;
  130. top: 50%;
  131. transform: translateY(-50%);
  132. font-size: 32rpx;
  133. font-weight: 700;
  134. }
  135. .btn{
  136. position: absolute;
  137. font-size: 24rpx;
  138. padding: 10rpx 30rpx;
  139. border-radius: 6rpx;
  140. right: 20rpx;
  141. top: 50%;
  142. transform: translateY(-50%);
  143. border: 1rpx solid #484848;
  144. }
  145. }
  146. }
  147. }
  148. </style>