client-detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. <template>
  2. <view class="client-detail">
  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. <view class="follow-section" v-else>
  126. <text class="follow-placeholder">跟进信息正在开发中...</text>
  127. </view>
  128. </view>
  129. </template>
  130. <script>
  131. export default {
  132. name: 'client-detail',
  133. data() {
  134. return {
  135. activeTab: 'details',
  136. clientInfo: {
  137. id: 1,
  138. name: '小明',
  139. gender: '男',
  140. status: '已匹配',
  141. tags: ['气质男', '小清新'],
  142. avatar: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=60',
  143. requirement: '165+ 本科 天津 本地户口 无婚姻经历',
  144. contact: '123****9912',
  145. backupContact: '155****4512',
  146. stats: {
  147. followTimes: 12,
  148. matchCount: 3,
  149. phoneCalls: 5,
  150. interviews: 7
  151. },
  152. details: {
  153. maritalStatus: '离异',
  154. education: '本科',
  155. occupation: '企业高管',
  156. income: '50万/年',
  157. housing: '已购房',
  158. requirement: {
  159. ageRange: '30-40岁',
  160. height: '175cm以上',
  161. maritalStatus: '离异无孩或未婚',
  162. education: '本科及以上',
  163. other: '外貌或者性格'
  164. }
  165. }
  166. }
  167. }
  168. },
  169. onLoad(options) {
  170. // 从URL参数获取客户ID
  171. if (options.id) {
  172. // 这里可以根据ID从API获取客户信息
  173. console.log('客户ID:', options.id)
  174. // this.loadClientInfo(options.id)
  175. }
  176. },
  177. methods: {
  178. // 返回上一页
  179. handleBack() {
  180. uni.navigateBack()
  181. },
  182. // 复制联系方式
  183. handleCopy(contact) {
  184. uni.setClipboardData({
  185. data: contact.replace(/\*+/g, ''),
  186. success: () => {
  187. uni.showToast({
  188. title: '复制成功',
  189. icon: 'success'
  190. })
  191. }
  192. })
  193. },
  194. // 切换标签
  195. switchTab(tab) {
  196. this.activeTab = tab
  197. },
  198. // 编辑客户信息
  199. handleEdit() {
  200. uni.showToast({
  201. title: '编辑功能正在开发中',
  202. icon: 'none'
  203. })
  204. },
  205. // 从API加载客户信息
  206. async loadClientInfo(id) {
  207. try {
  208. // 这里调用API获取客户信息
  209. // const res = await api.matchmaker.getClientInfo(id)
  210. // this.clientInfo = res.data
  211. } catch (e) {
  212. console.error('加载客户信息失败:', e)
  213. uni.showToast({
  214. title: '加载失败',
  215. icon: 'none'
  216. })
  217. }
  218. }
  219. }
  220. }
  221. </script>
  222. <style lang="scss" scoped>
  223. .client-detail {
  224. min-height: 100vh;
  225. background-color: #FFF9F9;
  226. padding-top: 90rpx;
  227. }
  228. /* 顶部导航栏 */
  229. .header {
  230. position: fixed;
  231. top: 0;
  232. left: 0;
  233. right: 0;
  234. height: 90rpx;
  235. display: flex;
  236. align-items: center;
  237. justify-content: space-between;
  238. padding: 0 20rpx;
  239. background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
  240. z-index: 999;
  241. .back-icon {
  242. width: 44rpx;
  243. height: 44rpx;
  244. 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>');
  245. background-size: contain;
  246. background-repeat: no-repeat;
  247. background-position: center;
  248. }
  249. .header-title {
  250. font-size: 38rpx;
  251. font-weight: bold;
  252. color: #333;
  253. }
  254. .header-right {
  255. width: 44rpx;
  256. }
  257. }
  258. /* 客户基本信息 */
  259. .client-basic-info {
  260. display: flex;
  261. align-items: flex-start;
  262. padding: 30rpx;
  263. background-color: #FFFFFF;
  264. margin: 20rpx;
  265. border-radius: 20rpx;
  266. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  267. .client-avatar {
  268. width: 160rpx;
  269. height: 160rpx;
  270. border-radius: 50%;
  271. margin-right: 30rpx;
  272. background-color: #F5F5F5;
  273. }
  274. .basic-info {
  275. flex: 1;
  276. .client-name {
  277. font-size: 36rpx;
  278. font-weight: bold;
  279. color: #333;
  280. margin-bottom: 10rpx;
  281. }
  282. .client-status {
  283. font-size: 28rpx;
  284. color: #FF6B8A;
  285. margin-bottom: 15rpx;
  286. display: inline-block;
  287. }
  288. .client-tags {
  289. display: flex;
  290. flex-wrap: wrap;
  291. gap: 10rpx;
  292. .tag {
  293. padding: 8rpx 20rpx;
  294. background-color: #F3E5F5;
  295. color: #9C27B0;
  296. border-radius: 20rpx;
  297. font-size: 24rpx;
  298. font-weight: bold;
  299. }
  300. }
  301. }
  302. }
  303. /* 择偶要求 */
  304. .requirement-section {
  305. padding: 30rpx;
  306. background-color: #FFFFFF;
  307. margin: 0 20rpx 20rpx;
  308. border-radius: 20rpx;
  309. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  310. .section-title {
  311. display: flex;
  312. align-items: center;
  313. margin-bottom: 20rpx;
  314. .title-icon {
  315. font-size: 28rpx;
  316. margin-right: 10rpx;
  317. }
  318. .title-text {
  319. font-size: 28rpx;
  320. font-weight: bold;
  321. color: #333;
  322. }
  323. }
  324. .requirement-content {
  325. font-size: 28rpx;
  326. color: #666;
  327. line-height: 1.5;
  328. }
  329. }
  330. /* 联系方式 */
  331. .contact-section {
  332. padding: 30rpx;
  333. background-color: #FFFFFF;
  334. margin: 0 20rpx 20rpx;
  335. border-radius: 20rpx;
  336. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  337. .contact-item {
  338. display: flex;
  339. justify-content: space-between;
  340. align-items: center;
  341. margin-bottom: 25rpx;
  342. &:last-child {
  343. margin-bottom: 0;
  344. }
  345. .contact-label {
  346. font-size: 28rpx;
  347. color: #333;
  348. }
  349. .contact-value {
  350. display: flex;
  351. align-items: center;
  352. gap: 20rpx;
  353. .contact-number {
  354. font-size: 28rpx;
  355. color: #666;
  356. }
  357. .copy-btn {
  358. padding: 8rpx 20rpx;
  359. background-color: #F3E5F5;
  360. color: #9C27B0;
  361. border-radius: 20rpx;
  362. font-size: 24rpx;
  363. font-weight: bold;
  364. }
  365. }
  366. }
  367. }
  368. /* 跟进统计 */
  369. .stats-section {
  370. padding: 30rpx;
  371. background-color: #FFFFFF;
  372. margin: 0 20rpx 20rpx;
  373. border-radius: 20rpx;
  374. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  375. .stats-title {
  376. font-size: 28rpx;
  377. font-weight: bold;
  378. color: #333;
  379. margin-bottom: 25rpx;
  380. }
  381. .stats-grid {
  382. display: grid;
  383. grid-template-columns: repeat(4, 1fr);
  384. gap: 20rpx;
  385. .stat-item {
  386. display: flex;
  387. flex-direction: column;
  388. align-items: center;
  389. justify-content: center;
  390. padding: 20rpx;
  391. background-color: #FFF3F5;
  392. border-radius: 15rpx;
  393. .stat-value {
  394. font-size: 48rpx;
  395. font-weight: bold;
  396. color: #FF6B8A;
  397. margin-bottom: 10rpx;
  398. }
  399. .stat-label {
  400. font-size: 22rpx;
  401. color: #666;
  402. }
  403. }
  404. }
  405. }
  406. /* 标签切换 */
  407. .tabs-section {
  408. display: flex;
  409. padding: 0 20rpx;
  410. background-color: #FFFFFF;
  411. margin: 0 20rpx 20rpx;
  412. border-radius: 20rpx;
  413. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  414. .tab {
  415. flex: 1;
  416. text-align: center;
  417. padding: 20rpx 0;
  418. font-size: 28rpx;
  419. color: #666;
  420. font-weight: bold;
  421. transition: all 0.3s;
  422. &.active {
  423. color: #9C27B0;
  424. border-bottom: 4rpx solid #9C27B0;
  425. }
  426. }
  427. }
  428. /* 详细信息 */
  429. .details-section {
  430. padding: 30rpx 20rpx 100rpx;
  431. background-color: #FFFFFF;
  432. margin: 0 20rpx 20rpx;
  433. border-radius: 20rpx;
  434. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  435. .edit-btn {
  436. position: absolute;
  437. top: 20rpx;
  438. right: 30rpx;
  439. padding: 8rpx 25rpx;
  440. background-color: #F3E5F5;
  441. color: #9C27B0;
  442. border-radius: 20rpx;
  443. font-size: 24rpx;
  444. font-weight: bold;
  445. }
  446. .detail-item {
  447. display: flex;
  448. margin-bottom: 25rpx;
  449. .detail-label {
  450. width: 180rpx;
  451. font-size: 28rpx;
  452. color: #333;
  453. font-weight: bold;
  454. }
  455. .detail-value {
  456. flex: 1;
  457. font-size: 28rpx;
  458. color: #666;
  459. }
  460. }
  461. .sub-section-title {
  462. font-size: 30rpx;
  463. font-weight: bold;
  464. color: #333;
  465. margin: 30rpx 0 20rpx;
  466. padding-bottom: 10rpx;
  467. border-bottom: 2rpx solid #F0F0F0;
  468. }
  469. .client-tags {
  470. display: flex;
  471. flex-wrap: wrap;
  472. gap: 10rpx;
  473. .tag {
  474. padding: 8rpx 20rpx;
  475. background-color: #F3E5F5;
  476. color: #9C27B0;
  477. border-radius: 20rpx;
  478. font-size: 24rpx;
  479. font-weight: bold;
  480. }
  481. }
  482. }
  483. /* 跟进信息 */
  484. .follow-section {
  485. padding: 100rpx 20rpx;
  486. background-color: #FFFFFF;
  487. margin: 0 20rpx 20rpx;
  488. border-radius: 20rpx;
  489. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  490. .follow-placeholder {
  491. text-align: center;
  492. font-size: 32rpx;
  493. color: #999;
  494. }
  495. }
  496. </style>