shop.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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>
  17. <view class="clear"></view>
  18. </view>
  19. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  20. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. list: [],
  29. loadMore: true,
  30. param: { pageNo: 1, pageSize: 10 },
  31. }
  32. },
  33. onLoad() {
  34. this.getData();
  35. },
  36. methods: {
  37. getData() {
  38. this.http.request({
  39. url: '/level-one-server/app/TbShop/getAppList',
  40. success: res=> {
  41. this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
  42. this.list.push(...res.data.data);
  43. }
  44. })
  45. },
  46. detail(id) {
  47. uni.navigateTo({ url: '/pages/shop/detail?id=' + id });
  48. },
  49. //刷新数据
  50. refresh() {
  51. this.loadMore = true;
  52. this.param.pageNo = 1;
  53. this.list = [];
  54. this.getData();
  55. }
  56. },
  57. //下拉刷新
  58. onPullDownRefresh() {
  59. setTimeout(() => {
  60. this.refresh();
  61. uni.stopPullDownRefresh();
  62. }, 1000);
  63. },
  64. //上拉加载
  65. onReachBottom() {
  66. if (this.loadMore) {
  67. this.param.pageNo++;
  68. this.getData();
  69. }
  70. }
  71. }
  72. </script>
  73. <style>
  74. </style>