myjslis.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="content">
  3. <!-- <view class="" style="height: 20rpx;"></view> -->
  4. <view class="list-top flex" v-if="list.length > 0">
  5. <view class="list-left">
  6. 规格
  7. </view>
  8. <view class="list-mid">
  9. 预估价格
  10. </view>
  11. <view class="list-right">
  12. 操作
  13. </view>
  14. </view>
  15. <view class="jg">
  16. </view>
  17. <scroll-view scroll-y="true" class="scroll-wrap" :style="{'height': height}" @scrolltolower="getList">
  18. <view class="list-box" v-for="item in list">
  19. <view class="list-item flex list-top">
  20. <view class="list-left clamp">
  21. 长:<text>{{item.long*1}}</text>宽:<text>{{item.wide*1}}</text>高:<text>{{item.high*1}}</text>
  22. </view>
  23. <view class="list-mid">
  24. <text>¥{{item.price*1}}</text>
  25. </view>
  26. <view class="list-right flex">
  27. <!-- <view class="sc btn" @click="showSc(item)">
  28. 删除
  29. </view> -->
  30. <view class="xq btn" @click="navto('/pages/user/jsxq?id=' + item.id + '&price=' + item.price + '&weight=' + item.weight + '&long=' + item.long + '&wide=' + item.wide + '&high=' + item.high + '&iswarm=' + item.is_warm)">
  31. 详情
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <uni-load-more :status="loadingType"></uni-load-more>
  37. </scroll-view>
  38. </view>
  39. </template>
  40. <script>
  41. import { getJsList } from '@/api/user.js'
  42. export default {
  43. data() {
  44. return {
  45. height: '',
  46. loadingType: 'more',
  47. list: [],
  48. page: 1,
  49. limit: 20,
  50. }
  51. },
  52. onLoad() {
  53. },
  54. onShow() {
  55. this.getList()
  56. },
  57. onReachBottom() {
  58. },
  59. onReady(res) {
  60. var obj = this;
  61. uni.getSystemInfo({
  62. success: resu => {
  63. const query = uni.createSelectorQuery();
  64. query.select('.scroll-wrap').boundingClientRect();
  65. query.exec(function(res) {
  66. obj.height = resu.windowHeight - res[0].top + 'px';
  67. });
  68. },
  69. fail: res => {}
  70. });
  71. },
  72. methods: {
  73. getList() {
  74. let obj = this
  75. if(obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  76. return
  77. }
  78. obj.loadingType = 'loading'
  79. getJsList().then(res => {
  80. let arr = res.data
  81. obj.list = obj.list.concat(arr)
  82. obj.page++
  83. if(arr.length == obj.limit) {
  84. obj.loadingType = 'more'
  85. }else {
  86. obj.loadingType = 'noMore'
  87. }
  88. })
  89. },
  90. showSc(item) {
  91. let obj = this
  92. uni.showModal({
  93. title: '提示',
  94. content: '确定删除该计算记录?',
  95. complete(e) {
  96. if(e.confirm) {
  97. // 确定删除
  98. // console.log()
  99. obj.$api.msg('已删除')
  100. }
  101. }
  102. })
  103. },
  104. navto(url) {
  105. uni.navigateTo({
  106. url
  107. })
  108. }
  109. }
  110. }
  111. </script>
  112. <style lang="scss">
  113. page {
  114. background: #fff;
  115. }
  116. .list-top {
  117. width: 708rpx;
  118. margin: auto;
  119. padding: 0 20rpx;
  120. text-align: center;
  121. font-size: 30rpx;
  122. font-weight: bold;
  123. color: #666666;
  124. background-color: #fff;
  125. line-height: 83rpx;
  126. .list-left {
  127. flex-shrink: 0;
  128. width: 55%;
  129. }
  130. .list-mid {
  131. flex-shrink: 0;
  132. width: 30%;
  133. }
  134. .list-right {
  135. flex-shrink: 0;
  136. width: 15%;
  137. }
  138. }
  139. .list-box {
  140. width: 708rpx;
  141. margin: auto;
  142. .list-item {
  143. border-bottom: 1px solid #EAEAEA;
  144. }
  145. .list-left {
  146. text {
  147. padding-right: 10rpx;
  148. }
  149. }
  150. text {
  151. color: #4261E3 !important;
  152. }
  153. .list-right {
  154. justify-content: center;
  155. .btn {
  156. width: 86rpx;
  157. height: 41rpx;
  158. border-radius: 21rpx;
  159. font-size: 24rpx;
  160. font-weight: 500;
  161. line-height: 41rpx;
  162. }
  163. .sc {
  164. border: 1px solid #D8D8D8;
  165. margin-right: 10rpx;
  166. }
  167. .xq {
  168. background: #ECEFFC;
  169. border: 1px solid #4261E3;
  170. color: #4261E3;
  171. }
  172. }
  173. }
  174. .jg {
  175. width: 750rpx;
  176. height: 1rpx;
  177. background: #EAEAEA;
  178. }
  179. </style>