|
|
@@ -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',
|