index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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. // let pageNo = 1;
  80. // let pageSize = 30;
  81. const listItem = ref();
  82. // const queryList = async (pageNo, pageSize) => {
  83. // console.log("执行力”")
  84. // // 此处请求仅为演示,请替换为自己项目中的请求
  85. // await requestApi('index.php/admin/borrow.borrowApp/apply',{
  86. // page:pageNo,
  87. // limit:pageSize
  88. // }).then(res => {
  89. // // 将请求结果通过complete传给z-paging处理,同时也代表请求结束,这一行必须调用
  90. // paging.value.complete(res.data.list.data);
  91. // console.log(res.data.list.data)
  92. // }).catch(res => {
  93. // console.log(res)
  94. // paging.value.complete(false);
  95. // })
  96. // }
  97. // 进详情页
  98. function detail(id) {
  99. wx.navigateTo({
  100. url: '/pages/index/detail?data=' + JSON.stringify(id)
  101. })
  102. }
  103. // 进借单申请页
  104. function application() {
  105. wx.navigateTo({
  106. url: '/pages/teacher/application'
  107. })
  108. }
  109. const tabs = ref(null);
  110. const tabList = ref(['待审批/待使用', '使用中/逾期', '已驳回/已归还']);
  111. // tabs通知swiper切换
  112. const tabsChange = (index) => {
  113. current.value = index;
  114. }
  115. // swiper滑动中
  116. const swiperTransition = (e) => {
  117. tabs.value.setDx(e.detail.dx);
  118. }
  119. // swiper滑动结束
  120. const swiperAnimationfinish = (e) => {
  121. current.value = e.detail.current;
  122. tabs.value.unlockDx();
  123. }
  124. const reloadCurrentList = () => {
  125. listItem.value[current.value].reload();
  126. }
  127. </script>
  128. <style lang="less">
  129. page {
  130. background-color: #fff;
  131. overflow: hidden;
  132. }
  133. .zp-swiper-super.data-v-bd8ff6a5 {
  134. background-color: rgb(244, 245, 249);
  135. }
  136. .search {
  137. margin: 20rpx 20rpx 0 20rpx;
  138. }
  139. .zp-swiper-container-fixed.data-v-bd8ff6a5 {
  140. // top: 100rpx !important;
  141. }
  142. swiper {
  143. min-height: 95vh;
  144. // overflow-y:auto;
  145. }
  146. .yiqijie{
  147. width: 280rpx;
  148. height: 90rpx;
  149. background-color: #2d8cf0;
  150. position: absolute;
  151. bottom: 80rpx;
  152. right: 50%;
  153. transform: translate(50%, 50%);
  154. border-radius: 50rpx;
  155. line-height: 90rpx;
  156. text-align: center;
  157. color: #fff;
  158. font-size: 35rpx;
  159. }
  160. .jie_card {
  161. width: 94%;
  162. margin: 30rpx auto;
  163. height: 270rpx;
  164. border-radius: 20rpx;
  165. background-color: #fff;
  166. // padding: 10rpx 0;
  167. }
  168. .tihuan_box {
  169. width: 84%;
  170. height: 500rpx;
  171. padding: 30rpx;
  172. background-color: #fff;
  173. margin: 30% auto;
  174. border-radius: 20rpx;
  175. }
  176. .jie_card_title {
  177. width: 100%;
  178. height: 84rpx;
  179. line-height: 84rpx;
  180. }
  181. .jie_swiper {
  182. // min-height: 1000rpx;
  183. background-color: rgb(244, 245, 249);
  184. }
  185. .jie_card_title_text {
  186. margin-left: 15rpx;
  187. line-height: center;
  188. // color: #606266;
  189. font-size: 28rpx;
  190. }
  191. .jie_tags {
  192. float: right;
  193. background-color: #E1F3D8;
  194. width: 104rpx;
  195. height: 42rpx;
  196. margin-top: 22rpx;
  197. border-radius: 23rpx 0 0 23rpx;
  198. font-size: 25rpx;
  199. padding-left: 10rpx;
  200. line-height: 40rpx;
  201. color: #529B2E;
  202. }
  203. .jie_tags2 {
  204. color: #B88230;
  205. background-color: #FAECD8;
  206. }
  207. .jie_contend {
  208. margin-left: 15rpx;
  209. margin-top: 15rpx;
  210. float: left;
  211. font-size: 31rpx;
  212. line-height: 42rpx;
  213. }
  214. .jie_contend_text {
  215. margin-bottom: 10rpx;
  216. }
  217. .jie_contend_text1 {
  218. color: #606266;
  219. }
  220. .jie_contend_text2 {
  221. color: #000;
  222. }
  223. .jie_card_ztai {
  224. width: 134rpx;
  225. height: 134rpx;
  226. background-color: #F89898;
  227. border-radius: 50%;
  228. line-height: 134rpx;
  229. float: right;
  230. color: #fff;
  231. font-size: 32rpx;
  232. text-align: center;
  233. margin-top: 25rpx;
  234. margin-right: 40rpx;
  235. }
  236. .jie_card_ztai2 {
  237. background-color: #A0CFFF;
  238. }
  239. </style>