mine.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <u-navbar title="我的" titleStyle="color: #fff;" @leftClick="leftClick" height="44px" bgColor="rgb(255,255,255,0)" :placeholder="true"></u-navbar>
  5. <view class="top hflex acenter">
  6. <image :src="user.avatar" class="avatar"></image>
  7. <view class="top_text">{{user.name}}</view>
  8. </view>
  9. <view class="hflex acenter jbetween tabs">
  10. <block v-for="(item,index) in tabs" :key="index">
  11. <view class="vflex acenter tab_item" @click="toDetail(item.url)">
  12. <image :src="item.src" class="tab_icon"></image>
  13. <view class="tab_text">{{item.name}}</view>
  14. </view>
  15. </block>
  16. </view>
  17. <view class="order">
  18. <view class="hflex acenter jbetween">
  19. <view class="title">我的订单</view>
  20. <view class="right" @click="toOrder(0)">查看全部</view>
  21. </view>
  22. <view class="hflex acenter jbetween" style="margin-top: 32rpx;">
  23. <block v-for="(item,index) in orderList" :key="index">
  24. <view class="vflex acenter order_item" @click="toOrder(item.id)">
  25. <image :src="item.src" class="order_icon"></image>
  26. <view class="order_text">{{item.name}}</view>
  27. </view>
  28. </block>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import $api from '@/static/js/api.js'
  36. var that = ''
  37. export default {
  38. data() {
  39. return {
  40. user: {
  41. avatar: '/static/images/mine/avatar1.jpg',
  42. name: 'Dxy_Leo'
  43. },
  44. tabs: [
  45. {
  46. src: '/static/images/shop/consulting.png',
  47. name: '消息',
  48. url: ''
  49. },
  50. {
  51. src: '/static/images/shop/collect.png',
  52. name: '收藏',
  53. url: '/page_shop/pages/mine/collect'
  54. },
  55. {
  56. src: '/static/images/shop/address.png',
  57. name: '地址',
  58. url: '/page_shop/pages/address/list'
  59. }
  60. ],
  61. orderList: [
  62. {
  63. src: '/static/images/shop/order_icon1.png',
  64. name: '待付款',
  65. id: 1,
  66. },
  67. {
  68. src: '/static/images/shop/order_icon2.png',
  69. name: '待发货',
  70. id: 2,
  71. },
  72. {
  73. src: '/static/images/shop/order_icon3.png',
  74. name: '待收货',
  75. id: 3,
  76. },
  77. {
  78. src: '/static/images/shop/order_icon4.png',
  79. name: '退款/售后',
  80. id: 4,
  81. }
  82. ]
  83. }
  84. },
  85. onLoad() {
  86. that = this
  87. },
  88. methods: {
  89. // 返回
  90. leftClick() {
  91. console.log('返回');
  92. $api.jump(-1)
  93. },
  94. // 进入详情页面
  95. toDetail(url) {
  96. $api.jump(url)
  97. },
  98. toOrder(id) {
  99. if(id == 4) {
  100. $api.jump('/page_shop/pages/order/refund')
  101. } else {
  102. $api.jump('/page_shop/pages/order/list?id=' + id)
  103. }
  104. }
  105. },
  106. }
  107. </script>
  108. <style lang="scss" scoped>
  109. .content {
  110. background: #F5F5F5;
  111. .box {
  112. width: 100%;
  113. background: linear-gradient(360deg, #F5F5F5 0%, #506DFF 100%);
  114. box-sizing: border-box;
  115. padding: 0 30rpx;
  116. .top {
  117. width: 100%;
  118. padding: 8rpx 0 30rpx;
  119. .avatar {
  120. width: 120rpx;
  121. height: 120rpx;
  122. border-radius: 50%;
  123. border: 2px solid #FFFFFF;
  124. }
  125. .top_text {
  126. font-size: 40rpx;
  127. font-weight: 500;
  128. color: #FFFFFF;
  129. line-height: 56rpx;
  130. margin-left: 12rpx;
  131. }
  132. }
  133. .tabs {
  134. padding: 30rpx 0 40rpx;
  135. .tab_item {
  136. width: 33%;
  137. text-align: center;
  138. .tab_icon {
  139. width: 52rpx;
  140. height: 52rpx;
  141. }
  142. .tab_text {
  143. font-size: 26rpx;
  144. font-weight: 400;
  145. color: #FFFFFF;
  146. line-height: 36rpx;
  147. padding-top: 12rpx;
  148. }
  149. }
  150. }
  151. .order {
  152. width: 100%;
  153. box-sizing: border-box;
  154. padding: 24rpx 20rpx;
  155. background: #FFFFFF;
  156. border-radius: 10px;
  157. .title {
  158. font-size: 28rpx;
  159. font-weight: 500;
  160. color: #0A0A0A;
  161. line-height: 40rpx;
  162. }
  163. .right {
  164. font-size: 24rpx;
  165. font-weight: 400;
  166. color: #B4B4B4;
  167. line-height: 34rpx;
  168. }
  169. .order_item{
  170. width: 25%;
  171. text-align: center;
  172. .order_icon {
  173. width: 52rpx;
  174. height: 52rpx;
  175. }
  176. .order_text {
  177. padding-top: 24rpx;
  178. font-size: 26rpx;
  179. font-weight: 400;
  180. color: #0A0A0A;
  181. line-height: 36rpx;
  182. }
  183. }
  184. }
  185. }
  186. }
  187. </style>