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