index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class=" padding-lr">
  3. <!-- #ifndef MP-WEIXIN -->
  4. <view class="flex" @click="goNav('/pages/public/pwd')">
  5. <view class="flex-sub text-df" style="line-height: 50upx;">修改密码</view>
  6. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 30rpx;height: 30rpx;">
  7. </image>
  8. </view>
  9. <!-- #endif -->
  10. <view class="flex" @click="goNav('/my/order/tousuList')">
  11. <view class="flex-sub text-df" style="line-height: 50upx;">我的投诉</view>
  12. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 30rpx;height: 30rpx;">
  13. </image>
  14. </view>
  15. <view class="flex" @click="goNav('/my/help/feedbackIndex')">
  16. <view class="flex-sub text-df" style="line-height: 50upx;">帮助中心</view>
  17. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 30rpx;height: 30rpx;">
  18. </image>
  19. </view>
  20. <view class="flex" @click="goNav('/my/feedback/index')">
  21. <view class="flex-sub text-df" style="line-height: 50upx;">意见反馈</view>
  22. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 30rpx;height: 30rpx;">
  23. </image>
  24. </view>
  25. <view class="flex" @click="goNav('/my/setting/xieyi')">
  26. <view class="flex-sub text-df" style="line-height: 50upx;">用户协议</view>
  27. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 30rpx;height: 30rpx;">
  28. </image>
  29. </view>
  30. <view class="flex" @click="goNav('/my/setting/mimi')">
  31. <view class="flex-sub text-df" style="line-height: 50upx;">隐私政策</view>
  32. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 30rpx;height: 30rpx;">
  33. </image>
  34. </view>
  35. <view class="flex" v-if="isShow" @click="goNav('/my/setting/zhuxiao')">
  36. <view class="flex-sub text-df" style="line-height: 50upx;">注销账号</view>
  37. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 30rpx;height: 30rpx;">
  38. </image>
  39. </view>
  40. <view class="flex" @click="goNav('/my/setting/about')">
  41. <view class="flex-sub text-df" style="line-height: 50upx;">关于我们</view>
  42. <image src="../../static/images/my/right.png" style="line-height: 50upx;width: 30rpx;height: 30rpx;">
  43. </image>
  44. </view>
  45. <view v-if="isShow" class="btn" @click="TuiLogin">退出登录</view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. version: '',
  53. isShow: false
  54. }
  55. },
  56. onShow() {
  57. let token = this.$queue.getData('token');
  58. if (token) {
  59. this.isShow = true;
  60. }
  61. },
  62. onLoad() {
  63. // #ifdef APP-PLUS
  64. plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
  65. this.version = widgetInfo.version;
  66. });
  67. // #endif
  68. },
  69. methods: {
  70. //退出登录
  71. TuiLogin() {
  72. let that = this
  73. let userId = this.$queue.getData('userId');
  74. if (userId) {
  75. uni.showModal({
  76. title: '提示',
  77. content: '确定退出登录吗?',
  78. success: function(res) {
  79. if (res.confirm) {
  80. console.log('用户点击确定');
  81. uni.removeStorageSync('userName')
  82. uni.removeStorageSync('avatar')
  83. uni.removeStorageSync('userId')
  84. uni.removeStorageSync('token')
  85. uni.removeStorageSync('phone')
  86. uni.removeStorageSync('zhiFuBaoName')
  87. uni.removeStorageSync('zhiFuBao')
  88. uni.removeStorageSync('invitationCode')
  89. uni.removeStorageSync('unionId')
  90. uni.removeStorageSync('openId')
  91. uni.removeStorageSync('isVIP')
  92. uni.showToast({
  93. title: '退出成功!',
  94. icon: 'none'
  95. })
  96. uni.switchTab({
  97. url:'/pages/my/index'
  98. })
  99. } else if (res.cancel) {
  100. console.log('用户点击取消');
  101. }
  102. }
  103. })
  104. } else {
  105. uni.showModal({
  106. title: '提示',
  107. content: '您还未登录,请先登录',
  108. success: function(res) {
  109. if (res.confirm) {
  110. console.log('用户点击确定');
  111. uni.navigateTo({
  112. url: '/pages/public/login'
  113. })
  114. } else if (res.cancel) {
  115. console.log('用户点击取消');
  116. }
  117. }
  118. })
  119. }
  120. },
  121. goNav(e) {
  122. uni.navigateTo({
  123. url: e
  124. })
  125. },
  126. goOut() {
  127. uni.showModal({
  128. title: '提示',
  129. content: '确定退出登录吗?',
  130. success: function(res) {
  131. if (res.confirm) {
  132. console.log('用户点击确定');
  133. uni.removeStorageSync('userName')
  134. uni.removeStorageSync('avatar')
  135. uni.removeStorageSync('userId')
  136. uni.removeStorageSync('token')
  137. uni.removeStorageSync('phone')
  138. uni.removeStorageSync('zhiFuBaoName')
  139. uni.removeStorageSync('zhiFuBao')
  140. uni.removeStorageSync('invitationCode')
  141. uni.removeStorageSync('unionId')
  142. uni.removeStorageSync('openId')
  143. uni.removeStorageSync('isVIP')
  144. uni.showToast({
  145. title: '退出成功!',
  146. icon: 'none'
  147. })
  148. setTimeout(function() {
  149. uni.navigateBack()
  150. }, 1000)
  151. } else if (res.cancel) {
  152. console.log('用户点击取消');
  153. }
  154. }
  155. })
  156. }
  157. }
  158. }
  159. </script>
  160. <style scoped>
  161. .text-df{
  162. font-size: 28rpx;
  163. color: #222222;
  164. padding: 16rpx 0 !important;
  165. }
  166. .btn {
  167. width: 686rpx;
  168. height: 100rpx;
  169. line-height: 100rpx;
  170. background: linear-gradient( 143deg, #FFE6EE 0%, #FF9AB2 100%);
  171. border-radius: 86rpx 86rpx 86rpx 86rpx;
  172. text-align: center;
  173. font-weight: bold;
  174. font-size: 32rpx;
  175. color: #222222;
  176. position: fixed;
  177. bottom: 94rpx;
  178. left: 32rpx;
  179. }
  180. </style>