瀏覽代碼

完善前端代码

chillqi 2 年之前
父節點
當前提交
c3d5dd081b
共有 1 個文件被更改,包括 5 次插入6 次删除
  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)
 }