张田田 3 месяцев назад
Родитель
Сommit
e373978f85

+ 1 - 1
miniprogram/module/order/pages/appointment/appointment.scss

@@ -1,7 +1,7 @@
 @import "../../../../themes/t.cell.scss";
 @import "../../../../themes/page.scss";
 
-/* module/order/pages/confirme-order/confirme-order.wxss */
+/* module/order/pages/appointment/appointment.wxss */
 .page-scroll__container {
   flex: 0 1 auto;
   height: var(--page-container-safeHeight, 100vh);

+ 11 - 42
miniprogram/module/order/pages/appointment/appointment.ts

@@ -1,10 +1,8 @@
 import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
 import DictionariesBehavior from "../../../../core/behavior/dictionaries.behavior";
-import tickleBehavior, {
-  getTickleContext,
-} from "../../../../core/behavior/tickle.behavior";
+import tickleBehavior from "../../../../core/behavior/tickle.behavior";
 import { patientOfflineTreatmentAppointmentMethod } from "../../request";
-// module/order/pages/confirme-order/confirme-order.ts
+// module/order/pages/appointment/appointment.ts
 Page({
   behaviors: [PageContainerBehavior, DictionariesBehavior, tickleBehavior],
   data: {
@@ -27,7 +25,7 @@ Page({
     offlineId: "",
   },
   onLoad(options: any) {
-    // 初始化日期列表(从今天开始5天),内部会调用 initTimeSlots
+    // 初始化日期列表(从今天开始5天)
     this.initDateList();
     if (options.goodsInfo) {
       const goodsInfo = JSON.parse(options.goodsInfo);
@@ -194,9 +192,7 @@ Page({
     }
     console.log(this.data.selectedDate, "this.data.selectedDate", this.data.selectedTime, "this.data.selectedTime", this.data.offlineId, "this.data.offlineId")
 
-    // const selectedDateItem = this.data.dateList.find(item => item.isSelected);
     const appointmentTime = `${this.data.selectedDate} ${this.data.selectedTime}`;
-    // console.log(selectedDateItem, "selectedDateItem")
     console.log(appointmentTime, "appointmentTime");
     console.log(this.data.offlineId, "this.data.offlineId");
     this.setData({
@@ -206,18 +202,17 @@ Page({
       },
     });
     try {
-      const res = await patientOfflineTreatmentAppointmentMethod(this.data.offlineId, appointmentTime);
-      console.log(res, "res========预约结果")
-
+      await patientOfflineTreatmentAppointmentMethod(this.data.offlineId, appointmentTime);
+      wx.showToast({
+        title: '预约成功',
+        icon: 'success',
+      });
       setTimeout(() => {
-        wx.showToast({
-          title: '预约成功',
-          icon: 'success',
+        wx.redirectTo({
+          url: `/module/order/pages/appointment-success/appointment-success?goodsInfo=${JSON.stringify(this.data.goodsInfo)}`,
         });
       }, 1000);
-      wx.redirectTo({
-        url: `/module/order/pages/appointment-success/appointment-success?goodsInfo=${JSON.stringify(this.data.goodsInfo)}`,
-      });
+
     } catch (error: any) {
       wx.showToast({
         title: error.errMsg || "预约失败",
@@ -225,32 +220,6 @@ Page({
       });
       console.log(error, "error")
     }
-    // 预约成功后跳转到成功页面,传递预约信息
-    // const selectedDateItem = this.data.dateList.find(item => item.isSelected);
-    // const serviceTime = selectedDateItem
-    //   ? `${selectedDateItem.dateStr} ${this.data.selectedTime || '09:00'}`
-    //   : '12月30日 09:00';
-    // console.log('提交预约:', {
-    //   service: this.data.serviceInfo.name,
-    //   date: selectedDateItem?.label + ' ' + selectedDateItem?.dateStr,
-    //   time: this.data.selectedTime,
-    //   time:appointmentTime,
-    //   offlineId: this.data.offlineId,
-    // });
-
-    // // TODO: 调用预约接口
-    // wx.showToast({
-    //   title: '预约成功',
-    //   icon: 'success',
-    // });
-
-
-
-    // setTimeout(() => {
-    //   wx.redirectTo({
-    //     url: `/module/order/pages/appointment-success/appointment-success?serviceName=${encodeURIComponent(this.data.serviceInfo.name)}&serviceTime=${encodeURIComponent(serviceTime)}&duration=${this.data.serviceInfo.duration}`,
-    //   });
-    // }, 500);
   },
 
   // 打开日历弹窗

+ 1 - 1
miniprogram/module/order/pages/appointment/appointment.wxml

@@ -1,4 +1,4 @@
-<!--module/order/pages/confirme-order/confirme-order.wxml-->
+<!--module/order/pages/appointment/appointment.wxml-->
 <t-navbar title="预约" left-arrow />
 <scroll-view class="page-scroll__container" type="list" scroll-y style="{{containerStyle}}">
   <!-- 服务信息卡片 -->

+ 2 - 2
miniprogram/module/order/pages/other-detail/other-detail.scss

@@ -194,13 +194,13 @@
 }
 
 .goods-status {
-  font-size: 24rpx;
+  font-size: 30rpx;
   font-weight: 400;
   color: #ff9500;
   flex-shrink: 0;
   white-space: nowrap;
   background: white;
-  padding: 0 40rpx 0 0;
+  padding: 0 30rpx 0 0;
   text-align: end;
 }