setting.vue 980 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!-- 设置 -->
  2. <template>
  3. <view class="setting">
  4. <u-cell-group :border="false" :title-style="{'color': '#333333', 'font-size': '24rpx'}">
  5. <u-cell-item icon="" title="退出登录" @click=" logoutModal = true"/>
  6. <u-cell-item icon="" title="版本信息" :arrow="false" value="当前版本8.9,已更新"/>
  7. </u-cell-group>
  8. <!-- 退出登录提示框 -->
  9. <u-modal
  10. v-model="logoutModal"
  11. width="70%"
  12. @confirm="logout"
  13. content="您确认退出登录吗?"
  14. :show-cancel-button="true"
  15. />
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. name: 'Setting',
  21. data() {
  22. return {
  23. // 登出提示框
  24. logoutModal: false
  25. }
  26. },
  27. methods: {
  28. /**
  29. * 退出登录
  30. */
  31. logout() {
  32. this.$u.vuex('vuex_hasLogin', false);
  33. this.$u.vuex('vuex_token', '');
  34. this.$u.vuex('vuex_user', '');
  35. this.$u.route('/pages/phoneLogin/phoneLogin');
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. .setting {
  42. padding: 20rpx 30rpx;
  43. }
  44. </style>