info.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view class="container">
  3. <!-- 空白页 -->
  4. <empty v-if="favoriteList.length < 1"></empty>
  5. <view class="favorites flex" v-for="ls in favoriteList">
  6. <view class="favorites_img"><image :src="ls.image"></image></view>
  7. <view class="favorites_list">
  8. <view class="favorites_name">{{ ls.store_name }}</view>
  9. <view class="favorites_peice flex">
  10. <view>
  11. <text>¥{{ ls.price }}</text>
  12. </view>
  13. <view class="icon_del">
  14. 库存:
  15. <text>{{ ls.number }}</text>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import { user_product } from '@/api/user.js';
  24. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  25. import empty from '@/components/empty';
  26. export default {
  27. components: {
  28. uniLoadMore,
  29. empty
  30. },
  31. data() {
  32. return {
  33. tabCurrentIndex: 0,
  34. favoriteList: '',
  35. delshow: true
  36. };
  37. },
  38. onLoad() {
  39. this.loadData();
  40. },
  41. methods: {
  42. //获取收藏夹列表
  43. loadData() {
  44. let obj = this;
  45. user_product({
  46. page: 1,
  47. limit: 1000
  48. })
  49. .then(function(e) {
  50. obj.favoriteList = e.data.list;
  51. console.log(obj.favoriteList);
  52. })
  53. .catch(function(e) {
  54. console.log(e);
  55. });
  56. }
  57. }
  58. };
  59. </script>
  60. <style lang="scss">
  61. page {
  62. height: 100%;
  63. }
  64. %flex-center {
  65. display: flex;
  66. flex-direction: column;
  67. justify-content: center;
  68. align-items: center;
  69. }
  70. %section {
  71. display: flex;
  72. justify-content: space-around;
  73. align-content: center;
  74. background: #fff;
  75. border-radius: 10rpx;
  76. }
  77. .container {
  78. height: 100%;
  79. background-color: $page-color-base;
  80. padding: 15rpx 0rpx;
  81. font-size: 28rpx;
  82. }
  83. .favorites {
  84. width: 100%;
  85. background-color: #ffffff;
  86. border-radius: 15rpx;
  87. margin: 0 auto;
  88. padding: 25rpx 25rpx;
  89. }
  90. .favorites_img {
  91. width: 80px !important;
  92. height: 80px;
  93. }
  94. .favorites_img image {
  95. width: 100%;
  96. height: 100%;
  97. }
  98. .favorites_list {
  99. width: 70%;
  100. padding-left: 20rpx;
  101. }
  102. .icon_del {
  103. font-size: 27rpx;
  104. font-family: PingFang SC;
  105. font-weight: 500;
  106. color: #333333;
  107. text {
  108. color: #fd3b39;
  109. }
  110. }
  111. .favorites_name {
  112. font-size: 35rpx;
  113. font-family: PingFang SC;
  114. font-weight: bold;
  115. color: #333333;
  116. height: 80rpx;
  117. overflow: hidden;
  118. text-overflow: ellipsis;
  119. display: -webkit-box;
  120. -webkit-box-orient: vertial;
  121. -webkit-line-clamp: 2;
  122. }
  123. .favorites_peice {
  124. font-size: 35rpx;
  125. font-family: PingFang SC;
  126. font-weight: 500;
  127. color: #333333;
  128. margin-top: 25rpx;
  129. font-weight: bold;
  130. }
  131. </style>