goodsModel.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="slot">
  3. <view class="integral">
  4. <view class="inte_img">
  5. <!-- <image src="../../../static/goods/points-header.png" mode=""></image> -->
  6. <p class="title">{{type=='hot'?'热门好物':type=='recommend'?'精品推荐':''}}</p>
  7. <view class="inte_right" @click="goZonePage('hot')">
  8. <span>更多>></span>
  9. </view>
  10. </view>
  11. <view class="goodsThree">
  12. <!-- <Goods v-for="(item, index) in list" :key="index" :data="item"></Goods> -->
  13. <view class="item" v-for="(data, index) in list" :key="index" @click="goGoodsDetail(data)">
  14. <image class="goodsImg" :src="data.cover" mode="aspectFit"></image>
  15. <view class="goods_title shu-elip-1">{{ data.title }}</view>
  16. <view class="money">
  17. <view class="now">
  18. <text>¥</text>
  19. <text>{{data.price_selling}}</text>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import Goods from '@/pages/mall/components/goods.vue';
  29. export default {
  30. name: 'goods-model',
  31. components: {
  32. Goods
  33. },
  34. props: {
  35. list: {
  36. type: Array,
  37. default: () => {
  38. return [];
  39. }
  40. },
  41. type:{
  42. type: String,
  43. default: ()=>{
  44. return "";
  45. },
  46. },
  47. },
  48. methods: {
  49. goGoodsDetail(item) {
  50. uni.navigateTo({
  51. url: '/pages-mall/pages/goods/detail?goodsId='+item.id
  52. });
  53. },
  54. goZonePage(){
  55. console.log(this.type);
  56. uni.navigateTo({
  57. url:'/pages-mall/pages/zone/zone?type='+this.type
  58. })
  59. }
  60. }
  61. };
  62. </script>
  63. <style lang="scss" scoped>
  64. .slot {
  65. position: relative;
  66. }
  67. .integral {
  68. margin: 28rpx 30rpx 0 30rpx;
  69. position: relative;
  70. .inte_img {
  71. position: relative;
  72. width: 100%;
  73. // height: 170rpx;
  74. // height: 80rpx;
  75. background-color: $app-theme-color;
  76. border-radius: 10rpx 10rpx 0 0;
  77. .title{
  78. color: #ffffff;
  79. text-align: center;
  80. font-size: 32rpx;
  81. font-weight: bold;
  82. padding-top: 30rpx;
  83. padding-bottom: 30rpx;
  84. }
  85. image {
  86. width: 100%;
  87. height: 174rpx;
  88. }
  89. .inte_right {
  90. display: flex;
  91. align-items: center;
  92. position: absolute;
  93. top: 35rpx;
  94. right: 20rpx;
  95. span {
  96. font-size: 28rpx;
  97. font-weight: 400;
  98. color: #fff;
  99. line-height: 40rpx;
  100. }
  101. image {
  102. width: 32rpx;
  103. height: 32rpx;
  104. }
  105. }
  106. }
  107. .commodity {
  108. background-color: #ffffff;
  109. position: relative;
  110. min-height: 100rpx;
  111. margin-top: -60rpx;
  112. border-radius: 8rpx;
  113. z-index: $app-zIndex-absolute;
  114. // .list_item{
  115. // padding: 0 25rpx;
  116. // }
  117. .borders {
  118. width: 100%;
  119. height: 2rpx;
  120. background: #efefef;
  121. }
  122. }
  123. }
  124. .goodsThree{
  125. display: flex;
  126. flex-wrap: wrap;
  127. background-color: #fff;
  128. border-radius: 0 0 15rpx 15rpx;
  129. padding-bottom: 15rpx;
  130. .item{
  131. width: 200rpx;
  132. margin: 30rpx 15rpx 15rpx;
  133. }
  134. }
  135. .goodsImg{
  136. width: 200rpx;
  137. height: 200rpx;
  138. }
  139. .money {
  140. display: flex;
  141. align-items: flex-end;
  142. .now {
  143. font-weight: bold;
  144. text:nth-child(1) {
  145. font-size: 20rpx;
  146. color: $app-theme-text-money-color;
  147. }
  148. text:nth-child(2) {
  149. font-size: 30rpx;
  150. color: $app-theme-text-money-color;
  151. }
  152. }
  153. .old {
  154. text {
  155. font-size: 20rpx;
  156. color: $app-theme-card-gray-color;
  157. text-decoration-line: line-through;
  158. }
  159. }
  160. }
  161. .goods_title{
  162. font-size: 28rpx;
  163. font-weight: 400;
  164. color: #171717;
  165. // height: 3em;
  166. margin-top: 6rpx;
  167. line-height: 1.5;
  168. }
  169. </style>