console.uvue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. <template>
  2. <view class="page">
  3. <view class="upContent">
  4. </view>
  5. <view class="city-info">
  6. <view class="city-text-box">
  7. <text>
  8. 当前城市:{{ cityInfo }}
  9. </text>
  10. </view>
  11. <u-icon name="notification" :size="24" />
  12. </view>
  13. <!-- 用户卡片 -->
  14. <view class="user-card ">
  15. <image class="user-bg wh" src="@/static/imagesInfo/bg-icon.png" mode="scaleToFill">
  16. </image>
  17. <view class="user-info">
  18. <view class="user-left">
  19. <view class="user-info">
  20. <text class="user-name">
  21. 刘大锤
  22. </text>
  23. <view class="tags">
  24. <text class="tag-new">
  25. 新人实习
  26. </text>
  27. </view>
  28. <u-icon name="edit" :size="18" />
  29. <text class="tag">
  30. 编辑
  31. </text>
  32. </view>
  33. <view class="user-info">
  34. <u-icon name="customer-interests" :size="18" />
  35. <text class="user-role">
  36. 小丁理疗师
  37. </text>
  38. <u-icon name="store" :size="18" />
  39. <text class="user-shop">
  40. 佳人有约
  41. </text>
  42. </view>
  43. <view class="online-switch">
  44. <u-switch :checked="isOnline" @change="toggleOnline" />
  45. </view>
  46. </view>
  47. <view class="user-right">
  48. <text class="text-time-box">
  49. 入驻时间
  50. </text>
  51. <text class="text-time-box" style="margin-top: 5rpx;">{{
  52. coachInfo?.created_at.split(' ')[0] }}
  53. </text>
  54. <image v-if="coachInfo?.avatar_url" @click.stop="jumpMasterInfo"
  55. :src="coachInfo?.avatar_url?.url"
  56. style="width: 138rpx;height:138rpx;border-radius: 50%;margin-top: 15rpx;" mode="aspectFit">
  57. </image>
  58. <image v-else src="/static/testInfo/boy-nickname.png"
  59. style="width: 138rpx;height:138rpx;border-radius: 50%;margin-top: 15rpx;" mode="aspectFit">
  60. </image>
  61. </view>
  62. </view>
  63. <view class="location-bar user-info">
  64. <u-icon name="navigation" :size="18" />
  65. <text class="location-text">
  66. 当前定位:烟台市楚凤一街1号楚凤花园
  67. </text>
  68. <text class="location-btn">
  69. 手动更新
  70. </text>
  71. </view>
  72. </view>
  73. <!-- 本月数据 -->
  74. <view class="stats-row">
  75. <view class="stat-item">
  76. <text class="stat-label">
  77. 本月收益(元)
  78. </text>
  79. <text class="stat-value">
  80. 2234.88
  81. </text>
  82. </view>
  83. <view class="stat-divider">
  84. </view>
  85. <view class="stat-item">
  86. <text class="stat-label">
  87. 本月接单量(单)
  88. </text>
  89. <text class="stat-value">
  90. 2234.88
  91. </text>
  92. </view>
  93. <view class="stat-divider">
  94. </view>
  95. <view class="stat-item">
  96. <text class="stat-label">
  97. 本月退单率
  98. </text>
  99. <text class="stat-value">
  100. 30%
  101. </text>
  102. </view>
  103. </view>
  104. <!-- 功能按钮 -->
  105. <view class="func-grid">
  106. <view class="func-item" v-for="(item, i) in funcList" :key="i">
  107. <view @click.stop="jumpSetProject">
  108. <image style="width: 92rpx;height: 92rpx;" :src="item.iconUrl"
  109. mode="aspectFit">
  110. </image>
  111. <text class="func-label">
  112. {{ item.label }}
  113. </text>
  114. </view>
  115. </view>
  116. </view>
  117. <!-- 数据统计 -->
  118. <view class="data-section">
  119. <view class="section-header">
  120. <text class="section-title">
  121. 数据统计
  122. </text>
  123. <text class="section-more">
  124. 查看全部 >
  125. </text>
  126. </view>
  127. <view class="data-grid">
  128. <view class="data-item" v-for="(item, i) in dataStats" :key="i">
  129. <text class="data-value">
  130. {{ item.value }}
  131. </text>
  132. <text class="data-label">
  133. {{ item.label }}
  134. </text>
  135. </view>
  136. </view>
  137. </view>
  138. <!-- 客户评价 -->
  139. <view class="eval-section">
  140. <view class="section-header">
  141. <text class="section-title">
  142. 客户评价
  143. </text>
  144. <text class="section-more">
  145. 查看全部 >
  146. </text>
  147. </view>
  148. <view class="eval-tags">
  149. <text class="eval-tag" v-for="(tag, i) in evalTags" :key="i">
  150. {{ tag.text }} {{ tag.count ? tag.count : '' }}
  151. </text>
  152. </view>
  153. <view class="eval-item">
  154. <image class="eval-avatar" src="/static/testInfo/boy-nickname.png" mode="aspectFill" />
  155. <view class="eval-content">
  156. <view class="eval-top">
  157. <text class="eval-name">
  158. 匿名评价
  159. </text>
  160. <text class="eval-date">
  161. 2025-04-24
  162. </text>
  163. </view>
  164. <view class="eval-stars">
  165. <text>
  166. ⭐⭐⭐⭐☆
  167. </text>
  168. <view class="stat-divider">
  169. </view>
  170. <text class="eval-service">
  171. 泰式松骨
  172. </text>
  173. </view>
  174. <text class="eval-comment">
  175. 服务到位
  176. </text>
  177. </view>
  178. </view>
  179. </view>
  180. <!-- 做一个悬浮球 -->
  181. <u-floating @dblclick="callPolice" />
  182. </view>
  183. </template>
  184. <script setup lang="ts">
  185. import { ref, computed } from 'vue';
  186. import { colors } from '@/common/theme';
  187. // 状态
  188. const isOnline = ref(true);
  189. // 切换上线状态
  190. const toggleOnline = () => {
  191. isOnline.value = !isOnline.value;
  192. // 这里可以调用 API 更新状态
  193. console.log('Status changed:', isOnline.value);
  194. };
  195. // 功能列表
  196. const funcList = [
  197. { iconUrl: '/static/imagesInfo/cx-shop.png', label: '接单时间' },
  198. { iconUrl: '/static/imagesInfo/item-icon.png', label: '服务项目' },
  199. { iconUrl: '/static/imagesInfo/jied-time.png', label: '重选店铺' },
  200. { iconUrl: '/static/imagesInfo/gengxin-wz.png', label: '位置更新' }
  201. ];
  202. // 功能按钮点击处理
  203. const jumpSetProject = () => {
  204. console.log('jumpSetProject invoked');
  205. // 在这里可以执行导航或其他逻辑
  206. };
  207. // 悬浮球双击处理
  208. const callPolice = () => {
  209. console.log('callPolice triggered');
  210. // 可在此触发紧急呼叫等操作
  211. };
  212. // 统计数据
  213. const dataStats = [
  214. { value: '456', label: '接单量' },
  215. { value: '10%', label: '加钟率' },
  216. { value: '70%', label: '好评率' },
  217. { value: '3%', label: '复购率' },
  218. { value: '19%', label: '退单率' }
  219. ];
  220. // 评价标签
  221. const evalTags = [
  222. { text: '不良引导' },
  223. { text: '手法不好', count: 101 },
  224. { text: '性格温柔', count: 198 },
  225. { text: '服务到位', count: 10 }
  226. ];
  227. </script>
  228. <style>
  229. .page {
  230. min-height: 100vh;
  231. background-color: $uni-bg-color-grey;
  232. padding: 24rpx;
  233. }
  234. .upContent {
  235. height: 50%;
  236. background-image: linear-gradient(180deg, #FFDA59 0%, rgba(255, 255, 255, 0) 100%);
  237. background-repeat: no-repeat;
  238. background-size: cover;
  239. position: fixed;
  240. top: 0;
  241. left: 0;
  242. width: 100%;
  243. }
  244. .city-info {
  245. flex-direction: row;
  246. justify-content: space-between;
  247. }
  248. /* 用户卡片 */
  249. .user-card {
  250. border-radius: 16rpx;
  251. padding: 20rpx;
  252. /* 如需更明显的分层可加阴影 */
  253. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
  254. height: auto;
  255. position: relative;
  256. z-index: ;
  257. margin-top: 16rpx;
  258. margin-bottom: 32rpx;
  259. }
  260. .user-bg {
  261. position: absolute;
  262. top: 0;
  263. left: 0;
  264. width: 100%;
  265. /* object-fit: cover; */
  266. }
  267. .user-info {
  268. /* display: flex; */
  269. flex-direction: row;
  270. align-items: center;
  271. margin-bottom: 16rpx;
  272. justify-content: space-between;
  273. }
  274. .user-name {
  275. font-size: 40rpx;
  276. font-weight: bold;
  277. color: #333333;
  278. /* margin-bottom: 16rpx; */
  279. }
  280. .tag {
  281. font-size: 24rpx;
  282. }
  283. .tag-new {
  284. /* 绿色透明度渐变 */
  285. background: linear-gradient(180deg, rgba(207, 221, 62, 0.69) 0%, rgba(162, 184, 29, 1) 100%);
  286. color: #FFFFFF;
  287. width: 160rpx;
  288. line-height: 40rpx;
  289. border-radius: 24rpx;
  290. text-align: center;
  291. margin: 0 20rpx;
  292. font-size: 28rpx;
  293. }
  294. .tag-edit {
  295. color: #999999;
  296. }
  297. .user-role,
  298. .user-shop {
  299. font-size: 26rpx;
  300. color: #999999;
  301. margin-right: 32rpx;
  302. }
  303. .online-switch {
  304. display: flex;
  305. align-items: center;
  306. margin-top: 24rpx;
  307. }
  308. .online-text {
  309. font-size: 26rpx;
  310. color: #333333;
  311. margin-right: 16rpx;
  312. }
  313. .user-right {
  314. display: flex;
  315. /* flex-direction: column; */
  316. align-items: center;
  317. /* position: absolute; */
  318. width: 180rpx;
  319. height: 245rpx;
  320. /* top: 0;
  321. right: 20rpx;
  322. */
  323. /* text-align: center; */
  324. z-index: 1;
  325. margin-right: 14rpx;
  326. }
  327. .text-time-box {
  328. margin-top: 10rpx;
  329. font-size: 24rpx;
  330. color: #fff;
  331. letter-spacing: 1rpx;
  332. text-align: center;
  333. }
  334. .join-time {
  335. text-align: center;
  336. font-size: 24rpx;
  337. color: #FFFFFF;
  338. background-color: rgba(0, 0, 0, 0.6);
  339. padding: 8rpx 16rpx;
  340. border-radius: 8rpx;
  341. margin-bottom: 16rpx;
  342. }
  343. .avatar {
  344. width: 120rpx;
  345. height: 120rpx;
  346. border-radius: 50%;
  347. border: 4rpx solid #FFFFFF;
  348. }
  349. .location-bar {
  350. display: flex;
  351. align-items: center;
  352. background-image: linear-gradient(to right, #FFF9E1 0%, #FFF1BF 100%);
  353. padding: 10rpx;
  354. border-radius: 18rpx;
  355. margin-top: 30rpx;
  356. font-size: 24rpx;
  357. justify-content: space-between;
  358. }
  359. .location-icon {
  360. font-size: 28rpx;
  361. margin-right: 16rpx;
  362. }
  363. .location-text {
  364. /* flex: 1; */
  365. font-size: 26rpx;
  366. /* color: #333333; */
  367. }
  368. .location-btn {
  369. font-size: 26rpx;
  370. border: 2rpx solid #0a0a0a;
  371. padding: 8rpx 8rpx;
  372. border-radius: 16rpx;
  373. }
  374. /* 本月数据 */
  375. .stats-row {
  376. display: flex;
  377. flex-direction: row;
  378. width: 100%;
  379. text-align: center;
  380. background-color: #FFFFFF;
  381. margin-bottom: 32rpx;
  382. border-radius: 24rpx;
  383. padding: 32rpx;
  384. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
  385. }
  386. .stat-item {
  387. flex: 1;
  388. text-align: center;
  389. }
  390. .stat-label {
  391. font-size: 26rpx;
  392. color: #999999;
  393. display: block;
  394. margin-bottom: 24rpx;
  395. text-align: center;
  396. }
  397. .stat-value {
  398. font-size: 40rpx;
  399. font-weight: bold;
  400. color: #333333;
  401. text-align: center;
  402. }
  403. .stat-divider {
  404. width: 2rpx;
  405. background-color: #EEEEEE;
  406. margin: 0 16rpx;
  407. }
  408. /* 功能网格 */
  409. .func-grid {
  410. display: flex;
  411. justify-content: space-around;
  412. background-color: #FFFFFF;
  413. margin-bottom: 32rpx;
  414. border-radius: 24rpx;
  415. padding: 32rpx 0;
  416. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
  417. flex-direction: row;
  418. }
  419. .func-item {
  420. display: flex;
  421. flex-direction: column;
  422. align-items: center;
  423. }
  424. .func-label {
  425. font-size: 24rpx;
  426. color: #666666;
  427. margin-top: 16rpx;
  428. }
  429. /* 数据统计 */
  430. .data-section {
  431. background-color: #FFFFFF;
  432. margin-bottom: 32rpx;
  433. border-radius: 24rpx;
  434. padding: 32rpx;
  435. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
  436. }
  437. .section-header {
  438. /* display: flex; */
  439. justify-content: space-between;
  440. align-items: center;
  441. margin-bottom: 32rpx;
  442. flex-direction: row;
  443. }
  444. .section-title {
  445. font-size: 32rpx;
  446. font-weight: 500;
  447. color: #333333;
  448. }
  449. .section-more {
  450. font-size: 26rpx;
  451. color: #999999;
  452. }
  453. .data-grid {
  454. /* display: flex; */
  455. justify-content: space-between;
  456. flex-direction: row;
  457. }
  458. .data-item {
  459. text-align: center;
  460. }
  461. .data-value {
  462. font-size: 36rpx;
  463. font-weight: bold;
  464. color: #333333;
  465. display: block;
  466. margin-bottom: 8rpx;
  467. }
  468. .data-label {
  469. font-size: 24rpx;
  470. color: #999999;
  471. }
  472. /* 客户评价 */
  473. .eval-section {
  474. background-color: #FFFFFF;
  475. margin-bottom: 32rpx;
  476. border-radius: 24rpx;
  477. padding: 32rpx;
  478. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
  479. }
  480. .eval-tags {
  481. display: flex;
  482. /* flex-wrap: wrap; */
  483. flex-direction: row;
  484. gap: 16rpx;
  485. margin-bottom: 32rpx;
  486. }
  487. .eval-tag {
  488. font-size: 24rpx;
  489. padding: 8rpx 24rpx;
  490. background-color: #F5F5F5;
  491. border-radius: 24rpx;
  492. /* color: #666666; */
  493. }
  494. .eval-item {
  495. /* display: flex; */
  496. gap: 24rpx;
  497. flex-direction: row;
  498. }
  499. .eval-avatar {
  500. width: 80rpx;
  501. height: 80rpx;
  502. border-radius: 50%;
  503. }
  504. .eval-content {
  505. flex: 1;
  506. }
  507. .eval-top {
  508. /* display: flex; */
  509. justify-content: space-between;
  510. margin-bottom: 8rpx;
  511. flex-direction: row;
  512. }
  513. .eval-name {
  514. /* font-size: 28rpx; */
  515. font-weight: 500;
  516. color: #333333;
  517. }
  518. .eval-date {
  519. font-size: 24rpx;
  520. color: #999999;
  521. }
  522. .eval-stars {
  523. font-size: 24rpx;
  524. color: #FFD740;
  525. margin-bottom: 8rpx;
  526. flex-direction: row;
  527. }
  528. .eval-service {
  529. color: #999999;
  530. margin-left: 16rpx;
  531. font-size: 28rpx;
  532. }
  533. .eval-comment {
  534. font-size: 26rpx;
  535. color: #333333;
  536. }
  537. </style>