purui 6 days ago
parent
commit
409a2b4163

+ 57 - 17
packages/app/src/pages-sub/home/mall/confirm-order/index.vue

@@ -28,6 +28,7 @@ const router = useRouter()
 const userStore = useUserStore()
 const { userInfo } = storeToRefs(userStore)
 const show = ref(false)
+const disabled = ref(false)
 const { alert } = useMessage()
 const data = ref()
 const selectedCoupons = ref<Coupon[]>([])
@@ -71,27 +72,66 @@ const offerPoints = computed(() => {
 })
 const handlePay = async () => {
   console.log(111)
-  const couponList =
-    selectedCoupons.value?.map((it) => ({
-      couponId: it.id,
-      projectIds: it.productIds,
-      buinessId: it.buinessId,
-    })) || []
-  const { code } = await requestToast(
-    () =>
-      orderPay({
-        ...data?.value,
-        couponList,
-      }),
-    { success: true, successTitle: '兑换成功' },
-  )
-  if (code === 0) {
-    await router.replace('/pages-sub/home/mall/purchased/success/index')
+  if(disabled.value){
+	  return false
+  }
+  disabled.value = true;
+  if(coupons.value.length>0 && selectedCoupons.value?.length===0){
+	  uni.showModal({
+	  	title:"提示",
+		content:"您有" + coupons.value.length + "张优惠券可用,是否要使用?",
+		success: async (res) => {
+			if(res.confirm){
+				handleQ()
+			}
+			if(res.cancel){
+				const couponList =
+				  selectedCoupons.value?.map((it) => ({
+				    couponId: it.id,
+				    projectIds: it.productIds,
+				    buinessId: it.buinessId,
+				  })) || []
+				const { code } = await requestToast(
+				  () =>
+				    orderPay({
+				      ...data?.value,
+				      couponList,
+				    }),
+				  { success: true, successTitle: '兑换成功' },
+				)
+				disabled.value = false;
+				if (code === 0) {
+				  await router.replace('/pages-sub/home/mall/purchased/success/index')
+				}
+			}
+		}
+	  })
+  }else{
+	  const couponList =
+	    selectedCoupons.value?.map((it) => ({
+	      couponId: it.id,
+	      projectIds: it.productIds,
+	      buinessId: it.buinessId,
+	    })) || []
+	  const { code } = await requestToast(
+	    () =>
+	      orderPay({
+	        ...data?.value,
+	        couponList,
+	      }),
+	    { success: true, successTitle: '兑换成功' },
+	  )
+	  if (code === 0) {
+	    await router.replace('/pages-sub/home/mall/purchased/success/index')
+	  }
+	  disabled.value = false;
   }
+  
 }
 const handleQ = async () => {
   // await setCoupons()
   show.value = true
+  disabled.value = false;
 }
 const handleSelect = (coupon: Coupon) => {
   selectedCoupons.value = [coupon]
@@ -198,7 +238,7 @@ onLoad(async (query: { data: string }) => {
           </div>
           <div class="text-black/40 text-base font-normal font-['PingFang_SC']">积分</div>
         </div>
-        <div class="">
+        <div :class="disabled?'filter':''">
           <ButtonEvo @click="handlePay">确认兑换</ButtonEvo>
         </div>
       </div>

+ 8 - 6
packages/app/src/pages-sub/mine/refferrer/details.vue

@@ -113,13 +113,15 @@ onLoad(async (options:object)=>{
 			</template>
 			<template #default="{ source }">
 				<view class="bg-white rounded-[20rpx] mx-[24rpx] mt-[30rpx] px-[20rpx] py-[30rpx]" v-if="type === 'recommend'">
-					<view class="flex items-center py-[30rpx] relative" v-for="(it, i) in source.list" :key="i" style="border-bottom: 2rpx solid #FAFAFA;">
-						<view class="rounded-full w-[88rpx] h-[88rpx] overflow-hidden mr-[20rpx]">
-							<image :src="it.avatar" mode="widthFix"></image>
+					<view class="py-[30rpx]" v-for="(it, i) in source.list" :key="i">
+						<view class="flex items-center pb-[20rpx]" style="border-bottom: 2rpx solid #FAFAFA;">
+							<view class="rounded-full w-[88rpx] h-[88rpx] overflow-hidden mr-[20rpx]">
+								<image :src="it.avatar" mode="widthFix"></image>
+							</view>
+							<view class="flex-grow text-[32rpx]">{{ it.name }}</view>
+							<view class="text-[#586A8F] text-[28rpx]" v-if="it.auditStatus === 0 && !referrerId" @click="toSecond(it)">推荐人数:{{ it.referrerCount }}</view>
 						</view>
-						<view class="flex-grow text-[32rpx]">{{ it.name }}</view>
-						<view class="text-[#586A8F] text-[28rpx]" v-if="it.auditStatus === 0 && !referrerId" @click="toSecond(it)">推荐人数:{{ it.referrerCount }}</view>
-						<view class="absolute bottom-0 left-[20%] text-[24rpx] text-[#EF4343]" v-if="it.auditStatus == 2">原因:{{ it.remark }}</view>
+						<view class="text-[24rpx] text-[#EF4343] pl-[108rpx] pt-[20rpx] pr-[20rpx]" v-if="it.auditStatus == 2">原因:{{ it.remark }}</view>					
 					</view>
 				</view>
 				<view class="bg-white rounded-[20rpx] mx-[24rpx] mt-[30rpx] px-[20rpx] py-[30rpx]" v-else>