|
@@ -8,11 +8,6 @@
|
|
|
</route>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import TiltedButton from '@/components/tilted-button.vue'
|
|
|
-import Product from '../components/product.vue'
|
|
|
-import { shoppingBag } from '@designer-hub/assets/src/assets/svgs/index'
|
|
|
-import InvertedTrapezoidButton from '@/components/inverted-trapezoid-button.vue'
|
|
|
-import TrapeziumButton from '@/components/trapezium-button.vue'
|
|
|
import { useRouter } from '../../../../core/utils/router'
|
|
|
import { createProductItemBuy, getProduct, productPlacing } from '../../../../core/libs/requests'
|
|
|
import { requestToast } from '../../../../core/utils/common'
|
|
@@ -21,6 +16,7 @@ import { storeToRefs } from 'pinia'
|
|
|
import BottomAppBar from '@/components/bottom-app-bar.vue'
|
|
|
import ButtonEvo from '@/components/button-evo.vue'
|
|
|
import { usePermissions } from '../../../../composables/permissions'
|
|
|
+import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html.vue'
|
|
|
|
|
|
const { clickByPermission } = usePermissions()
|
|
|
const userStore = useUserStore()
|
|
@@ -33,6 +29,8 @@ const type = ref<'add2Cart' | 'orderNow'>()
|
|
|
const { data, run: setData } = useRequest(() => getProduct(id.value))
|
|
|
|
|
|
const handleConfirm = async () => {
|
|
|
+ // 积分
|
|
|
+ const points = data.value?.showFavourable ? data.value?.favourablePoints : data.value?.points
|
|
|
if (type.value === 'orderNow') {
|
|
|
const { data: res, code } = await requestToast(() =>
|
|
|
productPlacing({
|
|
@@ -42,7 +40,7 @@ const handleConfirm = async () => {
|
|
|
list: [
|
|
|
{
|
|
|
productId: id.value,
|
|
|
- points: data.value.points,
|
|
|
+ points,
|
|
|
nums: nums.value,
|
|
|
productName: data.value.prodcutName,
|
|
|
orderImgUrl: data.value.productCoverImgUrl,
|
|
@@ -53,7 +51,7 @@ const handleConfirm = async () => {
|
|
|
}),
|
|
|
)
|
|
|
if (code !== 0) return
|
|
|
- router.push(`/pages/home/mall/confirm-order/index?data=${JSON.stringify(res)}`)
|
|
|
+ await router.push(`/pages/home/mall/confirm-order/index?data=${JSON.stringify(res)}`)
|
|
|
}
|
|
|
if (type.value === 'add2Cart') {
|
|
|
await requestToast(
|
|
@@ -63,7 +61,7 @@ const handleConfirm = async () => {
|
|
|
{
|
|
|
userId: userInfo.value.userId,
|
|
|
productId: data.value?.productId || '',
|
|
|
- points: data.value?.points,
|
|
|
+ points,
|
|
|
nums: nums.value,
|
|
|
},
|
|
|
],
|
|
@@ -83,29 +81,35 @@ onLoad(async (query: { id: string }) => {
|
|
|
<view class="flex-grow flex flex-col">
|
|
|
<div class="aspect-[1.34/1] relative">
|
|
|
<div class="absolute aspect-[1.26/1] top-0 w-full">
|
|
|
- <wd-img width="100%" height="100%" :src="data?.productCoverImgUrl" />
|
|
|
+ <wd-img width="100%" height="100%" mode="aspectFill" :src="data?.productDetailsImgUrl" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="relative flex-1 bg-white p-4 flex flex-col gap-4 rounded-tl-2xl rounded-tr-2xl">
|
|
|
- <div class="flex items-center gap-1">
|
|
|
- <div class="text-[#ef4343] text-[26px] font-normal font-['D-DIN_Exp'] leading-normal">
|
|
|
+ <div class="flex items-end gap-1">
|
|
|
+ <div class="text-[#ef4343] text-[26px] font-normal font-['D-DIN_Exp'] leading-[20px]">
|
|
|
<!-- 1000 -->
|
|
|
- {{ data?.points }}
|
|
|
- </div>
|
|
|
- <div class="text-black/60 text-base font-normal font-['PingFang_SC'] leading-[34px]">
|
|
|
- 积分
|
|
|
+ {{ data?.showFavourable ? data?.favourablePoints : data?.points }}
|
|
|
</div>
|
|
|
+ <template v-if="String(data?.needPoints) === '0'">
|
|
|
+ <div class="text-black/60 text-base font-normal font-['PingFang_SC'] leading-4">积分</div>
|
|
|
+ </template>
|
|
|
+ <template v-if="String(data?.needPoints) === '1'">
|
|
|
+ <div class="text-black/60 text-base font-normal font-['PingFang_SC'] leading-4">
|
|
|
+ 折(积分结算)
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<div
|
|
|
- class="w-[66px] text-black/30 text-xs font-normal font-['PingFang_SC'] line-through leading-normal"
|
|
|
+ v-if="Number(data?.productPrice)"
|
|
|
+ class="w-[66px] text-black/30 text-xs font-normal font-['PingFang_SC'] leading-3"
|
|
|
>
|
|
|
<!-- ¥60 -->
|
|
|
¥{{ data?.productPrice }}
|
|
|
</div>
|
|
|
<div class="flex-1"></div>
|
|
|
- <div class="text-[#999999] text-xs font-normal font-['PingFang_SC'] leading-[10.18px]">
|
|
|
- <!-- 已售5件 -->
|
|
|
- 已售{{ data?.exchangeCount || 0 }}件
|
|
|
- </div>
|
|
|
+ <!-- <div class="text-[#999999] text-xs font-normal font-['PingFang_SC']">-->
|
|
|
+ <!-- <!– 已售5件 –>-->
|
|
|
+ <!-- 已售{{ data?.exchangeCount || 0 }}件-->
|
|
|
+ <!-- </div>-->
|
|
|
</div>
|
|
|
<div class="text-black text-xl font-normal font-['PingFang_SC']">
|
|
|
<!-- 阿芙佳朵 -->
|
|
@@ -133,52 +137,38 @@ onLoad(async (query: { id: string }) => {
|
|
|
商品详情
|
|
|
</div>
|
|
|
</wd-divider>
|
|
|
- <wd-img width="100%" mode="widthFix" :src="data?.productDetailsImgUrl"></wd-img>
|
|
|
+ <mpHtml :content="data?.contentDesc"></mpHtml>
|
|
|
</div>
|
|
|
- <BottomAppBar fixed placeholder>
|
|
|
- <div class="h-[63px] bg-white backdrop-blur-[20px] flex items-center justify-between gap-2">
|
|
|
- <div class="flex-1">
|
|
|
- <ButtonEvo
|
|
|
- block
|
|
|
- color="white"
|
|
|
- location="right"
|
|
|
- @click="((show = true), (type = 'add2Cart'))"
|
|
|
- >
|
|
|
- <span class="text-black/80">加入购物车</span>
|
|
|
- </ButtonEvo>
|
|
|
- </div>
|
|
|
- <!-- <div @click="(show = true), (type = 'add2Cart')">
|
|
|
- <InvertedTrapezoidButton>
|
|
|
- <div
|
|
|
- class="w-20 h-[22px] text-black text-base font-normal font-['PingFang_SC'] leading-tight"
|
|
|
+ <template v-if="String(data?.needPoints) === '0'">
|
|
|
+ <BottomAppBar fixed placeholder>
|
|
|
+ <div class="h-[63px] bg-white backdrop-blur-[20px] flex items-center justify-between gap-2">
|
|
|
+ <div class="flex-1">
|
|
|
+ <ButtonEvo
|
|
|
+ block
|
|
|
+ color="white"
|
|
|
+ location="right"
|
|
|
+ @click="((show = true), (type = 'add2Cart'))"
|
|
|
>
|
|
|
- 加入购物车
|
|
|
- </div>
|
|
|
- </InvertedTrapezoidButton>
|
|
|
- </div> -->
|
|
|
- <div class="flex-1">
|
|
|
- <!-- <TrapeziumButton size="large">
|
|
|
- <div class="text-white text-base font-normal font-['PingFang_SC'] leading-tight">
|
|
|
- <div class="text-white text-base font-normal font-['PingFang_SC'] leading-tight">
|
|
|
- 立即兑换
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </TrapeziumButton> -->
|
|
|
- <ButtonEvo
|
|
|
- block
|
|
|
- size="lg"
|
|
|
- @click="
|
|
|
- clickByPermission('mallExchange', () => {
|
|
|
- show = true
|
|
|
- type = 'orderNow'
|
|
|
- })
|
|
|
- "
|
|
|
- >
|
|
|
- 立即兑换
|
|
|
- </ButtonEvo>
|
|
|
+ <span class="text-black/80">加入购物车</span>
|
|
|
+ </ButtonEvo>
|
|
|
+ </div>
|
|
|
+ <div class="flex-1">
|
|
|
+ <ButtonEvo
|
|
|
+ block
|
|
|
+ size="lg"
|
|
|
+ @click="
|
|
|
+ clickByPermission('mallExchange', () => {
|
|
|
+ show = true
|
|
|
+ type = 'orderNow'
|
|
|
+ })
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 立即兑换
|
|
|
+ </ButtonEvo>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </BottomAppBar>
|
|
|
+ </BottomAppBar>
|
|
|
+ </template>
|
|
|
<wd-action-sheet v-model="show">
|
|
|
<view class="px-7 py-11">
|
|
|
<div class="flex gap-3 mb-13.5">
|
|
@@ -189,11 +179,12 @@ onLoad(async (query: { id: string }) => {
|
|
|
<div class="text-black/40 text-base font-normal font-['PingFang_SC'] leading-normal">
|
|
|
{{ data?.prodcutName }}
|
|
|
</div>
|
|
|
- <div class="flex items-center">
|
|
|
- <div class="text-[#ef4343] text-[22px] font-normal font-['D-DIN_Exp'] leading-normal">
|
|
|
- {{ data?.points }}
|
|
|
+ <div class="flex items-end gap-1">
|
|
|
+ <div class="text-[#ef4343] text-[22px] font-normal font-['D-DIN_Exp'] leading-4">
|
|
|
+ <!-- {{ data?.points }}-->
|
|
|
+ {{ data?.showFavourable ? data?.favourablePoints : data?.points }}
|
|
|
</div>
|
|
|
- <div class="text-black/40 text-sm font-normal font-['PingFang_SC'] leading-[34px]">
|
|
|
+ <div class="text-black/40 text-sm font-normal font-['PingFang_SC'] leading-3">
|
|
|
积分
|
|
|
</div>
|
|
|
<div class="flex-1"></div>
|