my.vue 4.7 KB

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