Sfoglia il codice sorgente

请求充电参数更正

skyline 1 anno fa
parent
commit
3a9c965a62

+ 2 - 2
src/components/charge-station/charge-station.vue

@@ -65,8 +65,8 @@
           >
         </view>
         <block v-else>
-          <view class="lh-0 mt-18 fs-22" style="color: #999"
-          >以场地方公告为准!
+          <view class="lh-0 mt-18 fs-20" style="color: #999"
+          >停车费用:以场地方公告为准!
           </view
           >
           <view

+ 6 - 2
src/components/station-charge-coupon/station-charge-coupon.vue

@@ -156,7 +156,9 @@ const rightsList = ref<any[]>([]);
 
 const stationId = ref(null);
 const rightsId = ref(null);
+const userRechargeRightsId = ref(null);
 const couponId = ref(null);
+const userCouponId = ref(null);
 const visible = ref(false);
 
 const emits = defineEmits(['on-change'])
@@ -164,7 +166,9 @@ const emits = defineEmits(['on-change'])
 const handleClose = () => {
   visible.value = false;
   rightsId.value = null;
+  userRechargeRightsId.value = null;
   couponId.value = null;
+  userCouponId.value = null;
   stationId.value = null;
   mode.value = 0;
 }
@@ -174,8 +178,8 @@ const handleConfirm = () => {
     rightsId: rightsId.value,
     couponId: couponId.value,
     stationId: stationId.value,
-    userRights: rightsList.value?.find((k: any) => k.rightsId == rightsId.value),
-    userCoupon: couponList.value?.find((k: any) => k.couponId == couponId.value)
+    userRights: rightsList.value?.find((k: any) => k.userRechargeRightsId == userRechargeRightsId.value ),
+    userCoupon: couponList.value?.find((k: any) => k.userCouponId == userCouponId.value)
   }
   // console.log(emitData)
   emits('on-change', emitData)

+ 13 - 9
src/pages-charge/appointment/appointment.vue

@@ -51,7 +51,7 @@
               <view class="fs-28 color-000">后开始充电</view>
             </view>
             <view class="fs-24 color-999 mt-8"
-            >请在{{ appointmentData.startTime }}前到达充电桩并开始充电
+            >注意:启动充电前请勿拔插充电枪!
             </view
             >
           </view>
@@ -318,7 +318,9 @@ const timesInfo = ref<any>({
 });
 const checkedUserRightsOrCoupon = ref<any>({
   rightsId: null,
+  userRechargeRightsId: null,
   couponId: null,
+  userCouponId: null,
   stationId: null,
   userRights: null,
   userCoupon: null
@@ -389,10 +391,10 @@ const getHourPrice = (hour: string) => {
 const rebuildHours = (day: Date) => {
   timesInfo.value.hour = [];
   const nowHour = format("h");
-  const isTaday = format("d") === format("d", day.getTime());
+  const isToday = format("d") === format("d", day.getTime());
   // 当前时间的24小时内
-  let startHour = isTaday ? Number(nowHour) : 0;
-  let endHour = isTaday ? 24 : Number(nowHour) + 1;
+  let startHour = isToday ? Number(nowHour) : 0;
+  let endHour = isToday ? 24 : Number(nowHour) + 1;
   if (chargeTime.value.isPowerSaving) {
     startHour = 0;
     endHour = 8;
@@ -713,12 +715,12 @@ const submit = () => {
   if (chargeType.value === 1) {
     query += "isBooking=false";
   }
-  let {rightsId, couponId} = checkedUserRightsOrCoupon.value;
-  if (rightsId && rightsId >= 0) {
-    query += `&userRechargeRightsId=${rightsId}`;
+  let {userRechargeRightsId, userCouponId} = checkedUserRightsOrCoupon.value;
+  if (userRechargeRightsId && userRechargeRightsId >= 0) {
+    query += `&userRechargeRightsId=${userRechargeRightsId}`;
   }
-  if (couponId && couponId >= 0) {
-    query += `&userCouponId=${couponId}`;
+  if (userCouponId && userCouponId >= 0) {
+    query += `&userCouponId=${userCouponId}`;
   }
   console.log(query)
   uni.showLoading({
@@ -798,9 +800,11 @@ const fetchUserStationDefaultRightsAndCoupon = () => {
     if (rightsList && rightsList.length > 0) {
       checkedUserRightsOrCoupon.value.userRights = rightsList[0];
       checkedUserRightsOrCoupon.value.rightsId = rightsList[0].rightsId;
+      checkedUserRightsOrCoupon.value.userRechargeRightsId = rightsList[0].id;
     } else if (couponList && couponList.length > 0) {
       checkedUserRightsOrCoupon.value.userCoupon = couponList[0];
       checkedUserRightsOrCoupon.value.couponId = couponList[0].couponId;
+      checkedUserRightsOrCoupon.value.userCouponId = couponList[0].id;
     }
     console.log(res)
   });