recommend.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view class="scroll_box">
  3. <scroll-view class="scroll-view_x" scroll-x show-scrollbar="false">
  4. <view class="item_list" v-for="l in bastList" @click="listTo(l.id)">
  5. <image :src="l.image"></image>
  6. <view class="price">
  7. <text class="store_name clamp">{{l.store_name}}</text>
  8. <view class="price-d">
  9. <text class="now-price">¥{{l.price}}</text>
  10. <text class="ot-price" v-if="l.ot_price*1 > l.price*1">¥{{l.ot_price}}</text>
  11. </view>
  12. </view>
  13. </view>
  14. </scroll-view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. }
  22. },
  23. props: ["bastList"],
  24. methods: {
  25. listTo(id) {
  26. console.log(id)
  27. uni.navigateTo({
  28. url: '/pages/product/product?id=' + id + '&type=0'
  29. });
  30. }
  31. }
  32. }
  33. </script>
  34. <style lang="scss" scoped>
  35. .scroll_box{
  36. width: 100%;
  37. }
  38. .item_list{
  39. margin: 27rpx 10rpx;
  40. &:first-of-type {
  41. margin-left: 31rpx;
  42. }
  43. &:last-of-type {
  44. margin-right: 31rpx;
  45. }
  46. image {
  47. width: 256rpx;
  48. height: 256rpx;
  49. border-radius: 10rpx 10rpx 0 0;
  50. }
  51. }
  52. .price {
  53. border-radius: 0 0 10rpx 10rpx ;
  54. padding: 5rpx;
  55. background-color: #FFFFFF;
  56. margin-top: -10rpx;
  57. height: 102rpx;
  58. .store_name {
  59. width: 220rpx;
  60. padding-left: 10rpx;
  61. padding-bottom: 17rpx;
  62. color: #333333;
  63. font-family: PingFang-SC-Bold;
  64. font-size: 28rpx;
  65. }
  66. .price-d {
  67. padding-left: 10rpx;
  68. .now-price {
  69. color: #970100;
  70. font-size: 28rpx;
  71. }
  72. .ot-price {
  73. color: #989B9F;
  74. font-size: 20rpx;
  75. text-decoration: line-through;
  76. }
  77. }
  78. }
  79. </style>