panhui 3 years ago
parent
commit
5e195f3afc
1 changed files with 19 additions and 19 deletions
  1. 19 19
      src/views/ProductListPage.vue

+ 19 - 19
src/views/ProductListPage.vue

@@ -19,14 +19,14 @@
                     </ion-button>
                 </ion-buttons>
             </ion-toolbar>
-            <div class="status hot" v-if="status === '抢购中'">
+            <!-- <div class="status hot" v-if="status === '抢购中'">
                 <img src="../assets/info_icon_qianggouzhong.png" alt="" />
                 <span>{{ $t('product.hot') }}</span>
             </div>
             <div class="status" v-else-if="status">
                 <img src="../assets/info_icon_shijian.png" alt="" />
                 <span><van-count-down :time="status" /> {{ $t('product.start') }}</span>
-            </div>
+            </div> -->
         </ion-header>
         <ion-content>
             <!-- <div class="head">
@@ -96,23 +96,23 @@ const changeType = type => {
     listType.value = type
 }
 
-const status = computed(() => {
-    let date1 = getYear(new Date()) + '/' + (getMonth(new Date()) + 1) + '/' + getDate(new Date())
-    if (batchInfo.value && batchInfo.value.saleStart) {
-        if (
-            isAfter(new Date(), new Date(date1 + ' ' + batchInfo.value.saleStart)) &&
-            isBefore(new Date(), new Date(date1 + ' ' + batchInfo.value.saleEnd)) &&
-            !empty.value
-        ) {
-            return '抢购中'
-        } else if (isBefore(new Date(), new Date(date1 + ' ' + batchInfo.value.saleStart))) {
-            return getTime(new Date(date1 + ' ' + batchInfo.value.saleStart), 1) - getTime(new Date())
-        } else {
-            return getTime(addDays(new Date(date1 + ' ' + batchInfo.value.saleStart), 1)) - getTime(new Date())
-        }
-    }
-    return ''
-})
+// const status = computed(() => {
+//     let date1 = getYear(new Date()) + '/' + (getMonth(new Date()) + 1) + '/' + getDate(new Date())
+//     if (batchInfo.value && batchInfo.value.saleStart) {
+//         if (
+//             isAfter(new Date(), new Date(date1 + ' ' + batchInfo.value.saleStart)) &&
+//             isBefore(new Date(), new Date(date1 + ' ' + batchInfo.value.saleEnd)) &&
+//             !empty.value
+//         ) {
+//             return '抢购中'
+//         } else if (isBefore(new Date(), new Date(date1 + ' ' + batchInfo.value.saleStart))) {
+//             return getTime(new Date(date1 + ' ' + batchInfo.value.saleStart), 1) - getTime(new Date())
+//         } else {
+//             return getTime(addDays(new Date(date1 + ' ' + batchInfo.value.saleStart), 1)) - getTime(new Date())
+//         }
+//     }
+//     return ''
+// })
 
 onMounted(() => {
     getData(true)