index.vue 15 KB

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