myAccount.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view>
  3. <view class="infoItem">
  4. <u-text text="姓名"></u-text>
  5. <u-text :text="name" align="right"></u-text>
  6. </view>
  7. <view class="infoItem">
  8. <u-text text="身份证号"></u-text>
  9. <u-text :text="idNumber" align="right"></u-text>
  10. </view>
  11. <view class="infoItem">
  12. <u-text text="手机号"></u-text>
  13. <u-text :text="phone" align="right"></u-text>
  14. </view>
  15. <view>
  16. <u-modal :show="modalShow" :content="modalContent" @confirm="modalShow=false"></u-modal>
  17. </view>
  18. <view class="btn">
  19. <u-button text="修改信息" color="#7896F5" @click="gotoUpdateNameAndIdNumber"></u-button>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {
  25. mapMutations,
  26. mapState
  27. } from 'vuex'
  28. export default {
  29. data() {
  30. return {
  31. name: '',
  32. phone: '',
  33. idNumber: '',
  34. canNameUpdate: false,
  35. modalShow: false,
  36. modalContent: '请完善姓名及身份证号以正常使用!'
  37. };
  38. },
  39. computed: {
  40. ...mapState('m_user', ['token', 'userInfo'])
  41. },
  42. methods: {
  43. gotoUpdateNameAndIdNumber(){
  44. uni.navigateTo({
  45. url: '/subpkg/updateNameAndIdNumber/updateNameAndIdNumber'
  46. })
  47. }
  48. },
  49. onShow() {
  50. this.name = this.userInfo.name ? this.userInfo.name[0] + '**' : '';
  51. this.idNumber = this.userInfo.idNumber.slice(0, 6) + '********' + this.userInfo.idNumber.slice(14, 18);
  52. this.phone = this.userInfo.phone;
  53. },
  54. onLoad(options) {
  55. if (options.needSetIdNumber === 'true') {
  56. this.modalShow = true
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. .infoItem {
  63. height: 100rpx;
  64. display: flex;
  65. justify-content: space-between;
  66. align-items: center;
  67. margin: 0 40rpx;
  68. border-bottom: black 1px solid;
  69. }
  70. .btn{
  71. margin: 40rpx auto;
  72. width: 80vw;
  73. color: #FFFFFF;
  74. }
  75. </style>