|
@@ -165,11 +165,11 @@
|
|
|
</block>
|
|
</block>
|
|
|
<block v-else-if="checkedUserRightsOrCoupon&&checkedUserRightsOrCoupon.couponId">
|
|
<block v-else-if="checkedUserRightsOrCoupon&&checkedUserRightsOrCoupon.couponId">
|
|
|
<view class="fs-28 lh-28 ml-auto" style="color: #f43636" v-if="checkedUserRightsOrCoupon.userCoupon.couponType=='FullDiscount'">
|
|
<view class="fs-28 lh-28 ml-auto" style="color: #f43636" v-if="checkedUserRightsOrCoupon.userCoupon.couponType=='FullDiscount'">
|
|
|
- {{ ((checkedUserRightsOrCoupon?.userCoupon?.discount || 0) / 100).toFixed(2) }}元
|
|
|
|
|
- </view >
|
|
|
|
|
|
|
+ {{ ((checkedUserRightsOrCoupon?.userCoupon?.discount || 0) / 100).toFixed(2) }}元
|
|
|
|
|
+ </view>
|
|
|
<view class="fs-28 lh-28 ml-auto" style="color: #f43636" v-else>
|
|
<view class="fs-28 lh-28 ml-auto" style="color: #f43636" v-else>
|
|
|
{{ ((checkedUserRightsOrCoupon?.userCoupon?.discount || 0) / 10).toFixed(1) }}折
|
|
{{ ((checkedUserRightsOrCoupon?.userCoupon?.discount || 0) / 10).toFixed(1) }}折
|
|
|
- </view >
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
|
|
|
<!-- <view class="fs-28 lh-28 color-666 ml-8">权益待领取</view>-->
|
|
<!-- <view class="fs-28 lh-28 color-666 ml-8">权益待领取</view>-->
|
|
|
<uni-icons type="right" size="16" color="#CACACA"></uni-icons>
|
|
<uni-icons type="right" size="16" color="#CACACA"></uni-icons>
|
|
@@ -215,10 +215,17 @@
|
|
|
>
|
|
>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
- <style-button v-else type="primary" size="small" @click="submit">{{
|
|
|
|
|
- chargeType === 0 ? "提交预约" : "立即充电"
|
|
|
|
|
- }}
|
|
|
|
|
- </style-button>
|
|
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <style-button v-if="balance>0" type="primary" size="small" @click="submit">{{
|
|
|
|
|
+ chargeType === 0 ? "提交预约" : "立即充电"
|
|
|
|
|
+ }}
|
|
|
|
|
+ </style-button>
|
|
|
|
|
+
|
|
|
|
|
+ <style-button v-else type="primary" size="small" @click="to('/pages-user/wallet-recharge/wallet-recharge')">
|
|
|
|
|
+ 余额不足,请充值
|
|
|
|
|
+ </style-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</style-bottom-view>
|
|
</style-bottom-view>
|
|
|
</view>
|
|
</view>
|
|
@@ -307,7 +314,7 @@ import ChargeMachine from "../machines/charge-machine/charge-machine.vue";
|
|
|
import PriceDesc from "../machines/price-desc/price-desc.vue";
|
|
import PriceDesc from "../machines/price-desc/price-desc.vue";
|
|
|
import StationChargeCoupon from "@/components/station-charge-coupon/station-charge-coupon.vue";
|
|
import StationChargeCoupon from "@/components/station-charge-coupon/station-charge-coupon.vue";
|
|
|
import {format} from "@/utils/date";
|
|
import {format} from "@/utils/date";
|
|
|
-import {redirect} from "../../utils/navigate";
|
|
|
|
|
|
|
+import {redirect, to} from "../../utils/navigate";
|
|
|
|
|
|
|
|
|
|
|
|
|
const DAY = 24 * 60 * 60 * 1000;
|
|
const DAY = 24 * 60 * 60 * 1000;
|
|
@@ -319,6 +326,8 @@ const timesInfo = ref<any>({
|
|
|
day: [],
|
|
day: [],
|
|
|
time: [],
|
|
time: [],
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
const checkedUserRightsOrCoupon = ref<any>({
|
|
const checkedUserRightsOrCoupon = ref<any>({
|
|
|
rightsId: null,
|
|
rightsId: null,
|
|
|
userRechargeRightsId: null,
|
|
userRechargeRightsId: null,
|
|
@@ -360,6 +369,14 @@ const discountList = ref<any[]>([]);
|
|
|
const activity = ref();
|
|
const activity = ref();
|
|
|
|
|
|
|
|
const stationId = ref();
|
|
const stationId = ref();
|
|
|
|
|
+const balance = ref(0);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const refreshUserBalance = () => {
|
|
|
|
|
+ let user = getApp<any>().globalData.user
|
|
|
|
|
+ console.log(user)
|
|
|
|
|
+ balance.value = user?.balance || 0;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const handleShowStationChargeCoupon = () => {
|
|
const handleShowStationChargeCoupon = () => {
|
|
|
let {rightsId, couponId} = checkedUserRightsOrCoupon.value;
|
|
let {rightsId, couponId} = checkedUserRightsOrCoupon.value;
|
|
@@ -871,12 +888,14 @@ onLoad((_options: any) => {
|
|
|
activity.value = res.activityList[0];
|
|
activity.value = res.activityList[0];
|
|
|
activity.value.minDiscount = Number(
|
|
activity.value.minDiscount = Number(
|
|
|
(
|
|
(
|
|
|
- Number(res.activityList[0].rechargeRightsList[0].discount) / 10
|
|
|
|
|
|
|
+ Number(res.activityList[0].rechargeRightsList[0]?.discount) / 10
|
|
|
).toFixed(1)
|
|
).toFixed(1)
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
|
|
+ refreshUserBalance();
|
|
|
|
|
+ });
|
|
|
|
|
+ refreshUserBalance();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
@@ -884,6 +903,7 @@ onShow(() => {
|
|
|
discountIndex.value = getApp<any>().globalData.lastData.discount.index;
|
|
discountIndex.value = getApp<any>().globalData.lastData.discount.index;
|
|
|
getApp<any>().globalData.lastData.discount = undefined;
|
|
getApp<any>().globalData.lastData.discount = undefined;
|
|
|
}
|
|
}
|
|
|
|
|
+ refreshUserBalance();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|