console.uvue 12 KB

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