purui 2 ngày trước cách đây
mục cha
commit
6474f2d006

+ 5 - 5
packages/app/src/core/libs/requests.ts

@@ -495,11 +495,11 @@ export const deleteProductItemBuy = (data: {
 /**
  * 购物车商品数量增减
  */
-// export const updateProductItemNums = (data: {
-//   userId: number
-//   productId: string
-//   changingNum: number
-// }) => httpPost('/app-api/member/product-item-buy/increase-or-decrease/product/num', data)
+export const updateProductItemNums = (data: {
+  userId: number
+  productId: string
+  changingNum: number
+}) => httpPost('/app-api/member/product-item-buy/increase-or-decrease/product/num', data)
 /**
  * 商城下单
  */

+ 5 - 7
packages/app/src/pages-sub/home/activity/detail/index.vue

@@ -39,7 +39,7 @@ import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html.vue'
 import { useActivity } from '../../../../composables/activity'
 import ImageEvo from '@/components/image-evo.vue'
 import TooltipEvo from '@/components/tooltip-evo.vue'
-// import ActivityAsOf from '../../components/activity-as-of.vue'
+import ActivityAsOf from '../../components/activity-as-of.vue'
 import images from '@designer-hub/assets/src/libs/assets/images'
 import { usePermissions } from '../../../../composables/permissions'
 import { useAnalysis } from '@/composables/analysis'
@@ -399,12 +399,10 @@ onShareTimeline(() => ({ title: data.value.name, imageUrl: data.value.thumbnailU
         </div>
         <div class="flex-1"></div>
         <div>
-          <!-- <div class="relative">
+          <div class="relative" v-if="['waiting'].includes(status)">
+          <!-- <div class="relative" v-if="['waiting', 'registering'].includes(status)"> -->
             <div class="absolute bottom-3 left-0 right-0 flex flex-col justify-center items-center">
-              <div
-                v-if="['waiting', 'registering'].includes(status)"
-                class="bg-[#3b3c46] rounded-[60px] flex items-center py-1.5 px-4"
-              >
+              <div class="bg-[#3b3c46] rounded-[60px] flex items-center py-1.5 px-4">
                 <ActivityAsOf
                   :start-at="data?.applyStartTime || data?.planApplyStartTime"
                   :end-at="data?.applyEndTime || data?.planApplyEndTime"
@@ -412,7 +410,7 @@ onShareTimeline(() => ({ title: data.value.name, imageUrl: data.value.thumbnailU
                 ></ActivityAsOf>
               </div>
             </div>
-          </div> -->
+          </div>
           <TooltipEvo
             placement="top"
             :content="`还差${difference}积分`"

+ 3 - 2
packages/app/src/pages-sub/home/mall/confirm-order/index.vue

@@ -73,11 +73,11 @@ const offerPoints = computed(() => {
   console.log(sumBrandPoints)
   return Number(sumBrandPoints)
 })
-const handlePay = async () => {
-	disabled.value = false
+const handlePay = async () => {	
 	if(disabled.value){
 		return false
 	}
+	disabled.value = true
   if(coupons.value.length>0 && selectedCoupons.value?.length===0){
 	  showUse.value = true;	  
   }else{
@@ -95,6 +95,7 @@ const handlePay = async () => {
 	      }),
 	    { success: true, successTitle: '兑换成功' },
 	  )
+	  disabled.value = false
 	  if (code === 0) {
 	    await router.replace('/pages-sub/home/mall/purchased/success/index')
 	  }

+ 21 - 12
packages/app/src/pages-sub/home/mall/shopping-cart/index.vue

@@ -16,6 +16,7 @@ import {
   deleteProductItemBuy,
   getProductItemBuy,
   productPlacing,
+  updateProductItemNums,
 } from '../../../../core/libs/requests'
 import PageHelper from '@/components/page-helper.vue'
 import BottomAppBar from '@/components/bottom-app-bar.vue'
@@ -77,24 +78,32 @@ const handleDelete = async (product: any) => {
   await pageHelperRef.value?.refresh()
 }
 const handleProductNumsChange = async (nums, product) => {
+  console.log(nums, product.nums)	
   const changeNums = nums - product.nums
-  if (changeNums > 0) {
-    await createProductItemBuy({
-      doList: [
-        {
-          userId: userInfo.value.userId,
-          productId: product.productId,
-          points: product.points,
-          nums: Math.abs(changeNums),
-        },
-      ],
-    })
+  if (changeNums !== 0) {
+	 await updateProductItemNums({
+		 userId: userInfo.value.userId,
+		 productId: product.productId,
+		 changingNum: changeNums,
+	 })
+    // await createProductItemBuy({
+    //   doList: [
+    //     {
+    //       userId: userInfo.value.userId,
+    //       productId: product.productId,
+    //       points: product.points,
+    //       nums: Math.abs(changeNums),
+    //     },
+    //   ],
+    // })
     if (selected.value.map((it) => it.productId).includes(product.productId)) {
       selected.value = selected.value.map((it) =>
         it.productId === product.productId ? {...it, nums} : it,
       )
     }
-  } if (nums == 0) {
+  }
+  
+  if (nums == 0) {
     await deleteProductItemBuy({
       doList: [
         {

+ 11 - 12
packages/app/src/pages-sub/publish/moment/index.vue

@@ -102,13 +102,13 @@ const sortChange = () =>{
 const handleChange = ({ fileList: files }) => {  
   console.log(files)
   let arr = [];
-  for(let i in files){	  
-	  if(files[i].status==="success"){
-		  arr.push(files[i])
-	  }
-  }
-  fileList.value = arr
-  imgList.value = arr
+  // for(let i in files){	  
+	 //  if(files[i].status==="success"){
+		//   arr.push(files[i])
+	 //  }
+  // }
+  fileList.value = files
+  imgList.value = files
   if(files.length > 0){
 	  useVideo.value = false
   }else{
@@ -176,7 +176,7 @@ const handleSubmit = async () => {
       createCircle({
         stylistId: userInfo.value.userId,
         stylistName: userInfo.value.nickname,
-        bannerUrls: useImg.value?imgList.value:fileList.value.map(({ response }) => JSON.parse(response).data),
+        bannerUrls: useImg.value?imgList.value.map(({ response }) => JSON.parse(response).data):fileList.value.map(({ response }) => JSON.parse(response).data),
         tagName: tagName.value,
         headUrl: userInfo.value.avatar,
         circleDesc: content.value,
@@ -266,7 +266,6 @@ onLoad(async (query: { circleType: '1' | '2' }) => {
 		<div class="mr-[20rpx]" v-if="useImg">
 			<wd-upload
 			  :file-list="fileList"
-			  customPreviewClass="display"
 			  image-mode="aspectFill"
 			  accept="image"
 			  :action="action"
@@ -296,11 +295,11 @@ onLoad(async (query: { circleType: '1' | '2' }) => {
       size="base"
     >
       <template #start>
-        <div class="flex gap-2.5">
+        <div class="flex gap-2.5 overflow-x-scroll">
           <template v-if="tagName !== ''">
             <template v-for="it of tagName.split(',')" :key="it">
               <div
-                class="h-6 px-2 py-0.5 bg-[#f3f3f3] rounded-[3px] justify-center items-center gap-2 inline-flex"
+                class="h-6 px-2 py-0.5 bg-[#f3f3f3] rounded-[3px] justify-center items-center gap-2 inline-flex shrink-0"
               >
                 <div
                   class="text-center text-black/90 text-xs font-normal font-['PingFang_SC'] leading-tight"
@@ -327,6 +326,6 @@ onLoad(async (query: { circleType: '1' | '2' }) => {
 </template>
 <style>
 	.display{
-		display: none;
+		display: none !important;
 	}
 </style>