my.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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>
  9. <text>{{ user.nickName }}</text>
  10. <view class="icon">&#xe8b7;</view>
  11. </view>
  12. <view class="nh">{{ user == '' ? '你还未登陆' : ' 你好,欢迎来到智慧旅游' }}</view>
  13. </view>
  14. </view>
  15. <image src="../../static/bj.jpg" mode="aspectFill"></image>
  16. </view>
  17. <view class="main">
  18. <view class="list">
  19. <view class="item hr" @click="navigate('/pages/order/my')">
  20. <text class="icon ic" style="background-color: #2196F3;">&#xe705;</text>
  21. <text>我的预约</text>
  22. <text class="icon arrow">&#xe62d;</text>
  23. </view>
  24. <view class="item hr" @click="navigate('/pages/shop/list')">
  25. <text class="icon ic" style="background-color:#607D8B">&#xe616;</text>
  26. <text>商家中心</text>
  27. <text class="icon arrow">&#xe62d;</text>
  28. </view>
  29. </view>
  30. <view class="list" style="margin-top: 13px;">
  31. <view class="item hr" @click="call()">
  32. <text class="icon ic" style="background-color:#366092">&#xe634;</text>
  33. <text>求助电话</text>
  34. <text class="icon arrow">&#xe62d;</text>
  35. </view>
  36. <view class="item hr" @click="navigate('/pages/other/feedback')">
  37. <text class="icon ic" style="background-color:#FF554B">&#xe610;</text>
  38. <text>投诉建议</text>
  39. <text class="icon arrow">&#xe62d;</text>
  40. </view>
  41. <view class="item hr">
  42. <button open-type="share" hover-class='none'>
  43. <text class="icon ic" style="background-color:#18B566">&#xe607;</text>
  44. <text>分享朋友</text>
  45. <text class="icon arrow">&#xe62d;</text>
  46. </button>
  47. </view>
  48. <view class="item" @click="navigate('/pages/other/about')">
  49. <text class="icon ic" style="background-color:#606266">&#xe65f;</text>
  50. <text>关于我们</text>
  51. <text class="icon arrow">&#xe62d;</text>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. ip: this.$http.urls.ip,
  62. user: this.$getUser(),
  63. aboutUs: { showPictures: [] }
  64. };
  65. },
  66. onLoad() {
  67. this.aboutUs = uni.getStorageSync('aboutUs');
  68. },
  69. onShow() {
  70. this.user = this.$getUser();
  71. },
  72. methods: {
  73. navigate(url) {
  74. if (this.$hasLogin()) {
  75. uni.navigateTo({ url: url });
  76. } else {
  77. uni.navigateTo({ url: '/pages/user/login' });
  78. }
  79. },
  80. //拨打求助电话
  81. call() {
  82. this.$http.call(this.aboutUs);
  83. }
  84. },
  85. onShareAppMessage: function(res) {
  86. return {
  87. title: '谢通门智慧旅游',
  88. path: '/pages/index/index2',
  89. imageUrl: '../../static/fx.jpg',
  90. success: res => {},
  91. fail: res => {}
  92. };
  93. }
  94. };
  95. </script>
  96. <style lang="scss">
  97. .top {
  98. position: relative;
  99. height: 300px;
  100. color: white;
  101. .wd {
  102. position: absolute;
  103. top: 80px;
  104. left: 20px;
  105. z-index: 11;
  106. .head {
  107. width: 75px;
  108. height: 75px;
  109. border-radius: 50%;
  110. }
  111. .xs {
  112. margin-left: 90px;
  113. width: 100%;
  114. font-weight: bold;
  115. margin-top: 10px;
  116. .nickName {
  117. margin-top: 20px;
  118. }
  119. .nh {
  120. font-size: 12px;
  121. font-weight: normal;
  122. margin-top: 5px;
  123. }
  124. .icon {
  125. float: right;
  126. font-size: 25px;
  127. margin-right: -17px;
  128. }
  129. }
  130. }
  131. image {
  132. width: 100%;
  133. height: 300px;
  134. position: absolute;
  135. }
  136. }
  137. .main {
  138. padding: 15px 15px 50px 15px;
  139. width: 100%;
  140. overflow: hidden;
  141. position: absolute;
  142. margin-top: -100px;
  143. .list {
  144. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  145. width: 100%;
  146. background-color: white;
  147. border-radius: 5px;
  148. overflow: hidden;
  149. .item {
  150. padding: 16px;
  151. background-color: white;
  152. font-size: 16px;
  153. .ic {
  154. font-size: 20px;
  155. background-color: red;
  156. text-align: center;
  157. padding: 5px;
  158. border-radius: 5px;
  159. margin-right: 9px;
  160. color: white;
  161. }
  162. .arrow {
  163. font-size: 20px;
  164. }
  165. }
  166. }
  167. }
  168. button {
  169. text-align: left;
  170. background-color: white;
  171. color: #2e2e2e !important;
  172. font-size: 16px;
  173. padding-left: 0px;
  174. padding-right: 2px;
  175. line-height: 20px;
  176. overflow: initial;
  177. &:hover {
  178. background-color: white;
  179. outline:none;
  180. }
  181. }
  182. </style>