Forráskód Böngészése

feat: 下单入参修改、订单状态对接

liangan 1 hónapja
szülő
commit
247f146f6a
2 módosított fájl, 30 hozzáadás és 39 törlés
  1. 26 4
      src/pages/myOrders/orderDetail.vue
  2. 4 35
      src/pages/productDetail/checkOut.vue

+ 26 - 4
src/pages/myOrders/orderDetail.vue

@@ -88,6 +88,8 @@ async function getPink() {
   }
 }
 onLoad(async (options) => {
+  getConfig('open_red_envelope_rate')
+  getConfig('join_red_envelope_rate')
   const params = getPageParams(options)
   id.value = params.id
   await getOrderStatus()
@@ -169,21 +171,41 @@ function handleDialogClose() {
   <z-paging ref="paging" refresher-only @refresh="getDetail">
     <view class="pt-20rpx">
       <!-- 状态显示 -->
-      <view class="mb-20rpx bg-#17AA68/80 py-20rpx text-center text-28rpx text-white">
-        Congrats,You won the prize in this group!
+      <!-- 已中奖 -->
+      <view v-if="detail?.storePink?.status === 2 && detail?.storePink?.lId === 1" class="mb-20rpx bg-#17AA68/80 py-20rpx text-center text-28rpx text-white">
+        Congrats,You won the prize in this group!已中奖
         <br>
         You have received
         <text class="text-[var(--wot-color-theme)]">
-          ৳10
+          ৳{{ 10 }}
         </text>
         group opening reward
       </view>
+      <!-- 未中奖 -->
+      <view v-else-if="detail?.storePink?.status === 2 && detail?.storePink?.lId === 0" class="mb-20rpx bg-#E61B28/80 py-20rpx text-center text-28rpx text-white">
+        So sorry, You didn't win in this group
+        <br>
+        You have received
+        <text class="text-#66C59B">
+          ৳8
+        </text>
+        group opening reward
+      </view>
+      <!-- 未开奖||未支付 -->
+      <view v-else-if="detail?.storePink?.status === 1 || detail?.status === 1" class="mb-20rpx bg-#fff py-20rpx text-center text-28rpx text-white">
+        <text v-if="detail?.storePink?.status === 1" class="text-[var(--wot-color-theme)]">
+          Please wait for the draw of this group
+        </text>
+        <text v-else class="text-[var(--wot-color-theme)]">
+          Please make payment within:29:59
+        </text>
+      </view>
       <!-- 拼团头像 -->
       <view class="mb-20rpx bg-white px-20rpx py-20rpx text-center">
         <image v-for="i in 10" :key="i" class="mx-4rpx mb-8rpx h-80rpx w-80rpx rounded-full" src="/static/images/avatar.jpg" />
       </view>
       <!-- 地址 -->
-      <view class="mb-20rpx bg-white px-24rpx py-20rpx">
+      <view v-if="detail?.storePink?.status === 2 && detail?.storePink?.lId === 1" class="mb-20rpx bg-white px-24rpx py-20rpx">
         <!-- 无地址 -->
         <template v-if="!detail.orderAddressVO">
           <view class="flex items-center justify-between">

+ 4 - 35
src/pages/productDetail/checkOut.vue

@@ -97,42 +97,14 @@ function showInsufficientBalanceDialog() {
   ))
 }
 
-// 显示支付成功对话框
-function showPaymentSuccessDialog() {
-  Object.assign(dialogConfig.value, DialogUtils.success(
-    t('checkout.dialog.paymentSuccess'),
-    {
-      confirmText: t('checkout.dialog.viewOrder'),
-      showConfirm: true,
-    },
-  ))
-}
-
-// 显示支付失败对话框
-function showPaymentFailedDialog() {
-  Object.assign(dialogConfig.value, DialogUtils.error(
-    t('checkout.dialog.paymentFailed'),
-    {
-      confirmText: t('checkout.dialog.retryPayment'),
-    },
-  ))
-}
-
-// 显示网络错误对话框
-function showNetworkErrorDialog() {
-  Object.assign(dialogConfig.value, DialogUtils.error(
-    t('checkout.dialog.networkError'),
-    {
-      confirmText: t('checkout.dialog.retry'),
-      iconSize: '100rpx',
-    },
-  ))
-}
-
 // 下单处理
 async function handlePlaceOrder() {
   const params = {
     preOrderNo: queryParams.value.preOrderId,
+    type: queryParams.value.groupType,
+    pinkId: queryParams.value.pinkId,
+    cid: queryParams.value.cid,
+    groupType: queryParams.value.groupType,
   }
   const orderRes = await createOrder(params)
   console.log(orderRes)
@@ -140,9 +112,6 @@ async function handlePlaceOrder() {
     const payRes = await payOrder({
       orderId: orderRes?.data?.columns?.orderNo,
       type: queryParams.value.groupType,
-      pinkId: queryParams.value.pinkId,
-      cid: queryParams.value.cid,
-      groupType: queryParams.value.groupType,
     })
     console.log(payRes)
     if (payRes.code === '8000') {