珠宝小程序前端代码
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.

194 lines
3.5 KiB

3 months ago
  1. <template>
  2. <scroll-view
  3. scroll-y="true"
  4. :style="{height: height}"
  5. @scrolltolower="loadMoreData">
  6. <view class="list">
  7. <view class="item"
  8. v-for="(item,index) in list"
  9. @click="select(item)"
  10. :key="index">
  11. <view class="price">
  12. <view class="num">
  13. <view class="icon">
  14. </view>
  15. {{ item.price }}
  16. </view>
  17. <view class="tiao">
  18. {{ item.useType_dictText }}{{ item.conditionPrice }}可用
  19. </view>
  20. </view>
  21. <view class="date">
  22. <view>
  23. 有效期{{ item.endTime || '不限' }}
  24. </view>
  25. <view>
  26. {{ item.type_dictText }}使用
  27. </view>
  28. </view>
  29. <view class="status">
  30. <!-- 使 -->
  31. <!-- 使 -->
  32. {{ item.status_dictText }}
  33. </view>
  34. <view class="del"
  35. v-if="isSelect(item)">
  36. </view>
  37. </view>
  38. </view>
  39. <uv-empty
  40. v-if="list.length == 0"
  41. text="空空如也"
  42. textSize="30rpx"
  43. iconSize="200rpx"
  44. icon="list"></uv-empty>
  45. </scroll-view>
  46. </template>
  47. <script>
  48. import mixinList from '@/mixins/list.js'
  49. export default {
  50. name:"couponList",
  51. mixins : [mixinList],
  52. props : {
  53. height : {
  54. default : 'auto'
  55. // default : 'calc(90vh - 180rpx)'
  56. },
  57. // 押金
  58. depositPrice : {
  59. },
  60. washPrice: {//水洗费
  61. },
  62. rentPrice: {//租金
  63. },
  64. },
  65. data() {
  66. return {
  67. mixinsListApi : 'couponPage'
  68. };
  69. },
  70. methods : {
  71. select(item){
  72. if(this.isSelect(item)){
  73. return
  74. }
  75. this.$emit('select', item)
  76. },
  77. isSelect(item){
  78. if(!this.depositPrice && !this.rentPrice && !this.washPrice){
  79. return false
  80. }
  81. // 押金
  82. if(this.depositPrice &&
  83. item.useType == 0 &&
  84. this.depositPrice >= item.conditionPrice){
  85. return false
  86. }
  87. // 租金
  88. if(this.rentPrice &&
  89. item.useType == 1 &&
  90. this.rentPrice >= item.conditionPrice){
  91. return false
  92. }
  93. // 水洗
  94. if(this.washPrice &&
  95. item.useType == 2 &&
  96. this.washPrice >= item.conditionPrice){
  97. return false
  98. }
  99. return true
  100. },
  101. }
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .list{
  106. .item{
  107. color: #4FD3BC;
  108. position: relative;
  109. width: calc(100% - 40rpx);
  110. height: 220rpx;
  111. background: url(../../static/image/coupon/c.png);
  112. background-size: 100% 100%;
  113. margin: 20rpx;
  114. box-sizing: border-box;
  115. padding: 30rpx;
  116. .status{
  117. position: absolute;
  118. right: 20rpx;
  119. top: 20rpx;
  120. height: calc(100% - 40rpx);
  121. width: 60rpx;
  122. writing-mode:vertical-rl;
  123. box-sizing: border-box;
  124. padding: 20rpx;
  125. background-color: #fff;
  126. border-radius: 60rpx;
  127. font-size: 26rpx;
  128. display: flex;
  129. justify-content: center;
  130. align-items: center;
  131. }
  132. .price{
  133. display: flex;
  134. align-items: center;
  135. .num{
  136. color: #4FD3BC;
  137. font-weight: 900;
  138. font-size: 70rpx;
  139. display: flex;
  140. align-items: flex-end;
  141. .icon{
  142. color: #fff;
  143. background-color: #4FD3BC;
  144. width: 30rpx;
  145. height: 30rpx;
  146. display: flex;
  147. justify-content: center;
  148. align-items: center;
  149. font-size: 20rpx;
  150. border-radius: 14rpx;
  151. margin-bottom: 14rpx;
  152. margin-right: 10rpx;
  153. }
  154. }
  155. .tiao{
  156. padding: 10rpx 20rpx;
  157. background-color: #9ee3d1;
  158. color: #25a28c;
  159. font-size: 22rpx;
  160. margin-left: 20rpx;
  161. border-radius: 10rpx;
  162. }
  163. }
  164. .date{
  165. display: flex;
  166. font-size: 24rpx;
  167. view{
  168. margin-right: 20rpx;
  169. }
  170. }
  171. }
  172. .del{
  173. position: absolute;
  174. top: 0;
  175. left: 0;
  176. width: 100%;
  177. height: 100%;
  178. background-color: #ffffff99;
  179. z-index: 99;
  180. }
  181. }
  182. </style>