shop.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view>
  3. <view class="goodsManageList">
  4. <view class="item" v-for="(item, index) in list" :key="index" >
  5. <view class="top">
  6. <view class="title omit">{{ item.shopName }}</view>
  7. <view class="state">
  8. <text style="color: lightskyblue;font-weight: bold;" @click="detail(item.id)">详情></text>
  9. </view>
  10. <view class="clear"></view>
  11. </view>
  12. <view class="con">
  13. <view style="float: left;margin-right: 10px;">铺主:{{item.ownerName}}</view>
  14. <view style="">编号:{{item.shopNo}}</view>
  15. <view class="tradeAreaName">{{ item.tradeAreaName }}</view>
  16. <view class="date">区域:{{ item.area }}</view>
  17. </view>
  18. <view class="clear"></view>
  19. </view>
  20. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  21. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. list: [],
  30. loadMore: true,
  31. param: { pageNo: 1, pageSize: 10 },
  32. }
  33. },
  34. onLoad() {
  35. this.getData();
  36. },
  37. methods: {
  38. getData() {
  39. this.http.request({
  40. url: '/level-one-server/app/TbShop/getAppList',
  41. success: res=> {
  42. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  43. this.list.push(...res.data.data);
  44. }
  45. })
  46. },
  47. detail(id) {
  48. uni.navigateTo({ url: '/pages/shop/detail?id=' + id });
  49. },
  50. //刷新数据
  51. refresh() {
  52. this.loadMore = true;
  53. this.param.pageNo = 1;
  54. this.list = [];
  55. this.getData();
  56. }
  57. },
  58. //下拉刷新
  59. onPullDownRefresh() {
  60. setTimeout(() => {
  61. this.refresh();
  62. uni.stopPullDownRefresh();
  63. }, 1000);
  64. },
  65. //上拉加载
  66. onReachBottom() {
  67. if (this.loadMore) {
  68. this.param.pageNo++;
  69. this.getData();
  70. }
  71. }
  72. }
  73. </script>
  74. <style>
  75. </style>