yygoods.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="content">
  3. <checkbox-group>
  4. <view class="good" v-for="item in list">
  5. <image src="" mode="" class="good-img"></image>
  6. <view class="good-info">
  7. <view class="good-tit clamp2">
  8. 涅槃旗下官方正品线雕提拉术
  9. </view>
  10. <view class="good-tip">
  11. 随时随地 预约服务
  12. </view>
  13. <view class="good-buy">
  14. 已售1000件
  15. </view>
  16. <view class="good-price">
  17. 34 <text class="ot-price"></text>
  18. </view>
  19. </view>
  20. <checkbox :checked="item.isCheck" class="good-check" :value="item.id" @click="changeCheck(item)"/>
  21. </view>
  22. </checkbox-group>
  23. <u-loadmore :status="loadingType" />
  24. <view class="" style="height: 120rpx;">
  25. </view>
  26. <view class="sub-btn" @click="addGood">
  27. 确认添加
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. loadingType: 'loadmore',
  36. page: 1,
  37. limit: 10,
  38. loaded: false,
  39. list: [
  40. {
  41. id:1,
  42. isCheck: false
  43. },
  44. {
  45. id:2,
  46. isCheck: false
  47. },
  48. {
  49. id:2,
  50. isCheck: false
  51. },
  52. {
  53. id:2,
  54. isCheck: false
  55. },
  56. {
  57. id:2,
  58. isCheck: false
  59. }
  60. ]
  61. }
  62. },
  63. onLoad() {
  64. },
  65. onShow() {
  66. // this.getList()
  67. },
  68. onReachBottom() {
  69. // this.getList()
  70. },
  71. onReady() {
  72. },
  73. methods: {
  74. addGood() {
  75. uni.navigateBack()
  76. },
  77. changeCheck(item) {
  78. item.isCheck = !item.isCheck
  79. console.log(this.list)
  80. },
  81. getList() {
  82. let that = this
  83. if(that.loadingType == 'nomre' || that.loadingType == 'loading') {
  84. return
  85. }
  86. that.loadingType = 'loading'
  87. getYyGoods({
  88. page: that.page,
  89. limit: that.limit,
  90. }).then(res => {
  91. that.list = that.list.concat(res.data.list)
  92. that.page++
  93. if(that.limit == res.data.list.length ) {
  94. that.loadingType = 'loadmore'
  95. }else {
  96. that.loadingType = 'nomore'
  97. }
  98. })
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss">
  104. .content {
  105. padding-top: 1rpx;
  106. }
  107. .good {
  108. width: 690rpx;
  109. margin: 20rpx auto;
  110. display: flex;
  111. justify-content: flex-start;
  112. padding: 20rpx;
  113. background-color: #fff;
  114. border-radius: 20rpx;
  115. position: relative;
  116. .good-check {
  117. position: absolute;
  118. bottom: 20rpx;
  119. right: 20rpx;
  120. }
  121. .good-img {
  122. width: 256rpx;
  123. height: 256rpx;
  124. background: #D6DEE1;
  125. border-radius: 15rpx;
  126. flex-shrink: 0;
  127. margin-right: 15rpx;
  128. }
  129. .good-info {
  130. display: flex;
  131. flex-direction: column;
  132. // align-items: ;
  133. justify-content: space-between;
  134. align-items: flex-start;
  135. .good-tit {
  136. font-size: 28rpx;
  137. font-weight: 500;
  138. color: #333333;
  139. }
  140. .good-buy {
  141. font-size: 24rpx;
  142. font-weight: 500;
  143. color: #9a9a9a;
  144. }
  145. .good-tip {
  146. font-size: 24rpx;
  147. font-weight: 500;
  148. color: #FA7014;
  149. }
  150. .good-price {
  151. color: #fd463e;
  152. font-size: 32rpx;
  153. &::before {
  154. content: '¥';
  155. font-size: 22rpx;
  156. color: #fd463e;
  157. }
  158. text {
  159. }
  160. }
  161. }
  162. }
  163. .sub-btn {
  164. width: 616rpx;
  165. height: 74rpx;
  166. background: #4D74CF;
  167. border-radius: 15rpx;
  168. font-size: 30rpx;
  169. font-weight: bold;
  170. color: #FFFFFF;
  171. text-align: center;
  172. line-height: 74rpx;
  173. position: fixed;
  174. bottom: 45rpx;
  175. left: 0;
  176. right: 0;
  177. margin: auto;
  178. }
  179. </style>