index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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 { getToken, getUser } from '@/common/auth.js'
  45. import { decryptRowData_ECB, decryptData_ECB } from '@/common/sm4.js'
  46. import { updateKhjbxx, infoKhjbxx, ListKhjbxx, ListKhShxx } from '@/api/kh.js'
  47. export default {
  48. data() {
  49. return {
  50. interval: 3000,
  51. bannerList: [
  52. { image: '../../static/image/banner2.png' }
  53. ],
  54. lrInfo: {},
  55. // 人员信息
  56. userInfo: {},
  57. userType: '',
  58. form: {
  59. pageNum: 1,
  60. pageSize: 4,
  61. createUserId: ''
  62. },
  63. dataList: [],
  64. total: 0,
  65. }
  66. },
  67. onShow() {
  68. // 老人07、员工04、监管06
  69. this.userInfo = getUser()
  70. this.userType = this.userInfo.userType
  71. if (this.userType == '07') {
  72. this.info(this.userInfo.userId)
  73. } else {
  74. this.form.createUserId = this.userInfo.userId
  75. }
  76. this.dataList = []
  77. this.getDaiBanList()
  78. },
  79. methods: {
  80. getDaiBanList() {
  81. ListKhShxx(this.form).then(res => {
  82. if (res.code == 200) {
  83. this.total = res.total
  84. // let list = decryptRowData_ECB(res.rows, ["lrZjhm", "lrXm", "lrHjbcxx", "lrXjdzBcxx",
  85. // "lrCydh", "lrPoxm", "lrPoZjmh", "jhrXm", "jhrSjhm", "zlrXm", "zlrDh", "cjzh",
  86. // "yhzh", "khmc"
  87. // ], [2, 1, 4, 4, 3, 1, 2, 1, 2, 1, 3, 5, 5, 5])
  88. let list = res.rows
  89. this.dataList.push(...list)
  90. }
  91. })
  92. },
  93. toList() {
  94. // 待办事项(他给老人注册、他给老人维护) 会员维护 结算记账(食堂)
  95. // 登录不获取openid
  96. uni.navigateTo({
  97. url: '/pages/lr/shxxList'
  98. })
  99. },
  100. info(id) {
  101. infoKhjbxx(id).then(res => {
  102. if (res.code == 200) {
  103. this.lrInfo = decryptData_ECB(res.data, ["lrZjhm", "lrXm", "lrHjbcxx", "lrXjdzBcxx",
  104. "lrCydh", "lrPoxm", "lrPoZjmh", "jhrXm", "jhrSjhm", "zlrXm", "zlrDh", "cjzh",
  105. "yhzh", "khmc"
  106. ], [2, 1, 4, 4, 3, 1, 2, 1, 2, 1, 3, 5, 5, 5]);
  107. }
  108. })
  109. },
  110. btnClick(index) {
  111. // if (index == 1 && this.userType != '04') {
  112. if (index == 1) {
  113. uni.showToast({
  114. icon: 'none',
  115. title: '该功能暂未开放'
  116. })
  117. } else {
  118. // let baseUrl = '/pages/lr/base?info=' + JSON.stringify(this.lrInfo)
  119. // let url = index == 0 ? baseUrl : '/pages/test/index'
  120. // uni.navigateTo({
  121. // url: url
  122. // })
  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. }
  199. .daiban {
  200. position: fixed;
  201. left: 4px;
  202. right: 4px;
  203. }
  204. </style>