index.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <!-- 热门推荐 -->
  3. <view class='recommend' :style="colorStyle">
  4. <view class="flex-center">
  5. <image class="zs" src="../../static/img/recommend_zs.png"></image>
  6. <text class="fs-32 fw-500 text--w111-333 lh-44rpx px-6">{{ title }}</text>
  7. <image class="zs" src="../../static/img/recommend_zs.png"></image>
  8. </view>
  9. <view class="relative mt-24">
  10. <view class="jinabian"></view>
  11. <waterfallsFlow ref="waterfallsFlow" :wfList="hostProduct" recommend @itemTap="goDetail"></waterfallsFlow>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import {mapGetters} from "vuex";
  17. import { goShopDetail } from '@/libs/order.js'
  18. import colors from "@/mixins/color";
  19. import waterfallsFlow from "@/components/WaterfallsFlow/WaterfallsFlow.vue";
  20. export default {
  21. props: {
  22. hostProduct: {
  23. type: Array,
  24. default: function() {
  25. return [];
  26. }
  27. },
  28. title: {
  29. type: String,
  30. default: '猜你喜欢'
  31. }
  32. },
  33. components: {
  34. waterfallsFlow,
  35. },
  36. mixins: [colors],
  37. computed: mapGetters(['uid']),
  38. methods: {
  39. goDetail(item){
  40. goShopDetail(item, this.uid).catch(res => {
  41. uni.navigateTo({
  42. url: `/pages/goods_details/index?id=${item.id}`
  43. });
  44. });
  45. }
  46. },
  47. }
  48. </script>
  49. <style scoped lang="scss">
  50. .recommend{
  51. padding-top:40rpx;
  52. }
  53. .zs{
  54. width:42rpx;
  55. height:36rpx;
  56. }
  57. </style>