my.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view>
  3. <view class="bg theme_bg_bg"></view>
  4. <view class="top">
  5. <view class="box list dar3">
  6. <view class="r hr" @click="navigate('/pages/user/info')">
  7. <view class="r20"><image :src="user == '' ? '../../static/ls.jpg' : user.head" class="head"></image></view>
  8. <view class="r50">
  9. <view class="nickName" v-if="user == ''">登陆/注册</view>
  10. <view class="nickName" v-else>
  11. {{ user.nickName }}
  12. <text class="icon bo">&#xe65a;</text>
  13. </view>
  14. </view>
  15. <view class="clear"></view>
  16. </view>
  17. <view class="item hr">
  18. <button @click="navigate('/pages/order/list')">
  19. <text class="icon ic">&#xe70b;</text>
  20. 我的订单
  21. <text class="icon arrow">&#xe65a;</text>
  22. </button>
  23. </view>
  24. <view class="item hr">
  25. <button open-type="feedback">
  26. <text class="icon ic">&#xe617;</text>
  27. 意见反馈
  28. <text class="icon arrow">&#xe65a;</text>
  29. </button>
  30. </view>
  31. <view class="item hr">
  32. <button open-type="contact">
  33. <text class="icon ic">&#xe62a;</text>
  34. 客服会话
  35. <text class="icon arrow">&#xe65a;</text>
  36. </button>
  37. </view>
  38. <view class="item">
  39. <button open-type="share">
  40. <text class="icon ic">&#xe637;</text>
  41. 分享到
  42. <text class="icon arrow">&#xe65a;</text>
  43. </button>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. user: this.$getUser()
  54. };
  55. },
  56. onShow() {
  57. this.user = this.$getUser();
  58. },
  59. methods: {
  60. navigate(url) {
  61. if (this.$hasLogin()) {
  62. uni.navigateTo({ url: url });
  63. } else {
  64. uni.navigateTo({ url: '/pages/user/login' });
  65. }
  66. }
  67. }
  68. };
  69. </script>
  70. <style lang="scss">
  71. .top {
  72. padding: 15px;
  73. margin-top: -50px;
  74. }
  75. .bg {
  76. height: 70px;
  77. }
  78. .r {
  79. padding-bottom: 7px;
  80. .head {
  81. width: 60px;
  82. height: 60px;
  83. border-radius: 50%;
  84. margin-top: -50px;
  85. margin-left: 10px;
  86. border: 3px solid white;
  87. }
  88. }
  89. .list {
  90. background-color: white;
  91. margin-top: 10px;
  92. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  93. .nickName {
  94. font-size: 13px;
  95. color: $dar2;
  96. padding: 5px;
  97. }
  98. .item {
  99. padding: 7px;
  100. .ic {
  101. font-weight: bold;
  102. font-size: 20px;
  103. padding-right: 10px;
  104. }
  105. .arrow {
  106. margin-top: 6px;
  107. font-size: 20px;
  108. }
  109. }
  110. }
  111. button {
  112. text-align: left;
  113. background-color: white;
  114. color: #2e2e2e !important;
  115. font-size: 14px;
  116. }
  117. </style>