index.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view class="container">
  3. <!-- 顶部背景 -->
  4. <view class="nav-bg">
  5. <view class="bg-circle-1"></view>
  6. <view class="bg-circle-2"></view>
  7. </view>
  8. <!-- 头部用户信息 -->
  9. <view class="header-section">
  10. <view class="title-bar">个人中心</view>
  11. <view class="user-card" @click="navToProfile">
  12. <image class="avatar" :src="profile?.avatarUrl || '/static/touxiang.png'" mode="aspectFill"></image>
  13. <view class="info-content">
  14. <view class="name-row">
  15. <text class="name">{{ profile?.name || '未登录' }}</text>
  16. <view class="tags">
  17. <view class="tag green" v-if="profile?.status === '0'">接单中</view>
  18. <view class="tag green" v-else-if="profile?.status === '1'">休息中</view>
  19. <view class="tag" style="background:#eee;color:#999" v-else-if="profile?.status === '2'">已禁用</view>
  20. <view class="tag blue" v-if="profile?.workType === 'full_time'">全职</view>
  21. <image class="bike-icon" src="/static/icons/motorbike.svg"></image>
  22. </view>
  23. </view>
  24. <view class="detail-row">
  25. <image class="small-icon" src="/static/icons/location.svg"></image>
  26. <text>{{ profile?.stationName || profile?.cityName || '暂无站点' }}</text>
  27. <image class="arrow-icon-small" src="/static/icons/chevron_right_dark.svg"></image>
  28. </view>
  29. <view class="detail-row">
  30. <image class="small-icon" src="/static/icons/calendar.svg"></image>
  31. <text>已注册{{ profile?.registerDays || 0 }}天</text>
  32. </view>
  33. </view>
  34. <image class="settings-icon" src="/static/icons/settings.svg" @click.stop="navToSettings"></image>
  35. </view>
  36. <!-- 黑金权益卡 -->
  37. <view class="vip-card">
  38. <view class="vip-left">
  39. <image class="vip-icon" src="/static/icons/crown.svg"></image>
  40. <view class="vip-text">
  41. <text class="vip-title">{{ profile?.levelName || '普通履约者' }}</text>
  42. <text class="vip-desc">{{ profile?.levelDesc || '完成更多订单即可升级' }}</text>
  43. </view>
  44. </view>
  45. <view class="vip-btn" @click="navToLevel">
  46. <text>查看权益</text>
  47. <image class="arrow-icon-small" src="/static/icons/chevron_right_gold.svg"></image>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 统计面板 -->
  52. <view class="stats-panel">
  53. <view class="stat-item" @click="navToWallet">
  54. <view class="stat-header">
  55. <view class="red-bar"></view>
  56. <text class="label">我的钱包</text>
  57. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  58. </view>
  59. <view class="stat-value">
  60. <text class="num">{{ profile?.balance ? (profile.balance / 100).toFixed(2) : '0.00' }}</text>
  61. <text class="unit">元</text>
  62. </view>
  63. <text class="sub-text">账户余额</text>
  64. </view>
  65. <view class="divider"></view>
  66. <view class="stat-item" @click="navToOrderStats">
  67. <view class="stat-header">
  68. <view class="green-bar"></view>
  69. <text class="label">订单统计</text>
  70. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  71. </view>
  72. <view class="stat-value">
  73. <text class="num">{{ profile?.orderCount || 0 }}</text>
  74. <text class="unit">单</text>
  75. </view>
  76. <text class="sub-text">累计服务单量</text>
  77. </view>
  78. <view class="divider"></view>
  79. <view class="stat-item" @click="navToPoints">
  80. <view class="stat-header">
  81. <view class="orange-bar"></view>
  82. <text class="label">我的积分</text>
  83. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  84. </view>
  85. <view class="stat-value">
  86. <text class="num">{{ profile?.points || 0 }}</text>
  87. <text class="unit">分</text>
  88. </view>
  89. <text class="sub-text">可兑换权益</text>
  90. </view>
  91. </view>
  92. <!-- 菜单列表 -->
  93. <view class="menu-list">
  94. <view class="menu-item" @click="navToNotification">
  95. <image class="menu-icon" src="/static/icons/bell_linear.svg"></image>
  96. <text class="menu-text">消息中心</text>
  97. <view class="menu-right">
  98. <view class="red-dot"></view>
  99. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  100. </view>
  101. </view>
  102. <view class="menu-item" @click="navToRewards">
  103. <image class="menu-icon" src="/static/icons/money_linear.svg"></image>
  104. <text class="menu-text">我的奖惩</text>
  105. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  106. </view>
  107. <view class="menu-item" @click="openServicePopup">
  108. <image class="menu-icon" src="/static/icons/headset_linear.svg"></image>
  109. <text class="menu-text">联系客服</text>
  110. <image class="arrow-icon" src="/static/icons/chevron_right.svg"></image>
  111. </view>
  112. </view>
  113. <!-- 退出登录 -->
  114. <!-- 退出登录 -->
  115. <view class="logout-btn" @click="logout">退出登录</view>
  116. <!-- 联系客服弹窗 -->
  117. <view class="service-popup-mask" v-if="showServicePopup" @click="closeServicePopup">
  118. <view class="service-popup" @click.stop>
  119. <view class="service-header">
  120. <text class="service-title">联系客服</text>
  121. <image class="close-icon" src="/static/icons/close_gray.svg" @click="closeServicePopup"></image>
  122. </view>
  123. <view class="qr-section">
  124. <text class="qr-title">客服二维码</text>
  125. <image class="qr-img" src="/static/logo.png" @click="previewQRCode"></image>
  126. <text class="qr-desc">点击查看大图</text>
  127. </view>
  128. <view class="service-list">
  129. <view class="service-row" @click="openOnlineService">
  130. <image class="service-row-icon" src="/static/icons/headset_green.svg"></image>
  131. <view class="service-info">
  132. <text class="service-name">在线客服</text>
  133. <text class="service-desc">企业微信专属客服在线解答</text>
  134. </view>
  135. <image class="arrow-icon-small" src="/static/icons/chevron_right.svg"></image>
  136. </view>
  137. <view class="service-row">
  138. <image class="service-row-icon" src="/static/icons/phone_orange.svg"></image>
  139. <view class="service-info">
  140. <text class="service-name">客服电话</text>
  141. <text class="service-desc">400-123-4567</text>
  142. </view>
  143. <view class="call-btn" @click="callServicePhone">
  144. <image class="phone-icon-small" src="/static/icons/phone_green.svg"></image>
  145. <text>拨打</text>
  146. </view>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. <!-- 退出登录弹窗 -->
  152. <view class="logout-popup-mask" :class="{ 'show': showLogoutPopup }" @click="cancelLogout" @touchmove.stop.prevent>
  153. <view class="popup-modal" @click.stop>
  154. <text class="popup-title">退出登录</text>
  155. <text class="popup-desc">确定要退出当前账号吗?\n退出后需要重新登录才能使用完整功能。</text>
  156. <view class="popup-actions">
  157. <view class="popup-btn cancel" @click="cancelLogout">取消</view>
  158. <view class="popup-btn confirm" @click="confirmLogout">确定</view>
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. </template>
  164. <script>
  165. import logic from './logic.js';
  166. export default {
  167. ...logic
  168. }
  169. </script>
  170. <style>
  171. @import './style.css';
  172. </style>