user.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <s-layout :title="$t('index.user.title')" tabbar="/pages/index/user" navbar="custom"
  3. :bgStyle="template.style?.background" :navbarStyle="template.style?.navbar" onShareAppMessage
  4. :showFloatButton="true">
  5. <s-block v-for="(item, index) in template.data" :key="index" :styles="item.style">
  6. <s-block-item :type="item.type" :data="item.data" :styles="item.style" />
  7. </s-block>
  8. <view class="index-icon-list">
  9. <view class="index-icon-btn">
  10. <view class="icon" @click="goCashBack()">
  11. <image src="/static/6.png" class="index-icon"></image>
  12. </view>
  13. </view>
  14. </view>
  15. </s-layout>
  16. </template>
  17. <script setup>
  18. import {
  19. computed
  20. } from 'vue';
  21. import {
  22. onShow,
  23. onPageScroll,
  24. onPullDownRefresh
  25. } from '@dcloudio/uni-app';
  26. import sheep from '@/sheep';
  27. // 隐藏原生tabBar
  28. uni.hideTabBar();
  29. const template = computed(() => sheep.$store('app').template.user);
  30. const isLogin = computed(() => sheep.$store('user').isLogin);
  31. const goCashBack = () => {
  32. sheep.$router.go('/pages/index/finance');
  33. };
  34. onShow(() => {
  35. sheep.$store('user').updateUserData();
  36. });
  37. onPullDownRefresh(() => {
  38. sheep.$store('user').updateUserData();
  39. setTimeout(function() {
  40. uni.stopPullDownRefresh();
  41. }, 800);
  42. });
  43. onPageScroll(() => {});
  44. </script>
  45. <style>
  46. .index-icon-list {
  47. position: fixed;
  48. bottom: 10vh;
  49. right: 10px;
  50. z-index: 9;
  51. }
  52. .index-icon-list .index-icon-btn {
  53. width: 45px;
  54. height: 45px;
  55. border-radius: 50%;
  56. background: #fff;
  57. box-shadow: 0 3px 7px 0 rgba(157, 96, 130, .5);
  58. margin-bottom: 19px;
  59. display: flex;
  60. justify-content: center;
  61. align-items: center;
  62. }
  63. .index-icon-list image {
  64. width: 36px;
  65. height: 36px;
  66. }
  67. </style>