index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <app-view class="home-mine">
  3. <template #header>
  4. <app-navbar title="我的" :show-back-button="false" @ready="onReady" />
  5. </template>
  6. <div ref="headerRef" class="home-mine__header">
  7. <div class="home-mine__header-wrapper">
  8. <div class="profile">
  9. <div class="profile-user">
  10. <div class="profile-user__avatar">
  11. <img class="g-image--avatar" src="" />
  12. </div>
  13. <div class="profile-user__info">
  14. <span>{{ getUserId() }}</span>
  15. <span>{{ getLoginId() }}</span>
  16. </div>
  17. </div>
  18. <div class="profile-account">
  19. <span>正常</span>
  20. <span>{{ getFirstAccountId() }}</span>
  21. </div>
  22. </div>
  23. <div class="bank" v-if="accountInfo">
  24. <div class="bank-item">
  25. <span>余额</span>
  26. <span>{{ accountInfo.currentbalance }}</span>
  27. </div>
  28. <div class="bank-item">
  29. <span>冻结</span>
  30. <span>{{ accountInfo.freezemargin }}</span>
  31. </div>
  32. <div class="bank-item">
  33. <span>可用</span>
  34. <span>{{ accountInfo.usedmargin }}</span>
  35. </div>
  36. <div class="bank-item">
  37. <span>
  38. <a @click="routerTo('bank-statement')">资金流水</a>
  39. </span>
  40. <span></span>
  41. </div>
  42. </div>
  43. <div class="button">
  44. <Button size="small" @click="routerTo('bank-wallet')" round>提现</Button>
  45. <Button type="primary" size="small" color="#00577C" @click="routerTo('bank-wallet')" round>充值</Button>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="home-mine__iconbar">
  50. <ul>
  51. <li @click="routerTo('mine-generalize')" style="align-items:flex-start">
  52. <app-iconfont icon="icon-wodetuiguang" label-direction="bottom">我的推广</app-iconfont>
  53. </li>
  54. <!-- <li>
  55. <app-iconfont icon="icon-wodedingdan" label-direction="bottom">我的订单</app-iconfont>
  56. </li>
  57. <li>
  58. <app-iconfont icon="icon-wodecangdan" label-direction="bottom">我的仓单</app-iconfont>
  59. </li>
  60. <li>
  61. <app-iconfont icon="icon-fapiaoxinxi" label-direction="bottom">发票信息</app-iconfont>
  62. </li>
  63. <li @click="routerTo('mine-address')">
  64. <app-iconfont icon="icon-shouhuodizhi" label-direction="bottom">收货地址</app-iconfont>
  65. </li> -->
  66. </ul>
  67. </div>
  68. <div class="g-navmenu">
  69. <CellGroup>
  70. <Cell is-link :to="{ name: 'account-certification' }">
  71. <template #title>
  72. <app-iconfont icon="icon-shimingrenzheng">实名认证</app-iconfont>
  73. </template>
  74. </Cell>
  75. <Cell is-link :to="{ name: 'bank-sign' }">
  76. <template #title>
  77. <app-iconfont icon="icon-qianyuezhanghu">签约账户</app-iconfont>
  78. </template>
  79. </Cell>
  80. <Cell is-link :to="{ name: 'rules-zcxy' }">
  81. <template #title>
  82. <app-iconfont icon="icon-yonghuzhucexieyi">用户注册协议</app-iconfont>
  83. </template>
  84. </Cell>
  85. <Cell is-link :to="{ name: 'rules-yszc' }">
  86. <template #title>
  87. <app-iconfont icon="icon-guanyuzhengce">关于隐私</app-iconfont>
  88. </template>
  89. </Cell>
  90. <Cell is-link :to="{ name: 'mine-service' }">
  91. <template #title>
  92. <app-iconfont icon="icon-kefurexian">客服热线</app-iconfont>
  93. </template>
  94. </Cell>
  95. <Cell is-link :to="{ name: 'setting' }">
  96. <template #title>
  97. <app-iconfont icon="icon-shezhi">设置</app-iconfont>
  98. </template>
  99. </Cell>
  100. <Cell is-link :to="{ name: 'rules-gywm' }">
  101. <template #title>
  102. <app-iconfont icon="icon-guanyuwomen">关于我们</app-iconfont>
  103. </template>
  104. </Cell>
  105. <Cell is-link :to="{ name: 'logoff' }">
  106. <template #title>
  107. <app-iconfont icon="icon-zhuxiaofuwu">注销服务</app-iconfont>
  108. </template>
  109. </Cell>
  110. </CellGroup>
  111. </div>
  112. <div class="home-mine__footer">
  113. <Button class="button-logout" @click="userLogout">退出登录</Button>
  114. </div>
  115. </app-view>
  116. </template>
  117. <script lang="ts" setup>
  118. import { shallowRef } from 'vue'
  119. import { Cell, CellGroup, Button } from 'vant'
  120. import { dialog } from '@/utils/vant'
  121. import { useNavigation } from '@/hooks/navigation'
  122. import { useLoginStore, useAccountStore } from '@/stores'
  123. import { useAuth } from '@/business/auth'
  124. import AppIconfont from '@mobile/components/base/iconfont/index.vue'
  125. const { routerTo } = useNavigation()
  126. const { getLoginId, getUserId, getFirstAccountId } = useLoginStore()
  127. const { logout } = useAuth()
  128. const { accountInfo } = useAccountStore()
  129. const headerRef = shallowRef<HTMLDivElement>()
  130. const onReady = (el: HTMLDivElement) => {
  131. // 设置背景图位置
  132. headerRef.value?.style.setProperty('background-position', `0 -${el.clientHeight}px`)
  133. }
  134. const userLogout = () => {
  135. dialog('是否退出当前账号?', {
  136. showCancelButton: true
  137. }).then(() => {
  138. logout()
  139. })
  140. }
  141. </script>
  142. <style lang="less">
  143. @import './index.less';
  144. </style>