多租户商城-商户小程序端
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.

155 lines
3.9 KiB

2 years ago
11 months ago
2 years ago
2 years ago
11 months ago
2 years ago
2 years ago
  1. <template>
  2. <view class="hotTemplate" v-if="productList.length">
  3. <view class="evaluateIcon flex-items">
  4. <image src="http://36.138.125.206:8081/ceres-local-file/static/images/evaluateIcon.png"></image>
  5. <text>{{$t('page.hotrecommendation')}}</text>
  6. </view>
  7. <view class="recommendList">
  8. <view
  9. class="itemBox"
  10. v-for="(item, index) of productList"
  11. @click="goodsDateils(item.shopId,item.productId,item.skuId)"
  12. >
  13. <view class="itemImg">
  14. <image :src="item.image" class="pic-img default-img"
  15. onerror="this.src='url(http://36.138.125.206:8081/ceres-local-file/image/default.png) no-repeat center';this.οnerrοr=null"></image>
  16. </view>
  17. <view class="itemTit">{{item.productName}}</view>
  18. <view class="flex-items shopNameBox">
  19. <view class="shopName">{{item.shopName}}</view>
  20. <view class="paymentNum">{{item.users}}{{$t('common.payticktip')}}</view>
  21. </view>
  22. <view class="itemPrice">
  23. <view class="price">{{item.price}}</view>
  24. <view class="originalPrice">{{item.originalPrice}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. const NET = require('@/utils/request')
  32. const API = require('@/config/api')
  33. export default {
  34. data () {
  35. return {
  36. listQuery: {
  37. page: 1,
  38. pageSize: 5
  39. },
  40. productList: []
  41. }
  42. },
  43. created() {
  44. this.GetremenList()
  45. },
  46. methods: {
  47. // 获取列表数据
  48. GetremenList() {
  49. this.listQuery.timestamp = new Date().getTime()
  50. NET.request(API.GetremenList, this.listQuery, 'get').then(res => {
  51. uni.stopPullDownRefresh();
  52. if (res.code == 200) {
  53. this.productList = res.data.list
  54. } else {
  55. uni.showToast({
  56. title: res.message,
  57. icon: 'none'
  58. })
  59. }
  60. })
  61. },
  62. //商品详情
  63. goodsDateils(shopId, productId, skuId) {
  64. uni.navigateTo({
  65. url: '/pages_category_page1/goodsModule/goodsDetails?shopId=' + shopId + '&productId=' + productId + '&skuId=' +
  66. skuId
  67. })
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .hotTemplate{
  74. padding: 1rpx 0 50rpx 0;
  75. background: #FAFAFA ;
  76. .evaluateIcon {
  77. margin: 30rpx 0 20rpx 0;
  78. justify-content: center;
  79. image {
  80. width: 36rpx;
  81. height: 32rpx;
  82. margin-right: 20rpx;
  83. }
  84. }
  85. .recommendList {
  86. display: flex;
  87. flex-wrap: wrap;
  88. .itemBox {
  89. width: 47%;
  90. margin: 16rpx 1% 16rpx 2%;
  91. background: #FFFFFF;
  92. .itemImg {
  93. width: 100%;
  94. height: 314rpx;
  95. image {
  96. width: 100%;
  97. height: 100%;
  98. }
  99. }
  100. .itemTit {
  101. padding: 0 20rpx;
  102. height: 40rpx;
  103. width: 100%;
  104. overflow: hidden;
  105. white-space: nowrap;
  106. text-overflow:ellipsis;
  107. }
  108. .shopNameBox {
  109. padding: 0 20rpx;
  110. height: 40rpx;
  111. justify-content: space-between;
  112. margin-top: 20rpx;
  113. .shopName {
  114. color: #FFEBC4;
  115. font-size: 20rpx;
  116. width: 140rpx;
  117. height: 40rpx;
  118. line-height: 40rpx;
  119. border-radius: 0 20rpx 20rpx 0;
  120. background: #333333;
  121. padding-left: 10rpx;
  122. overflow: hidden;
  123. white-space: nowrap;
  124. text-overflow:ellipsis;
  125. }
  126. .paymentNum {
  127. border: 2rpx solid #E4E5E6;
  128. color: #C5AA7B;
  129. font-size: 20rpx;
  130. padding: 5rpx;
  131. }
  132. }
  133. .itemPrice {
  134. display: flex;
  135. align-items: center;
  136. padding: 0 20rpx 10rpx 20rpx;
  137. margin-top: 20rpx;
  138. .price {
  139. font-size: 40rpx;
  140. color: #C83732;
  141. margin-right: 10rpx;
  142. }
  143. .originalPrice {
  144. color: #CCCCCC;
  145. font-size: 24rpx;
  146. text-decoration: line-through;
  147. }
  148. }
  149. }
  150. }
  151. }
  152. </style>