index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <view class="container">
  3. <view>
  4. <text class="phoneText global-font">Hello,{{lrInfo.lrXm}}</text>
  5. </view>
  6. <view class="bannerBox">
  7. <swiper class="swiper-box" :interval="interval" autoplay indicator-dots indicator-color="#C7C7C7"
  8. indicator-active-color="#1aad19">
  9. <swiper-item v-for="(item, index) in bannerList" :key="index">
  10. <image src="../../static/images/banner2.png" class="imgItem" @click="bannerItemClick(item)"></image>
  11. </swiper-item>
  12. </swiper>
  13. </view>
  14. <view class="btnBox">
  15. <image class="btnImg" src="../../static/images/lr.png" @click="btnClick(0)" />
  16. <image class="btnImg img2" src="../../static/images/shqt.png" @click="btnClick(1)" />
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import {
  22. getToken
  23. } from '@/common/auth.js'
  24. import {
  25. getUser
  26. } from '@/common/auth.js'
  27. import {
  28. decryptRowData_ECB,
  29. decryptData_ECB
  30. } from '@/common/sm4.js'
  31. import {
  32. updateKhjbxx,
  33. infoKhjbxx
  34. } from '@/api/kh.js'
  35. export default {
  36. data() {
  37. return {
  38. interval: 3000,
  39. bannerList: [{
  40. image: '../../static/image/banner2.png'
  41. }],
  42. lrInfo: {},
  43. // 人员信息
  44. userInfo: {},
  45. }
  46. },
  47. mounted() {
  48. // 老人07、员工04、监管06
  49. if (!getToken()) {
  50. uni.navigateTo({
  51. url: '/pages/login/index'
  52. })
  53. }
  54. this.userInfo = getUser()
  55. if (this.userInfo.userType == '07') {
  56. this.info(this.userInfo.userId)
  57. }
  58. },
  59. methods: {
  60. info(id) {
  61. infoKhjbxx(id).then(res => {
  62. if (res.code == 200) {
  63. this.lrInfo = decryptData_ECB(res.data, ["lrZjhm", "lrXm", "lrHjbcxx", "lrXjdzBcxx",
  64. "lrCydh", "lrPoxm", "lrPoZjmh", "jhrXm", "jhrSjhm", "zlrXm", "zlrDh", "cjzh",
  65. "yhzh", "khmc"
  66. ], [2, 1, 4, 4, 3, 1, 2, 1, 2, 1, 3, 5, 5, 5]);
  67. }
  68. })
  69. },
  70. btnClick(index) {
  71. let baseUrl = this.userInfo.userType == '07' ? '/pages/lr/base?info=' + JSON.stringify(this.lrInfo) : '/pages/lr/base'
  72. let url = index == 0 ? baseUrl : '/pages/test/index'
  73. // let url = index == 0 ? '/pages/lr/base' : '/pages/lr/test'
  74. uni.navigateTo({
  75. url: url
  76. })
  77. }
  78. }
  79. }
  80. </script>
  81. <style scoped>
  82. /* 轮播图 */
  83. .bannerBox {
  84. position: absolute;
  85. margin-top: 14vh;
  86. width: 100vw;
  87. }
  88. .swiper-box {
  89. width: 90%;
  90. height: 300rpx;
  91. margin: 50rpx 5vw;
  92. margin-top: -15%;
  93. margin-bottom: 20rpx;
  94. }
  95. .swiper-adsense-box {
  96. width: 90%;
  97. height: 150rpx;
  98. margin: 30rpx auto;
  99. }
  100. .imgItem {
  101. width: 100%;
  102. height: 100%;
  103. }
  104. .swiper-box swiper-item {
  105. height: 280rpx !important;
  106. border-radius: 15px;
  107. overflow: hidden;
  108. }
  109. .wx-swiper-dots .wx-swiper-dot {
  110. width: 45rpx;
  111. height: 8rpx;
  112. border-radius: 5rpx;
  113. }
  114. .wx-swiper-dots .wx-swiper-dot:nth-of-type(n+2) {
  115. margin-left: 30rpx;
  116. }
  117. .wx-swiper-dots.wx-swiper-dots-horizontal {
  118. position: absolute;
  119. bottom: 0rpx;
  120. }
  121. .phoneText {
  122. position: absolute;
  123. margin-top: 2vh;
  124. margin-left: 5vw;
  125. width: 80vw;
  126. height: 2vh;
  127. font-size: 14px;
  128. color: white;
  129. font-weight: 700;
  130. line-height: 2vh;
  131. text-align: left;
  132. vertical-align: top;
  133. }
  134. .container {
  135. height: 100vh;
  136. width: 100vw;
  137. background: linear-gradient(to bottom, #07bf61 0%, #fff 30%, #F8FCFF 100%);
  138. }
  139. /* 按钮 */
  140. .btnBox {
  141. position: absolute;
  142. width: 90%;
  143. display: flex;
  144. margin: 30vh 5vw;
  145. margin-bottom: 10rem;
  146. }
  147. .btnImg {
  148. width: 45vw;
  149. height: 33vw;
  150. display: block;
  151. }
  152. .img2 {
  153. margin-left: 5vw;
  154. }
  155. </style>