useGasApply.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <!--用气申请-->
  2. <template>
  3. <view id="transportPerson">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="scroll-box">
  5. <view class="list">
  6. <view class="list_li" v-for="(item,index) in dataList" :key="index" @click="goInfo(item)">
  7. <img class="for-back-img" :src="imagesUrl('commonality/icon_yqsq_sys.png')">
  8. <text class="list_li_text">{{item.room}}</text>
  9. <text
  10. :class="item.remark=='1'?'list_li_text2':(item.remark=='0'?'colorA':(item.remark=='2'?'colorB':''))">{{item.remark=='1'?'有效期:'+item.startTime+'至'+item.endTime+'':(item.remark=='0'?'审核中':(item.remark=='2'?'审核驳回':''))}}</text>
  11. </view>
  12. </view>
  13. </scroll-view>
  14. <view class="empty" v-if="pageType==4">
  15. <img class="for-back-img" :src="imagesUrl('commonality/img_ysrygl_zwsj.png')">
  16. <view>暂无数据</view>
  17. </view>
  18. <view class="sub_btn" @click="subBtn()">申请用气</view>
  19. </view>
  20. </template>
  21. <script>
  22. import {
  23. useAgsApplyList
  24. } from '@/api/apiDemo/index.js'
  25. export default {
  26. name: "transportPerson",
  27. data() {
  28. return {
  29. pageType: 0,
  30. //列表请求参数
  31. getData: {
  32. pageNum: 1,
  33. pageSize: 20,
  34. },
  35. dataList: [],
  36. status: 0,
  37. }
  38. },
  39. onLoad() {
  40. },
  41. onShow() {
  42. //今天页面返回,清除存储气瓶信息
  43. uni.removeStorageSync('listDetail');
  44. },
  45. methods: {
  46. subBtn() {
  47. uni.redirectTo({
  48. url: '/pages_student/useGasApply/useGasApplyAdd?status=0'
  49. });
  50. },
  51. goInfo(d) {
  52. uni.redirectTo({
  53. url: '/pages_student/useGasApply/useGasApplyDetail?item=' + encodeURIComponent(JSON.stringify(d))
  54. });
  55. },
  56. //滚动加载事件
  57. scrollGet() {
  58. this.getData.pageNum += 1;
  59. this.getList();
  60. },
  61. //查询实验室
  62. async getList() {
  63. const {
  64. data
  65. } = await useAgsApplyList(this.getData)
  66. if (data.code == 200) {
  67. let _this = this;
  68. let res = data.rows
  69. if (_this.getData.pageNum == 1) {
  70. _this.dataList = res;
  71. if (res.length > 0) {
  72. _this.pageType = 0;
  73. } else {
  74. _this.pageType = 4;
  75. }
  76. } else {
  77. _this.dataList = _this.dataList.concat(res);
  78. }
  79. }
  80. },
  81. },
  82. mounted() {
  83. this.getList();
  84. },
  85. }
  86. </script>
  87. <style lang="stylus" scoped>
  88. #transportPerson {
  89. height: auto;
  90. width: 100%;
  91. flex: 1;
  92. display flex;
  93. flex-direction column overflow hidden;
  94. padding-bottom: 220rpx;
  95. .scroll-box {
  96. // flex:1;
  97. overflow-y scroll;
  98. .list {
  99. background: #FFFFFF;
  100. border-radius: 20rpx;
  101. margin: 20rpx 20rpx 0;
  102. padding: 0 20rpx;
  103. box-sizing: border-box;
  104. .list_li {
  105. height: 110rpx;
  106. display: flex;
  107. align-items: center;
  108. border-bottom: 1px solid #f5f5f5;
  109. >img {
  110. width: 60rpx;
  111. height: 60rpx;
  112. }
  113. >text {
  114. font-size: 28rpx;
  115. font-family: PingFang SC;
  116. font-weight: 500;
  117. color: #333333;
  118. line-height: 28rpx;
  119. display: inline-block;
  120. }
  121. .list_li_text {
  122. margin-left: 30rpx;
  123. width: 150rpx;
  124. font-size: 28rpx;
  125. font-family: PingFang SC;
  126. font-weight: 500;
  127. color: #333333;
  128. line-height: 28rpx;
  129. }
  130. .list_li_text2 {
  131. flex: 1;
  132. text-align: right;
  133. font-size: 24rpx;
  134. font-family: PingFang SC;
  135. font-weight: 500;
  136. color: #999999;
  137. line-height: 24rpx;
  138. }
  139. .colorA {
  140. flex: 1;
  141. text-align: right;
  142. font-size: 24rpx;
  143. font-family: PingFang SC;
  144. font-weight: 500;
  145. color: #FF8A00;
  146. line-height: 24rpx;
  147. }
  148. .colorB {
  149. flex: 1;
  150. text-align: right;
  151. font-size: 24rpx;
  152. font-family: PingFang SC;
  153. font-weight: 500;
  154. color: #FF6F6F;
  155. line-height: 24rpx;
  156. }
  157. }
  158. }
  159. }
  160. .empty {
  161. text-align: center;
  162. margin-top: 316rpx;
  163. >img {
  164. width: 336rpx;
  165. height: 222rpx;
  166. margin-left: 208rpx;
  167. }
  168. >view {
  169. font-size: 30rpx;
  170. font-family: PingFang SC;
  171. font-weight: 500;
  172. color: #E0E0E0;
  173. line-height: 30rpx;
  174. margin-top: 48rpx;
  175. }
  176. }
  177. /* 按钮 */
  178. .sub_btn {
  179. width: 650rpx;
  180. height: 100rpx;
  181. background: #0183FA;
  182. border-radius: 20rpx;
  183. font-size: 28rpx;
  184. font-family: PingFang SC;
  185. font-weight: 500;
  186. color: #FFFFFF;
  187. line-height: 100rpx;
  188. text-align: center;
  189. margin-left: 50rpx;
  190. position: fixed;
  191. bottom: 30rpx;
  192. z-index: 1000;
  193. }
  194. }
  195. </style>