index.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view style="background-color: #fff;">
  3. <u-cell-group :border="false">
  4. <!-- <u-cell title="帮助和反馈" :clickable="true" @click="allClick('帮助和反馈')">
  5. </u-cell> -->
  6. <u-cell title="关于库比森轮胎" :clickable="true" @click="allClick('关于APP')">
  7. <view slot="right-icon">
  8. 版本{{versionNumber}}
  9. <uni-icons type="right" size="18" color='#CCCCCC'></uni-icons>
  10. </view>
  11. </u-cell>
  12. <u-cell title="注销账号" :clickable="true" @click="allClick('注销账号')">
  13. </u-cell>
  14. </u-cell-group>
  15. <view style="width: 100%;position:fixed; bottom:200rpx;padding: 0;">
  16. <view style="width:600rpx;margin: 0 auto;">
  17. <debounce-button type="primary" @click="logOut" text="退出登录" bgColor="#0F974C"></debounce-button>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import {
  24. deleteAccount
  25. } from "@/api/me/setting.js"
  26. export default {
  27. data() {
  28. return {
  29. name: '获取失败',
  30. versionNumber: '获取失败'
  31. }
  32. },
  33. created() {
  34. const systemInfo = uni.getSystemInfoSync();
  35. this.versionNumber = systemInfo.appVersion ? systemInfo.appVersion : '获取失败'
  36. },
  37. methods: {
  38. allClick(name) {
  39. if (name == '关于APP') {
  40. uni.navigateTo({
  41. url: '/pages/me/setting/aboutApp',
  42. });
  43. }
  44. if (name == '注销账号') {
  45. uni.showModal({
  46. title: '提示',
  47. content: '是否注销账号?',
  48. success: function(res) {
  49. if (res.confirm) {
  50. uni.showLoading({
  51. title: '加载中',
  52. mask: true
  53. });
  54. deleteAccount().then(res => {
  55. uni.removeStorageSync('accessToken')
  56. uni.removeStorageSync('userInfo')
  57. uni.reLaunch({
  58. url: '/pages/login/index'
  59. });
  60. })
  61. .finally(() => {
  62. uni.hideLoading()
  63. });
  64. }
  65. }
  66. });
  67. }
  68. },
  69. logOut() {
  70. uni.removeStorageSync('accessToken')
  71. uni.removeStorageSync('userInfo')
  72. uni.reLaunch({
  73. url: '/pages/login/index'
  74. });
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .head {
  81. padding-top: var(--status-bar-height);
  82. }
  83. .head ::v-deep.u-navbar-inner {
  84. z-index: -99999;
  85. }
  86. </style>