金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
2.0 KiB

  1. <template>
  2. <view class="content">
  3. <view class="shop" @click="$url(main[0].link)">
  4. <image class="img" :src="main[0] && main[0].image" mode="aspectFill"></image>
  5. </view>
  6. <scroll-view class="scroll-view" :scroll-x="true">
  7. <view class="scroll-content">
  8. <view class="goods-item"
  9. v-for="(item, index) in list" :key="index"
  10. @click="$url('/pages/shop/goodsdetail?id='+ item.associate.id)">
  11. <image class="goods-img" :src="item.associate.img"></image>
  12. <view class="goods-info">
  13. <view class="lf-line-1">{{ item.associate.name }}</view>
  14. <view>{{ item.associate.sell_price }}</view>
  15. </view>
  16. </view>
  17. <view class="goods-item" @click="$url('/pages/shop/specialList')">
  18. <view class="more-box">
  19. <text>查看更多</text>
  20. <text class="lf-iconfont icon--2 lf-text-vertical"></text>
  21. </view>
  22. </view>
  23. </view>
  24. </scroll-view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. props: {
  30. list: {
  31. type: Array,
  32. default: []
  33. },
  34. main: {
  35. type: Array,
  36. default: []
  37. }
  38. },
  39. data(){
  40. return {
  41. }
  42. },
  43. created(){
  44. },
  45. methods: {
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped="scoped">
  50. .content{
  51. width: 750rpx;
  52. height: max-content;
  53. box-sizing: border-box;
  54. padding: 0rpx 32rpx;
  55. .shop{
  56. width: 100%;
  57. height: 245rpx;
  58. .img{
  59. width: 100%;
  60. height: 100%;
  61. }
  62. }
  63. .scroll-view{
  64. height: 280rpx;
  65. width: 100%;
  66. margin-top: 20rpx;
  67. .scroll-content{
  68. display: flex;
  69. width: 100%;
  70. .goods-item{
  71. margin-right: 15rpx;
  72. width: 180rpx;
  73. }
  74. .goods-img{
  75. width: 180rpx;
  76. height: 180rpx;
  77. background-color: #EEEEEE;
  78. }
  79. .goods-info{
  80. text-align: center;
  81. color: #222222;
  82. &>view:nth-child(1n){
  83. font-size: 24rpx;
  84. }
  85. &>view:nth-child(2n){
  86. font-size: 28rpx;
  87. font-weight: bold;
  88. }
  89. }
  90. .more-box{
  91. width: 180rpx;
  92. height: 180rpx;
  93. background-color: #EEEEEE;
  94. text-align: center;
  95. line-height: 180rpx;
  96. font-size: 24rpx;
  97. }
  98. }
  99. }
  100. }
  101. </style>