index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class='recommend'>
  3. <view class='title acea-row row-center-wrapper'>
  4. <text class='iconfont icon-zhuangshixian'></text>
  5. <text class='name'>热门推荐</text>
  6. <text class='iconfont icon-zhuangshixian lefticon'></text>
  7. </view>
  8. <view class='recommendList acea-row row-between-wrapper'>
  9. <view class='item' v-for="(item,index) in hostProduct" :key="index" hover-class='none' @tap="goDetail(item)">
  10. <view class='pictrue'>
  11. <image :src='item.picUrl'></image>
  12. <span class="pictrue_log_big pictrue_log_class" v-if="item.activityList && item.activityList[0] && item.activityList[0].type === 1">秒杀</span>
  13. <span class="pictrue_log_big pictrue_log_class" v-if="item.activityList && item.activityList[0] && item.activityList[0].type === 2">砍价</span>
  14. <span class="pictrue_log_big pictrue_log_class" v-if="item.activityList && item.activityList[0] && item.activityList[0].type === 3">拼团</span>
  15. </view>
  16. <view class='name line1'>{{ item.name }}</view>
  17. <view class='money font-color'>¥<text class='num'>{{ fen2yuan(item.price) }}</text></view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import { mapGetters } from "vuex";
  24. import { goShopDetail } from '@/libs/order.js'
  25. import * as Util from '@/utils/util.js';
  26. export default {
  27. computed: mapGetters(['uid']),
  28. props: {
  29. hostProduct: {
  30. type: Array,
  31. default: function() {
  32. return [];
  33. }
  34. }
  35. },
  36. methods: {
  37. goDetail(item){
  38. goShopDetail(item,this.uid).then(() => {
  39. uni.navigateTo({
  40. url:`/pages/goods_details/index?id=${item.id}`
  41. })
  42. })
  43. },
  44. fen2yuan(price) {
  45. return Util.fen2yuan(price)
  46. }
  47. }
  48. }
  49. </script>
  50. <style scoped lang="scss">
  51. .recommend {
  52. background-color: #fff;
  53. }
  54. .recommend .title {
  55. height: 135rpx;
  56. line-height: 135rpx;
  57. font-size: 28rpx;
  58. color: #282828;
  59. }
  60. .recommend .title .name {
  61. margin: 0 28rpx;
  62. }
  63. .recommend .title .iconfont {
  64. font-size: 170rpx;
  65. color: #454545;
  66. }
  67. .recommend .title .iconfont.lefticon {
  68. transform: rotate(180deg);
  69. }
  70. .recommend .recommendList {
  71. padding: 0 30rpx;
  72. /* #ifdef H5 */
  73. padding-bottom: 50rpx;
  74. /* #endif */
  75. }
  76. .recommend .recommendList .item {
  77. width: 335rpx;
  78. margin-bottom: 30rpx;
  79. }
  80. .recommend .recommendList .item .pictrue {
  81. position: relative;
  82. width: 100%;
  83. height: 335rpx;
  84. }
  85. .recommend .recommendList .item .pictrue image {
  86. width: 100%;
  87. height: 100%;
  88. border-radius: 14rpx;
  89. }
  90. .recommend .recommendList .item .name {
  91. font-size: 28rpx;
  92. color: #282828;
  93. margin-top: 20rpx;
  94. }
  95. .recommend .recommendList .item .money {
  96. font-size: 20rpx;
  97. margin-top: 8rpx;
  98. font-weight: 600;
  99. }
  100. .recommend .recommendList .item .money .num {
  101. font-size: 28rpx;
  102. }
  103. </style>