set.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class=" padding-lr">
  3. <!-- <view class="flex padding-tb" @click="goNav('/pages/public/pwd')">
  4. <view class="flex-sub text-df" style="line-height: 50upx;">修改密码</view>
  5. <image src="../../../static/image/go.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
  6. </image>
  7. </view> -->
  8. <view class="flex padding-tb" @click="goNav('/pages/riderMy/trainingList')">
  9. <view class="flex-sub text-df" style="line-height: 50upx;">帮助中心</view>
  10. <image src="../../../static/image/go.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
  11. </image>
  12. </view>
  13. <view class="flex padding-tb" @click="goNav('/pages/riderMy/set/xieyi')">
  14. <view class="flex-sub text-df" style="line-height: 50upx;">用户协议</view>
  15. <image src="../../../static/image/go.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
  16. </image>
  17. </view>
  18. <view class="flex padding-tb" @click="goNav('/pages/riderMy/set/mimi')">
  19. <view class="flex-sub text-df" style="line-height: 50upx;">隐私政策</view>
  20. <image src="../../../static/image/go.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
  21. </image>
  22. </view>
  23. <view class="flex padding-tb" @click="goNav('/pages/riderMy/set/about')">
  24. <view class="flex-sub text-df" style="line-height: 50upx;">关于我们</view>
  25. <image src="../../../static/image/go.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
  26. </image>
  27. </view>
  28. <view class="btn" @click="TuiLogin">退出登录</view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. userId: ""
  36. }
  37. },
  38. onLoad() {
  39. this.userId = uni.getStorageSync('userId')
  40. },
  41. methods: {
  42. goNav(e) {
  43. uni.navigateTo({
  44. url: e
  45. })
  46. },
  47. //退出登录
  48. TuiLogin() {
  49. let that = this
  50. if (that.userId) {
  51. uni.showModal({
  52. title: '提示',
  53. content: '确认退出登录吗?',
  54. success: function(res) {
  55. if (res.confirm) {
  56. uni.removeStorageSync('userId')
  57. uni.removeStorageSync('token')
  58. uni.removeStorageSync('avatar')
  59. uni.removeStorageSync('nickName')
  60. uni.removeStorageSync('phone')
  61. uni.removeStorageSync('invitationCode')
  62. uni.removeStorageSync('inviterCode')
  63. uni.removeStorageSync('platform')
  64. uni.removeStorageSync('sex')
  65. uni.removeStorageSync('zhiFuBao')
  66. uni.removeStorageSync('zhiFuBaoName')
  67. uni.removeStorageSync('checkCertification')
  68. // uni.navigateBack()
  69. uni.redirectTo({
  70. url:'/pages/index/index'
  71. })
  72. } else if (res.cancel) {
  73. console.log('用户点击取消');
  74. }
  75. }
  76. });
  77. } else {
  78. uni.showModal({
  79. title: '提示',
  80. content: '您还未登录,请先登录',
  81. success: function(res) {
  82. if (res.confirm) {
  83. console.log('用户点击确定');
  84. uni.navigateTo({
  85. url: '/pages/my/loginphone'
  86. })
  87. } else if (res.cancel) {
  88. console.log('用户点击取消');
  89. }
  90. }
  91. })
  92. }
  93. },
  94. }
  95. }
  96. </script>
  97. <style>
  98. page {
  99. background: #FFFFFF;
  100. }
  101. .btn {
  102. width: 100%;
  103. height: 80upx;
  104. background: #FF6A04;
  105. color: #FFFFFF;
  106. border-radius: 6upx;
  107. text-align: center;
  108. line-height: 80upx;
  109. margin-top: 40upx;
  110. font-size: 34upx;
  111. /* color: #fff; */
  112. }
  113. </style>