safe.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div style="background-color: #f5f5f5;">
  3. <van-nav-bar title="安全中心" left-text="返回" @click-left="$route_back" left-arrow>
  4. </van-nav-bar>
  5. <div class="user_index_scroller_com">
  6. <scroller>
  7. <van-cell-group class="user-group">
  8. <van-cell title="修改密码" is-link to="/change_pwd">
  9. <template slot="icon"><icon name="kttx" class="key-icon"></icon></template>
  10. </van-cell>
  11. </van-cell-group>
  12. <van-cell-group class="user-group">
  13. <van-cell icon="phone-o" title="修改手机号" is-link to="/change_phone">{{userinfo.mobile | mobile}}</van-cell>
  14. </van-cell-group>
  15. </scroller>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. export default {
  21. filters:{
  22. mobile(tel){
  23. if(tel){
  24. return tel==''?tel:tel.replace(tel.substring(3, 7), '****')
  25. }
  26. return ''
  27. }
  28. },
  29. methods:{
  30. logout(){
  31. let self = this
  32. this.$dialog.confirm({
  33. title: '退出登录',
  34. message: '您确定要退出吗?'
  35. }).then(() => {
  36. if (window.plus) {
  37. plus.storage.removeItem('user_info')
  38. } else {
  39. localStorage.removeItem('user_info')
  40. }
  41. self.$router.push({name: 'login'})
  42. }).catch(() => {
  43. // on cancel
  44. });
  45. }
  46. },
  47. data(){
  48. return {
  49. userinfo: this.$store.getters.user_info
  50. }
  51. }
  52. }
  53. </script>
  54. <style scoped>
  55. .user-group{margin-top:0.16rem;}
  56. .user_index_scroller_com{height: 100%; position: relative;}
  57. .user_index_header_com{height: 3.5rem; position: relative; z-index:2; padding-top:0.6rem;}
  58. .header_avatar_com{padding:0.32rem;}
  59. .user_nickname_com{text-align: center; line-height: 2;}
  60. .user_index_header_com .header_avatar{width:1.5rem; display: block; margin:0 auto;
  61. height: 1.5rem;
  62. -webkit-border-radius: 2.5rem;
  63. -moz-border-radius: 2.5rem;
  64. border-radius: 2.5rem;}
  65. .user_index_header_bg{position: absolute; width:20rem;
  66. height: 20rem;
  67. -webkit-border-radius: 5rem;
  68. top:-16rem;
  69. left:50%;
  70. margin-left:-10rem;
  71. background-color: #b8cc70;
  72. -moz-border-radius: 10rem;
  73. border-radius: 10rem; z-index:1;}
  74. .key-icon{width:0.32rem;
  75. height: 0.32rem; margin-top:0.08rem; margin-right:0.2rem;}
  76. </style>