setting.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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')" v-if="false" ></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. uni.showToast({
  65. title: error,
  66. icon: "none"
  67. })
  68. })
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. /deep/.u-cell_title{
  75. color: rgba(51,51,51,1);
  76. }
  77. /deep/.u-cell__value{
  78. color: #777777;
  79. };
  80. .exit{
  81. background-color: #fff;
  82. margin: 24rpx 0 0 0 ;
  83. text-align: center;
  84. line-height: 96rpx;
  85. color: rgba(238,49,56,1);
  86. font-size: 32rpx;
  87. }
  88. </style>