Browse Source

feat:活动页

needcode 2 years ago
parent
commit
99fa2d8752

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

@@ -504,18 +504,6 @@ const changeHour = (index: number) => {
 
 const changePowerSaving = (e: any) => {
   chargeTime.value.isPowerSaving = e.detail.value;
-  chargeTime.value = {
-    time: 0, // 时间戳
-    day: "",
-    hour: "",
-    isPowerSaving: chargeTime.value.isPowerSaving, // 省电模式
-    format: "",
-    formatPrice: "",
-    scrollId: "",
-  };
-  if (chargeTime.value.isPowerSaving) {
-    selectTime();
-  }
 };
 
 const closeTime = () => {
@@ -648,13 +636,9 @@ const submit = () => {
   let query = "";
   if (chargeType.value === 0) {
     query += "isBooking=true";
-    if (chargeTime.value.isPowerSaving && !chargeTime.value.hour) {
-      query += `&startTime=${format("y-M-d", startTime)} 00:00:00`;
-    } else {
-    }
     query += `&startTime=${format("y-M-d", startTime)} ${
-      chargeTime.value.hour
-    }:00`;
+      chargeTime.value.isPowerSaving ? "00:00:00" : `${chargeTime.value.hour}:00`
+    }`;
     if (chargeTime.value.isPowerSaving) {
       query += `&endTime=${format("y-M-d", startTime)} 08:00:00`;
     }
@@ -665,7 +649,6 @@ const submit = () => {
   if (discountIndex.value >= 0) {
     query += `&rechargeRightsId=${discountList.value[discountIndex.value].id}`;
   }
-  console.log(query);
   uni.showLoading({
     title: "提交中",
     mask: true,

+ 11 - 3
src/pages-charge/orders/orders.vue

@@ -144,7 +144,9 @@ const setCheckData = () => {
       price += Number(item.payAmount);
     }
   });
-  checkAll.value = infiniteScroller.list.every((item: any) => item.checked);
+  checkAll.value = infiniteScroller.list
+    .filter((item: any) => item.invoiceStatus === 0 && !item.hidden)
+    .every((item: any) => item.checked);
   checkedCount.value = count;
   checkedPrice.value = Number(Number(price).toFixed(2));
 };
@@ -153,7 +155,7 @@ const detail = (index: number) => {
     return;
   }
   if (isInvoice.value) {
-    if ([0, 3].includes(infiniteScroller.list[index].invoiceStatus)) {
+    if ([0].includes(infiniteScroller.list[index].invoiceStatus)) {
       infiniteScroller.list[index].checked =
         !infiniteScroller.list[index].checked;
       setCheckData();
@@ -222,9 +224,15 @@ const nextInvoice = () => {
 };
 const checkPage = () => {
   infiniteScroller.list = infiniteScroller.list.map((item: any) => {
+    if (item.invoiceStatus === 0 && !item.hidden) {
+      return {
+        ...item,
+        checked: checkAll.value ? false : true,
+      };
+    }
     return {
       ...item,
-      checked: checkAll.value ? false : true,
+      checked: false,
     };
   });
   setCheckData();

+ 42 - 59
src/pages-common/activity/activity.vue

@@ -1,87 +1,70 @@
 <template>
-  <view class="page pl-32 pr-32 pt-32">
-    <swiper
-      class="swiper"
-      circular
-      :indicator-dots="true"
-      :autoplay="banner.length > 1"
-      :interval="3000"
-    >
-      <swiper-item
-        class="full-percent"
-        v-for="(item, index) in banner"
-        :key="index"
-      >
+  <view class="page">
+    <block v-if="activity">
+      <navigation-bar
+        :title="activity.name"
+        :color="'#fff'"
+        :placeholder="false"
+        :background="'#3F3EC2'"
+      ></navigation-bar>
+      <image
+        v-if="activity.activityDescPage"
+        style="width: 100%"
+        mode="widthFix"
+        :src="activity.activityDescPage"
+      ></image>
+    </block>
+    <view class="desc">
+      <view class="flex mb-40" v-for="(item, index) in desc" :key="index">
         <view
-          class="full-percent"
-          :style="{
-            backgroundImage: `url(${item.bannerUrl})`,
-          }"
-        ></view>
-      </swiper-item>
-    </swiper>
-    <view class="fs-32 fw-500 color-000 pt-40">活动说明</view>
-    <view class="mt-32">
-      <view
-        class="mt-24 fs-28 color-666"
-        v-for="(item, index) in desc"
-        :key="index"
-        >{{ item }}</view
-      >
-    </view>
-    <style-bottom-view>
-      <view class="pl-40 pr-40 pb-30 pt-30" style="background-color: #fff">
-        <style-button
-          type="primary"
-          @click="to('/pages-user/wallet-recharge/wallet-recharge')"
-          >去充值</style-button
+          class="width-40 height-40 br-round fs-28 color-fff flex-center flex-shrink mr-20"
+          style="
+            shadow: 0px 1px 1px rgba(0, 0, 0, 0.25));
+            background: linear-gradient(180deg, #9767f8 0%, #564eed 100%);
+          "
+          >{{ index + 1 }}</view
         >
+        <view class="fs-28 lh-40 flex-grow" style="color: rgba(8, 0, 61, 0.8)">{{ item }}</view>
       </view>
-    </style-bottom-view>
+    </view>
   </view>
 </template>
 
 <script setup lang="ts">
-import { fetchProfile } from "../..//api/user";
-import { to } from "../../utils/navigate";
+import { fetchProfile } from "../../api/user";
 import { onLoad } from "@dcloudio/uni-app";
 import { ref } from "vue";
 
-const desc = ref([]);
-const banner = ref<any[]>([]);
+const desc = ref<string[]>([]);
+const activity = ref();
 
 onLoad((options: any) => {
   uni.showLoading({
     title: "加载中",
   });
   fetchProfile().then((res) => {
-    const activity = res.activityList.find(
-      (item: any) => item.id === options.id
-    );
-    uni.setNavigationBarTitle({
-      title: activity.name,
-    });
-    desc.value = activity.activityDesc.split("\n");
-    banner.value = activity.bannerList;
+    const a = res.activityList.find((item: any) => item.id === options.id);
+    desc.value = a.activityDesc.split("\n");
+    activity.value = a;
     uni.hideLoading();
   });
 });
 </script>
 
 <style lang="scss">
+page {
+  background-color: #716ffc;
+}
 .page {
-  min-height: 100vh;
-  background-color: #fff;
-  .swiper {
-    height: 176rpx;
+  position: relative;
+  .desc {
+    position: absolute;
     width: 100%;
-    border-radius: 16rpx;
-    overflow: hidden;
-    view {
-      background-position: center;
-      background-repeat: no-repeat;
-      background-size: 100% auto;
-    }
+    left: 0;
+    top: 650rpx;
+    box-sizing: border-box;
+    padding: 0 68rpx;
+    padding-top: 100rpx;
   }
 }
 </style>

+ 3 - 2
src/pages-user/wallet-recharge/wallet-recharge.vue

@@ -115,7 +115,7 @@ const confirm = () => {
         } else {
           to("/pages-user/wallet/wallet");
         }
-      }, 2000)
+      }, 2000);
     })
     .catch((err) => {
       if (/cancel/.test(err.errMsg)) {
@@ -142,7 +142,8 @@ onLoad((options: any) => {
         const fi = payOptions.value.findIndex((o) => o === val);
         if (fi >= 0) {
           payOptionsDiscount.value[fi] = item.rightsDesc;
-          payOptionsDiscountDay.value[fi] = item.validity;
+          payOptionsDiscountDay.value[fi] =
+            item.validity > 0 ? item.validity : 1;
         }
       });
       activityId.value = res.activityList[0].id;

+ 0 - 3
src/pages.json

@@ -156,9 +156,6 @@
         {
           "path": "activity/activity",
           "style": {
-            "navigationStyle": "default",
-            "navigationBarTitleText": "",
-            "navigationBarBackgroundColor": "#ffffff"
           }
         }
       ]