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

2 years ago
2 years ago
  1. <template>
  2. <view class="content">
  3. <view class="Box">
  4. <view class="productBox" v-for="(item,index) in productList" :key="index"
  5. @click="goodsDateils(item.shopId,item.productId,item.skuId)">
  6. <view class="proImg">
  7. <image :src="item.image" mode=""></image>
  8. </view>
  9. <view class="rightBox">
  10. <view class="proTitle">
  11. {{item.productName}}
  12. </view>
  13. <view class="price">
  14. <text class="fs36 font-color-red">
  15. ¥{{item.price}}
  16. </text>
  17. <text class="mar-left-10 fs26">
  18. {{item.users}}{{$t('common.payticktip')}}
  19. </text>
  20. </view>
  21. <view class="flex-sp-between flex-display mar-top-20" @click.stop="goStore(item.shopId)">
  22. <view>
  23. {{item.shopName}}
  24. </view>
  25. <view>
  26. <image class="rightIcon" src="https://ceres.zkthink.com/images/arrowRight.png" mode="aspectFill"></image>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. const NET = require('@/utils/request')
  36. const API = require('@/config/api')
  37. export default {
  38. data() {
  39. return {
  40. list: [],
  41. pageSize: 1,
  42. productList:[]
  43. }
  44. },
  45. onPullDownRefresh() { //上拉触底函数
  46. this.pageSize = this.pageSize + 1
  47. this.GetremenList()
  48. },
  49. onLoad() {
  50. this.GetremenList()
  51. },
  52. methods: {
  53. // 获取列表数据
  54. GetremenList() {
  55. let timestamp = new Date().getTime()
  56. NET.request(API.GetremenList, {
  57. page: this.pageSize,
  58. pageSize: 5,
  59. timestamp: timestamp
  60. }, 'get').then(res => {
  61. uni.stopPullDownRefresh();
  62. if (res.code == 200) {
  63. this.productList = res.data.list
  64. } else {
  65. uni.showToast({
  66. title: res.message,
  67. icon: 'none'
  68. })
  69. }
  70. })
  71. },
  72. // 跳转店铺
  73. goStore(shopId) {
  74. uni.navigateTo({
  75. url: './store/index?storeId=' + shopId
  76. })
  77. },
  78. //商品详情
  79. goodsDateils(shopId, productId, skuId) {
  80. uni.navigateTo({
  81. url: './goodsModule/goodsDetails?shopId=' + shopId + '&productId=' + productId + '&skuId=' +
  82. skuId
  83. })
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. page {
  90. background-color: #FBE7E0;
  91. }
  92. .content {
  93. .Box {
  94. padding: 30upx;
  95. .productBox {
  96. background-color: #FFFFFF;
  97. height: 280upx;
  98. margin-bottom: 20upx;
  99. border-radius: 20upx;
  100. padding: 20upx;
  101. display: flex;
  102. justify-content: space-between;
  103. .proImg {
  104. width: 240upx;
  105. height: 240upx;
  106. image {
  107. width: 100%;
  108. height: 100%;
  109. border-radius: 20upx;
  110. }
  111. }
  112. .rightBox {
  113. width: 60%;
  114. .proTitle {
  115. overflow: hidden;
  116. text-overflow: ellipsis;
  117. display: -webkit-box;
  118. -webkit-box-orient: vertical;
  119. -webkit-line-clamp: 2;
  120. }
  121. .biao {
  122. margin-top: 20upx;
  123. text {
  124. margin-right: 10upx;
  125. border-radius: 5upx;
  126. color: #C5AA7B;
  127. padding: 5upx 10upx 5upx;
  128. background-color: #FBE7E0;
  129. }
  130. }
  131. .price {
  132. margin-top: 55upx;
  133. }
  134. .rightIcon {
  135. width: 24upx;
  136. height: 24upx;
  137. }
  138. }
  139. }
  140. }
  141. }
  142. </style>