setting.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view>
  3. <u-navbar title="设置" title-color="#101010"></u-navbar>
  4. <u-cell-group>
  5. <!-- <u-cell-item title="个人信息" @click="gotoUrl('/pages/mine/personInfos')"></u-cell-item> -->
  6. <u-cell-item title="修改密码" @click="gotoUrl('/pages/mine/changePassword')"></u-cell-item>
  7. <u-cell-item title="修改手机号" :value="personInfo.phone" @click="gotoUrl('/pages/mine/changePhone')"></u-cell-item>
  8. <u-cell-item title="注销账号" @click="gotoUrl('/pages/mine/cancelAccount')"></u-cell-item>
  9. </u-cell-group>
  10. <view class="exit" @click="signOut">
  11. 退出账号
  12. </view>
  13. <u-modal v-model="show1" @confirm="confirm" confirm-color="#FF3D00" :show-cancel-button="true" ref="uModal"
  14. :asyncClose="true" title="退出账号" content="是否退出当前账号?" :content-style="{color: '#333333'}"></u-modal>
  15. </view>
  16. </template>
  17. <script>
  18. import * as userApi from '@/apis/pagejs/user.js'
  19. // import * as API from '@/apis/pagejs/index.js'
  20. export default {
  21. data() {
  22. return {
  23. personInfo: {},
  24. show1: false,
  25. }
  26. },
  27. onLoad() {
  28. if(this.carhelp.getPersonInfoPlus()) {
  29. var data = this.carhelp.getPersonInfoPlus();
  30. this.personInfo = data.regUser;
  31. if(this.personInfo.phone != null) {
  32. var phone = this.personInfo.phone;
  33. phone = phone.slice(0,3) + '****' + phone.slice(-4);
  34. this.personInfo.phone = phone;
  35. }
  36. }
  37. //this.homePage()
  38. },
  39. methods: {
  40. signOut() {
  41. this.show1 = true;
  42. },
  43. confirm() {
  44. uni.showLoading({
  45. title: "加载中",
  46. mask: true,
  47. })
  48. userApi.logout().then((res) => {
  49. uni.hideLoading();
  50. this.show1 = false;
  51. this.carhelp.logoff()
  52. uni.redirectTo({
  53. url: '/pages/login/login'
  54. })
  55. }).catch(error => {
  56. uni.showToast({
  57. title: error,
  58. icon: "none"
  59. })
  60. })
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. ::v-deep.u-cell_title {
  67. color: rgba(51, 51, 51, 1);
  68. }
  69. ::v-deep.u-cell__value {
  70. color: #777777;
  71. }
  72. ;
  73. .exit {
  74. background-color: #fff;
  75. margin: 24rpx 0 0 0;
  76. text-align: center;
  77. line-height: 96rpx;
  78. color: rgba(238, 49, 56, 1);
  79. font-size: 32rpx;
  80. }
  81. </style>