1
0

setting.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="main pdt0">
  3. <view class="cmd pdt0">
  4. <view class="s_item" @click="go('/pages/user/info')" v-if="user.doctor">
  5. <text class="icon ic" style="color: #9e9e9e">&#xe616;</text>
  6. <text class="title">个人信息</text>
  7. <text class="icon arrow">&#xe62b;</text>
  8. </view>
  9. <view class="s_item" @click="go('/pages/user/bind/index')" v-if="!user.doctor">
  10. <text class="icon ic" style="color: #9e9e9e">&#xe62d;</text>
  11. <text class="title">绑定就诊人</text>
  12. <text class="icon arrow">&#xe62b;</text>
  13. </view>
  14. <view class="s_item" @click="go('/pages/user/pass')" v-if="user.doctor">
  15. <text class="icon ic" style="color: #4caf50">&#xe613;</text>
  16. <text class="title">修改密码</text>
  17. <text class="icon arrow">&#xe62b;</text>
  18. </view>
  19. </view>
  20. <button class="btn" @click="exit()">退出登陆</button>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. user: this.getUser()
  28. };
  29. },
  30. methods: {
  31. go(url) {
  32. uni.navigateTo({ url: url });
  33. },
  34. exit() {
  35. uni.showModal({
  36. title: '提示',
  37. content: '确定退出登陆?',
  38. success: (res) => {
  39. if (res.confirm) {
  40. this.http.request({
  41. url: this.getUser().doctor ? '/logout' : '/app/user/exit',
  42. success: (res) => {
  43. uni.removeStorageSync('user');
  44. uni.navigateBack();
  45. }
  46. });
  47. }
  48. }
  49. });
  50. }
  51. }
  52. };
  53. </script>
  54. <style lang="scss"></style>