index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  1. <template>
  2. <view class="leads-container">
  3. <NavBar title="" color="#020202" :fixed="true" :bg="'#fff'">
  4. <template #left>
  5. <uni-search-bar placeholder="请输入" style="width: 70%" bgColor="#EEEEEE" clearButton="none"
  6. cancelButton="none"/>
  7. </template>
  8. <template #bottom>
  9. <view class="top-tabs">
  10. <scroll-view class="tab-scroll" scroll-x show-scrollbar="false">
  11. <view class="tab-list">
  12. <view class="tab-item" :class="{ active: currentTab === 'leads' }" @click="switchTab('leads')">
  13. <text class="tab-text">线索</text>
  14. <uni-badge v-if="tabCounts.leads > 0" :text="tabCounts.leads" type="error"
  15. size="small"></uni-badge>
  16. </view>
  17. <view class="tab-item" :class="{ active: currentTab === 'customer' }"
  18. @click="switchTab('customer')">
  19. <text class="tab-text">客户</text>
  20. <uni-badge v-if="tabCounts.customer > 0" :text="tabCounts.customer" type="error"
  21. size="small"></uni-badge>
  22. </view>
  23. <view class="tab-item" :class="{ active: currentTab === 'opportunity' }"
  24. @click="switchTab('opportunity')">
  25. <text class="tab-text">商机</text>
  26. <uni-badge v-if="tabCounts.opportunity > 0" :text="tabCounts.opportunity" type="error"
  27. size="small"></uni-badge>
  28. </view>
  29. <view class="tab-item" :class="{ active: currentTab === 'contract' }"
  30. @click="switchTab('contract')">
  31. <text class="tab-text">合同</text>
  32. <uni-badge v-if="tabCounts.contract > 0" :text="tabCounts.contract" type="error"
  33. size="small"></uni-badge>
  34. </view>
  35. <view class="tab-item" :class="{ active: currentTab === 'payment' }" @click="switchTab('payment')">
  36. <text class="tab-text">回款</text>
  37. <uni-badge v-if="tabCounts.payment > 0" :text="tabCounts.payment" type="error"
  38. size="small"></uni-badge>
  39. </view>
  40. </view>
  41. </scroll-view>
  42. <view class="menu-btn">
  43. <uni-icons type="bars" size="22" color="#333333"></uni-icons>
  44. </view>
  45. </view>
  46. </template>
  47. </NavBar>
  48. <scroll-view v-if="currentTab === 'leads'" class="content-scroll" scroll-y>
  49. <EmptyState
  50. v-if="leadsList.length === 0"
  51. text="暂无线索"
  52. sub-text="暂时没有新的线索信息"
  53. icon="person"
  54. />
  55. <view class="leads-list" v-else>
  56. <view class="leads-item" v-for="(item, index) in leadsList" :key="index" @click="viewDetail">
  57. <view class="row-title">
  58. <text class="title-text">{{ item.title }}</text>
  59. <text class="source-tag" :class="item.sourceType">{{ item.sourceName }}</text>
  60. </view>
  61. <view class="row-user">
  62. <UserAvatar src="" name="啊啊啊啊" :size="64" />
  63. <text class="user-name">啊啊啊啊</text>
  64. </view>
  65. <view class="row-info">
  66. <text class="info-item phone">手机:{{ item.phone }}</text>
  67. <text class="info-item follow">上次跟进:{{ item.lastFollow }}</text>
  68. <text v-if="item.overdue" class="info-item overdue"> {{ item.overdueTime }}</text>
  69. <uni-icons class="arrow-icon" type="right" size="14" color="#cccccc"></uni-icons>
  70. </view>
  71. </view>
  72. </view>
  73. </scroll-view>
  74. <scroll-view v-else-if="currentTab === 'customer'" class="content-scroll" scroll-y>
  75. <EmptyState
  76. v-if="customerList.length === 0"
  77. text="暂无客户"
  78. sub-text="暂时没有客户信息"
  79. icon="contact"
  80. />
  81. <view class="customer-list" v-else>
  82. <view class="company-group" v-for="(company, index) in customerList" :key="index">
  83. <view class="company-header" @click="viewDetail">
  84. <text class="company-name">{{ company.name }}</text>
  85. <uni-icons type="right" size="14" color="#cccccc"></uni-icons>
  86. </view>
  87. <view class="contact-item" v-for="(contact, cIndex) in company.contacts" :key="cIndex">
  88. <UserAvatar src="" name="" :size="48" />
  89. <view class="contact-info">
  90. <text class="contact-name">{{ contact.name }}</text>
  91. <text class="contact-intent">{{ contact.intent }}</text>
  92. </view>
  93. <text class="contact-follow">{{ contact.lastFollow }}</text>
  94. <uni-icons type="phone-filled" size="20" color="#ff6b35"></uni-icons>
  95. </view>
  96. </view>
  97. </view>
  98. </scroll-view>
  99. <scroll-view v-else-if="currentTab === 'opportunity'" class="content-scroll" scroll-y>
  100. <EmptyState
  101. v-if="opportunityList.length === 0"
  102. text="暂无商机"
  103. sub-text="暂时没有商机信息"
  104. icon="flag"
  105. />
  106. <view class="opportunity-list" v-else>
  107. <view class="opportunity-item" v-for="(item, index) in opportunityList" :key="index"
  108. @click="viewDetail">
  109. <view class="opp-header">
  110. <text class="opp-title">{{ item.title }}</text>
  111. <text class="stage-tag" :class="item.stageType">{{ item.stageName }}</text>
  112. </view>
  113. <view class="opp-company">
  114. <uni-icons type="shop" size="16" color="#999999"></uni-icons>
  115. <text class="company-name">{{ item.companyName }}</text>
  116. <uni-icons type="right" size="14" color="#cccccc"></uni-icons>
  117. </view>
  118. <view class="opp-contact">
  119. <uni-icons type="person" size="16" color="#999999"></uni-icons>
  120. <text class="contact-name">{{ item.contactName }}</text>
  121. <uni-icons type="phone-filled" size="16" color="#ff6b35"></uni-icons>
  122. </view>
  123. </view>
  124. </view>
  125. </scroll-view>
  126. <scroll-view v-else-if="currentTab === 'contract'" class="content-scroll" scroll-y>
  127. <EmptyState
  128. v-if="contractList.length === 0"
  129. text="暂无合同"
  130. sub-text="暂时没有合同信息"
  131. icon="paperclip"
  132. />
  133. <view class="contract-list" v-else>
  134. <view class="contract-item" v-for="(item, index) in contractList" :key="index" @click="viewDetail">
  135. <view class="contract-header">
  136. <text class="contract-title">{{ item.title }}</text>
  137. <text class="status-tag" :class="item.statusType">{{ item.statusName }}</text>
  138. </view>
  139. <view class="contract-company">
  140. <uni-icons type="shop" size="16" color="#999999"></uni-icons>
  141. <text class="company-name">{{ item.companyName }}</text>
  142. </view>
  143. <view class="contract-no">
  144. <uni-icons type="paperclip" size="16" color="#999999"></uni-icons>
  145. <text class="no-text">{{ item.contractNo }}</text>
  146. </view>
  147. </view>
  148. </view>
  149. </scroll-view>
  150. <scroll-view v-else-if="currentTab === 'payment'" class="content-scroll" scroll-y>
  151. <EmptyState
  152. v-if="paymentList.length === 0"
  153. text="暂无回款"
  154. sub-text="暂时没有回款记录"
  155. icon="wallet"
  156. />
  157. <view class="payment-list" v-else>
  158. <view class="payment-item" v-for="(item, index) in paymentList" :key="index" @click="viewDetail">
  159. <view class="payment-header">
  160. <text class="payment-title">{{ item.title }}</text>
  161. <text class="status-tag" :class="item.statusType">{{ item.statusName }}</text>
  162. </view>
  163. <view class="payment-company">
  164. <uni-icons type="shop" size="16" color="#999999"></uni-icons>
  165. <text class="company-name">{{ item.companyName }}</text>
  166. </view>
  167. <view class="payment-footer">
  168. <view class="payment-left">
  169. <uni-icons type="calendar" size="16" color="#999999"></uni-icons>
  170. <text class="date-text">{{ item.date }}</text>
  171. </view>
  172. <text class="payment-amount" :class="item.statusType">{{ item.amount }}</text>
  173. </view>
  174. </view>
  175. </view>
  176. </scroll-view>
  177. </view>
  178. </template>
  179. <script setup>
  180. import NavBar from '@/components/nav-bar/index.vue'
  181. import EmptyState from '@/components/empty-state/index.vue'
  182. import {
  183. ref,
  184. reactive
  185. } from 'vue'
  186. const currentTab = ref('leads')
  187. const tabCounts = reactive({
  188. leads: 0,
  189. customer: 0,
  190. opportunity: 0,
  191. contract: 0,
  192. payment: 0
  193. })
  194. const leadsList = reactive([])
  195. const customerList = reactive([])
  196. const opportunityList = reactive([{
  197. title: '独守空房几十块雷锋精神',
  198. stageType: 'negotiating',
  199. stageName: '独守空房几',
  200. companyName: '独守空房几十块',
  201. contactName: '几十块雷锋精'
  202. }, ])
  203. const contractList = reactive([{
  204. title: '独守空房几十块雷锋精神',
  205. statusType: 'overdue',
  206. statusName: '撒方方达',
  207. companyName: '是的范德萨范德萨',
  208. contractNo: 'NO741852960122'
  209. }])
  210. const paymentList = reactive([{
  211. title: '独守空房几十块雷锋精神',
  212. statusType: 'overdue',
  213. statusName: '独守',
  214. companyName: '独守空房几十块雷锋精神独守空房几十块雷锋精神',
  215. date: '2026-03-06',
  216. amount: '3680.9'
  217. }, ])
  218. const switchTab = (tab) => {
  219. currentTab.value = tab
  220. }
  221. const viewDetail = () => {
  222. uni.showToast({
  223. title: '',
  224. icon: 'none'
  225. })
  226. }
  227. </script>
  228. <style lang="scss" scoped>
  229. scroll-view {
  230. box-sizing: border-box;
  231. }
  232. .leads-container {
  233. height: 100vh;
  234. background: #f5f6f8;
  235. }
  236. .top-tabs {
  237. display: flex;
  238. align-items: center;
  239. background: #ffffff;
  240. padding: 0 20rpx;
  241. position: sticky;
  242. top: 0;
  243. .tab-scroll {
  244. flex: 1;
  245. white-space: nowrap;
  246. .tab-list {
  247. display: inline-flex;
  248. align-items: center;
  249. height: 88rpx;
  250. }
  251. .tab-item {
  252. display: inline-flex;
  253. align-items: center;
  254. padding: 0 20rpx;
  255. position: relative;
  256. .tab-text {
  257. font-size: 28rpx;
  258. color: #999999;
  259. }
  260. &.active .tab-text {
  261. font-size: 30rpx;
  262. font-weight: 600;
  263. color: #333333;
  264. }
  265. }
  266. }
  267. .menu-btn {
  268. display: flex;
  269. align-items: center;
  270. justify-content: center;
  271. padding: 20rpx;
  272. flex-shrink: 0;
  273. }
  274. }
  275. .content-scroll {
  276. flex: 1;
  277. overflow-y: auto;
  278. padding: 20rpx;
  279. box-sizing: border-box;
  280. }
  281. .leads-list {
  282. .leads-item {
  283. background: #ffffff;
  284. border-radius: 16rpx;
  285. padding: 24rpx 28rpx;
  286. margin-bottom: 20rpx;
  287. .row-title {
  288. display: flex;
  289. justify-content: space-between;
  290. align-items: center;
  291. margin-bottom: 16rpx;
  292. .title-text {
  293. font-size: 30rpx;
  294. font-weight: 600;
  295. color: #333333;
  296. flex: 1;
  297. }
  298. .source-tag {
  299. font-size: 22rpx;
  300. padding: 4rpx 12rpx;
  301. border-radius: 8rpx;
  302. flex-shrink: 0;
  303. margin-left: 16rpx;
  304. &.official {
  305. color: #ff6b35;
  306. background: rgba(255, 107, 53, 0.08);
  307. }
  308. &.miniapp {
  309. color: #52c41a;
  310. background: rgba(82, 196, 26, 0.08);
  311. }
  312. }
  313. }
  314. .row-user {
  315. display: flex;
  316. align-items: center;
  317. margin-bottom: 16rpx;
  318. .user-avatar {
  319. width: 48rpx;
  320. height: 48rpx;
  321. border-radius: 50%;
  322. margin-right: 12rpx;
  323. flex-shrink: 0;
  324. }
  325. .user-name {
  326. font-size: 26rpx;
  327. color: #666666;
  328. }
  329. }
  330. .row-info {
  331. display: flex;
  332. align-items: center;
  333. flex-wrap: wrap;
  334. .info-item {
  335. font-size: 24rpx;
  336. color: #999999;
  337. margin-right: 24rpx;
  338. &.phone {
  339. color: #666666;
  340. }
  341. &.overdue {
  342. color: #ff4d4f;
  343. }
  344. }
  345. .arrow-icon {
  346. margin-left: auto;
  347. flex-shrink: 0;
  348. }
  349. }
  350. }
  351. }
  352. .customer-list {
  353. .company-group {
  354. background: #ffffff;
  355. border-radius: 16rpx;
  356. margin-bottom: 20rpx;
  357. overflow: hidden;
  358. .company-header {
  359. display: flex;
  360. justify-content: space-between;
  361. align-items: center;
  362. padding: 24rpx 28rpx;
  363. background: #f8f9fa;
  364. .company-name {
  365. font-size: 30rpx;
  366. font-weight: 600;
  367. color: #333333;
  368. }
  369. }
  370. .contact-item {
  371. display: flex;
  372. align-items: center;
  373. padding: 24rpx 28rpx;
  374. border-bottom: 1rpx solid #f0f0f0;
  375. &:last-child {
  376. border-bottom: none;
  377. }
  378. .contact-avatar {
  379. width: 60rpx;
  380. height: 60rpx;
  381. border-radius: 50%;
  382. margin-right: 16rpx;
  383. flex-shrink: 0;
  384. }
  385. .contact-info {
  386. flex: 1;
  387. .contact-name {
  388. display: block;
  389. font-size: 28rpx;
  390. color: #333333;
  391. margin-bottom: 8rpx;
  392. }
  393. .contact-intent {
  394. display: block;
  395. font-size: 24rpx;
  396. color: #999999;
  397. }
  398. }
  399. .contact-follow {
  400. font-size: 24rpx;
  401. color: #999999;
  402. margin: 0 24rpx;
  403. }
  404. }
  405. }
  406. }
  407. .opportunity-list {
  408. .opportunity-item {
  409. background: #ffffff;
  410. border-radius: 16rpx;
  411. padding: 24rpx 28rpx;
  412. margin-bottom: 20rpx;
  413. .opp-header {
  414. display: flex;
  415. justify-content: space-between;
  416. align-items: center;
  417. margin-bottom: 16rpx;
  418. .opp-title {
  419. font-size: 30rpx;
  420. font-weight: 600;
  421. color: #333333;
  422. flex: 1;
  423. }
  424. .stage-tag {
  425. font-size: 22rpx;
  426. padding: 4rpx 12rpx;
  427. border-radius: 8rpx;
  428. flex-shrink: 0;
  429. margin-left: 16rpx;
  430. &.negotiating {
  431. color: #ff6b35;
  432. background: rgba(255, 107, 53, 0.08);
  433. }
  434. &.preliminary {
  435. color: #ff9500;
  436. background: rgba(255, 149, 0, 0.08);
  437. }
  438. &.demand {
  439. color: #1890ff;
  440. background: rgba(24, 144, 255, 0.08);
  441. }
  442. }
  443. }
  444. .opp-company {
  445. display: flex;
  446. align-items: center;
  447. margin-bottom: 12rpx;
  448. uni-icons {
  449. margin-right: 8rpx;
  450. }
  451. .company-name {
  452. flex: 1;
  453. font-size: 26rpx;
  454. color: #666666;
  455. }
  456. }
  457. .opp-contact {
  458. display: flex;
  459. align-items: center;
  460. uni-icons {
  461. margin-right: 8rpx;
  462. }
  463. .contact-name {
  464. flex: 1;
  465. font-size: 24rpx;
  466. color: #999999;
  467. }
  468. }
  469. }
  470. }
  471. .contract-list {
  472. .contract-item {
  473. background: #ffffff;
  474. border-radius: 16rpx;
  475. padding: 24rpx 28rpx;
  476. margin-bottom: 20rpx;
  477. .contract-header {
  478. display: flex;
  479. justify-content: space-between;
  480. align-items: center;
  481. margin-bottom: 16rpx;
  482. .contract-title {
  483. font-size: 30rpx;
  484. font-weight: 600;
  485. color: #333333;
  486. flex: 1;
  487. }
  488. .status-tag {
  489. font-size: 22rpx;
  490. padding: 4rpx 12rpx;
  491. border-radius: 8rpx;
  492. flex-shrink: 0;
  493. margin-left: 16rpx;
  494. &.overdue {
  495. color: #ff4d4f;
  496. background: rgba(255, 77, 79, 0.08);
  497. }
  498. &.warning {
  499. color: #ff9500;
  500. background: rgba(255, 149, 0, 0.08);
  501. }
  502. &.normal {
  503. color: #52c41a;
  504. background: rgba(82, 196, 26, 0.08);
  505. }
  506. }
  507. }
  508. .contract-company {
  509. display: flex;
  510. align-items: center;
  511. margin-bottom: 12rpx;
  512. uni-icons {
  513. margin-right: 8rpx;
  514. }
  515. .company-name {
  516. font-size: 26rpx;
  517. color: #666666;
  518. }
  519. }
  520. .contract-no {
  521. display: flex;
  522. align-items: center;
  523. uni-icons {
  524. margin-right: 8rpx;
  525. }
  526. .no-text {
  527. font-size: 24rpx;
  528. color: #999999;
  529. }
  530. }
  531. }
  532. }
  533. .payment-list {
  534. .payment-item {
  535. background: #ffffff;
  536. border-radius: 16rpx;
  537. padding: 24rpx 28rpx;
  538. margin-bottom: 20rpx;
  539. .payment-header {
  540. display: flex;
  541. justify-content: space-between;
  542. align-items: center;
  543. margin-bottom: 16rpx;
  544. .payment-title {
  545. font-size: 30rpx;
  546. font-weight: 600;
  547. color: #333333;
  548. flex: 1;
  549. }
  550. .status-tag {
  551. font-size: 22rpx;
  552. padding: 4rpx 12rpx;
  553. border-radius: 8rpx;
  554. flex-shrink: 0;
  555. margin-left: 16rpx;
  556. &.overdue {
  557. color: #ff4d4f;
  558. background: rgba(255, 77, 79, 0.08);
  559. }
  560. &.warning {
  561. color: #ff9500;
  562. background: rgba(255, 149, 0, 0.08);
  563. }
  564. &.normal {
  565. color: #52c41a;
  566. background: rgba(82, 196, 26, 0.08);
  567. }
  568. }
  569. }
  570. .payment-company {
  571. display: flex;
  572. align-items: center;
  573. margin-bottom: 16rpx;
  574. uni-icons {
  575. margin-right: 8rpx;
  576. }
  577. .company-name {
  578. font-size: 26rpx;
  579. color: #666666;
  580. }
  581. }
  582. .payment-footer {
  583. display: flex;
  584. justify-content: space-between;
  585. align-items: center;
  586. .payment-left {
  587. display: flex;
  588. align-items: center;
  589. uni-icons {
  590. margin-right: 8rpx;
  591. }
  592. .date-text {
  593. font-size: 24rpx;
  594. color: #999999;
  595. }
  596. }
  597. .payment-amount {
  598. font-size: 32rpx;
  599. font-weight: 600;
  600. &.overdue {
  601. color: #ff4d4f;
  602. }
  603. &.warning {
  604. color: #ff9500;
  605. }
  606. &.normal {
  607. color: #ff6b35;
  608. }
  609. }
  610. }
  611. }
  612. }
  613. </style>