gasManage.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <!-- 气瓶管理 -->
  2. <template>
  3. <view id="register">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="scroll-box">
  5. <view class="register_li" @click="goPage(item)" v-for="(item,index) in dataList" :key="index">
  6. <view class="register_li_min" :style="index2===item.configVos.length-1?'border:none':''"
  7. v-for="(item2,index2) in item.configVos" :key="index2">
  8. <view class="register_li_min_t">
  9. <img class="right-img" :src="imagesUrl('supplier/icon_qpgl_qp.png')">
  10. <text>{{item.airName}}</text>
  11. </view>
  12. <view class="register_li_min_b">
  13. <text>{{item2.configName}}</text>
  14. </view>
  15. </view>
  16. </view>
  17. </scroll-view>
  18. <view class="empty" v-if="pageType==4">
  19. <img class="for-back-img" :src="imagesUrl('commonality/img_ysrygl_zwsj.png')">
  20. <view class="text-null">暂无数据</view>
  21. </view>
  22. <view class="sub_btn" @click="subBtn()"><img class="right-img"
  23. :src="imagesUrl('supplier/icon_gysqpgl_xzqp.png')">新增气瓶</view>
  24. </view>
  25. </template>
  26. <script>
  27. import {
  28. bottleList
  29. } from '@/api/apiDemo/index.js'
  30. import {
  31. config
  32. } from '@/api/request/config.js'
  33. export default {
  34. data() {
  35. return {
  36. pageType: 0,
  37. //列表请求参数
  38. getData: {
  39. pageNum: 1,
  40. pageSize: 20,
  41. },
  42. dataList: [],
  43. }
  44. },
  45. onLoad(option) {
  46. },
  47. onShow() {
  48. },
  49. methods: {
  50. //滚动加载事件
  51. scrollGet() {
  52. this.getData.pageNum += 1;
  53. this.getList();
  54. },
  55. subBtn() {
  56. uni.redirectTo({
  57. url: '/pages_supplier/views/gasManage/gasManageAdd?status=0'
  58. });
  59. },
  60. goPage(d) {
  61. uni.redirectTo({
  62. url: '/pages_supplier/views/gasManage/gasManageDetail?status=1&id=' + d.id
  63. });
  64. },
  65. //获取列表数据
  66. async getList() {
  67. let _this = this;
  68. const {
  69. data
  70. } = await bottleList(this.getData)
  71. if (data.code == 200) {
  72. let res = data.data.records
  73. if (_this.getData.pageNum == 1) {
  74. _this.dataList = res;
  75. if (res.length > 0) {
  76. _this.pageType = 0;
  77. } else {
  78. _this.pageType = 4;
  79. }
  80. } else {
  81. _this.dataList = _this.dataList.concat(res);
  82. }
  83. }
  84. },
  85. },
  86. mounted() {
  87. this.getList()
  88. }
  89. }
  90. </script>
  91. <style lang="stylus" scoped>
  92. #register {
  93. height: 100%;
  94. width: 100%;
  95. display flex;
  96. flex-direction column;
  97. .empty {
  98. .for-back-img {
  99. margin: auto;
  100. }
  101. .text-null {
  102. text-align: center;
  103. line-height: 200rpx;
  104. color:#999;
  105. }
  106. }
  107. .scroll-box {
  108. // flex:1;
  109. overflow-y scroll;
  110. padding-top: 30rpx;
  111. padding-bottom: 180rpx;
  112. .register_li {
  113. overflow: hidden;
  114. background #fff;
  115. margin: 20rpx;
  116. border-radius: 20rpx;
  117. .register_li_min {
  118. height: auto;
  119. margin: 20rpx;
  120. border-bottom: 1px solid #F5F5F5;
  121. .register_li_min_t {
  122. display flex;
  123. align-items center;
  124. >img {
  125. width: 34rpx;
  126. height: 34rpx;
  127. }
  128. >text {
  129. font-size: 28rpx;
  130. font-family: PingFang SC;
  131. font-weight: 500;
  132. color: #333333;
  133. line-height: 28rpx;
  134. margin-left: 14rpx;
  135. }
  136. }
  137. .register_li_min_b {
  138. margin-top: 24rpx;
  139. display: flex;
  140. justify-content: flex-start;
  141. flex-wrap: wrap;
  142. margin-bottom: 20rpx;
  143. >text {
  144. font-size: 26rpx;
  145. font-family: PingFang SC;
  146. font-weight: 500;
  147. color: #999999;
  148. line-height: 26rpx;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. /* 按钮 */
  155. .sub_btn {
  156. width: 650rpx;
  157. height: 100rpx;
  158. background: #0183FA;
  159. border-radius: 20rpx;
  160. font-size: 28rpx;
  161. font-family: PingFang SC;
  162. font-weight: 500;
  163. color: #FFFFFF;
  164. line-height: 100rpx;
  165. text-align: center;
  166. margin-left: 50rpx;
  167. position: fixed;
  168. bottom: 30rpx;
  169. display: flex;
  170. align-items: center;
  171. justify-content: center;
  172. z-index: 1000;
  173. >img {
  174. width: 28rpx;
  175. height: 28rpx;
  176. margin-right: 12rpx;
  177. }
  178. }
  179. }
  180. </style>