index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="main">
  3. <view class="one">
  4. <view class="one_1">
  5. <image class="image" :src="user.logo&&user.logo.length>0?user.logo[0].url:'../../static/doctor.jpg'"
  6. mode=""></image>
  7. <view class="right">
  8. <text class="name">{{user.name||'微信用户'}}</text>
  9. <text class="phone">电话:{{user.phone||'暂无'}}</text>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="two">
  14. <view class="list" v-for="(item, index) in menuList" :key="index" @click="toCommon(item.route)">
  15. <view class="left">
  16. <view class="icon">
  17. <text class="iconfont" :class="[item.icon]"></text>
  18. </view>
  19. <text class="title">{{item.title||'暂无'}}</text>
  20. </view>
  21. <view class="right">
  22. <text class="iconfont icon-dayuhao"></text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. user: {},
  33. // 菜单
  34. menuList: []
  35. }
  36. },
  37. onLoad: async function() {
  38. const that = this;
  39. await that.searchOther();
  40. },
  41. onShow: async function(e) {
  42. const that = this;
  43. that.searchToken();
  44. await that.search();
  45. },
  46. methods: {
  47. searchToken() {
  48. const that = this;
  49. try {
  50. const res = uni.getStorageSync('token');
  51. if (res) that.$set(that, `user`, res);
  52. } catch (e) {
  53. uni.showToast({
  54. title: err.errmsg,
  55. icon: 'error',
  56. duration: 2000
  57. });
  58. }
  59. },
  60. // 查询
  61. async search() {
  62. const that = this;
  63. let res;
  64. // res = await that.$api(`/user`, 'GET', {
  65. // user: that.user._id
  66. // })
  67. // if (res.errcode == '0') {
  68. // that.$set(that, `list`, res.data)
  69. // } else {
  70. // uni.showToast({
  71. // title: res.errmsg,
  72. // });
  73. // }
  74. },
  75. // 公共跳转
  76. toCommon(e) {
  77. uni.navigateTo({
  78. url: `/${e}`
  79. })
  80. },
  81. async searchOther() {
  82. const that = this;
  83. let config = that.$config;
  84. that.$set(that, `menuList`, config.menuList);
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .main {
  91. display: flex;
  92. flex-direction: column;
  93. width: 100vw;
  94. height: 100vh;
  95. background-image: linear-gradient(to top, rgba(241, 241, 241, 1), rgba(241, 241, 241, 1), rgba(0, 122, 255, 1));
  96. .one {
  97. .one_1 {
  98. padding: 15vw 5vw;
  99. display: flex;
  100. align-items: center;
  101. .image {
  102. width: 15vw;
  103. height: 15vw;
  104. border-radius: 2vw;
  105. margin: 0 2vw;
  106. }
  107. .right {
  108. display: flex;
  109. flex-direction: column;
  110. .name {
  111. font-size: var(--font18Size);
  112. }
  113. .phone {
  114. margin: 1vw 0 0 0;
  115. font-size: var(--font14Size);
  116. color: var(--f99Color);
  117. }
  118. }
  119. }
  120. }
  121. .two {
  122. display: flex;
  123. flex-direction: column;
  124. padding: 2vw;
  125. margin: 2vw;
  126. border-radius: 10px;
  127. background-color: var(--mainColor);
  128. .list {
  129. display: flex;
  130. justify-content: space-between;
  131. padding: 2vw;
  132. border-bottom: 1px solid var(--f9Color);
  133. .left {
  134. display: flex;
  135. align-items: center;
  136. .icon {
  137. padding: 0 1vw 0 0;
  138. .iconfont {
  139. color: var(--f3CColor);
  140. font-size: var(--font18Size);
  141. }
  142. }
  143. .title {
  144. display: inline-block;
  145. font-size: var(--font14Size);
  146. }
  147. }
  148. .right {
  149. font-size: var(--font12Size);
  150. color: var(--f99Color);
  151. }
  152. }
  153. }
  154. }
  155. </style>