set.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="container">
  3. <uni-list>
  4. <uni-list-item :title="$t('safe.f6')" clickable showArrow @click="navTo('/pages/user/set/userinfo')" ></uni-list-item>
  5. <!-- <uni-list-item :title="$t('safe.f7')" clickable showArrow @click="navTo('/pages/user/set/password')" ></uni-list-item> -->
  6. <uni-list-item :title="$t('safe.d1')" clickable showArrow @click="navTo('/pages/user/set/transaction')" ></uni-list-item>
  7. </uni-list>
  8. <view class="list-cell log-out-btn" @click="toLogout">
  9. <text class="cell-tit">{{$t('accountSettings.a9')}}</text>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import { logout } from '@/api/set.js';
  15. import {
  16. mapMutations
  17. } from 'vuex';
  18. export default {
  19. data() {
  20. return {
  21. };
  22. },
  23. methods:{
  24. ...mapMutations('user',['logout']),
  25. navTo(url){
  26. uni.navigateTo({
  27. url:url,
  28. fail(red) {
  29. console.log(red);
  30. }
  31. })
  32. },
  33. //退出登录
  34. toLogout(){
  35. let obj = this;
  36. uni.showModal({
  37. content: this.$t('login.b7'),
  38. success: (e)=>{
  39. if(e.confirm){
  40. logout({}).then((e) => {
  41. uni.navigateBack();
  42. }).catch((e) => {
  43. console.log(e);
  44. })
  45. obj.logout();
  46. }
  47. }
  48. });
  49. },
  50. }
  51. }
  52. </script>
  53. <style lang='scss'>
  54. page{
  55. background: #f3f3f3;
  56. }
  57. .list-cell{
  58. display:flex;
  59. align-items:baseline;
  60. padding: 20rpx $page-row-spacing;
  61. line-height:60rpx;
  62. position:relative;
  63. background: #fff;
  64. justify-content: center;
  65. &.log-out-btn{
  66. margin-top: 40rpx;
  67. .cell-tit{
  68. text-align: center;
  69. margin-right: 0;
  70. }
  71. }
  72. .cell-tit{
  73. flex: 1;
  74. font-size: $font-base + 2rpx;
  75. color: $font-color-dark;
  76. margin-right:10rpx;
  77. }
  78. .cell-tip{
  79. font-size: $font-base;
  80. color: $font-color-light;
  81. }
  82. switch{
  83. transform: translateX(16rpx) scale(.84);
  84. }
  85. }
  86. </style>