xiongzhu 2 سال پیش
والد
کامیت
e02f8d32a2
3فایلهای تغییر یافته به همراه35 افزوده شده و 12 حذف شده
  1. 2 1
      src/locales/en.json
  2. 2 1
      src/locales/zh.json
  3. 31 10
      src/views/HomePage.vue

+ 2 - 1
src/locales/en.json

@@ -128,7 +128,8 @@
         "copy": "Copy"
     },
     "home": {
-        "all": "All"
+        "all": "All",
+        "trialPrompt": "This is only available to new users who register within 72 hours, please head to higher level"
     },
     "loginPage": {
         "agreement": "User Agreement",

+ 2 - 1
src/locales/zh.json

@@ -128,7 +128,8 @@
         "copy": "复制"
     },
     "home": {
-        "all": "全部"
+        "all": "全部",
+        "trialPrompt": "只对72小时内注册的新用户开放"
     },
     "loginPage": {
         "agreement": "用户协议",

+ 31 - 10
src/views/HomePage.vue

@@ -145,7 +145,7 @@
                         <van-image @click="goList(item)" :src="item.cover" fit="scale-down" />
 
                         <!-- <img class="second-btn" v-if="index === 0" src="../assets/TUTORIAL.png" alt="" /> -->
-                        <template v-if="item.empty !== null">
+                        <template v-if="item.empty !== null && item.id != 11547">
                             <div
                                 class="status hot animate__animated animate__tada animate__infinite"
                                 v-if="getStatus(item) === '抢购中'"
@@ -207,6 +207,7 @@ import { useStorage } from '@vueuse/core'
 import { init as initEruda } from '@/utils/console'
 import { emitter } from '@/utils/eventBus'
 import { getUtcTime } from '@/plugins/time'
+import { useUserStore } from '@/stores/user'
 
 const router = useIonRouter()
 
@@ -224,17 +225,19 @@ function getBanner() {
 const saleBatches = ref([])
 function getSaleBatch() {
     return http.post('saleBatch/all', {}, { body: 'json' }).then(res => {
-        saleBatches.value = res.content
-            .filter(i => true != i.hidden)
-            .map(item => {
-                return {
-                    ...item,
-                    empty: false,
-                    hotInfo: {}
-                }
-            })
+        saleBatches.value = res.content.map(item => {
+            return {
+                ...item,
+                empty: false,
+                hotInfo: {}
+            }
+        })
         if (!res.empty) {
             saleBatches.value.forEach((item, index) => {
+                if (item.id == 11547) {
+                    item.empty = true
+                    return
+                }
                 http.post(
                     '/product/list',
                     {
@@ -256,6 +259,24 @@ function getSaleBatch() {
 
 const i18n = useI18n()
 const goList = info => {
+    if (info.id == 11547) {
+        const { user } = useUserStore()
+        if (!user) {
+            emitter.emit('promptLogin')
+            return
+        }
+        if (user && isAfter(parse(user.createdAt, 'yyyy-MM-dd HH:mm:ss', new Date()), addDays(new Date(), -3))) {
+            router.push({
+                path: '/productList',
+                query: {
+                    batchId: info.id
+                }
+            })
+        } else {
+            toast(i18n.t('home.trialPrompt'))
+        }
+        return
+    }
     if (getStatus(info) === '抢购中') {
         router.push({
             path: '/productList',