index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <view class="center">
  3. <view class="logo" >
  4. <image class="logo-img" :src="avatarUrl"></image>
  5. <view class="logo-title" style="margin-top: -40px;">
  6. <text class="uer-name" style="font-size: 25px;">账号:{{username}}<br><div style="font-size: 20px;">姓名:{{remark}}</div></text>
  7. <!-- <text class="go-login navigat-arrow" v-if="!login">&#xe65e;</text> -->
  8. </view>
  9. </view>
  10. <view class="center-list">
  11. <view class="center-list-item border-bottom" @click="updatemm">
  12. <text class="list-icon">&#xe60f;</text>
  13. <text class="list-text">修改密码</text>
  14. <text class="navigat-arrow">&#xe65e;</text>
  15. </view>
  16. <view class="center-list-item">
  17. <text class="list-icon">&#xe639;</text>
  18. <text class="list-text">新消息通知</text>
  19. <text class="navigat-arrow">&#xe65e;</text>
  20. </view>
  21. </view>
  22. <view class="center-list">
  23. <view class="center-list-item border-bottom">
  24. <text class="list-icon">&#xe60b;</text>
  25. <text class="list-text">帮助与反馈</text>
  26. <text class="navigat-arrow">&#xe65e;</text>
  27. </view>
  28. <view class="center-list-item">
  29. <text class="list-icon">&#xe65f;</text>
  30. <text class="list-text">服务条款及隐私</text>
  31. <text class="navigat-arrow">&#xe65e;</text>
  32. </view>
  33. </view>
  34. <view class="center-list">
  35. <view class="center-list-item" @click="clickabout">
  36. <text class="list-icon">&#xe614;</text>
  37. <text class="list-text">关于应用</text>
  38. <text class="navigat-arrow">&#xe65e;</text>
  39. </view>
  40. </view>
  41. <!-- <view class="center-list">
  42. <view class="center-list-item" @click="clickupdate">
  43. <text class="list-icon">&#xe614;</text>
  44. <text class="list-text">检查升级</text>
  45. <text style="margin-right:30px;margin-top: 15px;">版本:{{version}}</text>
  46. </view>
  47. </view> -->
  48. <view class="center-list">
  49. <view class="center-list-item" @click="logout">
  50. <text class="list-icon">&#xe614;</text>
  51. <text class="list-text">注销登录</text>
  52. <text class="navigat-arrow">&#xe65e;</text>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import {logout} from '@/config/api.js';
  59. const config = require('@/config/request.js');
  60. export default {
  61. data() {
  62. return {
  63. version:'',
  64. avatarUrl: '',
  65. username:'',
  66. remark:'',
  67. show:true,
  68. login: false,
  69. uerInfo: {}
  70. }
  71. },
  72. async onLoad() {
  73. //检查是否登录
  74. if(!this.$u.utils.isLogin()) return
  75. this.version=uni.getSystemInfoSync().appWgtVersion; //当前App版本号
  76. this.avatarUrl=uni.$u.http.config.baseURL+this.vuex_token.head_img
  77. this.username=this.vuex_token.username
  78. this.remark=this.vuex_token.remark
  79. // console.log(uni.$u.http.config.baseURL)
  80. },
  81. onPullDownRefresh() {
  82. this.clickupdate()
  83. console.log('refresh');
  84. setTimeout(function () {
  85. uni.stopPullDownRefresh();
  86. }, 1000);
  87. },
  88. methods: {
  89. updatemm: function(e){
  90. // console.log(1111)
  91. uni.navigateTo({
  92. url:"/pages/center/mmxg/mmxg"
  93. })
  94. },
  95. clickabout: function(e){
  96. uni.navigateTo({
  97. url:"/pages/center/about/about"
  98. })
  99. },
  100. logout: function(e){
  101. const params={
  102. id:this.vuex_token.id,
  103. }
  104. this.dologout(params)
  105. },
  106. async dologout(params){
  107. var res=await logout(params);
  108. // console.log(res)
  109. if(res.code==200){
  110. this.$u.toast('退出成功!')
  111. //this.$u.vuex('vuex_username',null)
  112. this.$u.vuex('vuex_token',null)
  113. setTimeout(()=>{
  114. this.$u.route({
  115. type:'redirect',
  116. url: 'pages/auth/login',
  117. })
  118. },2500)
  119. }
  120. },
  121. }
  122. }
  123. </script>
  124. <style>
  125. @font-face {
  126. font-family: texticons;
  127. font-weight: normal;
  128. font-style: normal;
  129. src: url('https://at.alicdn.com/t/font_984210_5cs13ndgqsn.ttf') format('truetype');
  130. }
  131. page,
  132. view {
  133. display: flex;
  134. }
  135. page {
  136. background-color: #f8f8f8;
  137. }
  138. .center {
  139. flex-direction: column;
  140. }
  141. .logo {
  142. width: 750upx;
  143. height: 240upx;
  144. padding: 20upx;
  145. box-sizing: border-box;
  146. background-color: #4cd964;
  147. flex-direction: row;
  148. align-items: center;
  149. }
  150. .logo-hover {
  151. opacity: 0.8;
  152. }
  153. .logo-img {
  154. width: 150upx;
  155. height: 150upx;
  156. border-radius: 150upx;
  157. }
  158. .logo-title {
  159. height: 150upx;
  160. flex: 1;
  161. align-items: center;
  162. justify-content: space-between;
  163. flex-direction: row;
  164. margin-left: 20upx;
  165. }
  166. .uer-name {
  167. height: 60upx;
  168. line-height: 60upx;
  169. font-size: 38upx;
  170. color: #FFFFFF;
  171. }
  172. .go-login.navigat-arrow {
  173. font-size: 38upx;
  174. color: #FFFFFF;
  175. }
  176. .login-title {
  177. height: 150upx;
  178. align-items: self-start;
  179. justify-content: center;
  180. flex-direction: column;
  181. margin-left: 20upx;
  182. }
  183. .center-list {
  184. background-color: #FFFFFF;
  185. margin-top: 20upx;
  186. width: 750upx;
  187. flex-direction: column;
  188. }
  189. .center-list-item {
  190. height: 90upx;
  191. width: 750upx;
  192. box-sizing: border-box;
  193. flex-direction: row;
  194. padding: 0upx 20upx;
  195. }
  196. .border-bottom {
  197. border-bottom-width: 1upx;
  198. border-color: #c8c7cc;
  199. border-bottom-style: solid;
  200. }
  201. .list-icon {
  202. width: 40upx;
  203. height: 90upx;
  204. line-height: 90upx;
  205. font-size: 34upx;
  206. color: #4cd964;
  207. text-align: center;
  208. font-family: texticons;
  209. margin-right: 20upx;
  210. }
  211. .list-text {
  212. height: 90upx;
  213. line-height: 90upx;
  214. font-size: 34upx;
  215. color: #555;
  216. flex: 1;
  217. text-align: left;
  218. }
  219. .navigat-arrow {
  220. height: 90upx;
  221. width: 40upx;
  222. line-height: 90upx;
  223. font-size: 34upx;
  224. color: #555;
  225. text-align: right;
  226. font-family: texticons;
  227. }
  228. </style>