mine_collection.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view class="dt-page">
  3. <block v-if="emptyType == 0">
  4. <view class="data_wrap">
  5. <DtGoodsList :dataList="dataList" />
  6. </view>
  7. <DtNoMore v-if="isNoMore" />
  8. </block>
  9. <DtEmpty :type="emptyType" />
  10. </view>
  11. </template>
  12. <script>
  13. import DtGoodsList from '../comps/dt_goods_list.vue'
  14. import DtNoMore from '../comps/dt_no_more.vue'
  15. import DtEmpty from '../comps/dt_empty.vue'
  16. export default {
  17. components: {
  18. DtGoodsList,
  19. DtNoMore,
  20. DtEmpty
  21. },
  22. data() {
  23. return {
  24. dataList: [],
  25. memberId: 0
  26. }
  27. },
  28. methods: {
  29. async queryDataList() {
  30. if (this.isPull) {
  31. this.isNoMore = false
  32. this.pageIndex = 0
  33. this.dataList.length = 0
  34. }
  35. let resp = await this.$api.getMyFavoriteProduct({
  36. _isShowLoading: true,
  37. memberId: this.memberId,
  38. pageNo: this.pageIndex,
  39. pageSize: this.pageSize
  40. })
  41. let list = this.getDataList(resp)
  42. this.dataList = this.dataList.concat(list)
  43. },
  44. onLoadPage() {
  45. wx.hideShareMenu();
  46. this.memberId = this.$auth.getMemberId()
  47. this.queryDataList()
  48. },
  49. },
  50. onShow() {
  51. this.onShowPage()
  52. },
  53. onReachBottom() {
  54. this.onReachBottomPage()
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .dt-page {
  60. min-height: 100vh;
  61. background-color: #f2f2f2;
  62. }
  63. .data_wrap {
  64. background: #fff;
  65. }
  66. </style>