application.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="container" :style="{height:computeHeight}">
  3. <up-navbar title="首页" placeholder bgColor="transparent" leftIcon='' :title-style="{fontWeight:'bold'}">
  4. </up-navbar>
  5. <!-- header -->
  6. <view class="flex-row justify-between"
  7. style="width: 676rpx; height: 342rpx;padding-left: 48rpx;padding-right: 26rpx;">
  8. <view class="flex-column font-xxl" style="margin-top: 46rpx;">
  9. <text class="text-black3 font-weight-bolder">特困户系统</text>
  10. <view class="index-tag flex-row align-center justify-center">
  11. <text class="font text-white font-weight-bolder" style="margin-right: 12rpx;">便民服务</text>
  12. </view>
  13. </view>
  14. <view style="width: 284rpx;height: 342rpx;">
  15. <image style="width: 100%;height: 100%;" src="@/static/images/index-computer.png" mode="aspectFill">
  16. </image>
  17. </view>
  18. </view>
  19. <!--入口 -->
  20. <view class="px-32" style="margin-top: -60rpx;" @click="goReservation">
  21. <view class="position-relative flex-row align-center justify-between"
  22. style="width: 100%;height: 148rpx;border-radius: 20rpx;background-color: rgba(228, 240, 255, 0.8);">
  23. <image style="width: 100%;height: 100%;" src="@/static/images/index-center-bg.png" mode="aspectFill">
  24. </image>
  25. <view class="position-absolute top-0 left-0 flex-row align-center justify-between"
  26. style="height: 100%;width: 100%;">
  27. <view class="flex-row align-center" style="margin-left: 28rpx;">
  28. <image style="width: 66rpx;height: 66rpx;" src="@/static/images/index-enter-logo.png"
  29. mode="aspectFill"></image>
  30. <view class="flex-column ml-24">
  31. <text class="font-md" style="color: #4A90C6;">护理申请</text>
  32. <view class="bg-white flex-row align-center justify-center"
  33. style="width: 208rpx;height: 40rpx;border-radius: 20rpx;margin-top: 18rpx;">
  34. <text style="color: #4A90C6;font-size: 22rpx;">一键快速申请</text>
  35. </view>
  36. </view>
  37. </view>
  38. <image src="/static/images/index-enter-arrow.png"
  39. style="width: 32rpx;height: 32rpx;margin-right: 52rpx;" mode="aspectFill"></image>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. getMsgCountUrl
  48. } from '@/common/config/api.js'
  49. export default {
  50. data() {
  51. return {
  52. }
  53. },
  54. onLoad() {
  55. },
  56. onShow() {
  57. this.getMsgCount();
  58. },
  59. computed: {
  60. computeHeight() {
  61. return uni.$u.sys().windowHeight + 'px'
  62. }
  63. },
  64. methods: {
  65. // 获取未读消息数量
  66. getMsgCount() {
  67. console.log(this.vuex_user.id);
  68. getMsgCountUrl({
  69. params: {
  70. userId: this.vuex_user.id
  71. }
  72. })
  73. .then(res => {
  74. console.log('未读消息数', res);
  75. const count = parseInt(res);
  76. if (count > 0) {
  77. uni.setTabBarBadge({
  78. index: 1,
  79. text: count > 99 ? '99+' : res
  80. })
  81. } else {
  82. uni.removeTabBarBadge({
  83. index: 1
  84. })
  85. }
  86. })
  87. .catch(err => {
  88. console.log(err);
  89. })
  90. },
  91. // 点击预约
  92. goReservation() {
  93. uni.navigateTo({
  94. url: '/pages/subpack/pages/cat-choose/cat-choose'
  95. })
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .container {
  102. // background-image: url('@/static/images/index-bg.png');
  103. background-size: cover;
  104. background-position: center;
  105. .index-tag {
  106. width: 164rpx;
  107. height: 58rpx;
  108. margin-top: 38rpx;
  109. background-image: url('@/static/images/index-tag-bg.png');
  110. background-size: cover;
  111. background-position: center;
  112. }
  113. }
  114. </style>