classify.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <view class="container">
  3. <view class="goodsList-box">
  4. <view class="goodsList-item flex" :key="ind" v-for="(ls, ind) in list" @click="navTo(ls)">
  5. <image :src="ls.image" mode=" scaleToFill"></image>
  6. <view class="goodsList-content">
  7. <view class="title">
  8. <text>{{ ls.store_name }}</text>
  9. </view>
  10. <view class="goods-money flex">
  11. <view class="money-box">
  12. <view class="old-price" v-if="ls.ot_price * 1 > ls.price * 1">
  13. <text class="old-left">¥{{ ls.ot_price }}</text>
  14. <image src="../../static/icon/down.png" mode="widthFix"></image>
  15. <text class="old-right">直降{{ ls.ot_price * 1 - ls.price * 1 }}元</text>
  16. </view>
  17. <view class="otMoney-box">
  18. <view class="otMoney">¥{{ ls.price }}</view>
  19. <view class="give-jf">
  20. 赠{{ls.give_award_range*1}}绿色积分
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import {
  32. groomList
  33. } from '@/api/product.js';
  34. export default {
  35. data() {
  36. return {
  37. list: [],
  38. };
  39. },
  40. onLoad(option) {
  41. // 获取查询对象
  42. this.type = option.type;
  43. // 加载基础数据
  44. this.loadData();
  45. },
  46. methods: {
  47. navTo: function(ls) {
  48. uni.navigateTo({
  49. url: '/pages/product/product?id=' + ls.id + '&isbao=1'
  50. });
  51. },
  52. // 请求载入数据
  53. async loadData() {
  54. groomList({}, this.type)
  55. .then(({
  56. data
  57. }) => {
  58. this.list = data.list;
  59. })
  60. .catch(e => {
  61. console.log(e);
  62. });
  63. },
  64. }
  65. };
  66. </script>
  67. <style lang="scss">
  68. page {
  69. background: $page-color-base;
  70. }
  71. // 商品列表
  72. .goodsList-box {
  73. .goodsList-item {
  74. margin-bottom: 40rpx;
  75. background-color: #ffffff;
  76. padding: 30rpx;
  77. image {
  78. flex-shrink: 0;
  79. border-radius: $border-radius-sm;
  80. height: 180rpx;
  81. width: 180rpx;
  82. }
  83. .goodsList-content {
  84. margin-left: 20rpx;
  85. flex-grow: 1;
  86. height: 180rpx;
  87. position: relative;
  88. .title {
  89. font-size: $font-base;
  90. color: $font-color-dark;
  91. font-weight: 500;
  92. }
  93. .goods-money {
  94. position: absolute;
  95. left: 0;
  96. bottom: 0;
  97. width: 100%;
  98. .money-box {
  99. image {
  100. width: 14rpx;
  101. margin: 0 6rpx 0 10rpx;
  102. }
  103. .old-price {
  104. .old-left {
  105. font-size: 26rpx;
  106. font-weight: 500;
  107. text-decoration: line-through;
  108. color: #999999;
  109. }
  110. .old-right {
  111. font-size: 24rpx;
  112. font-weight: bold;
  113. color: #b59467;
  114. }
  115. }
  116. .otMoney-box {
  117. display: flex;
  118. align-items: center;
  119. .otMoney {
  120. font-size: 36rpx;
  121. color: $color-red;
  122. padding-right: 20rpx;
  123. }
  124. .give-jf {
  125. display: inline-block;
  126. padding: 8rpx;
  127. background: linear-gradient(90deg, #65B2E9, #CA57DC);
  128. border-radius: 10rpx 0px 10rpx 0px;
  129. font-size: 22rpx;
  130. font-weight: 500;
  131. color: #FFFFFF;
  132. }
  133. }
  134. }
  135. .cart {
  136. border: 1px solid $color-red;
  137. color: $color-red;
  138. font-size: $font-base;
  139. font-weight: bold;
  140. border-radius: 99px;
  141. width: 55rpx;
  142. height: 55rpx;
  143. display: flex;
  144. justify-content: center;
  145. align-items: center;
  146. }
  147. }
  148. }
  149. }
  150. }
  151. </style>