setting.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <div class="body">
  3. <!-- 选择类型 -->
  4. <back :title="titlename"></back>
  5. <div class="list">
  6. <router-link to="/Forgetpassword">
  7. <span>修改密码</span>
  8. </router-link>
  9. <router-link to="">
  10. <span>关于</span>
  11. </router-link>
  12. <router-link to="/Sytk">
  13. <span>使用条款</span>
  14. </router-link>
  15. </div>
  16. <div class="btn">
  17. <van-button color="#00c4b8" @click="loginout">退出登录</van-button>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. titlename: "设置",
  26. userId: "",
  27. user: [],
  28. };
  29. },
  30. created: function () {
  31. this.isLogin();
  32. this.userId = localStorage.getItem("userId");
  33. //this.openid = '123'
  34. },
  35. methods: {
  36. //跳转
  37. getUser() {
  38. this.$http
  39. .post(
  40. this.$store.state.host + "/interface/getUser",
  41. {
  42. userId: this.userId,
  43. },
  44. {
  45. emulateJSON: true,
  46. }
  47. )
  48. .then(
  49. (res) => {
  50. //发送成功
  51. if (res.body.code == 0) {
  52. this.user = res.body.userPd;
  53. console.log(this.user);
  54. }
  55. //if()
  56. },
  57. (res) => {
  58. //发送失败
  59. }
  60. );
  61. },
  62. // 退出登录
  63. loginout() {
  64. localStorage.removeItem("userId");
  65. localStorage.removeItem("openid");
  66. window.location.href = "http://47.101.145.23/wuliu/";
  67. },
  68. },
  69. };
  70. </script>
  71. <style lang="less" scoped>
  72. body {
  73. background: #fbfbfb;
  74. }
  75. .body {
  76. .head {
  77. padding: 0.43rem 0.38rem;
  78. font-size: 0.24rem;
  79. color: #999;
  80. display: flex;
  81. background: white;
  82. flex-wrap: wrap;
  83. position: relative;
  84. img {
  85. width: 1.48rem;
  86. height: 1.48rem;
  87. border-radius: 50%;
  88. margin-right: 0.4rem;
  89. }
  90. div {
  91. p:nth-of-type(1) {
  92. font-size: 0.36rem;
  93. font-weight: bold;
  94. color: #333;
  95. margin-bottom: 0.2rem;
  96. padding-top: 0.3rem;
  97. }
  98. }
  99. div:after {
  100. content: "";
  101. display: block;
  102. width: 0.2rem;
  103. height: 0.2rem;
  104. border-left: 0.01rem solid #333;
  105. border-top: 0.01rem solid #333;
  106. transform: rotate(135deg);
  107. position: absolute;
  108. right: 0.38rem;
  109. top: 1rem;
  110. }
  111. }
  112. .list {
  113. background: white;
  114. margin-top: 0.36rem;
  115. border-radius: 0.05rem;
  116. a {
  117. font-size: 0.3rem;
  118. display: block;
  119. color: #333;
  120. padding: 0.3rem 0.4rem;
  121. border-bottom: 1px solid #f4f3f3;
  122. position: relative;
  123. img {
  124. width: 0.4rem;
  125. height: 0.4rem;
  126. }
  127. span {
  128. position: relative;
  129. top: -0.075rem;
  130. margin-left: 0rem;
  131. }
  132. }
  133. a:after {
  134. content: "";
  135. display: block;
  136. width: 0.2rem;
  137. height: 0.2rem;
  138. border-left: 0.01rem solid #b8b8b8;
  139. border-top: 0.01rem solid #b8b8b8;
  140. transform: rotate(135deg);
  141. position: absolute;
  142. right: 0.4rem;
  143. top: 0.4rem;
  144. }
  145. }
  146. .btn {
  147. padding: 0px 0.37rem;
  148. button {
  149. width: 100%;
  150. color: white;
  151. }
  152. }
  153. }
  154. </style>