index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="me">
  3. <view class="headerBox">
  4. <view :style="{height: statusBarHeight + 'px'}"></view>
  5. <view class="title">我的</view>
  6. <u-line margin="60rpx 0"></u-line>
  7. <view class="avatorBox">
  8. <view class="leftBox">
  9. <image src="@/static/logo.png"></image>
  10. <view v-if="false">
  11. <view class="name">XXXX</view>
  12. <view class="greet">188****8888</view>
  13. </view>
  14. <view v-else @click="onLogin">
  15. 点击登录
  16. </view>
  17. </view>
  18. <view class="rightBox">
  19. <u-icon name="arrow-right"></u-icon>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="settings">
  24. <view class="settingItem" v-for="item in settingList" :key="item.id">
  25. <view class="left">
  26. <i :class="['custom-icon', `custom-icon-${item.icon}`]"></i>
  27. <span>{{item.name}}</span>
  28. </view>
  29. <u-icon name="arrow-right"></u-icon>
  30. </view>
  31. </view>
  32. <!-- 底部导航 -->
  33. <Tabbar :current-page="3" />
  34. </view>
  35. </template>
  36. <script>
  37. import Tabbar from "@/components/Tabbar/index.vue";
  38. import {login} from '@/utils/login.js'
  39. export default {
  40. components: {
  41. Tabbar
  42. },
  43. data() {
  44. return {
  45. statusBarHeight:getApp().globalData.statusBarHeight,
  46. settingList: [{
  47. id: 1,
  48. name: '浏览历史',
  49. icon: 'history',
  50. target: ''
  51. },
  52. {
  53. id: 2,
  54. name: '喜欢',
  55. icon: 'collected',
  56. target: ''
  57. },
  58. {
  59. id: 3,
  60. name: '收藏',
  61. icon: 'shoucang',
  62. target: ''
  63. },
  64. {
  65. id: 4,
  66. name: '积分',
  67. icon: 'jifen',
  68. target: ''
  69. },
  70. {
  71. id: 5,
  72. name: '排行榜',
  73. icon: 'charts',
  74. target: ''
  75. },
  76. {
  77. id: 6,
  78. name: '设置',
  79. icon: 'shezhi',
  80. target: ''
  81. },
  82. ]
  83. }
  84. },
  85. onLoad() {
  86. },
  87. methods: {
  88. onLogin() {
  89. uni.getUserProfile({
  90. desc:'用于绑定资料',
  91. success:infoRes=>{
  92. console.log(1111,infoRes)
  93. login()
  94. },
  95. fail:()=>{
  96. console.log(222)
  97. }
  98. })
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. page {
  105. background-color: #f9f9f9;
  106. height: 100%;
  107. }
  108. .me {
  109. // padding-top: 40rpx;
  110. height: 100%;
  111. .headerBox {
  112. width: 100%;
  113. height: 30%;
  114. background: linear-gradient(to right, #ffd6a7, #fff8ee);
  115. padding: 40rpx;
  116. .title {
  117. font-size: 60rpx;
  118. font-weight: 900;
  119. }
  120. .avatorBox {
  121. display: flex;
  122. align-items: center;
  123. justify-content: space-between;
  124. .leftBox {
  125. display: flex;
  126. align-items: center;
  127. .greet {
  128. font-size: 20rpx;
  129. margin-top: 6rpx;
  130. }
  131. .name {
  132. font-size: 32rpx;
  133. font-weight: 900;
  134. }
  135. image {
  136. width: 100rpx;
  137. height: 100rpx;
  138. border-radius: 32rpx;
  139. margin-right: 20rpx;
  140. }
  141. }
  142. .rightBox {
  143. image {
  144. width: 50rpx;
  145. height: 50rpx;
  146. }
  147. }
  148. }
  149. }
  150. .settings {
  151. // padding: 0 40rpx;
  152. padding-bottom: 180rpx;
  153. .settingItem {
  154. display: flex;
  155. justify-content: space-between;
  156. align-items: center;
  157. width: 90%;
  158. height: 100rpx;
  159. background-color: #fff;
  160. margin: 20rpx auto;
  161. padding: 40rpx;
  162. border-radius: 20rpx;
  163. box-shadow: 0 0 12rpx 2rpx rgba(0, 0, 0, 0.2);
  164. .custom-icon {
  165. font-size: 40rpx;
  166. margin-right: 30rpx;
  167. &::before {
  168. background: -webkit-linear-gradient(bottom, #f84a1a, #ffa53e);
  169. -webkit-background-clip: text;
  170. -webkit-text-fill-color: transparent;
  171. font-weight: bold;
  172. }
  173. }
  174. .custom-icon-collected {
  175. font-size: 46rpx;
  176. }
  177. .custom-icon-jifen {
  178. font-size: 60rpx;
  179. margin-left: -10rpx;
  180. }
  181. .left {
  182. display: flex;
  183. align-items: center;
  184. }
  185. }
  186. }
  187. }
  188. </style>