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

174 lines
4.3 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <view>
  3. <global-loading />
  4. <!-- 专题 -->
  5. <swiper class="banner" indicator-dots indicator-color="#FFFFFF" indicator-active-color="#FF7911" autoplay>
  6. <swiper-item class="banner-item" v-for="(item,index) in bannerList">
  7. <image :src="item" mode="widthFix" class="bannerImg"></image>
  8. </swiper-item>
  9. </swiper>
  10. <!-- <view class="flex-items-plus mar-top-20">-->
  11. <!-- <image class="choiceness" src="http://36.138.125.206:8081/ceres-local-file/static/images/choiceness.png"></image>-->
  12. <!-- </view>-->
  13. <view>
  14. <!-- {{goodsList.productVOList}} -->
  15. </view>
  16. <view v-if="goodsList.productVOList.length>0">
  17. <view v-for="(item, index) in goodsList.productVOList" :key="item.id" class="goodsDetails-box flex-display flex-column mar-left-30"
  18. @click="goodsDateils(item.id)">
  19. <view class="goodsDetails flex-items-plus flex-row mar-top-30">
  20. <image class="goodsImg" :src="item.imgs[0]"></image>
  21. <view class="mar-left-30">
  22. <view class="goodsName-box overflowNoDot">
  23. <!-- <image class="img618-cion" src="http://36.138.125.206:8081/ceres-local-file/static/images/618.png"></image> -->
  24. <label class="goodsName fs26 mar-left-20">{{item.productName}}</label>
  25. </view>
  26. <view class="priceBuyNum-box mar-top-20">
  27. <label class="fs24 font-color-C5AA7B">¥</label>
  28. <label class="fs36 font-color-C5AA7B mar-left-10">{{item.price}}</label>
  29. <label class="fs24 font-color-999 mar-left-10" v-if="item.buyCount != null">{{item.buyCount}}{{$t('common.payticktip')}}</label>
  30. <label class="fs24 font-color-999 mar-left-10" v-else>0{{$t('common.payticktip')}}</label>
  31. </view>
  32. <view class="flex-display flex-sp-between flex-row mar-top-10 flex-items">
  33. <label class="fs22 font-color-999">{{item.storeDTO.storeName}}</label>
  34. <image class="arrowImg" src="http://36.138.125.206:8081/ceres-local-file/static/img/user/arrow.png"></image>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 为空 -->
  41. <view v-else class="emptyOrder-box flex-items-plus flex-column">
  42. <image class="emptyOrder-img" src="http://36.138.125.206:8081/ceres-local-file/static/img/bgnull.png"></image>
  43. <label class="font-color-999 fs26 mar-top-30">专题商品为空哦</label>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. const NET = require('../../utils/request')
  49. const API = require('../../config/api')
  50. export default {
  51. data() {
  52. return {
  53. key: '',
  54. bannerList: [],
  55. goodsList: {
  56. productVOList:[]
  57. },
  58. subject:{},
  59. current: 1,
  60. size: 10,
  61. }
  62. },
  63. onLoad(options) {
  64. this.key = options.key
  65. this.getSubjectDetailByKeyList();
  66. },
  67. methods: {
  68. getSubjectDetailByKeyList() {
  69. let _this = this
  70. // uni.showLoading({
  71. // mask: true,
  72. // title: '加载中...'
  73. // })
  74. NET.request(API.SubjectWithProduct + this.key, {
  75. current: this.current,
  76. map: {},
  77. model: {},
  78. order: 'descending',
  79. size: this.size,
  80. sort: 'id'
  81. }, 'POST').then(res => {
  82. uni.hideLoading()
  83. _this.bannerList.push(res.data.subject.banner)
  84. _this.goodsList = res.data.productPageVO
  85. _this.subject = res.data.subject
  86. uni.setNavigationBarTitle({
  87.   title:res.data.subject.title
  88. })
  89. }).catch(res => {
  90. uni.hideLoading()
  91. })
  92. },
  93. goodsDateils(id){
  94. uni.navigateTo({
  95. url:`../goodsModule/goodsDetails?id=${id}`
  96. })
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss">
  102. page {
  103. background-color: #FBE7E0;
  104. }
  105. .bannerImg {
  106. height: 300upx;
  107. width: 100%;
  108. }
  109. .choiceness {
  110. height: 60upx;
  111. width: 300upx;
  112. }
  113. .goodsDetails-box {
  114. width: 690upx;
  115. background: #fff;
  116. margin-top: 10upx;
  117. border-radius: 10upx;
  118. padding: 0 20upx;
  119. box-sizing: border-box;
  120. .goodsDetails {
  121. padding-bottom: 30upx;
  122. .goodsName-box {
  123. width: 389upx;
  124. height: 85upx;
  125. .img618-cion {
  126. width: 70upx;
  127. height: 36upx;
  128. }
  129. }
  130. .goodsImg {
  131. width: 260upx;
  132. height: 260upx;
  133. }
  134. .discounts-box {
  135. margin-left: -10upx;
  136. margin-top: 20upx;
  137. .discounts-text {
  138. margin-left: 10upx;
  139. color: #C5AA7B;
  140. background-color: #FFE4CC;
  141. padding: 6upx 12upx;
  142. border-radius: 4upx;
  143. }
  144. }
  145. .arrowImg {
  146. width: 20upx;
  147. height: 20upx;
  148. }
  149. }
  150. }
  151. .emptyOrder-box {
  152. .emptyOrder-img {
  153. width: 113rpx;
  154. height: 98rpx;
  155. }
  156. }
  157. </style>