index.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <view class="mine-page">
  3. <!-- 顶部用户信息 -->
  4. <view class="user-info">
  5. <view class="user-header">
  6. <view class="user-avatar">
  7. <image class="avatar" :src="userInfo.avatar || '/static/img/logo3.png'" mode="aspectFill"></image>
  8. </view>
  9. <view class="user-detail">
  10. <view class="nickname">{{ userInfo.nickname }}</view>
  11. <view class="user-tag">{{ userInfo.tag }}</view>
  12. </view>
  13. </view>
  14. <!-- 用户数据 -->
  15. <view class="user-data">
  16. <view class="data-item">
  17. <view class="amount">{{ userInfo.balance }}</view>
  18. <view class="label">我的钱包</view>
  19. </view>
  20. <view class="data-item">
  21. <view class="amount">{{ userInfo.couponCount }}</view>
  22. <view class="label">优惠券</view>
  23. <view class="badge" v-if="userInfo.availableCoupons">{{ userInfo.availableCoupons }}张可领</view>
  24. </view>
  25. <view class="data-item">
  26. <view class="amount">{{ userInfo.points }}</view>
  27. <view class="label">我的积分</view>
  28. </view>
  29. </view>
  30. </view>
  31. <!-- 卖书订 -->
  32. <view class="order-section">
  33. <view class="section-header">
  34. <text>卖书订单</text>
  35. <view class="view-all" @click="viewAllOrders">
  36. <text>查看全部</text>
  37. <u-icon name="arrow-right" size="24" color="#999"></u-icon>
  38. </view>
  39. </view>
  40. <view class="order-types" style="padding: 0 20rpx;">
  41. <view class="type-item flex-d flex-a-c" v-for="(item, index) in orderTypes" :key="index"
  42. @click="navigateToOrder(item.path)">
  43. <image class="type-icon" :src="'/pages-mine/static/' + item.icon" mode="aspectFit"></image>
  44. <text>{{ item.name }}</text>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 实用工具 -->
  49. <view class="tools-section">
  50. <view class="section-title">实用工具</view>
  51. <view class="tools-grid">
  52. <view class="tool-item flex-d flex-a-c" v-for="(tool, index) in tools" :key="index"
  53. @click="navigateToTool(tool.path)">
  54. <image class="tool-icon" :src="'/pages-mine/static/' + tool.icon" mode="aspectFit"></image>
  55. <text>{{ tool.name }}</text>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. userInfo: {
  66. avatar: '',
  67. nickname: '这里是微信昵称.',
  68. tag: '合伙人',
  69. balance: '26.00',
  70. couponCount: '66',
  71. availableCoupons: '99',
  72. points: '3630'
  73. },
  74. orderTypes: [
  75. { name: '待初审', icon: '1.png', path: '/pages/order/pending-review' },
  76. { name: '待取件', icon: '2.png', path: '/pages/order/pending-pickup' },
  77. { name: '待审核', icon: '3.png', path: '/pages/order/pending-audit' },
  78. { name: '待到款', icon: '4.png', path: '/pages/order/pending-payment' },
  79. { name: '申请退回', icon: '5.png', path: '/pages/order/return-request' }
  80. ],
  81. tools: [
  82. { name: '消息通知', icon: 't1.png', path: '/pages/tools/notification' },
  83. { name: '我的收藏', icon: 't2.png', path: '/pages/tools/collection' },
  84. { name: '我的足迹', icon: 't3.png', path: '/pages/tools/footprint' },
  85. { name: '我的地址', icon: 't4.png', path: '/pages/tools/address' },
  86. { name: '我的优惠券', icon: 't5.png', path: '/pages/tools/coupon' },
  87. { name: '联系客服', icon: 't6.png', path: '/pages/tools/service' },
  88. { name: '意见反馈', icon: 't7.png', path: '/pages/tools/feedback' },
  89. { name: '到货提醒', icon: 't8.png', path: '/pages/tools/arrival-notice' },
  90. { name: '合伙人计划', icon: 't9.png', path: '/pages/tools/partner' },
  91. { name: '买卖答疑', icon: 't10.png', path: '/pages/tools/faq' },
  92. { name: '关于书嗨', icon: 't11.png', path: '/pages/tools/about' },
  93. { name: '我的余额', icon: 't12.png', path: '/pages/tools/balance' },
  94. { name: '用户设置', icon: 't13.png', path: '/pages/tools/settings' }
  95. ]
  96. }
  97. },
  98. methods: {
  99. viewAllOrders() {
  100. uni.navigateTo({
  101. url: '/pages-mine/pages/order-page'
  102. })
  103. },
  104. navigateToOrder(path) {
  105. uni.navigateTo({
  106. url: path
  107. })
  108. },
  109. navigateToTool(path) {
  110. uni.navigateTo({
  111. url: path
  112. })
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. .mine-page {
  119. min-height: 100vh;
  120. background-color: #f5f5f5;
  121. .user-info {
  122. background-color: #38C148;
  123. padding: 20rpx 50rpx 120rpx;
  124. color: #fff;
  125. position: relative;
  126. &::after {
  127. width: 140%;
  128. position: absolute;
  129. left: -20%;
  130. top: 0;
  131. z-index: -1;
  132. content: '';
  133. border-radius: 0 0 50% 50%;
  134. background: #fd6954;
  135. }
  136. .user-header {
  137. display: flex;
  138. align-items: center;
  139. margin-bottom: 40rpx;
  140. .user-avatar {
  141. border-radius: 50%;
  142. margin-right: 20rpx;
  143. border: 4rpx solid #fff;
  144. .avatar {
  145. width: 120rpx;
  146. height: 120rpx;
  147. }
  148. }
  149. .user-detail {
  150. .nickname {
  151. font-size: 32rpx;
  152. font-weight: 500;
  153. margin-bottom: 8rpx;
  154. }
  155. .user-tag {
  156. display: inline-block;
  157. font-size: 22rpx;
  158. padding: 4rpx 12rpx;
  159. background: linear-gradient(-90deg, #272321, #4B4542);
  160. border-radius: 4rpx;
  161. margin-top: 8rpx;
  162. }
  163. }
  164. }
  165. .user-data {
  166. display: flex;
  167. justify-content: space-between;
  168. position: relative;
  169. z-index: 1;
  170. padding: 0 40rpx;
  171. .data-item {
  172. position: relative;
  173. text-align: center;
  174. .amount {
  175. font-size: 38rpx;
  176. font-weight: 500;
  177. margin-bottom: 8rpx;
  178. }
  179. .label {
  180. font-size: 24rpx;
  181. font-weight: 400;
  182. opacity: 0.9;
  183. }
  184. .badge {
  185. position: absolute;
  186. top: -15rpx;
  187. right: -120%;
  188. padding: 0 10rpx;
  189. font-size: 20rpx;
  190. line-height: 30rpx;
  191. height: 30rpx;
  192. background: #FF8400;
  193. border-radius: 15rpx 15rpx 15rpx 0rpx;
  194. }
  195. }
  196. }
  197. }
  198. .order-section {
  199. margin: -80rpx 30rpx 20rpx;
  200. background: #fff;
  201. border-radius: 12rpx;
  202. padding: 30rpx;
  203. position: relative;
  204. z-index: 2;
  205. .section-header {
  206. display: flex;
  207. justify-content: space-between;
  208. align-items: center;
  209. margin-bottom: 30rpx;
  210. .view-all {
  211. display: flex;
  212. align-items: center;
  213. color: #999;
  214. font-size: 26rpx;
  215. }
  216. }
  217. .order-types {
  218. display: flex;
  219. justify-content: space-between;
  220. .type-item {
  221. text-align: center;
  222. .type-icon {
  223. width: 60rpx;
  224. height: 60rpx;
  225. margin-bottom: 12rpx;
  226. }
  227. text {
  228. font-size: 24rpx;
  229. color: #333;
  230. }
  231. }
  232. }
  233. }
  234. .tools-section {
  235. margin: 30rpx;
  236. background: #fff;
  237. border-radius: 12rpx;
  238. padding: 30rpx;
  239. position: relative;
  240. z-index: 2;
  241. .section-title {
  242. font-size: 30rpx;
  243. font-weight: 500;
  244. margin-bottom: 30rpx;
  245. }
  246. .tools-grid {
  247. display: grid;
  248. grid-template-columns: repeat(4, 1fr);
  249. gap: 30rpx;
  250. .tool-item {
  251. text-align: center;
  252. .tool-icon {
  253. width: 60rpx;
  254. height: 60rpx;
  255. margin-bottom: 12rpx;
  256. }
  257. text {
  258. font-size: 24rpx;
  259. color: #333;
  260. }
  261. }
  262. }
  263. }
  264. }
  265. </style>