index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view class="page">
  3. <uni-list>
  4. <uni-list-item title="登录密码修改"
  5. :show-arrow="true"
  6. :show-badge="true"
  7. thumb="../../static/theme/default/my/password.png"
  8. @click="goPath('../set/password')"
  9. />
  10. </uni-list>
  11. <view class="uni-padding-wrap uni-common-mt login_out">
  12. <button type="primary" class="but-view" @tap="loginOut">退出登录</button>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import uniList from '../../components/uni-ui/uni-list/uni-list.vue';
  18. import uniListItem from '../../components/uni-ui/uni-list-item/uni-list-item.vue';
  19. import _action from '../../common/_action';
  20. import _hook from '../../common/_hook';
  21. import _data from '../../common/_data';
  22. export default {
  23. components: {
  24. uniList,
  25. uniListItem
  26. },
  27. data() {
  28. return {
  29. my_data: {},
  30. }
  31. },
  32. onShow(){
  33. _hook.routeTabBarHook();
  34. let _this = this;
  35. /** 监听新的个人数据 */
  36. uni.$on('data_user_info',function(data){
  37. _this.my_data = data;
  38. });
  39. },
  40. onLoad() {
  41. let _this = this;
  42. _this.my_data = _data.data('user_info');
  43. },
  44. onUnload(){
  45. uni.$off('data_user_info');
  46. },
  47. computed: {
  48. },
  49. methods: {
  50. loginOut(){
  51. /** 跳转到登陆界面 */
  52. _action.checkFail()
  53. uni.reLaunch({
  54. url: '/pages/in/login'
  55. });
  56. },
  57. goPath(path) {
  58. if(path){
  59. uni.navigateTo({
  60. url: path
  61. });
  62. }
  63. },
  64. },
  65. watch: {
  66. },
  67. }
  68. </script>
  69. <style>
  70. .login_out {
  71. margin-top: 100upx ;
  72. }
  73. .phto {
  74. width: 130upx;
  75. height: 130upx;
  76. margin-left: 30upx;
  77. margin-right: 30upx;
  78. }
  79. .my_padding {
  80. padding-bottom: 25px;
  81. }
  82. .but-view {
  83. border-radius: 40upx;
  84. height: 80upx;
  85. text-align: center;
  86. line-height: 80upx;
  87. font-size: 16px;;
  88. }
  89. .my_padding:before {
  90. background-color:white;
  91. }
  92. .uni-list {
  93. margin-bottom: 30upx;
  94. }
  95. </style>