index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view class="coupon-shop-list-container">
  3. <JHeader title="优惠券可用商品列表" width="50" height="50" style="padding: 24upx 0 0;"></JHeader>
  4. <!-- 商品列表 -->
  5. <view>
  6. <view
  7. v-for="(item, index) in couponProductsList" :key="index"
  8. class="goodsDetails-box flex-display flex-column mar-left-30"
  9. @click="go(`/another-tf/another-serve/goodsDetails/index?shopId=${item.shopId}&productId=${item.productId}&skuId=${item.skuId}`)"
  10. >
  11. <view v-if="item.activityType == 0" class="goodsDetails flex-items-plus flex-row mar-top-30">
  12. <image class="goodsImg" :src="common.seamingImgUrl(item.image)"></image>
  13. <view class="mar-left-30">
  14. <view class="goodsName-box overflowNoDot">
  15. <label class="goodsName fs26">{{ item.productName }}</label>
  16. </view>
  17. <view class="priceBuyNum-box mar-top-20">
  18. <label class="fs24 font-color-C5AA7B">¥</label>
  19. <label class="fs36 font-color-C5AA7B mar-left-10">{{ item.price }}</label>
  20. <label v-if="item.users != null" class="fs24 font-color-999 mar-left-10">{{ item.users }}人付款</label>
  21. <label v-else class="fs24 font-color-999 mar-left-10">0人付款</label>
  22. </view>
  23. <view class="flex-display flex-sp-between flex-row mar-top-10 flex-items">
  24. <label class="fs22 font-color-999">{{ item.shopName }}</label>
  25. <tui-icon name="arrowright" :size="24" unit="upx" color="#9f8a66" margin="0"></tui-icon>
  26. </view>
  27. </view>
  28. </view>
  29. <view v-else class="spikeList">
  30. <view class="listItem">
  31. <view class="itemBox">
  32. <image :src="common.seamingImgUrl(item.image)"></image>
  33. </view>
  34. <view class="itemInfo mar-top-30">
  35. <p>{{ item.productName }}</p>
  36. <view v-if="item.users != null" class="number">
  37. {{ item.users }}人付款 <span v-if="item.total != 0">
  38. ,限量{{ item.total }}件
  39. </span>
  40. </view>
  41. <view v-else class="number">0人付款<span v-if="item.total != 0">,限量{{ item.total }}件</span></view>
  42. <view class="flex-row-plus flex-item mar-top-30">
  43. <view class="discountsPriceLine font-color-999">¥{{ item.originalPrice }}</view>
  44. <view class="mar-left-30 font-color-C5AA7B flex-row-plus">
  45. <label v-if="item.activityType == 1" class="fs30">拼团价</label>
  46. <label v-if="item.activityType == 2" class="fs30">秒杀价</label>
  47. <label v-if="item.activityType == 3" class="fs30">折扣价</label>
  48. <b>¥</b>
  49. <label class="fs28">{{ item.price }}</label>
  50. </view>
  51. </view>
  52. <view class="flex-display flex-sp-between flex-row mar-top-10 flex-items">
  53. <label class="fs22 font-color-999">{{ item.shopName }}</label>
  54. <tui-icon name="arrowright" :size="24" unit="upx" color="#9f8a66" margin="0"></tui-icon>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <view style="padding-bottom: 45upx;">
  62. <LoadingMore
  63. :status="!isEmpty && !couponProductsList.length
  64. ? 'loading' : !isEmpty && couponProductsList.length && (couponProductsList.length >= couponProductsTotal) ? 'no-more' : ''"
  65. >
  66. </LoadingMore>
  67. <tui-no-data v-if="isEmpty" :fixed="false" style="margin-top: 60upx;">无可用商品</tui-no-data>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import { getCouponProductsApi } from '../../../api/anotherTFInterface'
  73. export default {
  74. name: 'CouponShopList',
  75. data() {
  76. return {
  77. isEmpty: false,
  78. couponProductsList: [],
  79. couponProductsTotal: 0,
  80. queryInfo: {
  81. page: 1,
  82. pageSize: 20,
  83. activityId: null,
  84. shopCouponId: null
  85. }
  86. }
  87. },
  88. onLoad(option) {
  89. this.queryInfo.activityId = option.activityId
  90. this.queryInfo.shopCouponId = option.shopCouponId
  91. this.getCouponProductsList()
  92. },
  93. methods: {
  94. getCouponProductsList(isLoadmore) {
  95. uni.showLoading()
  96. getCouponProductsApi(this.queryInfo).then((res) => {
  97. this.couponProductsTotal = res.data.total
  98. if (isLoadmore) {
  99. this.couponProductsList.push(...res.data.list)
  100. } else {
  101. this.couponProductsList = res.data.list
  102. }
  103. this.isEmpty = this.couponProductsList.length === 0
  104. uni.hideLoading()
  105. })
  106. .catch((e) => {
  107. uni.hideLoading()
  108. })
  109. }
  110. },
  111. onReachBottom() {
  112. if (this.couponProductsList.length < this.couponProductsTotal) {
  113. ++this.queryInfo.page
  114. this.getCouponProductsList(true)
  115. }
  116. }
  117. }
  118. </script>
  119. <style lang="less" scoped>
  120. input {
  121. padding-left: 80upx;
  122. }
  123. .coupon-shop-list-container {
  124. min-height: 100vh;
  125. box-sizing: border-box;
  126. .goodsDetails-box {
  127. width: 690upx;
  128. .goodsDetails {
  129. border-bottom: 1upx solid #EDEDED;
  130. padding-bottom: 30upx;
  131. .goodsName-box {
  132. width: 389upx;
  133. height: 85upx;
  134. }
  135. .goodsImg {
  136. width: 260upx;
  137. height: 260upx;
  138. }
  139. }
  140. }
  141. .spikeList {
  142. padding-top: 30rpx;
  143. border-bottom: 1upx solid #EDEDED;
  144. .listItem {
  145. display: flex;
  146. border-bottom: 1upx solid #EEEEEE;
  147. margin-bottom: 30upx;
  148. &:last-child {
  149. border-bottom: none;
  150. }
  151. .itemBox {
  152. width: 260upx;
  153. height: 260upx;
  154. margin-right: 30upx;
  155. image {
  156. width: 100%;
  157. height: 100%;
  158. }
  159. }
  160. .itemInfo {
  161. flex: 1;
  162. p {
  163. font-size: 26upx;
  164. color: #333333;
  165. line-height: 40upx;
  166. margin-bottom: 20upx;
  167. text-overflow: -o-ellipsis-lastline;
  168. overflow: hidden;
  169. text-overflow: ellipsis;
  170. display: -webkit-box;
  171. -webkit-line-clamp: 2;
  172. line-clamp: 2;
  173. -webkit-box-orient: vertical;
  174. }
  175. .number {
  176. color: #999999;
  177. font-size: 26upx;
  178. }
  179. }
  180. }
  181. }
  182. }
  183. </style>