Ver Fonte

feat:paddle按钮显示

liyangbin há 4 meses atrás
pai
commit
612dfd4437
2 ficheiros alterados com 24 adições e 25 exclusões
  1. 12 12
      src/views/Product/Custom.vue
  2. 12 13
      src/views/Product/ID.vue

+ 12 - 12
src/views/Product/Custom.vue

@@ -130,17 +130,17 @@ let allShoppingNum = computed(() => {
   })
   return addNum
 })
-// watch(allShoppingNum, (val) => {
-//   if (val > 100 && paddleShow.value) {
-//     paddleShow.value = false
-//     if (payMethod.value === 'paddle') {
-//       payMethod.value = 'paypal'
-//     }
-//   }
-//   if (val <= 100 && !paddleShow.value) {
-//     paddleShow.value = true
-//   }
-// })
+watch(allShoppingNum, (val) => {
+  if (val > 100 && paddleShow.value) {
+    paddleShow.value = false
+    if (payMethod.value === 'paddle') {
+      payMethod.value = 'paypal'
+    }
+  }
+  if (val <= 100 && !paddleShow.value) {
+    paddleShow.value = true
+  }
+})
 const getShopping = () => {
   get(
     baseUrl + '/api/shopping-cart?vpp_member_id=' + useInfo.value.id
@@ -233,7 +233,7 @@ const payMethod = ref('paypal')
 const countryCode = ref('US')
 const postCode = ref('')
 const paypalLoading = ref(true)
-const paddleShow = ref(false)
+const paddleShow = ref(true)
 
 // 查询支付状态
 const getState = (trade_no, payMethod) => {

+ 12 - 13
src/views/Product/ID.vue

@@ -49,8 +49,7 @@ const payMethod = ref('paypal')
 const countryCode = ref('US')
 const postCode = ref('')
 const paypalLoading = ref(true)
-// const paddleShow = ref(true)
-const paddleShow = ref(false)
+const paddleShow = ref(true)
 const paymentID = ref(null)
 
 // 回到上一级
@@ -111,17 +110,17 @@ let useTeamDiscount = computed(() => {
   }
 })
 
-// watch(productNum, () => {
-//   if (productNum.value > 100 && paddleShow.value) {
-//     paddleShow.value = false
-//     if (payMethod.value === 'paddle') {
-//       payMethod.value = 'paypal'
-//     }
-//   }
-//   if (productNum.value <= 100 && !paddleShow.value) {
-//     paddleShow.value = true
-//   }
-// })
+watch(productNum, () => {
+  if (productNum.value > 100 && paddleShow.value) {
+    paddleShow.value = false
+    if (payMethod.value === 'paddle') {
+      payMethod.value = 'paypal'
+    }
+  }
+  if (productNum.value <= 100 && !paddleShow.value) {
+    paddleShow.value = true
+  }
+})
 
 // 查询支付状态
 const getState = (trade_no, payMethod) => {