2 Commits ba7cc5d6aa ... 077e578feb

Auteur SHA1 Message Date
  EvilDragon 077e578feb Merge remote-tracking branch 'own/main' into main il y a 3 semaines
  EvilDragon cc75032691 refactor(app): 优化产品详情页面和订单详情页面的展示逻辑 il y a 3 semaines

+ 14 - 15
packages/app/src/pages/home/spread/product-detail/index.vue

@@ -10,9 +10,6 @@
 <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 { getProduct, productPlacing } from '../../../../core/libs/requests'
 import { requestToast } from '../../../../core/utils/common'
@@ -20,6 +17,7 @@ import { useUserStore } from '../../../../store'
 import { storeToRefs } from 'pinia'
 import BottomAppBar from '@/components/bottom-app-bar.vue'
 import { usePermissions } from '../../../../composables/permissions'
+import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html.vue'
 
 const userStore = useUserStore()
 const router = useRouter()
@@ -51,10 +49,10 @@ const handleConfirm = async () => {
       ],
       couponList: [],
     }
-    const { data: res, code } = await requestToast(() => productPlacing(body))
+    const { data: res, code, msg } = await requestToast(() => productPlacing(body))
     if (code !== 0) {
-      uni.showToast({
-        title: res.msg,
+      await uni.showToast({
+        title: msg,
         icon: 'none',
       })
     } else {
@@ -134,7 +132,7 @@ onShareTimeline(() => ({
   <div 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?.productDetailsImgUrl" />-->
+        <!--        <wd-img width="100%" height="100%" :src="data?.productDetailsImgUrl" />-->
         <swiper>
           <template v-for="(it, index) in data?.productDetailsImgUrl?.split(',')" :key="index">
             <swiper-item>
@@ -146,10 +144,10 @@ onShareTimeline(() => ({
     </div>
     <div class="relative flex-1 bg-white p-7 flex flex-col gap-6 rounded-tl-2xl rounded-tr-2xl">
       <div
-        v-if="data.needPoints == 1"
+        v-if="String(data?.needPoints) === '1'"
         class="text-black text-xl font-normal font-['PingFang_SC'] leading-[10.18px] mr-1"
       >
-        {{ data.points }}折
+        {{ data?.points }}折
       </div>
       <div class="flex">
         <div class="text-black text-xl font-normal font-['PingFang_SC'] leading-[10.18px]">
@@ -159,19 +157,20 @@ onShareTimeline(() => ({
       <div class="text-black/60 text-sm font-normal font-['PingFang_SC']">
         {{ data?.exchangeDesc }}
       </div>
-      <div
-        class="text-justify text-black/40 text-base font-normal font-['PingFang_SC'] leading-relaxed"
-        v-html="data?.contentDesc"
-      ></div>
+      <!--      <div-->
+      <!--        class="text-justify text-black/40 text-base font-normal font-['PingFang_SC'] leading-relaxed"-->
+      <!--        v-html="data?.contentDesc"-->
+      <!--      ></div>-->
+      <mpHtml :content="data?.contentDesc"></mpHtml>
     </div>
 
-    <BottomAppBar fixed placeholder v-if="data.needPoints != 1">
+    <BottomAppBar fixed placeholder v-if="String(data?.needPoints) !== '1'">
       <div
         class="bg-white/90 backdrop-blur-[20px] flex px-10 py-2.5 border-t-1 border-t-solid border-t-[#ececec]"
       >
         <div class="text-[#ef4343] text-2xl font-normal font-['D-DIN_Exp'] leading-normal">
           <!--          {{ data?.points }}-->
-          {{ data?.showFavourable ? data.favourablePoints : data.points }}
+          {{ data?.showFavourable ? data?.favourablePoints : data?.points }}
         </div>
         <div class="text-black/40 text-base font-normal font-['PingFang_SC'] leading-[34px]">
           积分

+ 1 - 0
packages/app/src/pages/mine/orders/detail/index.vue

@@ -83,6 +83,7 @@ onLoad((query: { id: string }) => {
     ></SectionHeading>
     <SectionHeading title="总积分" size="sm" :end-text="`${data?.points ?? 0}`"></SectionHeading>
     <SectionHeading
+      v-if="data?.couponList"
       title="优惠券"
       :end-text="`已选${data.couponList?.length || 0}张`"
       end-arrow