client-detail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  1. <template>
  2. <view class="client-detail" :class="{ 'dark-mode': isDarkTheme }">
  3. <!-- 顶部导航栏 -->
  4. <view class="header">
  5. <view class="back-icon" @click="handleBack"></view>
  6. <text class="header-title">客户信息</text>
  7. <view class="header-right"></view>
  8. </view>
  9. <!-- 客户基本信息 -->
  10. <view class="client-basic-info">
  11. <image :src="clientInfo.avatar" class="client-avatar" mode="aspectFill"></image>
  12. <view class="basic-info">
  13. <text class="client-name">{{ clientInfo.gender }} · {{ clientInfo.name }}</text>
  14. <text class="client-status">{{ clientInfo.status }}</text>
  15. <view class="client-tags">
  16. <text class="tag" v-for="(tag, index) in clientInfo.tags" :key="index">{{ tag }}</text>
  17. </view>
  18. </view>
  19. </view>
  20. <!-- 择偶要求 -->
  21. <view class="requirement-section">
  22. <view class="section-title">
  23. <text class="title-icon">💑</text>
  24. <text class="title-text">择偶要求</text>
  25. </view>
  26. <text class="requirement-content">{{ clientInfo.requirement }}</text>
  27. </view>
  28. <!-- 联系方式 -->
  29. <view class="contact-section">
  30. <view class="contact-item">
  31. <text class="contact-label">联系方式</text>
  32. <view class="contact-value">
  33. <text class="contact-number">{{ clientInfo.contact }}</text>
  34. <text class="copy-btn" @click="handleCopy(clientInfo.contact)">复制</text>
  35. </view>
  36. </view>
  37. <view class="contact-item">
  38. <text class="contact-label">备用联系方式</text>
  39. <view class="contact-value">
  40. <text class="contact-number">{{ clientInfo.backupContact }}</text>
  41. <text class="copy-btn" @click="handleCopy(clientInfo.backupContact)">复制</text>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 跟进统计 -->
  46. <view class="stats-section">
  47. <text class="stats-title">跟进统计</text>
  48. <view class="stats-grid">
  49. <view class="stat-item">
  50. <text class="stat-value">{{ clientInfo.stats.followTimes }}</text>
  51. <text class="stat-label">跟进次数</text>
  52. </view>
  53. <view class="stat-item">
  54. <text class="stat-value">{{ clientInfo.stats.matchCount }}</text>
  55. <text class="stat-label">匹配对象</text>
  56. </view>
  57. <view class="stat-item">
  58. <text class="stat-value">{{ clientInfo.stats.phoneCalls }}</text>
  59. <text class="stat-label">电话沟通</text>
  60. </view>
  61. <view class="stat-item">
  62. <text class="stat-value">{{ clientInfo.stats.interviews }}</text>
  63. <text class="stat-label">面谈次数</text>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 标签切换 -->
  68. <view class="tabs-section">
  69. <text class="tab" :class="{ active: activeTab === 'details' }" @click="switchTab('details')">详细信息</text>
  70. <text class="tab" :class="{ active: activeTab === 'follow' }" @click="switchTab('follow')">跟进</text>
  71. </view>
  72. <!-- 详细信息 -->
  73. <scroll-view scroll-y class="details-section" v-if="activeTab === 'details'">
  74. <view class="edit-btn" @click="handleEdit">编辑</view>
  75. <!-- 基本信息 -->
  76. <view class="detail-item">
  77. <text class="detail-label">婚姻状况:</text>
  78. <text class="detail-value">{{ clientInfo.details.maritalStatus }}</text>
  79. </view>
  80. <view class="detail-item">
  81. <text class="detail-label">学历:</text>
  82. <text class="detail-value">{{ clientInfo.details.education }}</text>
  83. </view>
  84. <view class="detail-item">
  85. <text class="detail-label">职业:</text>
  86. <text class="detail-value">{{ clientInfo.details.occupation }}</text>
  87. </view>
  88. <view class="detail-item">
  89. <text class="detail-label">收入:</text>
  90. <text class="detail-value">{{ clientInfo.details.income }}</text>
  91. </view>
  92. <view class="detail-item">
  93. <text class="detail-label">购房情况:</text>
  94. <text class="detail-value">{{ clientInfo.details.housing }}</text>
  95. </view>
  96. <!-- 择偶要求详情 -->
  97. <view class="sub-section-title">择偶要求</view>
  98. <view class="detail-item">
  99. <text class="detail-label">年龄范围:</text>
  100. <text class="detail-value">{{ clientInfo.details.requirement.ageRange }}</text>
  101. </view>
  102. <view class="detail-item">
  103. <text class="detail-label">身高要求:</text>
  104. <text class="detail-value">{{ clientInfo.details.requirement.height }}</text>
  105. </view>
  106. <view class="detail-item">
  107. <text class="detail-label">婚姻状况:</text>
  108. <text class="detail-value">{{ clientInfo.details.requirement.maritalStatus }}</text>
  109. </view>
  110. <view class="detail-item">
  111. <text class="detail-label">学历要求:</text>
  112. <text class="detail-value">{{ clientInfo.details.requirement.education }}</text>
  113. </view>
  114. <view class="detail-item" v-if="clientInfo.details.requirement.other">
  115. <text class="detail-label">其他要求:</text>
  116. <text class="detail-value">{{ clientInfo.details.requirement.other }}</text>
  117. </view>
  118. <!-- 客户标签 -->
  119. <view class="sub-section-title">客户标签</view>
  120. <view class="client-tags">
  121. <text class="tag" v-for="(tag, index) in clientInfo.tags" :key="index">{{ tag }}</text>
  122. </view>
  123. </scroll-view>
  124. <!-- 跟进信息 -->
  125. <scroll-view scroll-y class="follow-section" v-else>
  126. <!-- 跟进方式 -->
  127. <view class="follow-group">
  128. <text class="group-label">跟进方式</text>
  129. <view class="follow-type-options">
  130. <view class="follow-type-item" :class="{ active: followForm.type === 'phone' }" @click="followForm.type = 'phone'">
  131. <text class="radio-circle"></text>
  132. <text class="option-text">电话</text>
  133. </view>
  134. <view class="follow-type-item" :class="{ active: followForm.type === 'meet' }" @click="followForm.type = 'meet'">
  135. <text class="radio-circle"></text>
  136. <text class="option-text">面谈</text>
  137. </view>
  138. <view class="follow-type-item" :class="{ active: followForm.type === 'other' }" @click="followForm.type = 'other'">
  139. <text class="radio-circle"></text>
  140. <text class="option-text">其他</text>
  141. </view>
  142. </view>
  143. </view>
  144. <!-- 跟进进度 -->
  145. <view class="follow-group">
  146. <text class="group-label">跟进进度</text>
  147. <view class="status-tags-row">
  148. <view class="status-tag" :class="{ active: followForm.progress === 'matched' }" @click="followForm.progress = 'matched'">已匹配</view>
  149. <view class="status-tag" :class="{ active: followForm.progress === 'notMet' }" @click="followForm.progress = 'notMet'">未见面</view>
  150. <view class="status-tag" :class="{ active: followForm.progress === 'communicating' }" @click="followForm.progress = 'communicating'">沟通中</view>
  151. </view>
  152. </view>
  153. <!-- 邀约状态 -->
  154. <view class="follow-group">
  155. <text class="group-label">邀约状态</text>
  156. <view class="input-like">{{ followForm.inviteStatus || '未邀约' }}</view>
  157. </view>
  158. <!-- 邀约时间 -->
  159. <view class="follow-group">
  160. <text class="group-label">邀约时间</text>
  161. <view class="input-like">
  162. <picker mode="date" :value="followForm.inviteDate" @change="onInviteDateChange">
  163. <view class="picker-inner">{{ followForm.inviteDate || '请选择日期' }}</view>
  164. </picker>
  165. </view>
  166. </view>
  167. <!-- 跟进备注 -->
  168. <view class="follow-group">
  169. <text class="group-label">跟进备注</text>
  170. <textarea class="textarea" v-model="followForm.remark" placeholder="请输入跟进备注详细信息..." placeholder-style="color:#C5A4D8" />
  171. </view>
  172. <!-- 提交按钮(预留) -->
  173. <view class="follow-submit-btn" @click="handleSubmitFollow">保存跟进</view>
  174. </scroll-view>
  175. </view>
  176. </template>
  177. <script>
  178. export default {
  179. name: 'client-detail',
  180. data() {
  181. return {
  182. activeTab: 'details',
  183. followForm: {
  184. type: 'phone',
  185. progress: 'matched',
  186. inviteStatus: '未邀约',
  187. inviteDate: '',
  188. remark: ''
  189. },
  190. clientInfo: {
  191. id: 1,
  192. name: '小明',
  193. gender: '男',
  194. status: '已匹配',
  195. tags: ['气质男', '小清新'],
  196. avatar: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=60',
  197. requirement: '165+ 本科 天津 本地户口 无婚姻经历',
  198. contact: '123****9912',
  199. backupContact: '155****4512',
  200. stats: {
  201. followTimes: 12,
  202. matchCount: 3,
  203. phoneCalls: 5,
  204. interviews: 7
  205. },
  206. details: {
  207. maritalStatus: '离异',
  208. education: '本科',
  209. occupation: '企业高管',
  210. income: '50万/年',
  211. housing: '已购房',
  212. requirement: {
  213. ageRange: '30-40岁',
  214. height: '175cm以上',
  215. maritalStatus: '离异无孩或未婚',
  216. education: '本科及以上',
  217. other: '外貌或者性格'
  218. }
  219. }
  220. },
  221. isDarkTheme: false
  222. }
  223. },
  224. onShow() {
  225. const stored = uni.getStorageSync('matchmakerDarkMode')
  226. if (stored === true || stored === false) {
  227. this.isDarkTheme = stored
  228. }
  229. },
  230. onLoad(options) {
  231. // 从URL参数获取客户ID
  232. if (options.id) {
  233. // 这里可以根据ID从API获取客户信息
  234. console.log('客户ID:', options.id)
  235. // this.loadClientInfo(options.id)
  236. }
  237. },
  238. methods: {
  239. // 返回上一页
  240. handleBack() {
  241. uni.navigateBack()
  242. },
  243. // 复制联系方式
  244. handleCopy(contact) {
  245. uni.setClipboardData({
  246. data: contact.replace(/\*+/g, ''),
  247. success: () => {
  248. uni.showToast({
  249. title: '复制成功',
  250. icon: 'success'
  251. })
  252. }
  253. })
  254. },
  255. // 切换标签
  256. switchTab(tab) {
  257. this.activeTab = tab
  258. },
  259. // 编辑客户信息
  260. handleEdit() {
  261. uni.showToast({
  262. title: '编辑功能正在开发中',
  263. icon: 'none'
  264. })
  265. },
  266. // 邀约日期变更
  267. onInviteDateChange(e) {
  268. this.followForm.inviteDate = e.detail.value
  269. },
  270. // 提交跟进(暂时仅提示)
  271. handleSubmitFollow() {
  272. uni.showToast({
  273. title: '跟进已保存',
  274. icon: 'success'
  275. })
  276. },
  277. // 从API加载客户信息
  278. async loadClientInfo(id) {
  279. try {
  280. // 这里调用API获取客户信息
  281. // const res = await api.matchmaker.getClientInfo(id)
  282. // this.clientInfo = res.data
  283. } catch (e) {
  284. console.error('加载客户信息失败:', e)
  285. uni.showToast({
  286. title: '加载失败',
  287. icon: 'none'
  288. })
  289. }
  290. }
  291. }
  292. }
  293. </script>
  294. <style lang="scss" scoped>
  295. .client-detail {
  296. min-height: 100vh;
  297. background-color: #FFF9F9;
  298. padding-top: 90rpx;
  299. }
  300. /* 顶部导航栏 */
  301. .header {
  302. position: fixed;
  303. top: 0;
  304. left: 0;
  305. right: 0;
  306. height: 90rpx;
  307. display: flex;
  308. align-items: center;
  309. justify-content: space-between;
  310. padding: 0 20rpx;
  311. background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
  312. z-index: 999;
  313. .back-icon {
  314. width: 44rpx;
  315. height: 44rpx;
  316. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23333"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>');
  317. background-size: contain;
  318. background-repeat: no-repeat;
  319. background-position: center;
  320. }
  321. .header-title {
  322. font-size: 38rpx;
  323. font-weight: bold;
  324. color: #333;
  325. }
  326. .header-right {
  327. width: 44rpx;
  328. }
  329. }
  330. /* 客户基本信息 */
  331. .client-basic-info {
  332. display: flex;
  333. align-items: flex-start;
  334. padding: 30rpx;
  335. background-color: #FFFFFF;
  336. margin: 20rpx;
  337. border-radius: 20rpx;
  338. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  339. .client-avatar {
  340. width: 160rpx;
  341. height: 160rpx;
  342. border-radius: 50%;
  343. margin-right: 30rpx;
  344. background-color: #F5F5F5;
  345. }
  346. .basic-info {
  347. flex: 1;
  348. .client-name {
  349. font-size: 36rpx;
  350. font-weight: bold;
  351. color: #333;
  352. margin-bottom: 10rpx;
  353. }
  354. .client-status {
  355. font-size: 28rpx;
  356. color: #FF6B8A;
  357. margin-bottom: 15rpx;
  358. display: inline-block;
  359. }
  360. .client-tags {
  361. display: flex;
  362. flex-wrap: wrap;
  363. gap: 10rpx;
  364. .tag {
  365. padding: 8rpx 20rpx;
  366. background-color: #F3E5F5;
  367. color: #9C27B0;
  368. border-radius: 20rpx;
  369. font-size: 24rpx;
  370. font-weight: bold;
  371. }
  372. }
  373. }
  374. }
  375. /* 择偶要求 */
  376. .requirement-section {
  377. padding: 30rpx;
  378. background-color: #FFFFFF;
  379. margin: 0 20rpx 20rpx;
  380. border-radius: 20rpx;
  381. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  382. .section-title {
  383. display: flex;
  384. align-items: center;
  385. margin-bottom: 20rpx;
  386. .title-icon {
  387. font-size: 28rpx;
  388. margin-right: 10rpx;
  389. }
  390. .title-text {
  391. font-size: 28rpx;
  392. font-weight: bold;
  393. color: #333;
  394. }
  395. }
  396. .requirement-content {
  397. font-size: 28rpx;
  398. color: #666;
  399. line-height: 1.5;
  400. }
  401. }
  402. /* 联系方式 */
  403. .contact-section {
  404. padding: 30rpx;
  405. background-color: #FFFFFF;
  406. margin: 0 20rpx 20rpx;
  407. border-radius: 20rpx;
  408. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  409. .contact-item {
  410. display: flex;
  411. justify-content: space-between;
  412. align-items: center;
  413. margin-bottom: 25rpx;
  414. &:last-child {
  415. margin-bottom: 0;
  416. }
  417. .contact-label {
  418. font-size: 28rpx;
  419. color: #333;
  420. }
  421. .contact-value {
  422. display: flex;
  423. align-items: center;
  424. gap: 20rpx;
  425. .contact-number {
  426. font-size: 28rpx;
  427. color: #666;
  428. }
  429. .copy-btn {
  430. padding: 8rpx 20rpx;
  431. background-color: #F3E5F5;
  432. color: #9C27B0;
  433. border-radius: 20rpx;
  434. font-size: 24rpx;
  435. font-weight: bold;
  436. }
  437. }
  438. }
  439. }
  440. /* 跟进统计 */
  441. .stats-section {
  442. padding: 30rpx;
  443. background-color: #FFFFFF;
  444. margin: 0 20rpx 20rpx;
  445. border-radius: 20rpx;
  446. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  447. .stats-title {
  448. font-size: 28rpx;
  449. font-weight: bold;
  450. color: #333;
  451. margin-bottom: 25rpx;
  452. }
  453. .stats-grid {
  454. display: grid;
  455. grid-template-columns: repeat(4, 1fr);
  456. gap: 20rpx;
  457. .stat-item {
  458. display: flex;
  459. flex-direction: column;
  460. align-items: center;
  461. justify-content: center;
  462. padding: 20rpx;
  463. background-color: #FFF3F5;
  464. border-radius: 15rpx;
  465. .stat-value {
  466. font-size: 48rpx;
  467. font-weight: bold;
  468. color: #FF6B8A;
  469. margin-bottom: 10rpx;
  470. }
  471. .stat-label {
  472. font-size: 22rpx;
  473. color: #666;
  474. }
  475. }
  476. }
  477. }
  478. /* 标签切换 */
  479. .tabs-section {
  480. display: flex;
  481. padding: 0 20rpx;
  482. background-color: #FFFFFF;
  483. margin: 0 20rpx 20rpx;
  484. border-radius: 20rpx;
  485. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  486. .tab {
  487. flex: 1;
  488. text-align: center;
  489. padding: 20rpx 0;
  490. font-size: 28rpx;
  491. color: #666;
  492. font-weight: bold;
  493. transition: all 0.3s;
  494. &.active {
  495. color: #9C27B0;
  496. border-bottom: 4rpx solid #9C27B0;
  497. }
  498. }
  499. }
  500. /* 详细信息滚动区域 */
  501. .details-section {
  502. padding: 30rpx 20rpx 100rpx;
  503. background-color: #FFFFFF;
  504. margin: 0 20rpx 20rpx;
  505. border-radius: 20rpx;
  506. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  507. box-sizing: border-box;
  508. .edit-btn {
  509. position: absolute;
  510. top: 20rpx;
  511. right: 30rpx;
  512. padding: 8rpx 25rpx;
  513. background-color: #F3E5F5;
  514. color: #9C27B0;
  515. border-radius: 20rpx;
  516. font-size: 24rpx;
  517. font-weight: bold;
  518. }
  519. .detail-item {
  520. display: flex;
  521. margin-bottom: 25rpx;
  522. .detail-label {
  523. width: 180rpx;
  524. font-size: 28rpx;
  525. color: #333;
  526. font-weight: bold;
  527. }
  528. .detail-value {
  529. flex: 1;
  530. font-size: 28rpx;
  531. color: #666;
  532. }
  533. }
  534. .sub-section-title {
  535. font-size: 30rpx;
  536. font-weight: bold;
  537. color: #333;
  538. margin: 30rpx 0 20rpx;
  539. padding-bottom: 10rpx;
  540. border-bottom: 2rpx solid #F0F0F0;
  541. }
  542. .client-tags {
  543. display: flex;
  544. flex-wrap: wrap;
  545. gap: 10rpx;
  546. .tag {
  547. padding: 8rpx 20rpx;
  548. background-color: #F3E5F5;
  549. color: #9C27B0;
  550. border-radius: 20rpx;
  551. font-size: 24rpx;
  552. font-weight: bold;
  553. }
  554. }
  555. }
  556. /* 跟进信息 */
  557. .follow-section {
  558. background-color: #FFFFFF;
  559. margin: 0 20rpx 20rpx;
  560. border-radius: 20rpx;
  561. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  562. padding: 30rpx 20rpx 40rpx;
  563. max-height: 700rpx;
  564. box-sizing: border-box;
  565. }
  566. .follow-group {
  567. margin-bottom: 30rpx;
  568. .group-label {
  569. font-size: 28rpx;
  570. color: #333;
  571. font-weight: bold;
  572. margin-bottom: 16rpx;
  573. display: block;
  574. }
  575. }
  576. /* 跟进方式单选 */
  577. .follow-type-options {
  578. display: flex;
  579. align-items: center;
  580. gap: 30rpx;
  581. .follow-type-item {
  582. display: flex;
  583. align-items: center;
  584. gap: 10rpx;
  585. font-size: 26rpx;
  586. color: #666;
  587. .radio-circle {
  588. width: 26rpx;
  589. height: 26rpx;
  590. border-radius: 50%;
  591. border: 2rpx solid #C5A4D8;
  592. box-sizing: border-box;
  593. }
  594. &.active {
  595. color: #D81B60;
  596. .radio-circle {
  597. background-color: #D81B60;
  598. border-color: #D81B60;
  599. }
  600. }
  601. }
  602. }
  603. /* 跟进进度标签 */
  604. .status-tags-row {
  605. display: flex;
  606. flex-wrap: wrap;
  607. gap: 16rpx;
  608. .status-tag {
  609. min-width: 140rpx;
  610. text-align: center;
  611. padding: 14rpx 20rpx;
  612. border-radius: 20rpx;
  613. border: 2rpx solid #E1BEE7;
  614. font-size: 26rpx;
  615. color: #9C27B0;
  616. background-color: #FAF5FF;
  617. box-sizing: border-box;
  618. &.active {
  619. background-color: #F8BBD0;
  620. border-color: #F06292;
  621. color: #FFFFFF;
  622. }
  623. }
  624. }
  625. /* 邀约状态/时间 等输入类展示 */
  626. .input-like {
  627. width: 100%;
  628. padding: 18rpx 22rpx;
  629. border-radius: 16rpx;
  630. background-color: #FAF5FF;
  631. font-size: 26rpx;
  632. color: #666;
  633. box-sizing: border-box;
  634. }
  635. .picker-inner {
  636. font-size: 26rpx;
  637. color: #666;
  638. }
  639. /* 备注输入框 */
  640. .textarea {
  641. width: 100%;
  642. min-height: 160rpx;
  643. padding: 18rpx 22rpx;
  644. border-radius: 16rpx;
  645. background-color: #FAF5FF;
  646. font-size: 26rpx;
  647. color: #333;
  648. box-sizing: border-box;
  649. }
  650. /* 保存按钮 */
  651. .follow-submit-btn {
  652. margin-top: 10rpx;
  653. width: 100%;
  654. padding: 22rpx 0;
  655. text-align: center;
  656. border-radius: 26rpx;
  657. background: linear-gradient(135deg, #F48FB1 0%, #EC407A 100%);
  658. color: #FFFFFF;
  659. font-size: 30rpx;
  660. font-weight: bold;
  661. }
  662. </style>