needcode пре 2 година
родитељ
комит
3a526814d4

+ 2 - 7
src/pages-charge/appointment/appointment.vue

@@ -85,7 +85,7 @@
             </view>
           </view>
         </view>
-        <view class="mt-20 block pl-30 pr-30">
+        <view class="mt-20 block pl-30 pr-30" v-if="chargeType === 0">
           <view
             class="pt-40 pb-40 flex-between"
             style="border-bottom: 1rpx solid rgba(0, 0, 0, 0.1)"
@@ -117,13 +117,8 @@
               >
             </view>
           </view>
-          <!-- <view class="pb-24 fs-24 color-primary"
-          >{{ priceInfo.minPriceTime }}充电,电费低至{{
-            priceInfo.minPrice
-          }}元/kwh</view
-        > -->
         </view>
-        <view class="mt-20 block flex-align-center pl-30 pr-30 pt-30 pb-30">
+        <view class="mt-20 block flex-align-center pl-30 pr-30 pt-30 pb-30" v-if="chargeType === 0">
           <view class="flex-column">
             <view class="fs-28 lh-28 color-000 fw-500">省钱模式</view>
             <view class="fs-24 lh-30 color-999 mt-8"

+ 12 - 14
src/pages-common/activity/activity.vue

@@ -4,14 +4,13 @@
       class="swiper"
       circular
       :indicator-dots="true"
-      :autoplay="true"
+      :autoplay="banner.length > 1"
       :interval="3000"
     >
       <swiper-item
         class="full-percent"
         v-for="(item, index) in banner"
         :key="index"
-        @click="back"
       >
         <view
           class="full-percent"
@@ -30,11 +29,15 @@
         >{{ item }}</view
       >
     </view>
+    <view class="mt-64"
+      ><style-button type="primary" @click="to('/pages-user/wallet-recharge/wallet-recharge')">去充值</style-button></view
+    >
   </view>
 </template>
 
 <script setup lang="ts">
-import { back } from "../../utils/navigate";
+import { fetchProfile } from "../..//api/user";
+import { to } from "../../utils/navigate";
 import { onLoad } from "@dcloudio/uni-app";
 import { ref } from "vue";
 
@@ -42,23 +45,18 @@ const desc = ref([]);
 const banner = ref<any[]>([]);
 
 onLoad((options: any) => {
-  if (
-    getApp<any>().globalData.user &&
-    getApp<any>().globalData.user.activityList &&
-    getApp<any>().globalData.user.activityList.length
-  ) {
-    const activity = getApp<any>().globalData.user.activityList.find(
-      (item) => item.id === options.id
-    );
+  uni.showLoading({
+    title: "加载中",
+  });
+  fetchProfile().then((res) => {
+    const activity = res.activityList.find((item) => item.id === options.id);
     uni.setNavigationBarTitle({
       title: activity.name,
     });
     desc.value = activity.activityDesc.split("\n");
     banner.value = activity.bannerList;
     uni.hideLoading();
-  } else {
-    back();
-  }
+  });
 });
 </script>
 

+ 5 - 5
src/pages-user/wallet-recharge/wallet-recharge.vue

@@ -25,7 +25,10 @@
         <view class="fs-30 color-666"
           >折扣优惠有效期{{ payOptionsDiscountDay[payOption] }}天</view
         >
-        <view class="ml-12 color-primary fs-30" @click="toDesc">
+        <view
+          class="ml-12 color-primary fs-30"
+          @click="to(`/pages-common/activity/activity?id=${activityId}`)"
+        >
           <text>详细规则</text>
           <text class="fs-24 ml-6">>></text>
         </view>
@@ -55,7 +58,7 @@ import { fetchProfile, insertMoney } from "../../api/user";
 import { onLoad } from "@dcloudio/uni-app";
 import { to } from "@/utils/navigate";
 const balance = ref(0);
-const payOption = ref(0);
+const payOption = ref(3);
 const payOptions = ref([30, 50, 100, 200, 500, 1000]);
 const payOptionsDiscount = ref(["", "", "", "", "", ""]);
 const payOptionsDiscountDay = ref([0, 0, 0, 0, 0, 0]);
@@ -116,9 +119,6 @@ const confirm = () => {
       });
     });
 };
