index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view class="bg-white 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/images/my/right.png" style="line-height: 50upx;width: 20rpx;height: 30rpx;"></image>
  6. </view> -->
  7. <view class="flex align-center padding-tb" @click="goNav('/my/setting/feedback')" v-if="XCXIsSelect=='是'">
  8. <view class="flex-sub text-df" style="line-height: 50upx;">意见反馈</view>
  9. <image src="../../static/images/index/right2.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
  10. </image>
  11. </view>
  12. <view class="flex align-center padding-tb" @click="goNav('/my/setting/xieyi')">
  13. <view class="flex-sub text-df" style="line-height: 50upx;">用户协议</view>
  14. <image src="../../static/images/index/right2.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
  15. </image>
  16. </view>
  17. <view class="flex align-center padding-tb" @click="goNav('/my/setting/mimi')">
  18. <view class="flex-sub text-df" style="line-height: 50upx;">隐私政策</view>
  19. <image src="../../static/images/index/right2.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
  20. </image>
  21. </view>
  22. <view class="flex align-center padding-tb" @click="goNav('/my/setting/about')">
  23. <view class="flex-sub text-df" style="line-height: 50upx;">关于我们</view>
  24. <image src="../../static/images/index/right2.png" style="line-height: 50upx;width: 15rpx;height: 30rpx;">
  25. </image>
  26. </view>
  27. <view class="btn" @click="goOut">退出登录</view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. XCXIsSelect: '是',
  35. checked: true
  36. }
  37. },
  38. onLoad() {
  39. this.XCXIsSelect = this.$queue.getData('XCXIsSelect') ? this.$queue.getData('XCXIsSelect') : '是'
  40. this.getUserInfo()
  41. },
  42. methods: {
  43. change(val) {
  44. this.checked = val
  45. this.$Request.post('/app/user/updateSendMsg', {
  46. isSendMsg: this.checked == true ? 1 : 2
  47. }).then(res => {
  48. if (res.code === 0) {
  49. this.content = res.data.value;
  50. }
  51. });
  52. },
  53. getUserInfo() {
  54. this.$Request.get("/app/user/selectUserById").then(res => {
  55. if (res.code == 0) {
  56. this.checked = res.data.isSendMsg == null || res.data.isSendMsg == 1 ? true : false
  57. }
  58. });
  59. },
  60. goNav(e) {
  61. uni.navigateTo({
  62. url: e
  63. })
  64. },
  65. goOut() {
  66. uni.showModal({
  67. title: '提示',
  68. content: '确定退出登录吗?',
  69. success: function(res) {
  70. if (res.confirm) {
  71. console.log('用户点击确定');
  72. uni.removeStorageSync('userName')
  73. uni.removeStorageSync('avatar')
  74. uni.removeStorageSync('userId')
  75. uni.removeStorageSync('token')
  76. uni.removeStorageSync('phone')
  77. uni.removeStorageSync('zhiFuBaoName')
  78. uni.removeStorageSync('zhiFuBao')
  79. uni.removeStorageSync('invitationCode')
  80. uni.removeStorageSync('unionId')
  81. uni.removeStorageSync('openId')
  82. uni.removeStorageSync('isVIP')
  83. uni.removeStorageSync('wxCode')
  84. uni.removeStorageSync('wxQrCode')
  85. uni.removeStorageSync('sex')
  86. uni.showToast({
  87. title: '退出成功!',
  88. icon: 'none'
  89. })
  90. setTimeout(function() {
  91. uni.navigateBack()
  92. }, 1000)
  93. } else if (res.cancel) {
  94. console.log('用户点击取消');
  95. }
  96. }
  97. })
  98. }
  99. }
  100. }
  101. </script>
  102. <style>
  103. page {
  104. background-color: #FFF;
  105. }
  106. .btn {
  107. width: 100%;
  108. height: 80upx;
  109. background: #FFAF5E;
  110. border-radius: 6upx;
  111. text-align: center;
  112. line-height: 80upx;
  113. margin-top: 40upx;
  114. font-size: 34upx;
  115. color: #fff;
  116. }
  117. </style>