setting.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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" :asyncClose="true" title="退出账号"
  14. 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. this.homePage()
  29. },
  30. methods: {
  31. signOut() {
  32. this.show1 = true;
  33. },
  34. confirm() {
  35. uni.showLoading({
  36. title: "加载中",
  37. mask: true,
  38. })
  39. userApi.logout().then((res) => {
  40. uni.hideLoading();
  41. this.show1 = false;
  42. this.carhelp.logoff()
  43. uni.redirectTo({
  44. url: '/pages/login/login'
  45. })
  46. }).catch(error => {
  47. uni.showToast({
  48. title: error,
  49. icon: "none"
  50. })
  51. })
  52. },
  53. homePage(){
  54. uni.showLoading({
  55. title: "加载中",
  56. mask: true,
  57. })
  58. API.homePage({
  59. }).then((response) => {
  60. uni.hideLoading();
  61. this.personInfo=response.data.regUser;
  62. }).catch(error => {
  63. uni.hideLoading();
  64. })
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. /deep/.u-cell_title{
  71. color: rgba(51,51,51,1);
  72. }
  73. /deep/.u-cell__value{
  74. color: #777777;
  75. };
  76. .exit{
  77. background-color: #fff;
  78. margin: 24rpx 0 0 0 ;
  79. text-align: center;
  80. line-height: 96rpx;
  81. color: rgba(238,49,56,1);
  82. font-size: 32rpx;
  83. }
  84. </style>