-const toDesc = () => {
-  to(`/pages-common/activity/activity?id=${activityId.value}&back=1`);
-};
 onLoad(() => {
   fetchProfile().then((res) => {
     // console.log(res);

+ 1 - 7
src/pages-user/wallet/wallet.vue

@@ -141,14 +141,8 @@ const infiniteScroller = useInfiniteScroll(10, (page) => {
 });
 const scrollViewHeight = ref(0);
 
-onLoad(() => {
-  infiniteScroller.refresh();
-  if (getApp<any>().globalData.user) {
-    user.value = getApp<any>().globalData.user;
-  }
-});
-
 onShow(() => {
+  infiniteScroller.refresh();
   if (getApp<any>().globalData.user) {
     user.value = getApp<any>().globalData.user;
   }

+ 18 - 29
src/pages/map/map.vue

@@ -95,14 +95,14 @@
           class="swiper"
           circular
           :indicator-dots="true"
-          :autoplay="true"
+          :autoplay="mapBanner.length > 1"
           :interval="3000"
         >
           <swiper-item
             class="full-percent"
             v-for="(item, index) in mapBanner"
             :key="index"
-            @click="toActivity(index)"
+            @click="to(`/pages-common/activity/activity?id=${item.activityId}`);"
           >
             <view
               class="full-percent"
@@ -122,9 +122,11 @@
       id="map"
       :style="{
         width: '100%',
-        height: `calc(100vh - ${styleData.dialogHeight}px - ${
-          styleData.cardHeight - 24
-        }px)`,
+        height: styleData.dialogHeight
+          ? `calc(100vh - ${styleData.dialogHeight}px - ${
+              styleData.cardHeight - 24
+            }px)`
+          : '50vh',
         zIndex: 1,
         pointerEvents: loading || !mapMode ? 'none' : 'auto',
       }"
@@ -265,9 +267,8 @@ import { fetchStations, fetchChargeStatus } from "@/api/charge";
 import { fetchCollectList } from "@/api/user";
 import { fetchLocation } from "@/utils/location";
 import { to } from "@/utils/navigate";
-import { onLoad } from "@dcloudio/uni-app";
+import { onLoad, onShow } from "@dcloudio/uni-app";
 import { ref } from "vue";
-import { WxRequest } from "@/utils/http";
 
 const isIOS = ref(false);
 const token = ref<string>();
@@ -500,17 +501,13 @@ const handleNavReady = (e: any) => {
 
 const toSearch = () => {
   if (!ready.value || station.value.length) {
-    return
+    return;
   }
   uni.navigateTo({
     url: "/pages-charge/search/search",
   });
 };
 
-const toActivity = (index: number) => {
-  to(`/${mapBanner.value[index].linkUrl}`);
-};
-
 onLoad((query: any) => {
   // 只为了打包进tab-bar使用
   console.log(fetchToken, login, onLogin);
@@ -570,6 +567,12 @@ onLoad((query: any) => {
   }, 300);
 });
 
+onShow(() => {
+  if (token.value) {
+    fetchCharging();
+  }
+});
+
 const fetchCharging = () => {
   fetchChargeStatus().then((res) => {
     if (res && [1, 2].includes(res.chargeStatus)) {
@@ -584,9 +587,9 @@ const fetchBanner = () => {
   });
 };
 
-const checkDiscounts = () => {
-  filterDialog.value.discounts = !filterDialog.value.discounts;
-};
+// const checkDiscounts = () => {
+//   filterDialog.value.discounts = !filterDialog.value.discounts;
+// };
 
 const checkFilterDistance = () => {
   if (!mapMode.value) {
@@ -724,20 +727,6 @@ const toCharging = () => {
       : `/pages-charge/ordering/ordering?sn=${charging.value.connectorId}&start=1`
   );
 };
-
-// TORM
-// const changeMarker = (e: any) => {
-//   _changeMarker(e.detail.current);
-// };
-// const emptyTap = () => {};
-// const changeFilterStatus = (index: number) => {
-//   filterDialog.value.options.status = index;
-// };
-// const resetFilter = () => {
-//   filterDialog.value.options.distance = defaulDistance;
-//   filterDialog.value.options.status = 0;
-//   refresh();
-// };
 </script>
 
 <style lang="scss">