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.

user-change.vue 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="content">
  3. <u-field required labelWidth="180" v-model="state.ocrData.name" input-align='right' label="姓名" disabled
  4. :fieldStyle="fieldStyle">
  5. </u-field>
  6. <!-- <u-field required labelWidth="180" v-model="state.ocrData.gender" input-align='right' label="性别"
  7. :fieldStyle="fieldStyle">
  8. </u-field> -->
  9. <u-field required labelWidth="180" v-model="state.ocrData.userCardId" input-align='right' label="身份证号"
  10. :fieldStyle="fieldStyle" disabled>
  11. </u-field>
  12. <!-- <u-field required labelWidth="180" v-model="state.ocrData.add" input-align='right' label="地址"
  13. :fieldStyle="fieldStyle">
  14. </u-field> -->
  15. <!-- <u-cell-item required title="证件有效期" :borderBottom="false" @click="timeClick"
  16. :titleStyle="{fontSize:'28rpx',color:'#777777'}" :valueStyle="{fontSize:'28rpx',color:'#333333'}"
  17. :value="state.ocrData.type"></u-cell-item> -->
  18. <u-field required labelWidth="180" :borderTop="true" v-model="state.ocrData.tel" input-align='right'
  19. label="联系方式" :fieldStyle="fieldStyle" disabled>
  20. </u-field>
  21. <view class="tips">* 修改的是etc预留手机号,不能修改登录账号手机号,修改后需要到票根网重新实名</view>
  22. </view>
  23. <view class="subBtn">
  24. <submit-button title="去修改" form-type="submit" @submit="formSubmit">
  25. </submit-button>
  26. </view>
  27. </template>
  28. <script setup lang="ts">
  29. import {
  30. reactive
  31. } from "vue";
  32. import {
  33. msg,
  34. navTo
  35. } from "@/utils/utils";
  36. import {
  37. stringToJson
  38. } from "@/utils/network/encryption";
  39. import {
  40. userInfoQuery
  41. } from "@/utils/network/api.js";
  42. import {
  43. getItem
  44. } from "@/utils/storage.ts"
  45. import {
  46. request
  47. } from "@/utils/network/request.js";
  48. const fieldStyle = {
  49. height: '60rpx',
  50. color: '#333333',
  51. fontSize: '28rpx'
  52. };
  53. import { onLoad } from "@dcloudio/uni-app"
  54. const state = reactive({
  55. ocrData: {
  56. name: '',
  57. gender: '',
  58. userCardId: '',
  59. add: "",
  60. tel: ''
  61. },
  62. customerId: ''
  63. })
  64. const getUserinfo = () => {
  65. const options = {
  66. type: 2,
  67. data: { openId: getItem('openId') },
  68. method: "POST",
  69. showLoading: true,
  70. };
  71. request(userInfoQuery, options).then((res) => {
  72. const data = stringToJson(res.bizContent);
  73. console.log(data, "用户信息");
  74. state.ocrData.name = data.list[0].customerName
  75. state.ocrData.userCardId = data.list[0].customerIdNum
  76. state.ocrData.tel = data.list[0].tel
  77. state.customerId = data.list[0].customerId
  78. });
  79. }
  80. const timeClick = () => {
  81. msg('证件有效期')
  82. }
  83. const formSubmit = () => {
  84. navTo(`/subpackage/personal-center/setting/personal-information/user-card?customerId=${state.customerId}`)
  85. };
  86. onLoad(() => {
  87. getUserinfo()
  88. })
  89. </script>
  90. <style>
  91. page {
  92. background-color: #EEF7F7;
  93. padding-top: 30rpx;
  94. }
  95. </style>
  96. <style lang="scss" scoped>
  97. .content {
  98. background-color: white;
  99. :deep(.u-cell) {
  100. padding: 23rpx 32rpx;
  101. }
  102. ::v-deep .u-flex-1 {
  103. width: 100%;
  104. }
  105. }
  106. .subBtn {
  107. padding: 500rpx 40rpx 60rpx;
  108. }
  109. .tips {
  110. color: red;
  111. padding: 20rpx 28rpx 20rpx 16rpx;
  112. font-size: 30rpx;
  113. }
  114. </style>