set.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class=" padding-lr">
  3. <view class="flex padding-tb" v-if="userId" @click="goNav('/pages/my/pwd')">
  4. <view class="flex-sub text-df" style="line-height: 50upx;">修改密码</view>
  5. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
  6. </image>
  7. </view>
  8. <view class="flex padding-tb" @click="goNav('/my/other/help')">
  9. <view class="flex-sub text-df" style="line-height: 50upx;">帮助中心</view>
  10. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
  11. </image>
  12. </view>
  13. <view class="flex padding-tb" @click="goNav('/my/other/xieyi')">
  14. <view class="flex-sub text-df" style="line-height: 50upx;">用户协议</view>
  15. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
  16. </image>
  17. </view>
  18. <view class="flex padding-tb" @click="goNav('/my/other/mimi')">
  19. <view class="flex-sub text-df" style="line-height: 50upx;">隐私政策</view>
  20. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
  21. </image>
  22. </view>
  23. <view class="flex padding-tb" @click="goNav('/my/other/about')">
  24. <view class="flex-sub text-df" style="line-height: 50upx;">关于我们</view>
  25. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
  26. </image>
  27. </view>
  28. <view class="btn" v-if="userId" @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. console.log('用户点击确定');
  57. uni.removeStorageSync('shopUserName')
  58. uni.removeStorageSync('shopCover')
  59. uni.removeStorageSync('userId')
  60. uni.removeStorageSync('token')
  61. uni.removeStorageSync('mobile')
  62. uni.removeStorageSync('zhiFuBaoName')
  63. uni.removeStorageSync('zhiFuBao')
  64. uni.removeStorageSync('invitationCode')
  65. uni.removeStorageSync('unionId')
  66. uni.removeStorageSync('openId')
  67. uni.removeStorageSync('shopToken')
  68. uni.removeStorageSync('shopId')
  69. uni.showToast({
  70. title: '退出成功!',
  71. icon: 'none'
  72. })
  73. uni.navigateBack()
  74. // that.isLogin = true
  75. // that.shopName = '匿名'
  76. // this.sumMoney = 0 //累计余额
  77. // this.dayMoney = 0 //今日收益
  78. // this.monthMoney = 0 //本月收益
  79. // this.cashMoney = 0 //本月提现
  80. // that.shopCover = '../../static/logo.png'
  81. // that.userId = uni.getStorageSync('userId')
  82. } else if (res.cancel) {
  83. console.log('用户点击取消');
  84. }
  85. }
  86. })
  87. } else {
  88. uni.showModal({
  89. title: '提示',
  90. content: '您还未登录,请先登录',
  91. success: function(res) {
  92. if (res.confirm) {
  93. console.log('用户点击确定');
  94. uni.navigateTo({
  95. url: '/pages/my/loginphone'
  96. })
  97. } else if (res.cancel) {
  98. console.log('用户点击取消');
  99. }
  100. }
  101. })
  102. }
  103. },
  104. }
  105. }
  106. </script>
  107. <style>
  108. page {
  109. background: #FFFFFF;
  110. }
  111. .btn {
  112. width: 100%;
  113. height: 80upx;
  114. background: #FFAF5E;
  115. border-radius: 6upx;
  116. text-align: center;
  117. line-height: 80upx;
  118. margin-top: 40upx;
  119. font-size: 34upx;
  120. /* color: #fff; */
  121. }
  122. </style>