index.vue 7.1 KB

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