猫妈狗爸伴宠师小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
4.6 KiB

  1. <template>
  2. <view>
  3. <view class="user-header">
  4. <view class="flex flex-between login">
  5. <view class="flex">
  6. <up-image class="mr20" width="120rpx" height="120rpx" src="https://cdn.uviewui.com/uview/album/1.jpg"
  7. shape="circle"></up-image>
  8. <view>{{!getIsLogin()?userInfo.name:"欢迎来到版宠师"}}</view>
  9. </view>
  10. <view style="width: 140rpx" v-if="!getIsLogin()">
  11. <up-button @click="handleLogin" :customStyle="{borderColor:'#fff'}" type="primary" text="请登录"
  12. shape="circle"
  13. color="#FFBF60"></up-button>
  14. </view>
  15. </view>
  16. <view class="header-money">
  17. <view class="header-money-list">
  18. <view class="header-money-item flex flex-evenly">
  19. <view style="text-align: center">
  20. <view class="mb20 flex">
  21. <up-image :show-loading="true" src="https://cdn.catmdogd.com/Work/image/work/icon4.png" width="68rpx"
  22. height="68rpx"></up-image>
  23. 服务酬劳
  24. </view>
  25. <view class="mb20">--</view>
  26. <view class="flex flex-between but">
  27. <view>提现</view>
  28. <view>|</view>
  29. <view>明细</view>
  30. </view>
  31. </view>
  32. <view style="text-align: center">
  33. <view class="mb20 flex">
  34. <up-image :show-loading="true" src="https://cdn.catmdogd.com/Work/image/work/icon4.png" width="68rpx"
  35. height="68rpx"></up-image>
  36. 保证金
  37. </view>
  38. <view class="mb20">--</view>
  39. <view class="but">保证金中心</view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="user-container">
  46. <view class="bgf pd40 radius20 mb28">
  47. <view class=" mb28 flex flex-between">
  48. <view class="font36">我的宠物</view>
  49. <view style="color: #3c9cff">更多 ></view>
  50. </view>
  51. <view>
  52. <up-button v-if="!getIsLogin()" @click="handleLogin" class="mb20" size="large" style="width: 500rpx"
  53. type="primary"
  54. text="登录后管理宠物" shape="circle"
  55. color="linear-gradient(to right, rgb(255 ,191 ,96 ,1), rgb(255, 51, 186))"></up-button>
  56. <up-button v-if="getIsLogin()" class="mb20" size="large" style="width: 500rpx" type="primary"
  57. text="请添加您的爱宠"
  58. shape="circle"
  59. color="linear-gradient(to right, rgb(255 ,191 ,96 ,1), rgb(255, 51, 186))"></up-button>
  60. <view v-if="isLogin" class="cw-box radius20 pd20 flex">
  61. <up-image class="mr20" width="140rpx" style="flex-shrink: 0" height="140rpx"
  62. src="https://cdn.uviewui.com/uview/album/1.jpg"
  63. shape="circle"></up-image>
  64. <view style="width: 418rpx">
  65. <view class="font32 mb20">阿拉斯加</view>
  66. <view class="font24 ellipsis">澳大利亚雾猫澳洲斑点雾猫| 1 个月</view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="bgf pd40 radius20">
  72. <view class="font36 mb28">服务中心</view>
  73. <view class="flex flex-between font28 flex-wrap">
  74. <view class="icon-list">
  75. <up-image class="mb20" src="https://cdn.catmdogd.com/Work/image/work/icon1.png"
  76. width="68rpx"
  77. height="68rpx"></up-image>
  78. <view>优惠卷</view>
  79. </view>
  80. <view class="icon-list">
  81. <up-image class="mb20" :show-loading="true" src="https://cdn.catmdogd.com/Work/image/work/icon2.png"
  82. width="68rpx"
  83. height="68rpx"></up-image>
  84. <view>平台协议</view>
  85. </view>
  86. <view class="icon-list">
  87. <up-image class="mb20" :show-loading="true" src="https://cdn.catmdogd.com/Work/image/work/icon3.png"
  88. width="68rpx"
  89. height="68rpx"></up-image>
  90. <view>订阅通知</view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </template>
  97. <script setup>
  98. import {ref} from "vue"
  99. import {getIsLogin, getStorage, getToken} from "../../utils/auth";
  100. import tab from "../../plugins/tab";
  101. const isLogin = ref(false)
  102. const userInfo = ref({})
  103. if (getIsLogin() && getToken()) {
  104. userInfo.value = getStorage("userInfo")
  105. isLogin.value = true
  106. }
  107. const handleLogin = () => {
  108. tab.navigateTo('/pages/login/index')
  109. }
  110. </script>
  111. <style scoped lang="scss">
  112. @import "index";
  113. </style>