index.vue 6.4 KB

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