金诚优选前端代码
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.

107 lines
2.1 KiB

4 years ago
  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. border-radius: 20rpx 20rpx 0rpx 0rpx;
  62. }
  63. }
  64. .scroll-view{
  65. height: 280rpx;
  66. width: 100%;
  67. margin-top: 20rpx;
  68. .scroll-content{
  69. display: flex;
  70. width: 100%;
  71. .goods-item{
  72. margin-right: 15rpx;
  73. width: 180rpx;
  74. }
  75. .goods-img{
  76. width: 180rpx;
  77. height: 180rpx;
  78. background-color: #EEEEEE;
  79. }
  80. .goods-info{
  81. text-align: center;
  82. color: #222222;
  83. &>view:nth-child(1n){
  84. font-size: 24rpx;
  85. }
  86. &>view:nth-child(2n){
  87. font-size: 28rpx;
  88. font-weight: bold;
  89. }
  90. }
  91. .more-box{
  92. width: 180rpx;
  93. height: 180rpx;
  94. background-color: #EEEEEE;
  95. text-align: center;
  96. line-height: 180rpx;
  97. font-size: 24rpx;
  98. }
  99. }
  100. }
  101. }
  102. </style>