index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  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. const contractList = reactive([])
  198. const paymentList = reactive([ ])
  199. const switchTab = (tab) => {
  200. currentTab.value = tab
  201. }
  202. const viewDetail = () => {
  203. uni.showToast({
  204. title: '',
  205. icon: 'none'
  206. })
  207. }
  208. </script>
  209. <style lang="scss" scoped>
  210. scroll-view {
  211. box-sizing: border-box;
  212. }
  213. .leads-container {
  214. height: 100vh;
  215. background: #f5f6f8;
  216. }
  217. .top-tabs {
  218. display: flex;
  219. align-items: center;
  220. background: #ffffff;
  221. padding: 0 20rpx;
  222. position: sticky;
  223. top: 0;
  224. .tab-scroll {
  225. flex: 1;
  226. white-space: nowrap;
  227. .tab-list {
  228. display: inline-flex;
  229. align-items: center;
  230. height: 88rpx;
  231. }
  232. .tab-item {
  233. display: inline-flex;
  234. align-items: center;
  235. padding: 0 20rpx;
  236. position: relative;
  237. .tab-text {
  238. font-size: 28rpx;
  239. color: #999999;
  240. }
  241. &.active .tab-text {
  242. font-size: 30rpx;
  243. font-weight: 600;
  244. color: #333333;
  245. }
  246. }
  247. }
  248. .menu-btn {
  249. display: flex;
  250. align-items: center;
  251. justify-content: center;
  252. padding: 20rpx;
  253. flex-shrink: 0;
  254. }
  255. }
  256. .content-scroll {
  257. flex: 1;
  258. overflow-y: auto;
  259. padding: 20rpx;
  260. box-sizing: border-box;
  261. }
  262. .leads-list {
  263. .leads-item {
  264. background: #ffffff;
  265. border-radius: 16rpx;
  266. padding: 24rpx 28rpx;
  267. margin-bottom: 20rpx;
  268. .row-title {
  269. display: flex;
  270. justify-content: space-between;
  271. align-items: center;
  272. margin-bottom: 16rpx;
  273. .title-text {
  274. font-size: 30rpx;
  275. font-weight: 600;
  276. color: #333333;
  277. flex: 1;
  278. }
  279. .source-tag {
  280. font-size: 22rpx;
  281. padding: 4rpx 12rpx;
  282. border-radius: 8rpx;
  283. flex-shrink: 0;
  284. margin-left: 16rpx;
  285. &.official {
  286. color: #ff6b35;
  287. background: rgba(255, 107, 53, 0.08);
  288. }
  289. &.miniapp {
  290. color: #52c41a;
  291. background: rgba(82, 196, 26, 0.08);
  292. }
  293. }
  294. }
  295. .row-user {
  296. display: flex;
  297. align-items: center;
  298. margin-bottom: 16rpx;
  299. .user-avatar {
  300. width: 48rpx;
  301. height: 48rpx;
  302. border-radius: 50%;
  303. margin-right: 12rpx;
  304. flex-shrink: 0;
  305. }
  306. .user-name {
  307. font-size: 26rpx;
  308. color: #666666;
  309. }
  310. }
  311. .row-info {
  312. display: flex;
  313. align-items: center;
  314. flex-wrap: wrap;
  315. .info-item {
  316. font-size: 24rpx;
  317. color: #999999;
  318. margin-right: 24rpx;
  319. &.phone {
  320. color: #666666;
  321. }
  322. &.overdue {
  323. color: #ff4d4f;
  324. }
  325. }
  326. .arrow-icon {
  327. margin-left: auto;
  328. flex-shrink: 0;
  329. }
  330. }
  331. }
  332. }
  333. .customer-list {
  334. .company-group {
  335. background: #ffffff;
  336. border-radius: 16rpx;
  337. margin-bottom: 20rpx;
  338. overflow: hidden;
  339. .company-header {
  340. display: flex;
  341. justify-content: space-between;
  342. align-items: center;
  343. padding: 24rpx 28rpx;
  344. background: #f8f9fa;
  345. .company-name {
  346. font-size: 30rpx;
  347. font-weight: 600;
  348. color: #333333;
  349. }
  350. }
  351. .contact-item {
  352. display: flex;
  353. align-items: center;
  354. padding: 24rpx 28rpx;
  355. border-bottom: 1rpx solid #f0f0f0;
  356. &:last-child {
  357. border-bottom: none;
  358. }
  359. .contact-avatar {
  360. width: 60rpx;
  361. height: 60rpx;
  362. border-radius: 50%;
  363. margin-right: 16rpx;
  364. flex-shrink: 0;
  365. }
  366. .contact-info {
  367. flex: 1;
  368. .contact-name {
  369. display: block;
  370. font-size: 28rpx;
  371. color: #333333;
  372. margin-bottom: 8rpx;
  373. }
  374. .contact-intent {
  375. display: block;
  376. font-size: 24rpx;
  377. color: #999999;
  378. }
  379. }
  380. .contact-follow {
  381. font-size: 24rpx;
  382. color: #999999;
  383. margin: 0 24rpx;
  384. }
  385. }
  386. }
  387. }
  388. .opportunity-list {
  389. .opportunity-item {
  390. background: #ffffff;
  391. border-radius: 16rpx;
  392. padding: 24rpx 28rpx;
  393. margin-bottom: 20rpx;
  394. .opp-header {
  395. display: flex;
  396. justify-content: space-between;
  397. align-items: center;
  398. margin-bottom: 16rpx;
  399. .opp-title {
  400. font-size: 30rpx;
  401. font-weight: 600;
  402. color: #333333;
  403. flex: 1;
  404. }
  405. .stage-tag {
  406. font-size: 22rpx;
  407. padding: 4rpx 12rpx;
  408. border-radius: 8rpx;
  409. flex-shrink: 0;
  410. margin-left: 16rpx;
  411. &.negotiating {
  412. color: #ff6b35;
  413. background: rgba(255, 107, 53, 0.08);
  414. }
  415. &.preliminary {
  416. color: #ff9500;
  417. background: rgba(255, 149, 0, 0.08);
  418. }
  419. &.demand {
  420. color: #1890ff;
  421. background: rgba(24, 144, 255, 0.08);
  422. }
  423. }
  424. }
  425. .opp-company {
  426. display: flex;
  427. align-items: center;
  428. margin-bottom: 12rpx;
  429. uni-icons {
  430. margin-right: 8rpx;
  431. }
  432. .company-name {
  433. flex: 1;
  434. font-size: 26rpx;
  435. color: #666666;
  436. }
  437. }
  438. .opp-contact {
  439. display: flex;
  440. align-items: center;
  441. uni-icons {
  442. margin-right: 8rpx;
  443. }
  444. .contact-name {
  445. flex: 1;
  446. font-size: 24rpx;
  447. color: #999999;
  448. }
  449. }
  450. }
  451. }
  452. .contract-list {
  453. .contract-item {
  454. background: #ffffff;
  455. border-radius: 16rpx;
  456. padding: 24rpx 28rpx;
  457. margin-bottom: 20rpx;
  458. .contract-header {
  459. display: flex;
  460. justify-content: space-between;
  461. align-items: center;
  462. margin-bottom: 16rpx;
  463. .contract-title {
  464. font-size: 30rpx;
  465. font-weight: 600;
  466. color: #333333;
  467. flex: 1;
  468. }
  469. .status-tag {
  470. font-size: 22rpx;
  471. padding: 4rpx 12rpx;
  472. border-radius: 8rpx;
  473. flex-shrink: 0;
  474. margin-left: 16rpx;
  475. &.overdue {
  476. color: #ff4d4f;
  477. background: rgba(255, 77, 79, 0.08);
  478. }
  479. &.warning {
  480. color: #ff9500;
  481. background: rgba(255, 149, 0, 0.08);
  482. }
  483. &.normal {
  484. color: #52c41a;
  485. background: rgba(82, 196, 26, 0.08);
  486. }
  487. }
  488. }
  489. .contract-company {
  490. display: flex;
  491. align-items: center;
  492. margin-bottom: 12rpx;
  493. uni-icons {
  494. margin-right: 8rpx;
  495. }
  496. .company-name {
  497. font-size: 26rpx;
  498. color: #666666;
  499. }
  500. }
  501. .contract-no {
  502. display: flex;
  503. align-items: center;
  504. uni-icons {
  505. margin-right: 8rpx;
  506. }
  507. .no-text {
  508. font-size: 24rpx;
  509. color: #999999;
  510. }
  511. }
  512. }
  513. }
  514. .payment-list {
  515. .payment-item {
  516. background: #ffffff;
  517. border-radius: 16rpx;
  518. padding: 24rpx 28rpx;
  519. margin-bottom: 20rpx;
  520. .payment-header {
  521. display: flex;
  522. justify-content: space-between;
  523. align-items: center;
  524. margin-bottom: 16rpx;
  525. .payment-title {
  526. font-size: 30rpx;
  527. font-weight: 600;
  528. color: #333333;
  529. flex: 1;
  530. }
  531. .status-tag {
  532. font-size: 22rpx;
  533. padding: 4rpx 12rpx;
  534. border-radius: 8rpx;
  535. flex-shrink: 0;
  536. margin-left: 16rpx;
  537. &.overdue {
  538. color: #ff4d4f;
  539. background: rgba(255, 77, 79, 0.08);
  540. }
  541. &.warning {
  542. color: #ff9500;
  543. background: rgba(255, 149, 0, 0.08);
  544. }
  545. &.normal {
  546. color: #52c41a;
  547. background: rgba(82, 196, 26, 0.08);
  548. }
  549. }
  550. }
  551. .payment-company {
  552. display: flex;
  553. align-items: center;
  554. margin-bottom: 16rpx;
  555. uni-icons {
  556. margin-right: 8rpx;
  557. }
  558. .company-name {
  559. font-size: 26rpx;
  560. color: #666666;
  561. }
  562. }
  563. .payment-footer {
  564. display: flex;
  565. justify-content: space-between;
  566. align-items: center;
  567. .payment-left {
  568. display: flex;
  569. align-items: center;
  570. uni-icons {
  571. margin-right: 8rpx;
  572. }
  573. .date-text {
  574. font-size: 24rpx;
  575. color: #999999;
  576. }
  577. }
  578. .payment-amount {
  579. font-size: 32rpx;
  580. font-weight: 600;
  581. &.overdue {
  582. color: #ff4d4f;
  583. }
  584. &.warning {
  585. color: #ff9500;
  586. }
  587. &.normal {
  588. color: #ff6b35;
  589. }
  590. }
  591. }
  592. }
  593. }
  594. </style>