setUp.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="container">
  3. <view class="cu-list menu text-left solid-top indexlow">
  4. <view class='cu-item' style='margin-bottom:10px;' @click="switchPicture">
  5. <view>
  6. <text>头像</text>
  7. </view>
  8. <view style='align-items: center;' class="flex">
  9. <view class="pictures">
  10. <image :src="headUrl" class="picture"></image>
  11. </view>
  12. <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow" ></image>
  13. </view>
  14. </view>
  15. <view class='cu-item' style='margin-bottom:10px;' @click="nickname(username)">
  16. <view>
  17. <text>昵称</text>
  18. </view>
  19. <view style='align-items: center;' class="flex">
  20. <view class="username">
  21. {{username}}
  22. </view>
  23. <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow" ></image>
  24. </view>
  25. </view>
  26. <view class='cu-item' @click='fankui'>
  27. <view>
  28. <text>意见反馈</text>
  29. </view>
  30. <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow" ></image>
  31. </view>
  32. </view>
  33. <view class='exitloginwrap'>
  34. <button @click='logout()' class='exitlogin'>退出登录</button>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import {
  40. mapState
  41. } from 'vuex';
  42. export default {
  43. data() {
  44. return {
  45. headUrl:"../../static/img/myimg/YongHu@3x.png",
  46. username:"",
  47. gridList: [
  48. {
  49. num:0,
  50. name: '退出登录',
  51. // icon:'cuIcon-exit',
  52. src:'../../static/img/sign/return@3x.png',
  53. tips: 0,
  54. url:'',
  55. show:true
  56. },
  57. ],
  58. }
  59. },
  60. computed: {
  61. // ...mapState(['hasLogin', 'userInfo'])
  62. },
  63. onShow() {
  64. this.getList()
  65. },
  66. onLoad() {
  67. },
  68. methods:{
  69. getList(){
  70. this.userInfo= uni.getStorageSync('userInfo')
  71. this.headUrl = this.userInfo.avatarUrl
  72. if(this.headUrl == null || this.headUrl == ""){
  73. this.headUrl="../../static/img/myimg/YongHu@3x.png"
  74. }
  75. this.username = this.userInfo.userName
  76. },
  77. switchPicture(){
  78. uni.navigateTo({
  79. url: `/pages/user/set_picture`
  80. })
  81. },
  82. nickname(username){
  83. uni.navigateTo({
  84. url: `/pages/user/set_nickname?nickname=${username}`
  85. })
  86. },
  87. exitlogin(){
  88. },
  89. fankui(){
  90. uni.navigateTo({
  91. url: `/pages/user/fankui`
  92. })
  93. },
  94. logout() {
  95. const that = this
  96. uni.showModal({
  97. title: '询问',
  98. content: '您确定要退出吗?',
  99. cancelText: '取消',
  100. confirmText: '确定',
  101. success: (e) => {
  102. if (e.confirm) {
  103. uni.hideTabBarRedDot({
  104. index:3
  105. })
  106. uni.clearStorageSync();
  107. that.$store.commit('logout')
  108. that.$api.logout()
  109. uni.navigateTo({
  110. url: `/pages/public/login`
  111. })
  112. }
  113. }
  114. })
  115. },
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. page{
  121. background-color: #F5F6FA;
  122. }
  123. .container {
  124. padding: 10px 0 0px;
  125. }
  126. .headPortrait {
  127. width: 100%;
  128. height: 52px;
  129. margin-top: 15px;
  130. background-color: #FFFFFF;
  131. border-radius: 6px;
  132. // justify-content: flex-end;
  133. }
  134. .title {
  135. font-size: 16px;
  136. line-height: 50px;
  137. font-weight: 600;
  138. margin-left: 10px;
  139. }
  140. .pictures {
  141. justify-content: flex-end;
  142. width: 35px;
  143. height: 35px;
  144. background-color: #E0FAF6;
  145. border-radius: 18px;
  146. }
  147. .picture {
  148. width: 35px;
  149. height: 35px;
  150. }
  151. .arrow {
  152. margin-left: 15px;
  153. width: 8px;
  154. height: 12px;
  155. // justify-content: flex-end
  156. }
  157. .username{
  158. line-height: 50px;
  159. color: #6D6D72;
  160. }
  161. .sign{
  162. width: 18px;
  163. height: 18px;
  164. top: 4px;
  165. margin-right: 6px;
  166. }
  167. .cu-list>.cu-item:after{
  168. border:none;
  169. }
  170. .exitloginwrap{
  171. position:fixed;
  172. bottom:0;
  173. left:0;
  174. width:100%;
  175. padding-bottom:20px;
  176. }
  177. .exitlogin{
  178. width:90%;
  179. background:#fff;
  180. border-radius:30px;
  181. color:#FB1E1E;
  182. font-size:17px;
  183. }
  184. .exitlogin:after{
  185. border:none;
  186. }
  187. </style>