address.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view class="address">
  3. <view class="adrbox ">
  4. <view class="flex1 plr2">
  5. <box-lit :datainfo="list" :wtdt="wtdt" type="address"></box-lit>
  6. </view>
  7. <view class="rhbtn flex0 mt16" @click="getAddFn">新建地址</view>
  8. </view>
  9. <loading></loading>
  10. </view>
  11. </template>
  12. <script>
  13. import config from '@/config'
  14. const baseUrl = config.baseUrl
  15. import boxLit from "@/mine/components/box/list.vue"
  16. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  17. export default{
  18. components:{boxLit},
  19. data(){
  20. return{
  21. hrimg:require('@/static/logo.png'),
  22. list:[],
  23. pageSize: 10,
  24. pageNum: 1,
  25. reachflag: true,
  26. wtdt:'',
  27. }
  28. },
  29. onLoad: function() {
  30. },
  31. // 上拉触底加载更多触发事件
  32. onReachBottom() {
  33. if (this.reachflag) {
  34. this.pageNum++
  35. this.getDataFn()
  36. }
  37. },
  38. methods:{
  39. checkPermi, checkRole,
  40. getAddFn(){
  41. this.$tab.navigateTo("/mine/pages/house/addaddress")
  42. },
  43. getDataFn(){
  44. var params={
  45. pageSize:this.pageSize,
  46. pageNum: this.pageNum,
  47. }
  48. params.noticeType=this.tabidx
  49. getNoticeList(params).then(res=>{
  50. if(res.code==200){
  51. if (res.rows.length < this.pageSize) {
  52. this.reachflag = false
  53. this.wtdt = '到底了~';
  54. } else {
  55. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  56. if (num < res.total) {
  57. this.reachflag = true
  58. this.wtdt = ''
  59. } else {
  60. this.reachflag = false
  61. this.wtdt = '到底了~';
  62. }
  63. }
  64. if (this.pageNum == 1) {
  65. this.list = res.rows;
  66. } else {
  67. this.list = this.list.concat(res.rows)
  68. }
  69. }else{
  70. this.$toast(res.msg)
  71. }
  72. })
  73. },
  74. }
  75. }
  76. </script>
  77. <style>
  78. page{background: #F3F3F0;}
  79. </style>
  80. <style lang="scss" scoped>
  81. .address{min-height: 100vh;padding: 20rpx 18rpx;display: flex;flex-direction: column;}
  82. .adrbox{background: #FFFFFF;border-radius: 20rpx;padding:0 26rpx 80rpx;flex: 1;display: flex;flex-direction: column;}
  83. </style>