index.vue 5.9 KB

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