index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="user-content">
  3. <!-- 头部 -->
  4. <view class="user-head" @click="toUserPage">
  5. <view class="user-photo">
  6. <open-data type="userAvatarUrl"></open-data>
  7. </view>
  8. <view class="user-info">
  9. <open-data type="userNickName"></open-data>
  10. </view>
  11. <view>
  12. <u-icon name="arrow-right" color="#fff"></u-icon>
  13. </view>
  14. </view>
  15. <view class="my-ledou">
  16. <view class="user-jifen">
  17. <view>我的乐豆:<text>345</text></view>
  18. <u-image mode="scaleToFill" width="35rpx" height="35rpx" src="/static/ledou.png"></u-image>
  19. </view>
  20. <view>
  21. <u-button size="mini" type="warning" shape="circle" @click="toLdPage">查看明细</u-button>
  22. </view>
  23. </view>
  24. <!-- 列表 -->
  25. <view class="user-list">
  26. <u-cell-group>
  27. <u-cell-item icon="order" icon-size="38" :icon-style="{color:'#ff5500'}" index="1" @click="toPage" title="我的订单"></u-cell-item>
  28. <u-cell-item icon="gift" icon-size="40" :icon-style="{color:'#00aaff'}" index="0" @click="toPage" title="投递记录"></u-cell-item>
  29. <u-cell-item icon="file-text" icon-size="40" :icon-style="{color:'#ffaa00'}" index="2" @click="toPage" title="服务协议"></u-cell-item>
  30. <u-cell-item icon="info-circle" icon-size="38" :icon-style="{color:'#55aa00'}" index="3" @click="toPage" title="关于我们"></u-cell-item>
  31. </u-cell-group>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import {logout} from '@/api/login.js'
  37. export default {
  38. data() {
  39. return {
  40. quitButton: {
  41. borderRadius:'100rpx',
  42. fontSize:'30rpx',
  43. background: '#01c9b2'
  44. }
  45. };
  46. },
  47. onShow() {
  48. },
  49. onLoad() {
  50. },
  51. methods:{
  52. // 打开对应的页面
  53. toPage(index){
  54. let pageUrl=[
  55. '/pages/userCenter/deliveryRecord',
  56. '/pages/order/order',
  57. '/pages/agreement/agreement?fromPage=usercenter',
  58. '/pages/userCenter/aboutUs'
  59. ]
  60. uni.navigateTo({
  61. url: pageUrl[index]
  62. })
  63. },
  64. // 跳转
  65. toUserPage(){
  66. // 未登录跳转登录,已登录跳转用户信息页
  67. uni.navigateTo({
  68. url: '/pages/userCenter/userInfo/userInfo'
  69. })
  70. },
  71. // 乐豆明细
  72. toLdPage(){
  73. uni.navigateTo({
  74. url: '/pages/userCenter/ldDetailed'
  75. })
  76. },
  77. bindGetUserInfo(res){
  78. console.log(res)
  79. },
  80. }
  81. }
  82. </script>
  83. <style lang="scss">
  84. .user-content{
  85. width: 100%;
  86. .user-head{
  87. background: #01c9b2;
  88. display: flex;
  89. align-items: center;
  90. padding: 35rpx 55rpx;
  91. .user-info{
  92. flex-grow: 1;
  93. padding: 0 20rpx;
  94. color: #FFFFFF;
  95. }
  96. .user-photo{
  97. width: 100rpx;
  98. height: 100rpx;
  99. border-radius: 50%;
  100. overflow: hidden;
  101. margin-right: 5rpx;
  102. }
  103. }
  104. .my-ledou{
  105. background: #FFFFFF;
  106. border-radius: 15upx;
  107. display: flex;
  108. align-items: center;
  109. justify-content: space-between;
  110. padding: 20upx;
  111. margin: 20upx;
  112. box-shadow: 0upx 3upx 6upx #eee;
  113. .user-jifen{
  114. display: flex;
  115. align-items: center;
  116. text{
  117. font-size: 40upx;
  118. font-weight: bold;
  119. color: red;
  120. }
  121. >view{
  122. &:first-child{
  123. display: flex;
  124. align-items: center;
  125. }
  126. }
  127. }
  128. }
  129. .user-list{
  130. border-radius: 15upx;
  131. margin: 20upx;
  132. overflow: hidden;
  133. box-shadow: 0upx 3upx 6upx #eee;
  134. }
  135. .user-btn{
  136. padding: 85rpx 200rpx;
  137. }
  138. }
  139. </style>