index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view class="teacher_box" >
  3. <view class="" v-if="data == 0">
  4. <uv-empty text="暂无数据" icon="https://cdn.uviewui.com/uview/empty/list.png"></uv-empty>
  5. </view>
  6. <block v-for="(items, indexs) in data" :key="indexs">
  7. <!-- <block v-if="items.status==0 || items.status==2"> -->
  8. <view class="jie_card" @click="detail(items.id)">
  9. <view class="jie_card_title">
  10. <text class="jie_card_title_text">借单号:{{items.encoding}}</text>
  11. <text class="jie_tags" v-if="items.purpose==1">教学借单</text>
  12. <text class="jie_tags jie_tags2" v-if="items.purpose==0">科研借单</text>
  13. </view>
  14. <uv-line></uv-line>
  15. <view class="jie_contend">
  16. <view class="jie_contend_text">
  17. <text class="jie_contend_text1">借取人:</text>
  18. <text class="jie_contend_text2">{{items.username}}</text>
  19. </view>
  20. <view class="jie_contend_text">
  21. <text class="jie_contend_text1">联系电话:</text>
  22. <text class="jie_contend_text2">{{items.mobile}}</text>
  23. </view>
  24. <view class="jie_contend_text">
  25. <text class="jie_contend_text1">申请时间:</text>
  26. <text class="jie_contend_text2">{{items.create_time}}</text>
  27. </view>
  28. </view>
  29. <view class="jie_card_ztai" v-if="items.status==0">待审批</view>
  30. <view class="jie_card_ztai jie_card_ztai2" v-else-if="items.status==2">待使用</view>
  31. <view class="jie_card_ztai" v-else-if="items.status==1">已驳回</view>
  32. <view class="jie_card_ztai jie_card_ztai2" v-else-if="items.status==4">已归还</view>
  33. <view class="jie_card_ztai" v-else-if="items.status==5">已逾期</view>
  34. <view class="jie_card_ztai jie_card_ztai2" v-else-if="items.status==3">使用中</view>
  35. <view class="jie_card_ztai" v-else-if="items.status==7">领导驳回</view>
  36. </view>
  37. <!-- </block> -->
  38. </block>
  39. <view style="width: 100%; height:9vh;">
  40. </view>
  41. </view>
  42. <view class="yiqijie" @click="application">
  43. <image src="../../static/img/sqi.png" mode="widthFix" style="width: 50rpx;margin-bottom: -12rpx;"></image>
  44. 仪器借用
  45. </view>
  46. </template>
  47. <script setup>
  48. import {
  49. ref
  50. } from 'vue'
  51. import {
  52. requestApi
  53. } from '@/api/request.js'
  54. // onShow是uni-app中的一个全局生命周期函数,当页面从后台进入前台显示时会被触发。
  55. import {
  56. onShow,
  57. onUnload
  58. } from '@dcloudio/uni-app'
  59. // import {Base64} from 'js-base64'
  60. // 获取后端需要的token认证
  61. // 使用wx.getStorageSync('userInfo')从本地存储中获取用户令牌信息并将其赋值给user_Token变量。
  62. const data = ref([])
  63. onShow(async () => {
  64. wx.showLoading({
  65. title: '加载中',
  66. })
  67. const res = await requestApi('index.php/admin/borrow.borrowApp/apply')
  68. wx.hideLoading()
  69. // console.log(res)
  70. data.value = res.data.list
  71. console.log(res )
  72. })
  73. // 进详情页
  74. function detail(id) {
  75. wx.navigateTo({
  76. url: '/pages/index/detail?data='+ JSON.stringify(id)
  77. })
  78. }
  79. // 进借单申请页
  80. function application() {
  81. wx.navigateTo({
  82. url: '/pages/teacher/application'
  83. })
  84. }
  85. </script>
  86. <style lang="less">
  87. page {
  88. background-color: rgb(244, 245, 249);
  89. overflow: hidden;
  90. }
  91. .yiqijie{
  92. width: 280rpx;
  93. height: 90rpx;
  94. background-color:#2d8cf0;
  95. position: absolute;
  96. bottom: 230rpx;
  97. right: 50%;
  98. transform:translate(50%,50%);
  99. border-radius: 50rpx;
  100. line-height: 90rpx;
  101. text-align: center;
  102. color: #fff;
  103. font-size: 35rpx;
  104. }
  105. .yijiey{
  106. // float: right;
  107. width: 90%;
  108. margin: 0 auto;
  109. }
  110. .jiedanss{
  111. float: left;
  112. width: 73%;
  113. }
  114. .search {
  115. height: 45px;
  116. padding: 20rpx 20rpx 20rpx 20rpx;
  117. background-color: #fff;
  118. }
  119. swiper {
  120. min-height: 95vh;
  121. // overflow-y:auto;
  122. }
  123. .teacher_box{
  124. height: 90vh;
  125. overflow-y:auto
  126. }
  127. .jie_card_ztai {
  128. width: 120rpx;
  129. height: 120rpx;
  130. background-color: #F89898;
  131. border-radius: 50%;
  132. line-height: 120rpx;
  133. float: right;
  134. color: #fff;
  135. font-size: 25rpx;
  136. text-align: center;
  137. margin-top: 30rpx;
  138. margin-right: 40rpx;
  139. }
  140. .yijiey button{
  141. height: 44px !important;
  142. }
  143. .jie_card_ztai2{
  144. background-color: #A0CFFF;
  145. }
  146. .jie_card {
  147. width: 94%;
  148. margin: 30rpx auto;
  149. height: 270rpx;
  150. border-radius: 20rpx;
  151. background-color: #fff;
  152. // padding: 10rpx 0;
  153. }
  154. .tihuan_box {
  155. width: 84%;
  156. height: 500rpx;
  157. padding: 30rpx;
  158. background-color: #fff;
  159. margin: 30% auto;
  160. border-radius: 20rpx;
  161. }
  162. .jie_card_title {
  163. width: 100%;
  164. height: 84rpx;
  165. line-height: 84rpx;
  166. }
  167. .jie_swiper {
  168. // min-height: 1000rpx;
  169. background-color: rgb(244, 245, 249);
  170. }
  171. .jie_card_title_text {
  172. margin-left: 15rpx;
  173. line-height: center;
  174. // color: #606266;
  175. font-size: 28rpx;
  176. }
  177. .jie_tags {
  178. float: right;
  179. background-color: #E1F3D8;
  180. width: 104rpx;
  181. height: 42rpx;
  182. margin-top: 22rpx;
  183. border-radius: 23rpx 0 0 23rpx;
  184. font-size: 25rpx;
  185. padding-left: 10rpx;
  186. line-height: 40rpx;
  187. color: #529B2E;
  188. }
  189. .jie_tags2 {
  190. color: #B88230;
  191. background-color: #FAECD8;
  192. }
  193. .jie_contend {
  194. margin-left: 15rpx;
  195. margin-top: 15rpx;
  196. float: left;
  197. font-size: 31rpx;
  198. line-height: 42rpx;
  199. }
  200. .jie_contend_text {
  201. margin-bottom: 10rpx;
  202. }
  203. .jie_contend_text1 {
  204. color: #606266;
  205. }
  206. .jie_contend_text2 {
  207. color: #000;
  208. }
  209. .jie_card_ztai {
  210. width: 134rpx;
  211. height: 134rpx;
  212. background-color: #F89898;
  213. border-radius: 50%;
  214. line-height: 134rpx;
  215. float: right;
  216. color: #fff;
  217. font-size: 32rpx;
  218. text-align: center;
  219. margin-top: 25rpx;
  220. margin-right: 40rpx;
  221. }
  222. .jie_card_ztai2 {
  223. background-color: #A0CFFF;
  224. }
  225. </style>