index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view :style="viewColor">
  3. <view class="main">
  4. <view class="show_main area-row">
  5. <view class="picture">
  6. <image :src="proInfo.image"></image>
  7. </view>
  8. <view class="show_info">
  9. <view class="show_name line1">{{proInfo.store_name}}</view>
  10. <view class="show_count"><text class="num">{{count}}</text>条买家秀</view>
  11. </view>
  12. </view>
  13. <view class="tab-cont">
  14. <view v-if="goods.length" class="goods-wrap">
  15. <view class="goods">
  16. <WaterfallsFlow :wfList='goods' :isFind="false" :isShow="true" :isAuth="0"/>
  17. </view>
  18. </view>
  19. <view :hidden="!loading" class="acea-row row-center-wrapper loadingicon">
  20. <text class="iconfont icon-jiazai loading"></text>
  21. </view>
  22. <emptyPage v-if="goods.length == 0 && !loading" title="暂无文章~"></emptyPage>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. // +----------------------------------------------------------------------
  29. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  30. // +----------------------------------------------------------------------
  31. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  32. // +----------------------------------------------------------------------
  33. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  34. // +----------------------------------------------------------------------
  35. // | Author: CRMEB Team <admin@crmeb.com>
  36. // +----------------------------------------------------------------------
  37. import WaterfallsFlow from '@/components/plantWaterfallsFlow/WaterfallsFlow.vue'
  38. import { graphicLstApi, graphicProApi} from '@/api/community.js';
  39. import { mapGetters } from "vuex";
  40. import emptyPage from '@/components/emptyPage.vue'
  41. const app = getApp();
  42. export default {
  43. components: {
  44. emptyPage,
  45. WaterfallsFlow,
  46. },
  47. data() {
  48. return {
  49. focus: false,
  50. goods: [], // 商铺商品
  51. count: 0, //买家秀条数
  52. keyword: '',
  53. loaded: false,
  54. loading: false,
  55. loadTitle: '加载更多',
  56. proInfo: {},
  57. where: {
  58. keyword: '',
  59. page: 1,
  60. limit: 30,
  61. topic_id: '',
  62. spu_id: ''
  63. },
  64. }
  65. },
  66. created() {},
  67. computed: {
  68. ...mapGetters(['isLogin','uid','scrollTop','viewColor']),
  69. },
  70. watch: {},
  71. onLoad: function(options) {
  72. this.where.spu_id = options.spu_id
  73. this.getGoods();
  74. this.getProDetail();
  75. },
  76. onShow() {},
  77. mounted: function() {},
  78. methods: {
  79. // 获取关注商品
  80. getGoods: function() {
  81. let that = this;
  82. if (that.loadend) return;
  83. if (that.loading) return;
  84. that.loading = true;
  85. that.loadTitle = '';
  86. graphicLstApi(that.where).then(res => {
  87. that.loading = false;
  88. let list = res.data.list;
  89. let goodsList = that.$util.SplitArray(list, that.goods);
  90. let loadend = list.length < that.where.limit;
  91. that.loadend = loadend;
  92. that.loading = false;
  93. that.count = res.data.count;
  94. that.loadTitle = loadend ? '已全部加载' : '加载更多';
  95. that.$set(that, 'goods', goodsList);
  96. that.$set(that.where, 'page', that.where.page + 1);
  97. }).catch(err => {
  98. that.loading = false;
  99. that.goodsLoading = false;
  100. uni.showToast({
  101. title: err,
  102. icon: 'none'
  103. })
  104. });
  105. },
  106. getProDetail(){
  107. let that = this
  108. graphicProApi(that.where.spu_id).then(res => {
  109. that.proInfo = res.data
  110. }).catch(err => {
  111. uni.showToast({
  112. title: err,
  113. icon: 'none'
  114. })
  115. });
  116. }
  117. },
  118. onReachBottom() {
  119. this.getGoods();
  120. },
  121. // 滚动监听
  122. onPageScroll(e) {
  123. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  124. uni.$emit('scroll');
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. .main {
  130. padding: 20rpx 20rpx 0;
  131. min-height: 100vh;
  132. .goods-wrap{
  133. margin-top: 20rpx;
  134. }
  135. }
  136. .show_main{
  137. padding: 20rpx 30rpx;
  138. background: #fff;
  139. border-radius: 16rpx;
  140. justify-content: space-between;
  141. display: flex;
  142. .picture{
  143. width: 108rpx;
  144. height: 108rpx;
  145. }
  146. .show_info{
  147. width: 510rpx;
  148. position: relative;
  149. }
  150. .show_name{
  151. color: #282828;
  152. font-size: 28rpx;
  153. font-weight: bold;
  154. font-family: 'PingFang SC';
  155. }
  156. .show_count{
  157. position: absolute;
  158. bottom: 4rpx;
  159. color: #282828;
  160. font-size: 24rpx;
  161. .num{
  162. font-size: 30rpx;
  163. font-weight: bold;
  164. color: var(--view-theme);
  165. }
  166. }
  167. }
  168. .show_main .picture image{
  169. width: 100%;
  170. height: 100%;
  171. }
  172. .goods {
  173. display: flex;
  174. flex-wrap: wrap;
  175. justify-content: space-between;
  176. }
  177. .empty-box{
  178. display: flex;
  179. flex-direction: column;
  180. justify-content: center;
  181. align-items: center;
  182. margin-top: 0;
  183. padding-top: 200rpx;
  184. image{
  185. width: 414rpx;
  186. height: 240rpx;
  187. }
  188. .txt{
  189. font-size: 26rpx;
  190. color: #999;
  191. }
  192. }
  193. </style>