|
@@ -8,9 +8,12 @@ import { getMaterialDetail, getByDictType, getMaterialHomePage } from '../../../
|
|
import NavbarEvo from '@/components/navbar-evo.vue'
|
|
import NavbarEvo from '@/components/navbar-evo.vue'
|
|
import { DictType } from '../../../core/libs/models'
|
|
import { DictType } from '../../../core/libs/models'
|
|
import { phone } from '../../../core/libs/svgs'
|
|
import { phone } from '../../../core/libs/svgs'
|
|
-import { handleCall, openLocation } from '../../../core/utils/common'
|
|
|
|
|
|
+import { handleCall, openLocation, previewImage } from '../../../core/utils/common'
|
|
import router from '@designer-hub/assets/src/assets/svgs/router'
|
|
import router from '@designer-hub/assets/src/assets/svgs/router'
|
|
|
|
+import { isVideoUrl } from 'wot-design-uni/components/common/util'
|
|
|
|
+import { useUserStore } from '@/store'
|
|
|
|
|
|
|
|
+const userStore = useUserStore()
|
|
const id = ref()
|
|
const id = ref()
|
|
const { data, run: setData } = useRequest(() => getMaterialDetail({ id: id.value }))
|
|
const { data, run: setData } = useRequest(() => getMaterialDetail({ id: id.value }))
|
|
const { data: materialHomePageData, run: setMaterialHomePageData } = useRequest(
|
|
const { data: materialHomePageData, run: setMaterialHomePageData } = useRequest(
|
|
@@ -33,6 +36,38 @@ const { data: materialsManageBrands, run: setMaterialsManageBrands } = useReques
|
|
() => getByDictType(DictType.materialsManageBrand),
|
|
() => getByDictType(DictType.materialsManageBrand),
|
|
{ initialData: [] },
|
|
{ initialData: [] },
|
|
)
|
|
)
|
|
|
|
+const handleDownload = () => {
|
|
|
|
+ // console.log('handleDownload')
|
|
|
|
+ const Authorization = userStore.userInfo?.token
|
|
|
|
+ uni.downloadFile({
|
|
|
|
+ url: `https://www.zhuchaohui.com/app-api/member/materials/download?materialsId=${id.value}`,
|
|
|
|
+ header: {
|
|
|
|
+ 'trace-id': 1,
|
|
|
|
+ Authorization,
|
|
|
|
+ },
|
|
|
|
+ success: (res) => {
|
|
|
|
+ console.log('downloadFile success', res)
|
|
|
|
+ uni.saveFile({
|
|
|
|
+ tempFilePath: res.tempFilePath,
|
|
|
|
+ success: (res) => {
|
|
|
|
+ console.log('saveFile success', res)
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ console.log('saveFile fail', err)
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ uni.openDocument({
|
|
|
|
+ filePath: res.tempFilePath,
|
|
|
|
+ success: (res) => {
|
|
|
|
+ console.log('openDocument success', res)
|
|
|
|
+ },
|
|
|
|
+ fail: (err) => {
|
|
|
|
+ console.log('openDocument fail', err)
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+}
|
|
onLoad(async (query: { id: number }) => {
|
|
onLoad(async (query: { id: number }) => {
|
|
id.value = query.id
|
|
id.value = query.id
|
|
await setData()
|
|
await setData()
|
|
@@ -66,25 +101,24 @@ onLoad(async (query: { id: number }) => {
|
|
></wd-img>
|
|
></wd-img>
|
|
<div class="flex flex-col gap-2.5">
|
|
<div class="flex flex-col gap-2.5">
|
|
<div class="flex gap-2 items-center">
|
|
<div class="flex gap-2 items-center">
|
|
- <div
|
|
|
|
- class="text-black/90 text-lg font-normal font-['PingFang_SC'] leading-[10.18px]"
|
|
|
|
- >
|
|
|
|
|
|
+ <div class="text-black/90 text-lg font-normal font-['PingFang_SC']">
|
|
<!-- IMOLA瓷砖 -->
|
|
<!-- IMOLA瓷砖 -->
|
|
{{ data?.materialsName }}
|
|
{{ data?.materialsName }}
|
|
</div>
|
|
</div>
|
|
- <div
|
|
|
|
- class="w-[52px] h-[17px] px-2 bg-[#ef4343] rounded-[3px] justify-center items-center gap-2.5 inline-flex"
|
|
|
|
- >
|
|
|
|
- <div
|
|
|
|
- class="text-white text-[10px] font-normal font-['PingFang_SC'] leading-normal"
|
|
|
|
- >
|
|
|
|
- <!-- 自营品牌 -->
|
|
|
|
- {{
|
|
|
|
- materialBrandLevels.find(({ value }) => value === String(data.materialsType))
|
|
|
|
- ?.label
|
|
|
|
- }}
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+
|
|
|
|
+ <!-- <div-->
|
|
|
|
+ <!-- class="w-[52px] h-[17px] px-2 bg-[#ef4343] rounded-[3px] justify-center items-center gap-2.5 inline-flex"-->
|
|
|
|
+ <!-- >-->
|
|
|
|
+ <!-- <div-->
|
|
|
|
+ <!-- class="text-white text-[10px] font-normal font-['PingFang_SC'] leading-normal"-->
|
|
|
|
+ <!-- >-->
|
|
|
|
+ <!-- <!– 自营品牌 –>-->
|
|
|
|
+ <!-- {{-->
|
|
|
|
+ <!-- materialBrandLevels.find(({ value }) => value === String(data.materialsType))-->
|
|
|
|
+ <!-- ?.label-->
|
|
|
|
+ <!-- }}-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- </div>-->
|
|
</div>
|
|
</div>
|
|
<div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-[10.18px]">
|
|
<div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-[10.18px]">
|
|
{{
|
|
{{
|
|
@@ -112,26 +146,26 @@ onLoad(async (query: { id: number }) => {
|
|
}}
|
|
}}
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
- <div class="flex gap-2.5">
|
|
|
|
- <div
|
|
|
|
- class="w-[77px] h-5 px-2 py-px bg-neutral-100 rounded-[3px] justify-center items-center gap-2.5 inline-flex"
|
|
|
|
- >
|
|
|
|
- <div
|
|
|
|
- class="text-black/60 text-[10px] font-normal font-['PingFang_SC'] leading-normal"
|
|
|
|
- >
|
|
|
|
- 积分比例:{{ data?.pointsExchangeRate }}%
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div
|
|
|
|
- class="w-[92px] h-5 px-2 py-px bg-neutral-100 rounded-[3px] justify-center items-center gap-2.5 inline-flex"
|
|
|
|
- >
|
|
|
|
- <div
|
|
|
|
- class="text-black/60 text-[10px] font-normal font-['PingFang_SC'] leading-normal"
|
|
|
|
- >
|
|
|
|
- 门店打卡:{{ data?.clockPoints }}积分
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <!-- <div class="flex gap-2.5">-->
|
|
|
|
+ <!-- <div-->
|
|
|
|
+ <!-- class="w-[77px] h-5 px-2 py-px bg-neutral-100 rounded-[3px] justify-center items-center gap-2.5 inline-flex"-->
|
|
|
|
+ <!-- >-->
|
|
|
|
+ <!-- <div-->
|
|
|
|
+ <!-- class="text-black/60 text-[10px] font-normal font-['PingFang_SC'] leading-normal"-->
|
|
|
|
+ <!-- >-->
|
|
|
|
+ <!-- 积分比例:{{ data?.pointsExchangeRate }}%-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- <div-->
|
|
|
|
+ <!-- class="w-[92px] h-5 px-2 py-px bg-neutral-100 rounded-[3px] justify-center items-center gap-2.5 inline-flex"-->
|
|
|
|
+ <!-- >-->
|
|
|
|
+ <!-- <div-->
|
|
|
|
+ <!-- class="text-black/60 text-[10px] font-normal font-['PingFang_SC'] leading-normal"-->
|
|
|
|
+ <!-- >-->
|
|
|
|
+ <!-- 门店打卡:{{ data?.clockPoints }}积分-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- </div>-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<template
|
|
<template
|
|
@@ -197,14 +231,24 @@ onLoad(async (query: { id: number }) => {
|
|
mode="aspectFill"
|
|
mode="aspectFill"
|
|
custom-class=""
|
|
custom-class=""
|
|
></wd-img> -->
|
|
></wd-img> -->
|
|
- <video class="w-full h-full"></video>
|
|
|
|
- </div>
|
|
|
|
- <div class="text-black/90 text-base font-normal font-['PingFang_SC'] leading-[10.18px]">
|
|
|
|
- <!-- {{ materialHomePageData. }} -->
|
|
|
|
- {{
|
|
|
|
- materialsManageBrands.find(({ value }) => value === String(data?.manageBrand))?.label
|
|
|
|
- }}
|
|
|
|
|
|
+ <template v-if="isVideoUrl(materialHomePageData.brandAdvantageUrl)">
|
|
|
|
+ <video class="w-full h-full"></video>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <wd-img
|
|
|
|
+ width="100%"
|
|
|
|
+ height="100%"
|
|
|
|
+ :src="materialHomePageData.brandAdvantageUrl"
|
|
|
|
+ mode="aspectFill"
|
|
|
|
+ custom-class=""
|
|
|
|
+ ></wd-img>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- <div class="text-black/90 text-base font-normal font-['PingFang_SC'] leading-[10.18px]">-->
|
|
|
|
+ <!-- {{-->
|
|
|
|
+ <!-- materialsManageBrands.find(({ value }) => value === String(data?.manageBrand))?.label-->
|
|
|
|
+ <!-- }}-->
|
|
|
|
+ <!-- </div>-->
|
|
<div
|
|
<div
|
|
class="text-justify text-black/60 text-sm font-normal font-['PingFang_SC'] leading-[25px]"
|
|
class="text-justify text-black/60 text-sm font-normal font-['PingFang_SC'] leading-[25px]"
|
|
>
|
|
>
|
|
@@ -216,18 +260,34 @@ onLoad(async (query: { id: number }) => {
|
|
<SectionHeading title="产品展示"></SectionHeading>
|
|
<SectionHeading title="产品展示"></SectionHeading>
|
|
</template>
|
|
</template>
|
|
<template v-for="(it, index) in materialHomePageData.productDOList" :key="index">
|
|
<template v-for="(it, index) in materialHomePageData.productDOList" :key="index">
|
|
- <div class="aspect-[1.66/1] rounded-2xl overflow-hidden">
|
|
|
|
|
|
+ <div class="aspect-[1.66/1] rounded-2xl overflow-hidden relative">
|
|
<swiper class="h-[55.7vw]">
|
|
<swiper class="h-[55.7vw]">
|
|
- <template v-for="img of it?.productImgUrl?.split(',')" :key="img">
|
|
|
|
|
|
+ <template v-for="(img, index) in it?.productImgUrl?.split(',')" :key="img">
|
|
<swiper-item class="h-full">
|
|
<swiper-item class="h-full">
|
|
- <wd-img width="100%" height="100%" class="" :src="img" mode="aspectFill" />
|
|
|
|
|
|
+ <wd-img
|
|
|
|
+ width="100%"
|
|
|
|
+ height="100%"
|
|
|
|
+ class=""
|
|
|
|
+ :src="img"
|
|
|
|
+ mode="aspectFill"
|
|
|
|
+ @click="previewImage(index, it?.productImgUrl?.split(','))"
|
|
|
|
+ />
|
|
</swiper-item>
|
|
</swiper-item>
|
|
</template>
|
|
</template>
|
|
</swiper>
|
|
</swiper>
|
|
|
|
+ <div
|
|
|
|
+ class="absolute bottom-0 w-full h-[66px] bg-gradient-to-t from-black to-[#5e5e5e00] rounded-bl-2xl rounded-br-2xl flex items-center px-4.5"
|
|
|
|
+ >
|
|
|
|
+ <div class="text-white text-base font-normal font-['PingFang_SC'] leading-[10.18px]">
|
|
|
|
+ {{ it.productTitleName }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
- <wd-button custom-class="w-full! rounded-lg!">下载所有素材包</wd-button>
|
|
|
|
|
|
+ <wd-button custom-class="w-full! rounded-lg!" @click="handleDownload">
|
|
|
|
+ 下载所有素材包
|
|
|
|
+ </wd-button>
|
|
</div>
|
|
</div>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|