my.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <view class="container">
  3. <!-- 顶部用户信息区域 -->
  4. <view class="header">
  5. <img src="../../static/my/headerImg.png" />
  6. <!-- 页面标题 -->
  7. <view class="title">我的</view>
  8. <!-- 头像区域 -->
  9. <img class="img" src="../../static/my/portrait.png" />
  10. <!-- 姓名区域 -->
  11. <view class="name" v-if="flag">张三</view>
  12. <!-- 用户id区域 -->
  13. <view class="number" v-if="flag">ID:1925689</view>
  14. <!-- 是否实名认证区域 -->
  15. <view class="real" v-if="real">
  16. <img src="../../static/my/true.png" />
  17. 已实名认证
  18. </view>
  19. <view class="real2" v-if="flag" v-else @click="goPageCommon">
  20. 去认证
  21. <img src="../../static/my/right2.png" />
  22. </view>
  23. <view class="login" v-if="!flag" @click="goPageLogin">去登录</view>
  24. </view>
  25. <!-- 内容区域 -->
  26. <view class="body">
  27. <!-- 订单管理区域 -->
  28. <view class="body_item" @click="goPageOrder">
  29. <img class="img" src="../../static/my/order.png" />
  30. 订单管理
  31. </view>
  32. <!-- 常用旅客区域 -->
  33. <view class="body_item" @click="goPageCommon">
  34. <img class="img2" src="../../static/my/people.png" />
  35. 常用旅客
  36. </view>
  37. <!-- 设置区域 -->
  38. <view class="body_item" @click="goPageSet">
  39. <img class="img3" src="../../static/my/set.png" />
  40. 设置
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. // 是否实名认证
  50. real: false,
  51. // 是否登录标识
  52. flag: false
  53. }
  54. },
  55. onLoad() {
  56. this.flag = false
  57. },
  58. onShow() {
  59. // console.log(121)
  60. },
  61. methods: {
  62. // 去登录文字回调
  63. goPageLogin() {
  64. uni.navigateTo({
  65. url: '/pages/login/login'
  66. })
  67. },
  68. // 点击订单管理按钮回调
  69. goPageOrder() {
  70. if (this.isLogin()) {
  71. uni.navigateTo({
  72. url: '/pages/orderManage/orderManage'
  73. })
  74. }
  75. },
  76. // 点击常用旅客按钮回调
  77. goPageCommon() {
  78. if (this.isLogin()) {
  79. uni.navigateTo({
  80. url: '/pages/common/common'
  81. })
  82. }
  83. },
  84. // 点击设置按钮回调
  85. goPageSet() {
  86. if (this.isLogin()) {
  87. uni.navigateTo({
  88. url: '/pages/set/set'
  89. })
  90. }
  91. },
  92. isLogin() {
  93. if (this.flag) {
  94. return true
  95. } else {
  96. uni.showToast({
  97. title: '请先登录',
  98. icon: 'none',
  99. mask: true
  100. })
  101. setTimeout(() => {
  102. uni.navigateTo({
  103. url: '/pages/login/login'
  104. })
  105. }, 1500)
  106. }
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .container {
  113. position: relative;
  114. min-height: 100vh;
  115. background-color: #ebeced;
  116. .header {
  117. position: relative;
  118. height: 480rpx;
  119. color: #fff;
  120. overflow: hidden;
  121. img {
  122. width: 100%;
  123. }
  124. .title {
  125. position: absolute;
  126. top: 65rpx;
  127. left: 342rpx;
  128. font-size: 28rpx;
  129. color: #fff;
  130. }
  131. .img {
  132. position: absolute;
  133. top: 190rpx;
  134. left: 32rpx;
  135. width: 140rpx;
  136. height: 140rpx;
  137. }
  138. .name {
  139. position: absolute;
  140. top: 178rpx;
  141. left: 202rpx;
  142. font-size: 40rpx;
  143. font-weight: bold;
  144. }
  145. .number {
  146. position: absolute;
  147. top: 240rpx;
  148. left: 202rpx;
  149. font-size: 24rpx;
  150. opacity: 0.5;
  151. }
  152. .real {
  153. position: absolute;
  154. top: 285rpx;
  155. left: 202rpx;
  156. display: flex;
  157. align-items: center;
  158. box-sizing: border-box;
  159. padding-left: 13rpx;
  160. width: 179rpx;
  161. height: 42rpx;
  162. font-size: 24rpx;
  163. border-radius: 113rpx;
  164. background-color: rgba(255, 255, 255, 0.2);
  165. img {
  166. margin-right: 7rpx;
  167. width: 24rpx;
  168. height: 24rpx;
  169. }
  170. }
  171. .real2 {
  172. position: absolute;
  173. top: 285rpx;
  174. left: 202rpx;
  175. display: flex;
  176. justify-content: center;
  177. align-items: center;
  178. box-sizing: border-box;
  179. padding-left: 13rpx;
  180. width: 179rpx;
  181. height: 42rpx;
  182. font-size: 24rpx;
  183. border-radius: 113rpx;
  184. background-color: rgba(255, 255, 255, 0.2);
  185. img {
  186. margin-left: 12rpx;
  187. width: 24rpx;
  188. height: 24rpx;
  189. }
  190. }
  191. .login {
  192. position: absolute;
  193. top: 235rpx;
  194. left: 202rpx;
  195. font-size: 40rpx;
  196. font-weight: bold;
  197. }
  198. }
  199. .body {
  200. position: absolute;
  201. top: 360rpx;
  202. box-sizing: border-box;
  203. padding: 0 30rpx;
  204. width: 100%;
  205. height: calc(100vh - 360rpx);
  206. border-radius: 20rpx 20rpx 0 0;
  207. background-color: #fff;
  208. .body_item {
  209. display: flex;
  210. align-items: center;
  211. height: 121rpx;
  212. font-size: 28rpx;
  213. border-bottom: 1rpx solid #e6e6e6;
  214. .img {
  215. margin-right: 17rpx;
  216. width: 53rpx;
  217. height: 53rpx;
  218. }
  219. .img2 {
  220. margin-right: 22rpx;
  221. width: 42rpx;
  222. height: 42rpx;
  223. }
  224. .img3 {
  225. margin-right: 18rpx;
  226. width: 50rpx;
  227. height: 50rpx;
  228. }
  229. }
  230. }
  231. }
  232. </style>