index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view class="container">
  3. <view>
  4. <text class="phoneText global-font">Hello,{{userInfo.nickName}}</text>
  5. </view>
  6. <view class="bannerBox">
  7. <swiper class="swiper-box" :interval="interval" autoplay indicator-dots indicator-color="#C7C7C7" indicator-active-color="#1aad19">
  8. <swiper-item v-for="(item, index) in bannerList" :key="index">
  9. <image src="../../static/images/banner2.png" class="imgItem" @click="bannerItemClick(item)"></image>
  10. </swiper-item>
  11. </swiper>
  12. </view>
  13. <view class="btnBox">
  14. <image class="btnImg" src="../../static/images/lrzc.png" @click="btnClick(0)" />
  15. <image v-if="userType !== '07'" class="btnImg img2" src="../../static/images/jsjz.png" @click="btnClick(1)" />
  16. </view>
  17. <view>
  18. <uni-card v-if="userType !== '07'" class="daiban">
  19. <uni-section type="line" title="待办事项">
  20. <template v-slot:right>
  21. <text @click="toList">更多 ></text>
  22. </template>
  23. <uni-list>
  24. <template v-for="(item,index) in dataList">
  25. <uni-list-item v-if="(item.lzzt == '1' || item.lzzt == '2' || item.lzzt == '5'|| item.lzzt == '7') && item.state !== '99'" :key="index"
  26. :title="item.lrXm" :note="item.sqyy" thumbSize="lg" :showArrow="false">
  27. <template v-slot:header>
  28. <image :src="item.lrTx?config.baseUrl+item.lrTx:config.baseUrl + config.head"
  29. style="width: 10vw;height: 5vh;margin-right: 2vw;border-radius: 50%;"></image>
  30. </template>
  31. <template v-slot:footer>
  32. <view class="item-right">
  33. <text>{{item.sqsj.substring(0,8) }}</text>
  34. <image class="item-img" src="@/static/images/daishenhe.png" mode=""></image>
  35. <!-- <text>{{item.lrSpyj || '无'}}</text> -->
  36. </view>
  37. </template>
  38. </uni-list-item>
  39. </template>
  40. </uni-list>
  41. </uni-section>
  42. </uni-card>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import { getToken, getUser } from '@/common/auth.js'
  48. import { decryptRowData_ECB, decryptData_ECB } from '@/common/sm4.js'
  49. import { updateKhjbxx, infoKhjbxx, ListKhjbxx, ListKhShxx } from '@/api/kh.js'
  50. export default {
  51. data() {
  52. return {
  53. interval: 3000,
  54. bannerList: [
  55. { image: '../../static/image/banner2.png' }
  56. ],
  57. lrInfo: {},
  58. // 人员信息
  59. userInfo: {},
  60. userType: '',
  61. form: {
  62. pageNum: 1,
  63. pageSize: 4,
  64. createUserId: ''
  65. },
  66. dataList: [],
  67. total: 0,
  68. }
  69. },
  70. onLoad() {
  71. // 老人07、员工04、监管00
  72. this.userInfo = getUser()
  73. this.userType = this.userInfo.userType
  74. console.log(this.userInfo);
  75. },
  76. onShow() {
  77. if (this.userType == '07') {
  78. this.info(this.userInfo.userId)
  79. } else {
  80. this.form.createUserId = this.userInfo.userId
  81. }
  82. this.dataList = []
  83. this.getDaiBanList()
  84. },
  85. methods: {
  86. getDaiBanList() {
  87. ListKhShxx(this.form).then(res => {
  88. if (res.code == 200) {
  89. this.total = res.total
  90. // let list = decryptRowData_ECB(res.rows, ["lrZjhm", "lrXm", "lrHjbcxx", "lrXjdzBcxx",
  91. // "lrCydh", "lrPoxm", "lrPoZjmh", "jhrXm", "jhrSjhm", "zlrXm", "zlrDh", "cjzh",
  92. // "yhzh", "khmc"
  93. // ], [2, 1, 4, 4, 3, 1, 2, 1, 2, 1, 3, 5, 5, 5])
  94. let list = res.rows
  95. this.dataList.push(...list)
  96. }
  97. })
  98. },
  99. toList() {
  100. // 待办事项(他给老人注册、他给老人维护) 会员维护 结算记账(食堂)
  101. // 登录不获取openid
  102. uni.navigateTo({
  103. url: '/pages/lr/shxxList'
  104. })
  105. },
  106. info(id) {
  107. infoKhjbxx(id).then(res => {
  108. if (res.code == 200) {
  109. this.lrInfo = decryptData_ECB(res.data, ["lrZjhm", "lrXm", "lrHjbcxx", "lrXjdzBcxx",
  110. "lrCydh", "lrPoxm", "lrPoZjmh", "jhrXm", "jhrSjhm", "zlrXm", "zlrDh", "cjzh",
  111. "yhzh", "khmc"
  112. ], [2, 1, 4, 4, 3, 1, 2, 1, 2, 1, 3, 5, 5, 5]);
  113. }
  114. })
  115. },
  116. btnClick(index) {
  117. if (index == 1) {
  118. // uni.showToast({
  119. // icon: 'none',
  120. // title: '该功能暂未开放'
  121. // })
  122. } else {
  123. let baseUrl = '/pages/info/add-files'
  124. uni.navigateTo({
  125. url: baseUrl
  126. })
  127. }
  128. }
  129. }
  130. }
  131. </script>
  132. <style lang="scss" scoped>
  133. .item-right {
  134. width: 60px;
  135. display: flex;
  136. flex-direction: column;
  137. background-position: left;
  138. background-size: 58px 58px;
  139. background-repeat: no-repeat;
  140. position: relative;
  141. font-size: 14px;
  142. .item-img {
  143. position: absolute;
  144. right: -5px;
  145. bottom: -10px;
  146. height: 40px;
  147. width: 40px;
  148. }
  149. }
  150. .container {
  151. display: flex;
  152. flex-direction: column;
  153. height: 100vh;
  154. width: 100vw;
  155. background: linear-gradient(to bottom, #07bf61 0%, #fff 30%, #F8FCFF 100%);
  156. }
  157. /* 轮播图 */
  158. .bannerBox {
  159. width: 100vw;
  160. }
  161. .swiper-box {
  162. height: 19vh;
  163. margin: 7vh 2vh 20px;
  164. }
  165. .imgItem {
  166. width: 100%;
  167. height: 100%;
  168. }
  169. .swiper-box swiper-item {
  170. border-radius: 15px;
  171. overflow: hidden;
  172. }
  173. .phoneText {
  174. position: absolute;
  175. margin-top: 2vh;
  176. margin-left: 5vw;
  177. width: 80vw;
  178. height: 2vh;
  179. font-size: 14px;
  180. color: white;
  181. font-weight: 700;
  182. line-height: 2vh;
  183. text-align: left;
  184. vertical-align: top;
  185. }
  186. /* 按钮 */
  187. .btnBox {
  188. /* width: 90%; */
  189. display: flex;
  190. margin: 1vh 19px;
  191. }
  192. .btnImg {
  193. width: 49%;
  194. height: 16vh;
  195. }
  196. .img2 {
  197. margin-left: 2%;
  198. opacity: 0.36;
  199. }
  200. .daiban {
  201. position: fixed;
  202. left: 4px;
  203. right: 4px;
  204. }
  205. </style>