info copy.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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('ImproveImmediately.Title.AddressInformation') }}</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="idTypeOptions[0]?.text"
  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 { onLoad } from '@dcloudio/uni-app'
  75. import { ref, onMounted, watch, computed, reactive } from "vue";
  76. import InfoRow from './components/InfoRow.vue';
  77. import VerificationRow from './components/VerificationRow.vue';
  78. import { useI18n } from "vue-i18n";
  79. import useUserStore from "@/stores/use-user-store";
  80. import useRouter from "@/hooks/useRouter";
  81. import useIdTypeOptions from "@/composables/useIdTypeOptions";
  82. const { allIdTypeOptions } = useIdTypeOptions()
  83. const userStore = useUserStore();
  84. const userInfo = computed(() => userStore.userInfo);
  85. const { t } = useI18n();
  86. const router = useRouter();
  87. const idTypeOptions = computed(() => {
  88. return allIdTypeOptions.value?.filter(item => item.value === userInfo.value?.idType);
  89. });
  90. // 获取身份认证状态
  91. function getIdentityStatus() {
  92. // 认证成功就是已认证;否则视为审核中(pending)
  93. if (userInfo.value?.approveStatus == 2 || userInfo.value?.kycStatus == 2) {
  94. return 'verified';
  95. }
  96. return 'pending';
  97. }
  98. // 获取身份认证日期
  99. function getIdentityDate() {
  100. // 如果有证件有效期,则使用证件签发日期
  101. if (userInfo.value?.issueDate) {
  102. return new Date(userInfo.value.issueDate).toLocaleDateString();
  103. }
  104. return '';
  105. }
  106. const handleEditProfile = () => {
  107. router.push('/pages/mine/improve');
  108. };
  109. const handleChangePassword = () => {
  110. uni.showToast({
  111. title: t('card.Msg.ComingSoon'),
  112. icon: 'none'
  113. });
  114. };
  115. </script>
  116. <style scoped lang="scss">
  117. @import "@/uni.scss";
  118. .page-wrapper {
  119. padding: 0;
  120. }
  121. .user-profile-detail {
  122. min-height: 100vh;
  123. background-color: #f9fafb;
  124. }
  125. .header {
  126. background: linear-gradient(to right, #2563eb, #60a5fa);
  127. padding: px2rpx(16);
  128. }
  129. .header-content {
  130. display: flex;
  131. align-items: center;
  132. gap: px2rpx(8);
  133. }
  134. .avatar {
  135. width: px2rpx(40);
  136. height: px2rpx(40);
  137. border-radius: 50%;
  138. background-color: white;
  139. border: px2rpx(2) solid white;
  140. box-shadow: 0 px2rpx(2) px2rpx(6) rgba(0, 0, 0, 0.1);
  141. }
  142. .header-info {
  143. flex: 1;
  144. display: flex;
  145. flex-direction: column;
  146. }
  147. .user-name {
  148. color: white;
  149. font-size: px2rpx(18);
  150. margin-bottom: px2rpx(2);
  151. }
  152. .user-email {
  153. color: #bfdbfe;
  154. font-size: px2rpx(12);
  155. }
  156. .content {
  157. padding: px2rpx(1) px2rpx(16) px2rpx(24);
  158. }
  159. .info-card {
  160. background-color: white;
  161. border-radius: px2rpx(8);
  162. box-shadow: 0 px2rpx(1) px2rpx(4) rgba(0, 0, 0, 0.1);
  163. margin-top: px2rpx(16);
  164. overflow: hidden;
  165. }
  166. .card-header {
  167. display: flex;
  168. align-items: center;
  169. gap: px2rpx(4);
  170. padding: px2rpx(12) px2rpx(16);
  171. border-bottom: 1px solid #f3f4f6;
  172. }
  173. .card-title {
  174. color: #1f2937;
  175. font-size: px2rpx(14);
  176. }
  177. .card-body {
  178. padding: px2rpx(16);
  179. }
  180. .action-buttons {
  181. margin-top: px2rpx(24);
  182. display: flex;
  183. flex-direction: column;
  184. gap: px2rpx(12);
  185. }
  186. .btn-primary {
  187. width: 100%;
  188. background-color: #2563eb;
  189. color: white;
  190. padding: px2rpx(12);
  191. border-radius: px2rpx(8);
  192. border: none;
  193. font-size: px2rpx(14);
  194. }
  195. .btn-primary:active {
  196. background-color: #1d4ed8;
  197. }
  198. .btn-secondary {
  199. width: 100%;
  200. background-color: white;
  201. color: #374151;
  202. padding: px2rpx(12);
  203. border-radius: px2rpx(8);
  204. border: 1px solid #d1d5db;
  205. font-size: px2rpx(14);
  206. }
  207. .btn-secondary:active {
  208. background-color: #f9fafb;
  209. }
  210. </style>