index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. <template>
  2. <view class="mine-container">
  3. <!-- 顶部用户信息区域 -->
  4. <view class="user-header">
  5. <StatusBarPlaceholder></StatusBarPlaceholder>
  6. <!-- 背景装饰 -->
  7. <view class="header-bg-decoration"></view>
  8. <view class="header-content">
  9. <view class="user-info">
  10. <view class="avatar-wrapper">
  11. <image class="avatar" src="/static/avatar-default.png" mode="aspectFill" />
  12. </view>
  13. <view class="user-details">
  14. <view class="name-row">
  15. <text class="user-name">赵建平</text>
  16. <text class="user-role">销售经理</text>
  17. </view>
  18. <text class="company-name">浙江舒博特网络科有限公司</text>
  19. </view>
  20. </view>
  21. <view class="qr-btn" @click="showCard">
  22. <uni-icons type="qrcode" size="28" color="#ffffff"></uni-icons>
  23. <text class="qr-text">我的名片</text>
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 线索数据卡片 -->
  28. <view class="data-card">
  29. <view class="card-header">
  30. <text class="card-title">线索数据</text>
  31. </view>
  32. <view class="data-row">
  33. <view class="data-item">
  34. <text class="data-value">1,266</text>
  35. <text class="data-label">线索总数</text>
  36. </view>
  37. <view class="data-item highlight">
  38. <text class="data-value orange">65</text>
  39. <text class="data-label">本月新增</text>
  40. </view>
  41. <view class="data-item">
  42. <text class="data-value">126</text>
  43. <text class="data-label">我的线索</text>
  44. </view>
  45. </view>
  46. </view>
  47. <!-- 客户数据卡片 -->
  48. <view class="data-card">
  49. <view class="card-header">
  50. <text class="card-title">客户数据</text>
  51. <uni-icons type="eye" size="20" color="#999999"></uni-icons>
  52. </view>
  53. <view class="data-row">
  54. <view class="data-item">
  55. <text class="data-value">1,088</text>
  56. <text class="data-label">客户总数</text>
  57. </view>
  58. <view class="data-item highlight">
  59. <text class="data-value orange">123</text>
  60. <text class="data-label">本月新增</text>
  61. </view>
  62. <view class="data-item">
  63. <text class="data-value">235</text>
  64. <text class="data-label">我的客户</text>
  65. </view>
  66. </view>
  67. </view>
  68. <!-- 商机数据卡片 -->
  69. <view class="data-card">
  70. <view class="card-header">
  71. <text class="card-title">商机数据</text>
  72. <uni-icons type="eye" size="20" color="#999999"></uni-icons>
  73. </view>
  74. <view class="data-row">
  75. <view class="data-item">
  76. <text class="data-value">1,366</text>
  77. <text class="data-label">商机总数</text>
  78. </view>
  79. <view class="data-item highlight">
  80. <text class="data-value orange">63</text>
  81. <text class="data-label">本月新增</text>
  82. </view>
  83. <view class="data-item">
  84. <text class="data-value">86</text>
  85. <text class="data-label">我的商机</text>
  86. </view>
  87. </view>
  88. </view>
  89. <!-- 功能菜单 -->
  90. <view class="menu-card">
  91. <view class="menu-item" @click="navigateTo('guide')">
  92. <view class="menu-icon-wrapper">
  93. <uni-icons type="help" size="22" color="#667eea"></uni-icons>
  94. </view>
  95. <text class="menu-text">使用指南</text>
  96. <uni-icons type="right" size="16" color="#cccccc"></uni-icons>
  97. </view>
  98. <view class="menu-divider"></view>
  99. <view class="menu-item" @click="navigateTo('service')">
  100. <view class="menu-icon-wrapper">
  101. <uni-icons type="paperclip" size="22" color="#667eea"></uni-icons>
  102. </view>
  103. <text class="menu-text">联系客服</text>
  104. <uni-icons type="right" size="16" color="#cccccc"></uni-icons>
  105. </view>
  106. <view class="menu-divider"></view>
  107. <view class="menu-item" @click="navigateTo('about')">
  108. <view class="menu-icon-wrapper">
  109. <uni-icons type="gear" size="22" color="#667eea"></uni-icons>
  110. </view>
  111. <text class="menu-text">关于我们</text>
  112. <uni-icons type="right" size="16" color="#cccccc"></uni-icons>
  113. </view>
  114. <view class="menu-divider"></view>
  115. <view class="menu-item logout-item" @click="handleLogout">
  116. <view class="menu-icon-wrapper">
  117. <uni-icons type="closeempty" size="22" color="#ff4d4f"></uni-icons>
  118. </view>
  119. <text class="menu-text logout-text">退出登录</text>
  120. <uni-icons type="right" size="16" color="#cccccc"></uni-icons>
  121. </view>
  122. </view>
  123. </view>
  124. </template>
  125. <script setup>
  126. import { ref ,onMounted} from 'vue'
  127. import StatusBarPlaceholder from "@/components/status-bar-placeholder/index.vue"
  128. import { logout } from '@/api/login.js'
  129. const navigateTo = (page) => {
  130. uni.showToast({
  131. title: ``,
  132. icon: 'none'
  133. })
  134. }
  135. // 显示名片
  136. const showCard = () => {
  137. uni.showToast({
  138. title: '我的名片',
  139. icon: 'none'
  140. })
  141. }
  142. // ��出登��const handleLogout = () => {
  143. uni.showModal({
  144. title: '提示',
  145. content:'缺人要退出登录吗?',
  146. success: async (res) => {
  147. if (res.confirm) {
  148. try {
  149. // 调用��出登录接�� await logout({})
  150. // 清除本地存储
  151. uni.removeStorageSync('token')
  152. uni.removeStorageSync('userInfo')
  153. uni.removeStorageSync('code')
  154. // 提示成功
  155. uni.showToast({
  156. title: '操作成功',
  157. icon: 'success'
  158. })
  159. // 延迟跳转到登录页
  160. setTimeout(() => {
  161. uni.reLaunch({
  162. url: '/pages/login/login'
  163. })
  164. }, 1500)
  165. } catch (error) {
  166. console.error('退出登录失败', error)
  167. uni.showToast({
  168. title: '退出登录失败,请重试',
  169. icon: 'none'
  170. })
  171. }
  172. }
  173. }
  174. })
  175. }
  176. </script>
  177. <style lang="scss" scoped>
  178. .mine-container {
  179. min-height: 100vh;
  180. background: #f5f6f8;
  181. }
  182. // 顶部用户信息区域
  183. .user-header {
  184. background: linear-gradient(135deg, #4A90E2 0%, #6FB3F2 50%, #87CEEB 100%);
  185. padding: 0 40rpx 160rpx;
  186. padding-top: calc(var(--status-bar-height) + 20rpx);
  187. position: relative;
  188. overflow: hidden;
  189. // 背景光晕装饰
  190. .header-bg-decoration {
  191. position: absolute;
  192. top: -100rpx;
  193. right: -100rpx;
  194. width: 400rpx;
  195. height: 400rpx;
  196. background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  197. border-radius: 50%;
  198. }
  199. .header-content {
  200. position: relative;
  201. z-index: 2;
  202. display: flex;
  203. justify-content: space-between;
  204. align-items: flex-start;
  205. }
  206. .user-info {
  207. display: flex;
  208. align-items: center;
  209. flex: 1;
  210. .avatar-wrapper {
  211. flex-shrink: 0;
  212. margin-right: 24rpx;
  213. position: relative;
  214. .avatar {
  215. width: 128rpx;
  216. height: 128rpx;
  217. border-radius: 50%;
  218. border: 4rpx solid rgba(255, 255, 255, 0.4);
  219. box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.15);
  220. background: #ffffff;
  221. }
  222. }
  223. .user-details {
  224. flex: 1;
  225. .name-row {
  226. display: flex;
  227. align-items: center;
  228. margin-bottom: 12rpx;
  229. .user-name {
  230. font-size: 36rpx;
  231. font-weight: 600;
  232. color: #ffffff;
  233. text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  234. }
  235. .user-role {
  236. font-size: 22rpx;
  237. color: #ffffff;
  238. background: rgba(255, 255, 255, 0.25);
  239. padding: 4rpx 16rpx;
  240. border-radius: 20rpx;
  241. margin-left: 16rpx;
  242. font-weight: 500;
  243. }
  244. }
  245. .company-name {
  246. font-size: 24rpx;
  247. color: rgba(255, 255, 255, 0.85);
  248. display: block;
  249. text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  250. }
  251. }
  252. }
  253. .qr-btn {
  254. display: flex;
  255. flex-direction: column;
  256. align-items: center;
  257. justify-content: center;
  258. background: rgba(255, 255, 255, 0.2);
  259. padding: 16rpx 20rpx;
  260. border-radius: 24rpx;
  261. backdrop-filter: blur(10rpx);
  262. border: 1rpx solid rgba(255, 255, 255, 0.3);
  263. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
  264. .qr-text {
  265. font-size: 20rpx;
  266. color: #ffffff;
  267. margin-top: 4rpx;
  268. text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
  269. }
  270. }
  271. }
  272. // 数据卡片
  273. .data-card {
  274. background: #ffffff;
  275. margin: 20rpx 40rpx;
  276. padding: 32rpx;
  277. border-radius: 24rpx;
  278. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
  279. .card-header {
  280. display: flex;
  281. justify-content: space-between;
  282. align-items: center;
  283. margin-bottom: 24rpx;
  284. }
  285. .card-title {
  286. font-size: 28rpx;
  287. font-weight: 600;
  288. color: #333333;
  289. }
  290. .data-row {
  291. display: flex;
  292. justify-content: space-between;
  293. .data-item {
  294. display: flex;
  295. flex-direction: column;
  296. align-items: center;
  297. flex: 1;
  298. position: relative;
  299. .data-value {
  300. font-size: 40rpx;
  301. font-weight: 600;
  302. color: #333333;
  303. margin-bottom: 12rpx;
  304. font-family: DIN, 'DIN Alternate', sans-serif;
  305. }
  306. .data-label {
  307. font-size: 24rpx;
  308. color: #999999;
  309. }
  310. &.highlight .data-value {
  311. color: #ff6b35;
  312. }
  313. &:not(:last-child)::after {
  314. content: '';
  315. position: absolute;
  316. right: 0;
  317. top: 50%;
  318. transform: translateY(-50%);
  319. width: 1rpx;
  320. height: 60rpx;
  321. background: #f0f0f0;
  322. }
  323. }
  324. }
  325. }
  326. // 功能菜单
  327. .menu-card {
  328. background: #ffffff;
  329. margin: 20rpx 40rpx;
  330. padding: 0 32rpx;
  331. border-radius: 24rpx;
  332. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
  333. .menu-item {
  334. display: flex;
  335. align-items: center;
  336. padding: 32rpx 0;
  337. .menu-icon-wrapper {
  338. width: 60rpx;
  339. height: 60rpx;
  340. border-radius: 16rpx;
  341. background: rgba(102, 126, 234, 0.08);
  342. display: flex;
  343. align-items: center;
  344. justify-content: center;
  345. margin-right: 20rpx;
  346. }
  347. .menu-text {
  348. flex: 1;
  349. font-size: 28rpx;
  350. color: #333333;
  351. }
  352. }
  353. .menu-divider {
  354. height: 1rpx;
  355. background: #f0f0f0;
  356. }
  357. // ��出登录样�� .logout-item {
  358. .menu-icon-wrapper {
  359. background: rgba(255, 77, 79, 0.08);
  360. }
  361. .menu-text {
  362. color: #ff4d4f;
  363. &.logout-text {
  364. color: #ff4d4f;
  365. }
  366. }
  367. }
  368. }
  369. </style>