info.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <cwg-page-wrapper>
  3. <view class="user-profile-detail">
  4. <!-- Content -->
  5. <view class="content">
  6. <!-- Basic Information -->
  7. <view class="info-card">
  8. <view class="card-header">
  9. <cwg-icon name="icon_personal certification" :size="20" color="#2563eb" />
  10. <text class="card-title">{{ t('card.Info.s1') }}</text>
  11. </view>
  12. <view class="card-body">
  13. <info-row icon="xm" :label="t('card.Form.f5') + ' ' + t('card.Form.f4')"
  14. :value="userInfo.firstName + ' ' + userInfo.lastName" />
  15. <info-row icon="email-outline" :label="t('card.Form.f3')" :value="userInfo.email" />
  16. <info-row icon="phone" :label="t('card.Form.f2')"
  17. :value="userInfo.areaCode + ' ' + userInfo.mobile" />
  18. <info-row icon="cwg-calendar" :label="t('card.Form.f6')" :value="userInfo.birthday" />
  19. <info-row :icon="userInfo.gender == 'M' ? 'nan' : 'nv'" :label="t('card.Form.f8')"
  20. :value="userInfo.gender == 'M' ? t('card.Form.v1') : t('card.Form.v2')" :isLast="true" />
  21. </view>
  22. </view>
  23. <!-- Location Information -->
  24. <view class="info-card">
  25. <view class="card-header">
  26. <cwg-icon name="dw" :size="20" color="#16a34a" />
  27. <text class="card-title">{{ t('global.t1') }}</text>
  28. </view>
  29. <view class="card-body">
  30. <info-row icon="gj" :label="t('card.Form.f7')" :value="userInfo.countryCnName" />
  31. <info-row icon="dw" :label="t('card.Form.f9')" :value="userInfo.townEnName" />
  32. <info-row icon="xxdz" :label="t('card.Form.f10')" :value="userInfo.address" />
  33. <info-row icon="paperclip" :label="t('card.Form.f11')" :value="userInfo.postCode"
  34. :isLast="true" />
  35. </view>
  36. </view>
  37. <!-- Career Information -->
  38. <view class="info-card">
  39. <view class="card-header">
  40. <cwg-icon name="globe" :size="20" color="#9333ea" />
  41. <text class="card-title">{{ t('card.Info.s0') }}</text>
  42. </view>
  43. <view class="card-body">
  44. <info-row icon="globe" :label="t('card.Form.f12')" :value="userInfo.occupationDesc" />
  45. <info-row icon="location" :label="t('card.Form.f13')" :value="userInfo.annualSalary" />
  46. <info-row icon="globe" :label="t('card.Form.f14')" :value="userInfo.accountPurpose" />
  47. <info-row icon="gzcalendar" :label="t('card.Form.f15')" :value="userInfo.expectedMonthlyVolume"
  48. :isLast="true" />
  49. </view>
  50. </view>
  51. <!-- Identity Verification -->
  52. <view class="info-card">
  53. <view class="card-header">
  54. <cwg-icon name="checkmark" :size="20" color="#ea580c" />
  55. <text class="card-title">{{ t('card.Info.s2') }}</text>
  56. </view>
  57. <view class="card-body">
  58. <verification-row icon="checkmarkempty" :label="t('card.Form.f16')"
  59. :status="getIdentityStatus()" :date="getIdentityDate()" :idType="userInfo.idType"
  60. :idFrontUrl="userInfo.idFrontUrl" :idBackUrl="userInfo.idBackUrl"
  61. :idHoldUrl="userInfo.idHoldUrl" :isLast="true" />
  62. </view>
  63. </view>
  64. <!-- Action Buttons -->
  65. <!-- <view class="action-buttons">
  66. <button class="btn-primary" @click="handleEditProfile">{{ t('card.Btn.Edit') }}</button>
  67. <button class="btn-secondary" @click="handleChangePassword">{{ t('card.Btn.ChangePwd') }}</button>
  68. </view> -->
  69. </view>
  70. </view>
  71. </cwg-page-wrapper>
  72. </template>
  73. <script setup lang="ts">
  74. import { ref, onMounted, watch, computed, reactive } from "vue";
  75. import InfoRow from './components/InfoRow.vue';
  76. import VerificationRow from './components/VerificationRow.vue';
  77. import { useI18n } from "vue-i18n";
  78. import useUserStore from "@/stores/use-user-store";
  79. import useRouter from "@/hooks/useRouter";
  80. const userStore = useUserStore();
  81. const userInfo = computed(() => userStore.userInfo);
  82. const { t } = useI18n();
  83. const router = useRouter();
  84. // 获取身份认证状态
  85. function getIdentityStatus() {
  86. // 认证成功就是已认证;否则视为审核中(pending)
  87. if (userInfo.value?.approveStatus == 2 || userInfo.value?.kycStatus == 2) {
  88. return 'verified';
  89. }
  90. return 'pending';
  91. }
  92. // 获取身份认证日期
  93. function getIdentityDate() {
  94. // 如果有证件有效期,则使用证件签发日期
  95. if (userInfo.value?.issueDate) {
  96. return new Date(userInfo.value.issueDate).toLocaleDateString();
  97. }
  98. return '';
  99. }
  100. const handleEditProfile = () => {
  101. router.push('/pages/mine/improve');
  102. };
  103. const handleChangePassword = () => {
  104. uni.showToast({
  105. title: t('card.Msg.ComingSoon'),
  106. icon: 'none'
  107. });
  108. };
  109. </script>
  110. <style scoped lang="scss">
  111. @import "@/uni.scss";
  112. .page-wrapper {
  113. padding: 0;
  114. }
  115. .user-profile-detail {
  116. min-height: 100vh;
  117. background-color: #f9fafb;
  118. }
  119. .header {
  120. background: linear-gradient(to right, #2563eb, #60a5fa);
  121. padding: px2rpx(16);
  122. }
  123. .header-content {
  124. display: flex;
  125. align-items: center;
  126. gap: px2rpx(8);
  127. }
  128. .avatar {
  129. width: px2rpx(40);
  130. height: px2rpx(40);
  131. border-radius: 50%;
  132. background-color: white;
  133. border: px2rpx(2) solid white;
  134. box-shadow: 0 px2rpx(2) px2rpx(6) rgba(0, 0, 0, 0.1);
  135. }
  136. .header-info {
  137. flex: 1;
  138. display: flex;
  139. flex-direction: column;
  140. }
  141. .user-name {
  142. color: white;
  143. font-size: px2rpx(18);
  144. margin-bottom: px2rpx(2);
  145. }
  146. .user-email {
  147. color: #bfdbfe;
  148. font-size: px2rpx(12);
  149. }
  150. .content {
  151. padding: px2rpx(1) px2rpx(16) px2rpx(24);
  152. }
  153. .info-card {
  154. background-color: white;
  155. border-radius: px2rpx(8);
  156. box-shadow: 0 px2rpx(1) px2rpx(4) rgba(0, 0, 0, 0.1);
  157. margin-top: px2rpx(16);
  158. overflow: hidden;
  159. }
  160. .card-header {
  161. display: flex;
  162. align-items: center;
  163. gap: px2rpx(4);
  164. padding: px2rpx(12) px2rpx(16);
  165. border-bottom: 1px solid #f3f4f6;
  166. }
  167. .card-title {
  168. color: #1f2937;
  169. font-size: px2rpx(14);
  170. }
  171. .card-body {
  172. padding: px2rpx(16);
  173. }
  174. .action-buttons {
  175. margin-top: px2rpx(24);
  176. display: flex;
  177. flex-direction: column;
  178. gap: px2rpx(12);
  179. }
  180. .btn-primary {
  181. width: 100%;
  182. background-color: #2563eb;
  183. color: white;
  184. padding: px2rpx(12);
  185. border-radius: px2rpx(8);
  186. border: none;
  187. font-size: px2rpx(14);
  188. }
  189. .btn-primary:active {
  190. background-color: #1d4ed8;
  191. }
  192. .btn-secondary {
  193. width: 100%;
  194. background-color: white;
  195. color: #374151;
  196. padding: px2rpx(12);
  197. border-radius: px2rpx(8);
  198. border: 1px solid #d1d5db;
  199. font-size: px2rpx(14);
  200. }
  201. .btn-secondary:active {
  202. background-color: #f9fafb;
  203. }
  204. </style>