You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

107 lines
1.9 KiB

  1. <template>
  2. <view class="container">
  3. <view class="list-cell b-b m-t" @click="navTo('/pages/userinfo/userinfo')" hover-class="cell-hover" :hover-stay-time="50">
  4. <text class="cell-tit">Change Password</text>
  5. <text class="cell-more yticon icon-you"></text>
  6. </view>
  7. <view class="list-cell log-out-btn" @click="toLogout">
  8. <text class="cell-tit">Sign Out</text>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import {
  14. mapMutations
  15. } from 'vuex';
  16. export default {
  17. data() {
  18. return {
  19. };
  20. },
  21. methods:{
  22. ...mapMutations(['logout']),
  23. navTo(url){
  24. uni.navigateTo({
  25. url:url
  26. });
  27. },
  28. //退出登录
  29. toLogout(){
  30. uni.showModal({
  31. cancelText:'Cancel',
  32. confirmText:'OK',
  33. content: 'Are you sure you want to log out',
  34. success: (e)=>{
  35. if(e.confirm){
  36. this.logout();
  37. setTimeout(()=>{
  38. uni.navigateBack();
  39. }, 200)
  40. }
  41. }
  42. });
  43. },
  44. //switch
  45. switchChange(e){
  46. let statusTip = e.detail.value ? '打开': '关闭';
  47. this.$api.msg(`${statusTip}消息推送`);
  48. },
  49. }
  50. }
  51. </script>
  52. <style lang='scss'>
  53. page{
  54. background: $page-color-base;
  55. }
  56. .list-cell{
  57. display:flex;
  58. align-items:baseline;
  59. padding: 20upx $page-row-spacing;
  60. line-height:60upx;
  61. position:relative;
  62. background: #fff;
  63. justify-content: center;
  64. &.log-out-btn{
  65. margin-top: 40upx;
  66. .cell-tit{
  67. color: $uni-color-primary;
  68. text-align: center;
  69. margin-right: 0;
  70. }
  71. }
  72. &.cell-hover{
  73. background:#fafafa;
  74. }
  75. &.b-b:after{
  76. left: 30upx;
  77. }
  78. &.m-t{
  79. margin-top: 16upx;
  80. }
  81. .cell-more{
  82. align-self: baseline;
  83. font-size:$font-lg;
  84. color:$font-color-light;
  85. margin-left:10upx;
  86. }
  87. .cell-tit{
  88. flex: 1;
  89. font-size: $font-base + 2upx;
  90. color: $font-color-dark;
  91. margin-right:10upx;
  92. }
  93. .cell-tip{
  94. font-size: $font-base;
  95. color: $font-color-light;
  96. }
  97. switch{
  98. transform: translateX(16upx) scale(.84);
  99. }
  100. }
  101. </style>