index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. <template>
  2. <view class="index-container">
  3. <!-- 顶部用户信息卡片 -->
  4. <view class="page-top">
  5. <view class="user-card">
  6. <view class="user-info">
  7. <view class="avatar-wrapper">
  8. <image class="avatar" src="/static/avatar-default.png" mode="aspectFill" />
  9. </view>
  10. <view class="user-details">
  11. <view class="name-row">
  12. <text class="user-name">赵建平</text>
  13. <text class="user-role">销售经理</text>
  14. </view>
  15. <text class="company-name">杭州臻迹网络技术有限公司</text>
  16. </view>
  17. </view>
  18. <view class="user-address">
  19. <view class="row" @click="makeCall">
  20. <text class="contact-icon">📞</text>
  21. <text class="contact-text">400-0000-0000 (点击拨打电话)</text>
  22. </view>
  23. <view class="row">
  24. <text class="contact-icon">✉️</text>
  25. <text class="contact-text">zhao.jp@subote.com</text>
  26. </view>
  27. <view class="row">
  28. <text class="contact-icon">📍</text>
  29. <text class="contact-text">上海市静安区江宁路 168 号</text>
  30. </view>
  31. </view>
  32. <view class="share-btn" @click="shareCard">
  33. <text class="share-icon">📇</text>
  34. <text class="share-text">分享名片</text>
  35. </view>
  36. </view>
  37. </view>
  38. <!-- 最近访客模块 -->
  39. <view class="recent-visitors">
  40. <view class="section-header">
  41. <text class="section-title">最近访客</text>
  42. <view class="visitor-count">
  43. <image class="visitor-icon" src="/static/visitor-icon.png" mode="aspectFit" />
  44. <text class="visitor-number">258 人</text>
  45. </view>
  46. <text class="view-more" @click="viewAllVisitors">查看更多</text>
  47. </view>
  48. <view class="visitor-list">
  49. <view class="visitor-item">
  50. <view class="visitor-avatar">
  51. <image src="/static/avatar-1.png" mode="aspectFill" />
  52. </view>
  53. <view class="visitor-info">
  54. <view class="visitor-name-row">
  55. <text class="visitor-name">惠誉黑白激光打印机</text>
  56. <text class="visitor-tag">待跟进</text>
  57. </view>
  58. <text class="visitor-source">来源:微信小程序 手机:13622255856</text>
  59. <text class="visitor-action">打印机 | 惠普</text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 功能菜单网格 -->
  65. <view class="function-grid">
  66. <view class="grid-item" @click="navigateTo('clue')">
  67. <view class="grid-icon clue-icon">
  68. <text class="icon-text">📋</text>
  69. </view>
  70. <text class="grid-label">线索管理</text>
  71. </view>
  72. <view class="grid-item" @click="navigateTo('customer')">
  73. <view class="grid-icon customer-icon">
  74. <text class="icon-text">🏢</text>
  75. </view>
  76. <text class="grid-label">客户管理</text>
  77. </view>
  78. <view class="grid-item" @click="navigateTo('contact')">
  79. <view class="grid-icon contact-icon">
  80. <text class="icon-text">👥</text>
  81. </view>
  82. <text class="grid-label">联系人管理</text>
  83. </view>
  84. <view class="grid-item" @click="navigateTo('public-pool')">
  85. <view class="grid-icon pool-icon">
  86. <text class="icon-text">🌊</text>
  87. </view>
  88. <text class="grid-label">客户公海</text>
  89. </view>
  90. <view class="grid-item" @click="navigateTo('opportunity')">
  91. <view class="grid-icon opportunity-icon">
  92. <text class="icon-text">💼</text>
  93. </view>
  94. <text class="grid-label">商机管理</text>
  95. </view>
  96. <view class="grid-item" @click="navigateTo('payment')">
  97. <view class="grid-icon payment-icon">
  98. <text class="icon-text">💰</text>
  99. </view>
  100. <text class="grid-label">回款管理</text>
  101. </view>
  102. <view class="grid-item" @click="navigateTo('product')">
  103. <view class="grid-icon product-icon">
  104. <text class="icon-text">📦</text>
  105. </view>
  106. <text class="grid-label">产品管理</text>
  107. </view>
  108. <view class="grid-item" @click="navigateTo('all')">
  109. <view class="grid-icon all-icon">
  110. <text class="icon-text">📊</text>
  111. </view>
  112. <text class="grid-label">全部</text>
  113. </view>
  114. </view>
  115. <!-- 业务日历模块 -->
  116. <view class="business-calendar">
  117. <view class="section-header">
  118. <text class="section-title">业务日历</text>
  119. <text class="view-more" @click="viewAllCalendar">查看更多</text>
  120. </view>
  121. <!-- 日历头部 -->
  122. <view class="calendar-header">
  123. <text class="calendar-month">2026 年 4 月</text>
  124. </view>
  125. <!-- 星期 -->
  126. <view class="calendar-weekdays">
  127. <text class="weekday">日</text>
  128. <text class="weekday">一</text>
  129. <text class="weekday">二</text>
  130. <text class="weekday">三</text>
  131. <text class="weekday">四</text>
  132. <text class="weekday">五</text>
  133. <text class="weekday">六</text>
  134. </view>
  135. <!-- 日期网格 -->
  136. <view class="calendar-dates">
  137. <view class="date-cell">
  138. <text class="date-num">15</text>
  139. </view>
  140. <view class="date-cell">
  141. <text class="date-num">16</text>
  142. </view>
  143. <view class="date-cell">
  144. <text class="date-num">17</text>
  145. </view>
  146. <view class="date-cell today">
  147. <text class="date-num current">18</text>
  148. </view>
  149. <view class="date-cell has-event">
  150. <text class="date-num">19</text>
  151. <view class="event-dot"></view>
  152. </view>
  153. <view class="date-cell">
  154. <text class="date-num">20</text>
  155. </view>
  156. <view class="date-cell">
  157. <text class="date-num">21</text>
  158. </view>
  159. </view>
  160. <!-- 今日日程 -->
  161. <view class="today-schedule">
  162. <view class="schedule-item">
  163. <view class="schedule-time">
  164. <text class="time-period">下午</text>
  165. <text class="time-value">3:00</text>
  166. </view>
  167. <view class="schedule-content">
  168. <text class="schedule-title">与李总沟通合同细节</text>
  169. </view>
  170. </view>
  171. <view class="schedule-item tomorrow">
  172. <view class="schedule-time">
  173. <text class="time-period">明天</text>
  174. <text class="time-value">10:00</text>
  175. </view>
  176. <view class="schedule-content">
  177. <text class="schedule-title">拜访新客户 - 科技公司</text>
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. <!-- 底部留白,避免被 TabBar 遮挡 -->
  183. <view class="bottom-spacer"></view>
  184. </view>
  185. </template>
  186. <script setup>
  187. import {
  188. ref,
  189. onMounted
  190. } from 'vue'
  191. import {
  192. getUserInfo,
  193. isLogin
  194. } from '@/utils/userCache.js'
  195. const userInfo = ref(null)
  196. onMounted(() => {
  197. loadUserInfo()
  198. })
  199. const loadUserInfo = () => {
  200. const info = getUserInfo()
  201. if (info) {
  202. userInfo.value = info
  203. }
  204. }
  205. const makeCall = () => {
  206. uni.makePhoneCall({
  207. phoneNumber: '4000000000'
  208. })
  209. }
  210. const shareCard = () => {
  211. uni.showShareMenu({
  212. withShareTicket: true
  213. })
  214. }
  215. const viewAllVisitors = () => {
  216. uni.navigateTo({
  217. url: '/pages/visitors/list'
  218. })
  219. }
  220. const navigateTo = (page) => {
  221. uni.showToast({
  222. title: `功能开发中:${page}`,
  223. icon: 'none'
  224. })
  225. }
  226. const viewAllCalendar = () => {
  227. uni.navigateTo({
  228. url: '/pages/calendar/list'
  229. })
  230. }
  231. </script>
  232. <style lang="scss" scoped>
  233. .index-container {
  234. min-height: 100vh;
  235. background-color: #f5f6f8;
  236. padding-bottom: 120rpx;
  237. }
  238. /* 用户信息卡片 */
  239. .page-top {
  240. width: 750rpx;
  241. background: linear-gradient(180deg, #abc7ff 44%, #f4f5f9 100%);
  242. margin-bottom: 20rpx;
  243. padding: 20px;
  244. .user-card {
  245. background: linear-gradient(180deg, rgba(255, 255, 255, 0.20) 51%, rgba(255, 255, 255, 0.80) 100%), rgba(255, 255, 255, 0.20);
  246. border: 4rpx solid #fcf6ec;
  247. border-radius: 28rpx;
  248. padding: 20px;
  249. position: relative;
  250. .user-info {
  251. display: flex;
  252. align-items: flex-start;
  253. .avatar-wrapper {
  254. flex-shrink: 0;
  255. margin-right: 24rpx;
  256. .avatar {
  257. width: 120rpx;
  258. height: 120rpx;
  259. border-radius: 50%;
  260. border: 4rpx solid rgba(255, 255, 255, 0.3);
  261. }
  262. }
  263. .user-details {
  264. flex: 1;
  265. .name-row {
  266. display: flex;
  267. align-items: center;
  268. margin-bottom: 12rpx;
  269. .user-name {
  270. font-size: 40rpx;
  271. font-weight: 600;
  272. text-align: LEFT;
  273. color: #202020;
  274. line-height: 50rpx;
  275. letter-spacing: 0.02rpx;
  276. }
  277. .user-role {
  278. margin-left: 10px;
  279. width: 108rpx;
  280. height: 40rpx;
  281. line-height: 40rpx;
  282. text-align: center;
  283. background: rgba(255, 255, 255, 0.90);
  284. border-radius: 8rpx;
  285. font-size: 22rpx;
  286. font-weight: 500;
  287. color: #456eff;
  288. }
  289. }
  290. .company-name {
  291. font-size: 26rpx;
  292. color: rgba(255, 255, 255, 0.9);
  293. display: block;
  294. margin-bottom: 16rpx;
  295. }
  296. .contact-row,
  297. .email-row,
  298. .address-row {
  299. display: flex;
  300. align-items: center;
  301. margin-bottom: 8rpx;
  302. .contact-icon {
  303. font-size: 24rpx;
  304. margin-right: 8rpx;
  305. }
  306. .contact-text {
  307. font-size: 22rpx;
  308. color: rgba(255, 255, 255, 0.85);
  309. }
  310. }
  311. }
  312. }
  313. .user-address{
  314. display: grid;
  315. gap: 10rpx;
  316. .row{
  317. display: grid;
  318. grid-template-columns: 24px 1fr;
  319. gap: 6rpx;
  320. align-items: center;
  321. font-size: 24rpx;
  322. .contact-text{
  323. font-weight: 500;
  324. color: #666666;
  325. }
  326. }
  327. }
  328. .share-btn {
  329. display: flex;
  330. align-items: center;
  331. justify-content: center;
  332. background: rgba(255, 255, 255, 0.2);
  333. align-self: flex-start;
  334. width: 204rpx;
  335. height: 66rpx;
  336. background: linear-gradient(90deg, #446dff, rgba(68, 109, 255, 0.30) 100%);
  337. border-radius: 8rpx 28rpx 8rpx 28rpx;
  338. box-sizing: border-box;
  339. position: absolute;
  340. top: -2rpx;
  341. right: -2rpx;
  342. .share-icon {
  343. font-size: 28rpx;
  344. margin-right: 8rpx;
  345. }
  346. .share-text {
  347. font-size: 26rpx;
  348. color: #ffffff;
  349. }
  350. }
  351. }
  352. }
  353. /* 最近访客模块 */
  354. .recent-visitors {
  355. background: #ffffff;
  356. margin: 20rpx;
  357. padding: 32rpx;
  358. border-radius: 24rpx;
  359. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
  360. .section-header {
  361. display: flex;
  362. align-items: center;
  363. justify-content: space-between;
  364. margin-bottom: 24rpx;
  365. .section-title {
  366. font-size: 32rpx;
  367. font-weight: 600;
  368. color: #333333;
  369. }
  370. .visitor-count {
  371. display: flex;
  372. align-items: center;
  373. .visitor-icon {
  374. width: 32rpx;
  375. height: 32rpx;
  376. margin-right: 8rpx;
  377. }
  378. .visitor-number {
  379. font-size: 24rpx;
  380. color: #999999;
  381. }
  382. }
  383. .view-more {
  384. font-size: 24rpx;
  385. color: #667eea;
  386. }
  387. }
  388. .visitor-list {
  389. .visitor-item {
  390. display: flex;
  391. align-items: flex-start;
  392. .visitor-avatar {
  393. width: 80rpx;
  394. height: 80rpx;
  395. border-radius: 50%;
  396. margin-right: 20rpx;
  397. flex-shrink: 0;
  398. image {
  399. width: 100%;
  400. height: 100%;
  401. border-radius: 50%;
  402. }
  403. }
  404. .visitor-info {
  405. flex: 1;
  406. .visitor-name-row {
  407. display: flex;
  408. align-items: center;
  409. margin-bottom: 8rpx;
  410. .visitor-name {
  411. font-size: 28rpx;
  412. color: #333333;
  413. font-weight: 500;
  414. }
  415. .visitor-tag {
  416. font-size: 20rpx;
  417. color: #ff6b6b;
  418. background: rgba(255, 107, 107, 0.1);
  419. padding: 4rpx 12rpx;
  420. border-radius: 16rpx;
  421. margin-left: 12rpx;
  422. }
  423. }
  424. .visitor-source {
  425. font-size: 22rpx;
  426. color: #999999;
  427. display: block;
  428. margin-bottom: 8rpx;
  429. }
  430. .visitor-action {
  431. font-size: 22rpx;
  432. color: #666666;
  433. }
  434. }
  435. }
  436. }
  437. }
  438. /* 功能菜单网格 */
  439. .function-grid {
  440. display: grid;
  441. grid-template-columns: repeat(4, 1fr);
  442. gap: 24rpx;
  443. background: #ffffff;
  444. margin: 20rpx;
  445. padding: 32rpx 24rpx;
  446. border-radius: 24rpx;
  447. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
  448. .grid-item {
  449. display: flex;
  450. flex-direction: column;
  451. align-items: center;
  452. .grid-icon {
  453. width: 96rpx;
  454. height: 96rpx;
  455. border-radius: 28rpx;
  456. display: flex;
  457. align-items: center;
  458. justify-content: center;
  459. margin-bottom: 12rpx;
  460. .icon-text {
  461. font-size: 48rpx;
  462. }
  463. }
  464. .clue-icon {
  465. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  466. }
  467. .customer-icon {
  468. background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
  469. }
  470. .contact-icon {
  471. background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  472. }
  473. .pool-icon {
  474. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  475. }
  476. .opportunity-icon {
  477. background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  478. }
  479. .payment-icon {
  480. background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
  481. }
  482. .product-icon {
  483. background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
  484. }
  485. .all-icon {
  486. background: linear-gradient(135deg, #cd9cf2 0%, #f6f3ff 100%);
  487. }
  488. .grid-label {
  489. font-size: 24rpx;
  490. color: #333333;
  491. }
  492. }
  493. }
  494. /* 业务日历模块 */
  495. .business-calendar {
  496. background: #ffffff;
  497. margin: 20rpx;
  498. padding: 32rpx;
  499. border-radius: 24rpx;
  500. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
  501. .section-header {
  502. display: flex;
  503. align-items: center;
  504. justify-content: space-between;
  505. margin-bottom: 24rpx;
  506. .section-title {
  507. font-size: 32rpx;
  508. font-weight: 600;
  509. color: #333333;
  510. }
  511. .view-more {
  512. font-size: 24rpx;
  513. color: #667eea;
  514. }
  515. }
  516. .calendar-header {
  517. text-align: center;
  518. margin-bottom: 20rpx;
  519. .calendar-month {
  520. font-size: 30rpx;
  521. font-weight: 600;
  522. color: #333333;
  523. }
  524. }
  525. .calendar-weekdays {
  526. display: grid;
  527. grid-template-columns: repeat(7, 1fr);
  528. text-align: center;
  529. margin-bottom: 16rpx;
  530. .weekday {
  531. font-size: 24rpx;
  532. color: #999999;
  533. padding: 12rpx 0;
  534. }
  535. }
  536. .calendar-dates {
  537. display: grid;
  538. grid-template-columns: repeat(7, 1fr);
  539. gap: 8rpx;
  540. margin-bottom: 32rpx;
  541. .date-cell {
  542. aspect-ratio: 1;
  543. display: flex;
  544. flex-direction: column;
  545. align-items: center;
  546. justify-content: center;
  547. border-radius: 50%;
  548. position: relative;
  549. .date-num {
  550. font-size: 26rpx;
  551. color: #333333;
  552. }
  553. &.today {
  554. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  555. .date-num {
  556. color: #ffffff;
  557. font-weight: 600;
  558. }
  559. }
  560. &.has-event {
  561. .event-dot {
  562. width: 12rpx;
  563. height: 12rpx;
  564. background: #ff6b6b;
  565. border-radius: 50%;
  566. position: absolute;
  567. bottom: 8rpx;
  568. }
  569. }
  570. }
  571. }
  572. .today-schedule {
  573. .schedule-item {
  574. display: flex;
  575. align-items: flex-start;
  576. padding: 24rpx;
  577. background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  578. border-radius: 16rpx;
  579. margin-bottom: 16rpx;
  580. border-left: 6rpx solid #667eea;
  581. &.tomorrow {
  582. border-left-color: #30cfd0;
  583. }
  584. .schedule-time {
  585. display: flex;
  586. flex-direction: column;
  587. align-items: center;
  588. margin-right: 20rpx;
  589. min-width: 100rpx;
  590. .time-period {
  591. font-size: 22rpx;
  592. color: #999999;
  593. margin-bottom: 4rpx;
  594. }
  595. .time-value {
  596. font-size: 28rpx;
  597. font-weight: 600;
  598. color: #333333;
  599. }
  600. }
  601. .schedule-content {
  602. flex: 1;
  603. .schedule-title {
  604. font-size: 28rpx;
  605. color: #333333;
  606. line-height: 1.5;
  607. }
  608. }
  609. }
  610. }
  611. }
  612. .bottom-spacer {
  613. height: 40rpx;
  614. }
  615. </style>