index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <view class="">
  3. <!-- <view class="search">
  4. <uv-search placeholder="请输入搜索内容" v-model="keyword"></uv-search>
  5. </view> -->
  6. <view class="">
  7. <!-- 使用z-paging-swiper为根节点可以免计算高度 -->
  8. <z-paging-swiper>
  9. <template #top>
  10. <z-tabs ref="tabs" :list="tabList" :current="current" @change="tabsChange" />
  11. </template>
  12. <!-- swiper必须设置height:100%,因为swiper有默认的高度,只有设置高度100%才可以铺满页面 -->
  13. <swiper class="swiper" :current="current" @transition="swiperTransition" @animationfinish="swiperAnimationfinish">
  14. <swiper-item class="swiper-item" v-for="(item, index) in tabList" :key="index">
  15. <!-- 这里的swiper-list-item为demo中为演示用定义的组件,列表及分页代码在swiper-list-item组件内 -->
  16. <!-- 请注意,swiper-list-item非z-paging内置组件,在自己的项目中必须自己创建,若未创建则会报组件不存在的错误 -->
  17. <swiper-list-item ref="listItem" :tabIndex="index" :currentIndex="current">
  18. </swiper-list-item>
  19. </swiper-item>
  20. </swiper>
  21. </z-paging-swiper>
  22. </view>
  23. </view>
  24. <view class="">
  25. <uni-popup ref="wxpopup" type="bottom">
  26. <view class="tihuan_box" style="height: 650rpx;">
  27. <view class="" style="text-align: center; margin-bottom: 20rpx; font-size: 35rpx; font-weight: bold;margin-bottom: 30rpx;">
  28. 请长按识别二维码关注公众号
  29. <br />
  30. 方便信息及时通知
  31. </view>
  32. <view class="" style="width: 80%; margin: 0 auto;">
  33. <image :show-menu-by-longpress="true" src="../../static/img/erweima.jpg" mode="widthFix" style="width: 100%;"></image>
  34. </view>
  35. </view>
  36. </uni-popup>
  37. </view>
  38. <view class="yiqijie" @click="application">
  39. <image src="../../static/img/sqi.png" mode="widthFix" style="width: 50rpx;margin-bottom: -12rpx;"></image>
  40. 仪器借用
  41. </view>
  42. </template>
  43. <script setup>
  44. import { ref } from 'vue';
  45. import {
  46. requestApi
  47. } from '@/api/request.js'
  48. // onShow是uni-app中的一个全局生命周期函数,当页面从后台进入前台显示时会被触发。
  49. import {
  50. onShow,
  51. } from '@dcloudio/uni-app'
  52. // import {Base64} from 'js-base64'
  53. let wxpopup = ref(null)
  54. let userInfo =wx.getStorageSync('userInfos')
  55. let stuts = ref(false)
  56. let current =ref(0);
  57. // console.log('w',userInfo)
  58. // 获取后端需要的token认证
  59. // 使用wx.getStorageSync('userInfo')从本地存储中获取用户令牌信息并将其赋值给user_Token变量。
  60. const data = ref([])
  61. onShow(async () => {
  62. // reloadCurrentList()
  63. const ress= await requestApi(
  64. 'api/xmwechat.Offiaccount/isBind?server=1',
  65. {
  66. id:userInfo.userInfo.id,
  67. },
  68. 'POST'
  69. )
  70. // console.log(ress)
  71. if(ress.data.isBind=='ture'){
  72. // console.log(ress)
  73. }else{
  74. wxpopup.value.open('top');
  75. }
  76. })
  77. const paging = ref(null);
  78. const dataList = ref([])
  79. const listItem = ref();
  80. // 进借单申请页
  81. function application() {
  82. wx.navigateTo({
  83. url: '/pages/teacher/application'
  84. })
  85. }
  86. const tabs = ref(null);
  87. const tabList = ref(['待审批/待使用', '使用中/逾期', '已驳回/已归还']);
  88. // tabs通知swiper切换
  89. const tabsChange = (index) => {
  90. current.value = index;
  91. }
  92. // swiper滑动中
  93. const swiperTransition = (e) => {
  94. tabs.value.setDx(e.detail.dx);
  95. }
  96. // swiper滑动结束
  97. const swiperAnimationfinish = (e) => {
  98. current.value = e.detail.current;
  99. tabs.value.unlockDx();
  100. }
  101. const reloadCurrentList = () => {
  102. listItem.value[current.value].reload();
  103. }
  104. </script>
  105. <style lang="less">
  106. page {
  107. background-color: #fff;
  108. overflow: hidden;
  109. }
  110. .zp-swiper-super.data-v-bd8ff6a5 {
  111. background-color: rgb(244, 245, 249);
  112. }
  113. .search {
  114. margin: 20rpx 20rpx 0 20rpx;
  115. }
  116. .zp-swiper-container-fixed.data-v-bd8ff6a5 {
  117. // top: 100rpx !important;
  118. }
  119. swiper {
  120. min-height: 95vh;
  121. // overflow-y:auto;
  122. }
  123. .jie_card {
  124. width: 94%;
  125. margin: 30rpx auto;
  126. height: 270rpx;
  127. border-radius: 20rpx;
  128. background-color: #fff;
  129. // padding: 10rpx 0;
  130. }
  131. .tihuan_box {
  132. width: 84%;
  133. height: 500rpx;
  134. padding: 30rpx;
  135. background-color: #fff;
  136. margin: 30% auto;
  137. border-radius: 20rpx;
  138. }
  139. .jie_card_title {
  140. width: 100%;
  141. height: 84rpx;
  142. line-height: 84rpx;
  143. }
  144. .jie_swiper {
  145. // min-height: 1000rpx;
  146. background-color: rgb(244, 245, 249);
  147. }
  148. .jie_card_title_text {
  149. margin-left: 15rpx;
  150. line-height: center;
  151. // color: #606266;
  152. font-size: 28rpx;
  153. }
  154. .jie_tags {
  155. float: right;
  156. background-color: #E1F3D8;
  157. width: 104rpx;
  158. height: 42rpx;
  159. margin-top: 22rpx;
  160. border-radius: 23rpx 0 0 23rpx;
  161. font-size: 25rpx;
  162. padding-left: 10rpx;
  163. line-height: 40rpx;
  164. color: #529B2E;
  165. }
  166. .jie_tags2 {
  167. color: #B88230;
  168. background-color: #FAECD8;
  169. }
  170. .jie_contend {
  171. margin-left: 15rpx;
  172. margin-top: 15rpx;
  173. float: left;
  174. font-size: 31rpx;
  175. line-height: 42rpx;
  176. }
  177. .jie_contend_text {
  178. margin-bottom: 10rpx;
  179. }
  180. .jie_contend_text1 {
  181. color: #606266;
  182. }
  183. .jie_contend_text2 {
  184. color: #000;
  185. }
  186. .jie_card_ztai {
  187. width: 134rpx;
  188. height: 134rpx;
  189. background-color: #F89898;
  190. border-radius: 50%;
  191. line-height: 134rpx;
  192. float: right;
  193. color: #fff;
  194. font-size: 32rpx;
  195. text-align: center;
  196. margin-top: 25rpx;
  197. margin-right: 40rpx;
  198. }
  199. .jie_card_ztai2 {
  200. background-color: #A0CFFF;
  201. }
  202. </style>