index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <cwg-page-wrapper :isHeaderFixed="true">
  3. <view class="page">
  4. <cwg-header :title="t('pages.mine.index')">
  5. <div class="language-switch" @click="router.push('/pages/mine/cog')">
  6. <cwg-icon color="#000" icon="cog-outline" />
  7. </div>
  8. </cwg-header>
  9. <view class="user-card">
  10. <view class="avatar"></view>
  11. <view class="user-info">
  12. <view class="phone">{{ userInfo?.email }}</view>
  13. </view>
  14. </view>
  15. <view class="group">
  16. <view class="group-item" @click="openProfile()">
  17. <cwg-icon color="#000" icon="shield-lock-open-outline" />
  18. <text class="item-text">{{ t("language.i3") }}</text>
  19. <text class="item-text version" v-if="!isPersonalInfoCompleted">{{ t("language.i0") }}</text>
  20. <text class="item-text version" v-if="isPersonalInfoCompleted">{{ t("State.ToCertified") }}</text>
  21. <cwg-icon color="#000" icon="chevron-right" />
  22. </view>
  23. <view class="group-item" @click="router.push('/pages/apply-record/list')">
  24. <cwg-icon color="#000" icon="kksq" />
  25. <text class="item-text">{{ t("card.tab15") }}</text>
  26. <text class="version item-text"></text>
  27. <cwg-icon color="#000" icon="chevron-right" />
  28. </view>
  29. <view class="group-item" @click="router.push('/pages/wallet/balance')">
  30. <cwg-icon color="#000" icon="qbye" />
  31. <text class="item-text">{{ t("card.tab17") }}</text>
  32. <text class="version item-text"></text>
  33. <cwg-icon color="#000" icon="chevron-right" />
  34. </view>
  35. <view class="group-item" @click="router.push('/pages/wallet/vaultody-list')">
  36. <cwg-icon color="#000" icon="qbye" />
  37. <text class="item-text">{{ t("pages.wallet.vaultody-list") }}</text>
  38. <text class="version item-text"></text>
  39. <cwg-icon color="#000" icon="chevron-right" />
  40. </view>
  41. <view class="group-item" @click="router.push('/pages/wallet/withdraw-list')">
  42. <cwg-icon color="#000" icon="qbye" />
  43. <text class="item-text">{{ t("pages.wallet.withdraw-list") }}</text>
  44. <text class="version item-text"></text>
  45. <cwg-icon color="#000" icon="chevron-right" />
  46. </view>
  47. <view class="group-item" @click="router.push('/pages/mine/help')">
  48. <cwg-icon color="#000" icon="cjwt" />
  49. <text class="item-text">{{ t('pages.mine.help') }}</text>
  50. <text class="version item-text"></text>
  51. <cwg-icon color="#000" icon="chevron-right" />
  52. </view>
  53. <view class="group-item" @click="router.push('/pages/mine/cog')">
  54. <cwg-icon color="#000" icon="sz" />
  55. <text class="item-text">{{ t('pages.mine.cog') }}</text>
  56. <text class="version item-text"></text>
  57. <cwg-icon color="#000" icon="chevron-right" />
  58. </view>
  59. </view>
  60. </view>
  61. </cwg-page-wrapper>
  62. </template>
  63. <script setup lang="ts">
  64. import { ref, computed, onMounted } from "vue";
  65. import { useI18n } from "vue-i18n";
  66. import useRouter from "@/hooks/useRouter";
  67. import useUserStore from "@/stores/use-user-store";
  68. import { ucardApi } from "@/api/ucard";
  69. const { t } = useI18n();
  70. const userStore = useUserStore();
  71. const router = useRouter();
  72. const userInfo = computed(() => userStore.userInfo);
  73. // 判断是否已完成个人信息认证
  74. const isPersonalInfoCompleted = computed(() => {
  75. if (userInfo?.approveStatus == 2) {
  76. return true;
  77. } else {
  78. return false;
  79. }
  80. });
  81. function openProfile() {
  82. if (!isPersonalInfoCompleted.value) {
  83. router.push('/pages/mine/info');
  84. } else {
  85. router.push('/pages/mine/improve');
  86. }
  87. }
  88. async function getUserInfo() {
  89. try {
  90. const res = await ucardApi.getSingle();
  91. userStore.saveUserInfo(res.data);
  92. } catch (error) {
  93. console.log(error, 111);
  94. }
  95. }
  96. onMounted(() => {
  97. if (!userInfo.value?.id) {
  98. getUserInfo();
  99. }
  100. });
  101. </script>
  102. <style scoped lang="scss">
  103. @import "@/uni.scss";
  104. :deep(.u-modal__content) {
  105. padding: px2rpx(24) px2rpx(40);
  106. .p1 {
  107. color: #363130;
  108. font-family: "League Spartan";
  109. font-size: px2rpx(17);
  110. font-style: normal;
  111. font-weight: 400;
  112. line-height: normal;
  113. margin-bottom: px2rpx(32);
  114. }
  115. .modal-class {
  116. width: px2rpx(300);
  117. }
  118. .title {
  119. color: #1a1a1a;
  120. text-align: center;
  121. font-family: Roboto;
  122. font-size: px2rpx(22);
  123. font-style: normal;
  124. font-weight: 600;
  125. line-height: px2rpx(22);
  126. }
  127. .no-button {
  128. width: 100%;
  129. margin: px2rpx(12) 0;
  130. .u-button {
  131. background-color: #ffbdc8 !important;
  132. }
  133. }
  134. .ok-button {
  135. margin: px2rpx(4) 0;
  136. /* background-color: #EA002A; */
  137. }
  138. }
  139. .user-card {
  140. width: 100%;
  141. display: inline-flex;
  142. flex-direction: column;
  143. justify-content: center;
  144. align-items: center;
  145. gap: px2rpx(24);
  146. padding-bottom: px2rpx(48);
  147. .avatar {
  148. width: px2rpx(64);
  149. height: px2rpx(64);
  150. border-radius: 50%;
  151. background: #d8d8d8 url("/static/images/avatars.png") center/cover no-repeat;
  152. border: 4rpx solid #fff;
  153. }
  154. .phone {
  155. // 1a1a1a
  156. color: var(--primary-color);
  157. font-family: Roboto;
  158. font-size: px2rpx(22);
  159. font-style: normal;
  160. font-weight: 600;
  161. line-height: px2rpx(4);
  162. }
  163. }
  164. .user-info .group {
  165. background: var(--action-bg);
  166. border-radius: px2rpx(16);
  167. margin-top: px2rpx(24);
  168. overflow: hidden;
  169. }
  170. .group-item {
  171. display: flex;
  172. align-items: center;
  173. padding: px2rpx(16) 0;
  174. color: #000;
  175. font-size: px2rpx(16);
  176. /* border-bottom: 2rpx solid var(--action-bg); */
  177. position: relative;
  178. }
  179. .group-item:last-child {
  180. border-bottom: none;
  181. }
  182. svg {
  183. width: px2rpx(24);
  184. height: px2rpx(24);
  185. color: #000;
  186. font-size: px2rpx(24);
  187. }
  188. .group-item .version {
  189. margin-left: auto;
  190. color: #000;
  191. font-size: px2rpx(16);
  192. }
  193. .item-text {
  194. margin-left: px2rpx(12);
  195. }
  196. .code-dialog {
  197. display: flex;
  198. justify-content: center;
  199. gap: px2rpx(12);
  200. padding: px2rpx(16);
  201. :deep(.u-popup__content) {
  202. width: 90% !important;
  203. }
  204. :deep(.u-modal) {
  205. width: 100% !important;
  206. }
  207. }
  208. </style>