appointment.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  1. <template>
  2. <view class="page">
  3. <template v-if="data && priceInfo">
  4. <view class="block">
  5. <view class="station">
  6. <ChargeMachine
  7. :title="'NO.' + data.equipment.shortId"
  8. :list="data.equipment.connectorInfos"
  9. :time="priceInfo.useTime"
  10. :parkingNo="data.equipment.parkingNo"
  11. ></ChargeMachine>
  12. </view>
  13. <view class="pt-20 pb-20 pl-30 pr-30 flex-align-center">
  14. <image
  15. src="/pages-charge/static/machines-banner-address.png"
  16. mode="widthFix"
  17. class="flex-shrink mr-12 width-40"
  18. />
  19. <view class="fs-26 color-666">{{ data.station.address }}</view>
  20. </view>
  21. </view>
  22. <view class="mt-40 color-999 fs-32 fw-500">费用说明</view>
  23. <view
  24. class="mt-20 block height-96 flex-align-center pl-30 pr-30"
  25. @click="openPriceDesc"
  26. >
  27. <view class="fs-26 color-666">充电费用</view>
  28. <view class="ml-64 fs-26 color-333"
  29. >{{ priceInfo.minPrice }}~{{ priceInfo.maxPrice }}元/度</view
  30. >
  31. <view class="ml-auto">
  32. <uni-icons type="right" size="16" color="rgba(0,0,0,0.4)"></uni-icons>
  33. </view>
  34. </view>
  35. <template v-if="appointmentData">
  36. <view class="mt-40 color-999 fs-32 fw-500">已预约充电</view>
  37. <view class="mt-20 block flex-align-center" style="height: 180rpx">
  38. <image
  39. class="width-56 ml-30"
  40. src="/pages-charge/static/icon-alarm.png"
  41. mode="widthFix"
  42. ></image>
  43. <view class="ml-24">
  44. <view class="flex" v-if="appointmentCountDown">
  45. <view class="fs-28 color-000">将在</view>
  46. <view class="fs-44 lh-36 color-primary ml-8 mr-8">{{
  47. appointmentCountDown
  48. }}</view>
  49. <view class="fs-28 color-000">后开始充电</view>
  50. </view>
  51. <view class="fs-24 color-999 mt-8"
  52. >请在{{ appointmentData.startTime }}前到达充电桩并开始充电</view
  53. >
  54. </view>
  55. </view>
  56. <view class="mt-40 flex-center">
  57. <view
  58. class="flex-center height-68 br-68 fs-26 color-666"
  59. style="width: 184rpx; border: 1rpx solid rgba(0, 0, 0, 0.3)"
  60. @click="cancelAppointment"
  61. >取消预约</view
  62. >
  63. </view>
  64. </template>
  65. <template v-else>
  66. <view class="mt-40 color-999 fs-32 fw-500">选择充电方式</view>
  67. <view class="mt-20 block pl-30 pr-30">
  68. <view
  69. v-for="(type, index) in chargeTypes"
  70. :key="index"
  71. :class="['pt-40', 'pb-40', 'flex-align-center']"
  72. :style="{
  73. borderTop: index === 0 ? '' : '1rpx solid rgba(0, 0, 0, 0.10)',
  74. }"
  75. @click="changeType(index)"
  76. >
  77. <view>
  78. <view class="fs-28 lh-28 color-000 fw-500">{{ type.title }}</view>
  79. <view class="fs-24 color-999 lh-24 mt-16" v-if="type.tip">{{
  80. type.tip
  81. }}</view>
  82. </view>
  83. <view class="ml-auto">
  84. <style-checkbox :checked="chargeType === index"></style-checkbox>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="mt-20 block pl-30 pr-30" v-if="chargeType === 0">
  89. <view
  90. class="pt-40 pb-40 flex-between"
  91. style="border-bottom: 1rpx solid rgba(0, 0, 0, 0.1)"
  92. @click="selectTime"
  93. >
  94. <view class="fs-28 color-000 fw-500">充电时间</view>
  95. <view class="flex-align-center lh-28">
  96. <view
  97. v-if="chargeTime.format"
  98. class="fs-28 color-333 fw-500 mr-16"
  99. >{{ chargeTime.format }}</view
  100. >
  101. <view v-else class="fs-26 mr-16" style="color: #cacaca"
  102. >请选择</view
  103. >
  104. <uni-icons type="right" size="16" color="#CACACA"></uni-icons>
  105. </view>
  106. </view>
  107. <view class="pt-40 pb-40 flex-between">
  108. <view class="fs-28 color-000 fw-500">预计费用</view>
  109. <view class="flex-align-center lh-28">
  110. <view
  111. v-if="chargeTime.formatPrice"
  112. class="fs-28 color-333 fw-500"
  113. >{{ chargeTime.formatPrice }}</view
  114. >
  115. <view v-else class="fs-26 mr-16" style="color: #cacaca"
  116. >选择时间后显示</view
  117. >
  118. </view>
  119. </view>
  120. </view>
  121. <view
  122. class="mt-20 block flex-align-center pl-30 pr-30 pt-30 pb-30"
  123. v-if="chargeType === 0"
  124. >
  125. <view class="flex-column">
  126. <view class="fs-28 lh-28 color-000 fw-500">省钱模式</view>
  127. <view class="fs-24 lh-30 color-999 mt-8"
  128. >处于00:00-08:00时,电费低至{{ priceInfo.minPrice }}元/kwh</view
  129. >
  130. </view>
  131. <view class="ml-auto">
  132. <switch
  133. :checked="chargeTime.isPowerSaving"
  134. color="#347DFF"
  135. @change="changePowerSaving"
  136. />
  137. </view>
  138. </view>
  139. </template>
  140. <view class="pt-60 pb-80"></view>
  141. <style-bottom-view>
  142. <view class="pt-20 pl-40 pr-40 pb-20 bg-fff flex">
  143. <template v-if="appointmentData">
  144. <view class="mr-10" style="width: 50%">
  145. <style-button size="small" @click="selectTime"
  146. >修改时间</style-button
  147. ></view
  148. >
  149. <view class="ml-10" style="width: 50%">
  150. <style-button type="primary" size="small" @click="submitNow"
  151. >立即开始</style-button
  152. >
  153. </view>
  154. </template>
  155. <style-button v-else type="primary" size="small" @click="submit">{{
  156. chargeType === 0 ? "提交预约" : "马上充电"
  157. }}</style-button>
  158. </view>
  159. </style-bottom-view>
  160. </template>
  161. <style-dialog
  162. v-if="chargeTimeDialog"
  163. @close="closeTime"
  164. title="请选择充电时间"
  165. >
  166. <view class="flex" style="border-top: 1rpx solid rgba(0, 0, 0, 0.1)">
  167. <view
  168. class="flex-shrink"
  169. style="height: 840rpx; width: 256rpx; background-color: #f0f0f0"
  170. >
  171. <view
  172. class="flex-align-center pl-32 height-90"
  173. v-for="(day, index) in timesInfo.day"
  174. :key="index"
  175. :style="{
  176. backgroundColor:
  177. day.format === chargeTime.day ? '#fff' : 'transparent',
  178. }"
  179. @click="changeDay(index)"
  180. >
  181. <view
  182. :class="[
  183. 'fs-32',
  184. 'fw-500',
  185. day.format === chargeTime.day ? 'color-primary' : 'color-000',
  186. ]"
  187. >{{ day.format }}</view
  188. >
  189. <view
  190. class="fs-24 color-666 ml-12 br-8 width-60 height-40 flex-center"
  191. style="background-color: rgba(0, 0, 0, 0.07)"
  192. v-if="day.year && day.format !== chargeTime.day"
  193. >{{ day.year }}年</view
  194. >
  195. </view>
  196. </view>
  197. <scroll-view
  198. scroll-y
  199. class="flex-grow"
  200. style="height: 840rpx"
  201. :scroll-into-view="chargeTime.scrollId"
  202. >
  203. <view
  204. :id="`hour-${hour.format}`"
  205. class="flex-align-center pl-40 height-90 fs-32"
  206. v-for="(hour, index) in timesInfo.hour"
  207. :key="index"
  208. :style="{
  209. color: hour.disabled
  210. ? '#999'
  211. : hour.format === chargeTime.hour
  212. ? 'var(--color-primary)'
  213. : '#000',
  214. }"
  215. @click="changeHour(index)"
  216. >
  217. {{ hour.format }}
  218. </view>
  219. </scroll-view>
  220. </view>
  221. </style-dialog>
  222. <PriceDesc
  223. v-if="priceDescVisible"
  224. :desc="priceInfo.policyInfos || []"
  225. @close="closePriceDesc"
  226. ></PriceDesc>
  227. </view>
  228. </template>
  229. <script setup lang="ts">
  230. import {
  231. fetchChargeStatus,
  232. fetchStationByConnectorIdOrShortId,
  233. fetchStationPriceDesc,
  234. startCharge,
  235. cancelAppointmentCharge,
  236. changeAppointmentTime,
  237. } from "@/api/charge";
  238. import { onLoad } from "@dcloudio/uni-app";
  239. import { ref } from "vue";
  240. import ChargeMachine from "../machines/charge-machine/charge-machine.vue";
  241. import PriceDesc from "../machines/price-desc/price-desc.vue";
  242. import { format } from "@/utils/date";
  243. const DAY = 24 * 60 * 60 * 1000;
  244. const options = ref<any>();
  245. const data = ref<any>();
  246. const priceInfo = ref();
  247. const priceDescVisible = ref(false);
  248. const timesInfo = ref<any>({
  249. day: [],
  250. time: [],
  251. });
  252. const chargeType = ref(1);
  253. const chargeTypes = ref([
  254. {
  255. title: "预约充电",
  256. tip: "预约特定时间点开始充电",
  257. },
  258. {
  259. title: "立即充电",
  260. },
  261. ]);
  262. const chargeTimeDialog = ref(false);
  263. const chargeTime = ref({
  264. time: 0, // 时间戳
  265. day: "",
  266. hour: "",
  267. format: "",
  268. formatPrice: "",
  269. scrollId: "",
  270. isPowerSaving: false, // 省电模式
  271. });
  272. const appointmentData = ref();
  273. const appointmentCountDown = ref();
  274. const changeType = (index: number) => {
  275. chargeType.value = index;
  276. };
  277. const isPassTime = (hour: string, time: number) => {
  278. const now = new Date();
  279. const _hour = Number(hour.substring(0, 2));
  280. if (typeof _hour !== "number") {
  281. return true;
  282. }
  283. return now.getHours() >= _hour && now.getDate() === Number(format("d", time));
  284. };
  285. const getHourPrice = (hour: string) => {
  286. let price = "";
  287. priceInfo.value.policyInfos.forEach((item: any) => {
  288. if (Number(hour) >= Number(item.startTime.substring(0, 2))) {
  289. price = item.totalPrice;
  290. }
  291. });
  292. return price;
  293. };
  294. const rebuildHours = (now: Date) => {
  295. timesInfo.value.hour = [];
  296. let hourTemp = "";
  297. let priceTemp = "";
  298. for (let index = 0; index < 24; index++) {
  299. hourTemp = index >= 10 ? `${index}` : `0${index}`;
  300. priceTemp = getHourPrice(hourTemp);
  301. timesInfo.value.hour.push({
  302. format: `${hourTemp}:00`,
  303. formatPrice: priceTemp,
  304. disabled: isPassTime(
  305. `${hourTemp}:00`,
  306. chargeTime.value.time ? chargeTime.value.time : now.getTime()
  307. ),
  308. });
  309. timesInfo.value.hour.push({
  310. format: `${hourTemp}:30`,
  311. formatPrice: priceTemp,
  312. disabled: isPassTime(
  313. `${hourTemp}:30`,
  314. chargeTime.value.time ? chargeTime.value.time : now.getTime()
  315. ),
  316. });
  317. }
  318. };
  319. const selectTime = () => {
  320. if (!appointmentData.value && chargeType.value === 1) {
  321. uni.showToast({
  322. title: "请选择预约模式",
  323. icon: "none",
  324. });
  325. return;
  326. }
  327. const now = appointmentData.value
  328. ? new Date(appointmentData.value.startTime.replace(/-/g, "/"))
  329. : new Date();
  330. const year = format("y", now.getTime());
  331. const nextyear = format("y", now.getTime() + DAY);
  332. // 天
  333. timesInfo.value.day = [
  334. {
  335. time: now.getTime(),
  336. format: format("M月d日", now.getTime()),
  337. year: "",
  338. },
  339. {
  340. time: now.getTime() + DAY,
  341. format: format("M月d日", now.getTime() + DAY),
  342. year: year === nextyear ? "" : nextyear.slice(2),
  343. },
  344. ];
  345. // 时间
  346. // timesInfo.value.hour = priceInfo.value.policyInfos.map((item: any) => {
  347. // return {
  348. // format: item.startTime,
  349. // formatPrice: item.totalPrice,
  350. // disabled: isPassTime(
  351. // item.startTime,
  352. // chargeTime.value.time ? chargeTime.value.time : now.getTime()
  353. // ),
  354. // };
  355. // });
  356. rebuildHours(now);
  357. // 预约时间
  358. if (!appointmentData.value) {
  359. if (!chargeTime.value.day) {
  360. chargeTime.value.time = timesInfo.value.day[0].time;
  361. chargeTime.value.day = timesInfo.value.day[0].format;
  362. }
  363. // 滚动到特定位置
  364. if (chargeTime.value.hour) {
  365. chargeTime.value.scrollId = `hour-${chargeTime.value.hour}`;
  366. } else {
  367. let hourNow = now.getHours();
  368. chargeTime.value.scrollId = `hour-${hourNow}:00`;
  369. }
  370. }
  371. // 修改时间
  372. if (appointmentData.value) {
  373. chargeTime.value.time = timesInfo.value.day[0].time;
  374. chargeTime.value.day = timesInfo.value.day[0].format;
  375. const findIndex = timesInfo.value.hour.findIndex(
  376. (item: any) => item.format === format("h:m:s", now.getTime())
  377. );
  378. if (findIndex >= 0) {
  379. chargeTime.value.hour = timesInfo.value.hour[findIndex].format;
  380. chargeTime.value.formatPrice =
  381. timesInfo.value.hour[findIndex].formatPrice;
  382. }
  383. }
  384. chargeTimeDialog.value = true;
  385. };
  386. const changeDay = (index: number) => {
  387. chargeTime.value.time = timesInfo.value.day[index].time;
  388. chargeTime.value.day = timesInfo.value.day[index].format;
  389. if (chargeTime.value.hour) {
  390. chargeTime.value.hour = "";
  391. chargeTime.value.formatPrice = "";
  392. }
  393. const now = new Date(chargeTime.value.time);
  394. rebuildHours(now);
  395. chargeTime.value.scrollId = "";
  396. };
  397. const changeHour = (index: number) => {
  398. if (timesInfo.value.hour[index].disabled) {
  399. uni.showToast({
  400. title: "无法选择过去的时间",
  401. icon: "none",
  402. });
  403. return;
  404. }
  405. if (appointmentData.value) {
  406. // 修改时间
  407. uni.showModal({
  408. title: "温馨提示",
  409. content: `确认修改为${timesInfo.value.hour[index].format}吗?`,
  410. confirmText: "确定",
  411. confirmColor: "#347DFF",
  412. success(modal) {
  413. if (modal.confirm) {
  414. uni.showLoading({
  415. title: "提交中",
  416. mask: true,
  417. });
  418. changeAppointmentTime(
  419. appointmentData.value.startChargeSeq,
  420. `${format("y-M-d", chargeTime.value.time)} ${
  421. timesInfo.value.hour[index].format
  422. }`
  423. )
  424. .then(() => {
  425. return fetchChargeStatus();
  426. })
  427. .then((res) => {
  428. uni.hideLoading();
  429. if (res && res.isBooking === 1) {
  430. uni.showToast({
  431. icon: "success",
  432. title: "修改成功",
  433. });
  434. closeTime();
  435. appointmentData.value = res;
  436. startAppointmentCountDown();
  437. }
  438. });
  439. }
  440. },
  441. });
  442. return;
  443. }
  444. chargeTime.value.hour = timesInfo.value.hour[index].format;
  445. chargeTime.value.format = `${format("y年M月d日", chargeTime.value.time)} ${
  446. chargeTime.value.hour
  447. }`;
  448. chargeTime.value.formatPrice = timesInfo.value.hour[index].formatPrice;
  449. closeTime();
  450. };
  451. const changePowerSaving = (e: any) => {
  452. chargeTime.value.isPowerSaving = e.detail.value;
  453. };
  454. const closeTime = () => {
  455. chargeTimeDialog.value = false;
  456. if (appointmentData.value) {
  457. return;
  458. }
  459. if (!chargeTime.value.hour) {
  460. chargeTime.value = {
  461. time: 0, // 时间戳
  462. day: "",
  463. hour: "",
  464. isPowerSaving: chargeTime.value.isPowerSaving, // 省电模式
  465. format: "",
  466. formatPrice: "",
  467. scrollId: "",
  468. };
  469. }
  470. };
  471. const openPriceDesc = () => {
  472. priceDescVisible.value = true;
  473. };
  474. const closePriceDesc = () => {
  475. priceDescVisible.value = false;
  476. };
  477. const cancelAppointment = () => {
  478. uni.showModal({
  479. title: "取消预约",
  480. content: "确定取消预约吗?",
  481. cancelText: "取消预约",
  482. cancelColor: "#999999",
  483. confirmText: "点错了",
  484. confirmColor: "#347DFF",
  485. success: (res) => {
  486. if (res.cancel) {
  487. uni.showLoading({
  488. title: "提交中",
  489. mask: true,
  490. });
  491. cancelAppointmentCharge()
  492. .then(() => {
  493. uni.hideLoading();
  494. uni.showToast({
  495. icon: "success",
  496. title: "已取消",
  497. });
  498. appointmentData.value = undefined;
  499. startAppointmentCountDown();
  500. })
  501. .catch((err) => {
  502. uni.hideLoading();
  503. });
  504. }
  505. },
  506. });
  507. };
  508. let appointmentCountDownTimer = 0;
  509. const startAppointmentCountDown = () => {
  510. appointmentCountDownTimer && clearTimeout(appointmentCountDownTimer);
  511. if (!appointmentData.value) {
  512. appointmentCountDown.value = "";
  513. return;
  514. }
  515. appointmentCountDown.value = formatAppointmentCountDown(
  516. appointmentData.value.startTime
  517. );
  518. appointmentCountDownTimer = setTimeout(() => {
  519. startAppointmentCountDown();
  520. }, 1000);
  521. };
  522. const formatAppointmentCountDown = (time: string) => {
  523. const now = new Date();
  524. const date = new Date(time.replace(/-/g, "/"));
  525. let secondTime = parseInt(`${(date.getTime() - now.getTime()) / 1000}`);
  526. let hourTime = 0;
  527. let minuteTime = 0; // 分
  528. if (secondTime >= 60) {
  529. minuteTime = parseInt(`${secondTime / 60}`);
  530. secondTime = parseInt(`${secondTime % 60}`);
  531. if (minuteTime >= 60) {
  532. hourTime = parseInt(`${minuteTime / 60}`);
  533. minuteTime = parseInt(`${minuteTime % 60}`);
  534. }
  535. }
  536. return `${hourTime < 10 ? "0" + hourTime : hourTime}:${
  537. minuteTime < 10 ? "0" + minuteTime : minuteTime
  538. }:${secondTime < 10 ? "0" + secondTime : secondTime}`;
  539. };
  540. const submit = () => {
  541. if (chargeType.value === 0 && !chargeTime.value.hour) {
  542. uni.showToast({
  543. title: "请选择充电时间",
  544. icon: "none",
  545. });
  546. return;
  547. }
  548. const now = new Date();
  549. let startTime = chargeTime.value.time;
  550. if (chargeTime.value.isPowerSaving) {
  551. // 省电模式
  552. if (
  553. now.getHours() >= 8 &&
  554. now.getDate() === Number(format("d", chargeTime.value.time))
  555. ) {
  556. startTime += DAY;
  557. }
  558. }
  559. let query = "";
  560. if (chargeType.value === 0) {
  561. query += "isBooking=true";
  562. query += `&startTime=${format("y-M-d", startTime)} ${
  563. chargeTime.value.isPowerSaving ? "00:00:00" : `${chargeTime.value.hour}:00`
  564. }`;
  565. if (chargeTime.value.isPowerSaving) {
  566. query += `&endTime=${format("y-M-d", startTime)} 08:00:00`;
  567. }
  568. }
  569. if (chargeType.value === 1) {
  570. query += "isBooking=false";
  571. }
  572. console.log(query);
  573. uni.showLoading({
  574. title: "提交中",
  575. mask: true,
  576. });
  577. startCharge(options.value.sn, query)
  578. .then(() => {
  579. if (chargeType.value === 0) {
  580. fetchChargeStatus()
  581. .then((res) => {
  582. if (res && res.isBooking === 1) {
  583. uni.hideLoading();
  584. uni.showToast({
  585. icon: "success",
  586. title: "预约成功",
  587. });
  588. appointmentData.value = res;
  589. startAppointmentCountDown();
  590. }
  591. })
  592. .catch(() => {
  593. uni.navigateBack();
  594. });
  595. }
  596. if (chargeType.value === 1) {
  597. uni.navigateTo({
  598. url: `/pages-charge/ordering/ordering?sn=${options.value.sn}&start=1`,
  599. });
  600. }
  601. })
  602. .catch((err) => {
  603. uni.hideLoading();
  604. uni.showModal({
  605. content: `${err.errMsg}`,
  606. showCancel: false,
  607. });
  608. });
  609. };
  610. const submitNow = () => {
  611. uni.showLoading({
  612. title: "提交中",
  613. mask: true,
  614. });
  615. cancelAppointmentCharge()
  616. .then(() => {
  617. return startCharge(options.value.sn, "isBooking=false");
  618. })
  619. .then(() => {
  620. uni.navigateTo({
  621. url: `/pages-charge/ordering/ordering?sn=${options.value.sn}&start=1`,
  622. });
  623. })
  624. .catch((err) => {
  625. uni.hideLoading();
  626. uni.showModal({
  627. content: `${err.errMsg}`,
  628. showCancel: false,
  629. });
  630. });
  631. };
  632. onLoad((_options: any) => {
  633. // sn=SN100523042860091 测试环境
  634. console.log("options", _options);
  635. let sn = _options.sn;
  636. uni.showLoading({
  637. title: "加载中",
  638. });
  639. fetchStationByConnectorIdOrShortId(sn)
  640. .then((res) => {
  641. console.log(res);
  642. if (
  643. res.equipment &&
  644. res.equipment.connectorInfos &&
  645. res.equipment.connectorInfos.length
  646. ) {
  647. sn = res.equipment.connectorInfos[0].connectorId;
  648. _options.sn = res.equipment.connectorInfos[0].connectorId;
  649. }
  650. options.value = _options;
  651. data.value = res;
  652. return fetchStationPriceDesc(sn);
  653. })
  654. .then((res) => {
  655. // console.log(res);
  656. uni.hideLoading();
  657. priceInfo.value = res;
  658. return fetchChargeStatus(false, true);
  659. })
  660. .then((res) => {
  661. if (res && res.isBooking === 1) {
  662. appointmentData.value = res;
  663. startAppointmentCountDown();
  664. }
  665. })
  666. .catch((err) => {
  667. console.log(err);
  668. uni.hideLoading();
  669. });
  670. });
  671. </script>
  672. <style lang="scss" scoped>
  673. .page {
  674. min-height: 100vh;
  675. width: 100%;
  676. padding: 20rpx;
  677. background-color: #f6f7fa;
  678. }
  679. .block {
  680. border-radius: 20rpx;
  681. background: #fff;
  682. }
  683. .station {
  684. height: 148rpx;
  685. border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  686. }
  687. </style>