my.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="page">
  3. <view class="top">
  4. <view class="wd">
  5. <view class="qw"><image :src="user == '' ? '../../static/ls.jpg' : user.avatarUrl" class="head"></image></view>
  6. <view class="xs" @click="navigate('/pages/user/info')">
  7. <view v-if="user == ''">登录 / 注册</view>
  8. <view class="nickName" v-else>{{ user.nickName }}</view>
  9. <view class="nh">{{ user == '' ? '你还未登陆' : ' 你好,欢迎来到智慧旅游' }}</view>
  10. </view>
  11. </view>
  12. <image :src="ip + aboutUs.showPictures[1]" mode="aspectFill" v-if="aboutUs.showPictures.length>1"></image>
  13. <image src="../../static/bj.jpg" mode="aspectFill" v-else></image>
  14. </view>
  15. <view class="sjia" @click="navigate('/pages/shop/list')" v-if="user != ''"><text>商家中心</text></view>
  16. <view class="main">
  17. <view class="flex menu">
  18. <view class="f" @click="navigate('/pages/order/my')">
  19. <view class="icon" style="background-color: #607D8B">&#xe636;</view>
  20. <view class="title">我的预约</view>
  21. </view>
  22. <view class="f">
  23. <view class="icon" style="background-color: #e23e33;">&#xe610;</view>
  24. <view class="title">我的投诉</view>
  25. </view>
  26. <view class="f">
  27. <view class="icon" style="background-color: #2cc937;">&#xe656;</view>
  28. <view class="title">我的评论</view>
  29. </view>
  30. <view class="f">
  31. <view class="icon" style="background-color: #2196F3;">&#xe623;</view>
  32. <view class="title">我的旅途</view>
  33. </view>
  34. </view>
  35. <view class="list">
  36. <view class="item hr" @click="navigate('/pages/user/info')">
  37. <text class="icon ic">&#xe626;</text>
  38. <text>个人资料</text>
  39. </view>
  40. <view class="item" @click="navigate('/pages/other/about')">
  41. <text class="icon ic">&#xe65f;</text>
  42. <text>关于我们</text>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. ip: this.$http.urls.ip,
  53. user: this.$getUser(),
  54. aboutUs:{showPictures:[]}
  55. };
  56. },
  57. onLoad() {
  58. this.aboutUs=uni.getStorageSync('aboutUs');
  59. },
  60. onShow() {
  61. this.user = this.$getUser();
  62. },
  63. methods: {
  64. navigate(url) {
  65. if (this.$hasLogin()) {
  66. uni.navigateTo({ url: url });
  67. } else {
  68. uni.navigateTo({ url: '/pages/user/login' });
  69. }
  70. }
  71. }
  72. };
  73. </script>
  74. <style lang="scss">
  75. .top {
  76. position: relative;
  77. height: 300px;
  78. color: white;
  79. .wd {
  80. position: absolute;
  81. top: 70px;
  82. left: 20px;
  83. z-index: 11;
  84. .head {
  85. width: 75px;
  86. height: 75px;
  87. border-radius: 50%;
  88. }
  89. .xs {
  90. margin-left: 90px;
  91. width: 100%;
  92. font-weight: bold;
  93. margin-top: 10px;
  94. .nickName {
  95. margin-top: 20px;
  96. }
  97. .nh {
  98. font-size: 12px;
  99. font-weight: normal;
  100. margin-top: 5px;
  101. }
  102. }
  103. }
  104. image {
  105. width: 100%;
  106. height: 300px;
  107. position: absolute;
  108. }
  109. }
  110. .main {
  111. padding: 15px 15px 50px 15px;
  112. width: 100%;
  113. margin-top: -50px;
  114. overflow: hidden;
  115. position: absolute;
  116. .menu {
  117. background-color: white;
  118. border-radius: 10px;
  119. padding: 15px;
  120. width: 100%;
  121. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  122. .icon {
  123. font-size: 30px;
  124. background-color: red;
  125. width: 38px;
  126. height: 38px;
  127. border-radius: 5px;
  128. margin: 0 auto;
  129. color: white;
  130. padding: 3px;
  131. }
  132. .title {
  133. padding-top: 4px;
  134. font-size: 13px;
  135. }
  136. }
  137. .list {
  138. margin-top: 10px;
  139. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  140. border-radius: 5px;
  141. .item {
  142. padding: 15px;
  143. .ic {
  144. font-size: 20px;
  145. padding-right: 10px;
  146. }
  147. .arrow {
  148. margin-top: 6px;
  149. font-size: 20px;
  150. }
  151. }
  152. }
  153. }
  154. .sjia {
  155. position: fixed;
  156. top: 13%;
  157. right: 0px;
  158. width: 90px;
  159. background: red;
  160. z-index: 111;
  161. padding: 5px 10px 5px 10px;
  162. color: white;
  163. font-size: 15px;
  164. text-align: center;
  165. border-radius: 10px 0px 0px 10px;
  166. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
  167. opacity: 0.7;
  168. .icon {
  169. font-size: 25px;
  170. padding-bottom: 3px;
  171. }
  172. }
  173. </style>