Browse Source

完善前端代码

chillqi 2 years ago
parent
commit
c3d5dd081b
1 changed files with 5 additions and 6 deletions
  1. 5 6
      src/components/PayDialog.vue

+ 5 - 6
src/components/PayDialog.vue

@@ -39,6 +39,10 @@ function getOrderDetail(orderId: number) {
     //根据商品单价和购买数量计算总价
     totalPrice.value = price.value * amount.value
     discountPrice.value = totalPrice.value
+
+    getAvailableCouponsByStoreId(storeId.value).then(res => {
+      availableCouponList.value = res.data.result
+    })
   })
 }
 
@@ -78,12 +82,7 @@ const availableCouponList = ref<Coupon[]>([])
 const currentRow = ref()
 const singleTableRef = ref<InstanceType<typeof ElTable>>()
 
-getAvailableCouponsByStoreId(storeId.value).then(res => {
-  console.log(res.data.result)
-  availableCouponList.value = res.data.result
-})
-
-const setCurrent = (row?: User) => {
+const setCurrent = (row?: Coupon) => {
   singleTableRef.value!.setCurrentRow(row)
 }