|
@@ -28,6 +28,10 @@ import { storeToRefs } from 'pinia'
|
|
|
import lightning from '@designer-hub/assets/src/libs/assets/lightning'
|
|
|
import textGreatMoney from '@designer-hub/assets/src/libs/assets/textGreatMoney'
|
|
|
import grabNow from '@designer-hub/assets/src/libs/assets/grabNow'
|
|
|
+import ProgressEvo from '@/components/progress-evo.vue'
|
|
|
+import SwiperEvo from '@/components/swiper-evo.vue'
|
|
|
+import { diff } from 'radash'
|
|
|
+import dayjs from 'dayjs'
|
|
|
|
|
|
const router = useRouter()
|
|
|
const userStore = useUserStore()
|
|
@@ -50,6 +54,13 @@ const { data: favourableProducts, run: setFavourableProducts } = useRequest(
|
|
|
const current = ref<number>(0)
|
|
|
const swiperList = computed(() => banners.value.map((it) => it.bannerImgUrl))
|
|
|
const categories = computed(() => productCategories.value.find(({ id }) => id === 1)?.children)
|
|
|
+const time = computed(
|
|
|
+ () =>
|
|
|
+ dayjs(favourableProducts.value[current.value].favourableEndDate).diff(
|
|
|
+ dayjs(),
|
|
|
+ 'milliseconds',
|
|
|
+ ) || 0,
|
|
|
+)
|
|
|
const category = ref()
|
|
|
const query = computed(() => ({
|
|
|
oneCategory: category.value?.parentId,
|
|
@@ -58,6 +69,9 @@ const query = computed(() => ({
|
|
|
const handleChange = async () => {
|
|
|
setCarts()
|
|
|
}
|
|
|
+const handleSwiperChange = async (e) => {
|
|
|
+ console.log(e)
|
|
|
+}
|
|
|
onMounted(async () => {
|
|
|
await Promise.all([setProductCategories(), setBanners(), setCarts(), setFavourableProducts()])
|
|
|
// await setProductCategories()
|
|
@@ -77,74 +91,87 @@ onMounted(async () => {
|
|
|
<wd-img width="95" height="25" :src="textGreatMoney"></wd-img>
|
|
|
<div class="flex-1"></div>
|
|
|
<div
|
|
|
- class="text-center text-white text-base font-normal font-['PingFang_SC'] leading-relaxed"
|
|
|
+ class="flex gap-1 text-center text-white text-base font-normal font-['PingFang_SC'] leading-relaxed"
|
|
|
>
|
|
|
- 17:02:18 结束
|
|
|
+ <wd-count-down :time="time">
|
|
|
+ <template #default="{ current }">
|
|
|
+ <span
|
|
|
+ class="text-center text-white text-base font-normal font-['PingFang_SC'] leading-relaxed"
|
|
|
+ >
|
|
|
+ <span class="custom-count-down">{{ current.hours }}</span>
|
|
|
+ <span class="custom-count-down-colon">:</span>
|
|
|
+ <span class="custom-count-down">{{ current.minutes }}</span>
|
|
|
+ <span class="custom-count-down-colon">:</span>
|
|
|
+ <span class="custom-count-down">{{ current.seconds }}</span>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </wd-count-down>
|
|
|
+ <!-- 17:02:18 -->
|
|
|
+ 结束
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="absolute top-11 left-0 right-0 bottom-0 bg-white rounded-2xl shadow">
|
|
|
- <swiper class="w-full h-full" v-model:value="current">
|
|
|
- <template v-for="(it, i) in favourableProducts" :key="i">
|
|
|
- <swiper-item>
|
|
|
- <div class="w-full h-full px-4 flex items-center gap-3">
|
|
|
- <wd-img
|
|
|
- width="114"
|
|
|
- height="114"
|
|
|
- custom-class="rounded-2xl overflow-hidden"
|
|
|
- :src="it.productCoverImgUrl"
|
|
|
- />
|
|
|
- <div>
|
|
|
+ <SwiperEvo v-model="current" :items="favourableProducts">
|
|
|
+ <template #default="{ item: it }">
|
|
|
+ <div class="w-full h-full px-4 flex items-center gap-3 box-border">
|
|
|
+ <wd-img
|
|
|
+ width="114"
|
|
|
+ height="114"
|
|
|
+ custom-class="rounded-2xl overflow-hidden"
|
|
|
+ :src="it.productCoverImgUrl"
|
|
|
+ />
|
|
|
+ <div class="flex-1">
|
|
|
+ <div
|
|
|
+ class="w-[178px] text-black/90 text-base font-normal font-['PingFang_SC'] leading-normal"
|
|
|
+ >
|
|
|
+ <!-- 海蓝之谜精华面霜60ml -->
|
|
|
+ {{ it.prodcutName }}
|
|
|
+ </div>
|
|
|
+ <div class="flex items-center gap-2.5">
|
|
|
+ <div class="flex-1">
|
|
|
+ <!-- {{ (it.exchangeCount || 0 / it.productRepertory || 0) * 100 }} -->
|
|
|
+ <ProgressEvo
|
|
|
+ :height="6"
|
|
|
+ :model-value="(it.exchangeCount || 0 / it.productRepertory || 0) * 100"
|
|
|
+ color="black"
|
|
|
+ ></ProgressEvo>
|
|
|
+ </div>
|
|
|
<div
|
|
|
- class="w-[178px] text-black/90 text-base font-normal font-['PingFang SC'] leading-normal"
|
|
|
+ class="text-black/40 text-[10px] font-normal font-['PingFang_SC'] leading-normal"
|
|
|
>
|
|
|
- <!-- 海蓝之谜精华面霜60ml -->
|
|
|
- {{ it.prodcutName }}
|
|
|
+ 还剩{{ it.productRepertory - it.exchangeCount }}件
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="flex items-end gap-1 mt-5">
|
|
|
+ <div class="text-[#ef4343] text-[22px] font-normal font-['D-DIN_Exp'] pb-3">
|
|
|
+ <!-- 1600 -->
|
|
|
+ {{ it.favourablePoints }}
|
|
|
</div>
|
|
|
- <div class="flex items-center gap-2.5">
|
|
|
- <div class="flex-1">
|
|
|
- <wd-progress
|
|
|
- :percentage="(it.exchangeCount || 0 / it.productRepertory || 0) * 100"
|
|
|
- hide-text
|
|
|
- color="black"
|
|
|
- ></wd-progress>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class="text-black/40 text-[10px] font-normal font-['PingFang_SC'] leading-normal"
|
|
|
- >
|
|
|
- 还剩{{ it.productRepertory - it.exchangeCount }}件
|
|
|
- </div>
|
|
|
+ <div class="text-black/60 text-sm font-normal font-['PingFang_SC'] pb-3">
|
|
|
+ 积分
|
|
|
</div>
|
|
|
- <div class="flex items-end gap-1 mt-5">
|
|
|
- <div class="text-[#ef4343] text-[22px] font-normal font-['D-DIN_Exp'] pb-3">
|
|
|
- <!-- 1600 -->
|
|
|
- {{ it.favourablePoints }}
|
|
|
- </div>
|
|
|
- <div class="text-black/60 text-sm font-normal font-['PingFang_SC'] pb-3">
|
|
|
- 积分
|
|
|
- </div>
|
|
|
- <div class="flex-1"></div>
|
|
|
- <div @click="router.push(`/pages/home/mall/detail/index?id=${it.productId}`)">
|
|
|
- <wd-img width="106" height="40" :src="grabNow"></wd-img>
|
|
|
- </div>
|
|
|
+ <div class="flex-1"></div>
|
|
|
+ <div @click="router.push(`/pages/home/mall/detail/index?id=${it.productId}`)">
|
|
|
+ <wd-img width="106" height="40" :src="grabNow"></wd-img>
|
|
|
</div>
|
|
|
- <div class="flex gap-4">
|
|
|
- <div
|
|
|
- class="text-black/30 text-[10px] font-normal font-['PingFang SC'] line-through leading-normal"
|
|
|
- >
|
|
|
- {{ it.points }}积分
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class="text-black/30 text-[10px] font-normal font-['PingFang SC'] line-through leading-normal"
|
|
|
- >
|
|
|
- ¥{{ it.productPrice }}
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="flex gap-4">
|
|
|
+ <div
|
|
|
+ class="text-black/30 text-[10px] font-normal font-['PingFang_SC'] line-through leading-normal"
|
|
|
+ >
|
|
|
+ {{ it.points }}积分
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="text-black/30 text-[10px] font-normal font-['PingFang_SC'] line-through leading-normal"
|
|
|
+ >
|
|
|
+ ¥{{ it.productPrice }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </swiper-item>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
- </swiper>
|
|
|
+ </SwiperEvo>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="w-full inline-flex gap-2">
|
|
@@ -183,7 +210,15 @@ onMounted(async () => {
|
|
|
<div class="h-16 bg-white flex items-center justify-between px-3.5">
|
|
|
<!-- <div> -->
|
|
|
<!-- <wd-button type="text" size="small"> -->
|
|
|
- <wd-img :round="false" width="32" height="32" :src="shoppingBag"></wd-img>
|
|
|
+ <wd-badge :modelValue="carts.total || 0">
|
|
|
+ <wd-img
|
|
|
+ :round="false"
|
|
|
+ width="32"
|
|
|
+ height="32"
|
|
|
+ :src="shoppingBag"
|
|
|
+ @click="router.push('/pages/home/mall/shopping-cart/index')"
|
|
|
+ ></wd-img>
|
|
|
+ </wd-badge>
|
|
|
<!-- </wd-button> -->
|
|
|
<!-- </div> -->
|
|
|
<div @click="router.push('/pages/home/mall/shopping-cart/index')">
|