index.vue 6.4 KB

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