system.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <!-- 系统设置 -->
  3. <view>
  4. <u-navbar title="系统设置" autoBack placeholder></u-navbar>
  5. <view class="card_system">
  6. <view class="space_between card_mine_option frame" @click="logOut">
  7. <view class="option_title">退出登录</view>
  8. <u-icon name="arrow-right" size="20"></u-icon>
  9. </view>
  10. <u-modal :show="logoutShow" showCancelButton :title="title" :content='content' @cancel="cancel"
  11. @confirm="confirm"></u-modal>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. logoutShow: false,
  20. title: '确定退出?',
  21. content: '退出登录后将无法查看订单,重新登录后即可查看'
  22. }
  23. },
  24. methods: {
  25. // 退出登录
  26. logOut() {
  27. this.logoutShow = true
  28. },
  29. // 确定退出登录
  30. confirm() {
  31. this.$cache.removeToken()
  32. this.$cache.removeCache('userInfo')
  33. uni.redirectTo({
  34. url: '/pages/login'
  35. })
  36. },
  37. // 取消
  38. cancel() {
  39. this.logoutShow = false
  40. },
  41. }
  42. }
  43. </script>
  44. <style lang="scss">
  45. .card_system {
  46. margin: 30rpx 30rpx 30rpx 30rpx;
  47. }
  48. .card_mine_option {
  49. margin: 40rpx 0rpx;
  50. // border-bottom: 2rpx solid #E4E7ED;
  51. padding-bottom: 30rpx;
  52. }
  53. .frame {
  54. position: relative; //重要
  55. }
  56. .frame::after {
  57. position: absolute;
  58. content: '';
  59. border-bottom: 2rpx solid #e7e6e4;
  60. // border-radius: 16rpx;
  61. width: 200%;
  62. height: 200%;
  63. top: 0;
  64. left: 0;
  65. transform: scale(0.5);
  66. transform-origin: 0 0;
  67. pointer-events: none;
  68. /* 使伪元素不会阻止鼠标事件 */
  69. }
  70. .option_title {
  71. font-size: 32rpx;
  72. font-weight: bold;
  73. }
  74. </style>