Bläddra i källkod

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 9 månader sedan
förälder
incheckning
5fe410b6a2
2 ändrade filer med 18 tillägg och 35 borttagningar
  1. 0 16
      src/components/pay/confirmPaymentDialog.vue
  2. 18 19
      src/components/pay/index.vue

+ 0 - 16
src/components/pay/confirmPaymentDialog.vue

@@ -14,7 +14,6 @@
         ref="payRef"
         v-bind="$attrs"
         @payTypeChange="null"
-        @paySubmit="paySubmit"
       ></pay>
     </CtDialog>
   </div>
@@ -36,21 +35,6 @@ const handleClose = () => {
   payDialog.value = false
   emit('close')
 }
-
-const paySubmit = async (payType) => {
-  try {
-    if (payType && payType !== '余额') {
-      // if (timer.value) clearInterval(timer.value); timer.value = null
-      // timer.value = setInterval(async () => { // 打开轮巡
-      //   console.log('setInterval->')
-      // }, 3000)
-    } else {
-      // if (timer.value) clearInterval(timer.value); timer.value = null
-    }
-  } catch (error) {
-    console.log('error', error)
-  }
-}
 </script>
 <style lang="scss" scoped>
 </style>

+ 18 - 19
src/components/pay/index.vue

@@ -43,7 +43,7 @@
           v-if="isWalletPay"
           class="buttons" color="primary"
           :loading="payLoading"
-          @click="paySubmit"
+          @click="walletPaySubmit"
         >
           <!-- {{ isWalletPay ? '确认' : '支付完成' }} -->
           确认
@@ -87,6 +87,20 @@ const props = defineProps({
 })
 const loading = ref(true)
 
+const balance = JSON.parse(localStorage.getItem('enterpriseUserAccount'))?.balance || 0
+const balanceNotEnough = computed(() => {
+  return (Number(props.cost) > Number(balance))
+})
+// 支付方式
+const isWalletPay = ref(true)
+const isQrCodePay = ref(false)
+const payTypeChange = (val) => {
+  payType.value = val
+  isQrCodePay.value = qrCodePay.includes(payType.value)
+  isWalletPay.value = walletPay.includes(payType.value)
+  if (isQrCodePay.value) initPayQrCode() // 生成二维码内容
+  emit('payTypeChange', val, balanceNotEnough)
+}
 // 支付方式
 const payType = ref('')
 const payTypeList = ref([])
@@ -127,7 +141,6 @@ const getUnpaidOrderList = async () => {
   try {
     const data = await getUnpaidOrder({ spuId: props.spuId, type: props.type })
     // order:业务订单; payOrder:支付订单
-    console.log('获取待支付的订单', data)
     if (!data) {
       // 订单超时,重新提交订单
       await createTradeOrder({
@@ -165,23 +178,9 @@ const payTypeItem = {
   items: payTypeList.value
 }
 
-const balance = JSON.parse(localStorage.getItem('enterpriseUserAccount'))?.balance || 0
-const balanceNotEnough = computed(() => {
-  return (Number(props.cost) > Number(balance))
-})
-
-const isWalletPay = ref(true)
-const isQrCodePay = ref(false)
-const payTypeChange = (val) => {
-  payType.value = val
-  isQrCodePay.value = qrCodePay.includes(payType.value)
-  isWalletPay.value = walletPay.includes(payType.value)
-  if (isQrCodePay.value) initPayQrCode() // 生成二维码内容
-  emit('payTypeChange', val, balanceNotEnough)
-}
-
-const paySubmit = () => {
-  emit('paySubmit', payType.value)
+// 钱包支付(余额支付)
+const walletPaySubmit = () => {
+  // emit('paySubmit', payType.value)
 }
 
 // 生成二维码内容