From 03e285239c8e612a45cdd58c0ebe2bc72306d6f6 Mon Sep 17 00:00:00 2001 From: pushuo <229102104@qq.com> Date: Mon, 4 Jul 2022 17:54:18 +0800 Subject: [PATCH] wip --- themes/default/checkout.blade.php | 69 ++++++++++++++++--------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/themes/default/checkout.blade.php b/themes/default/checkout.blade.php index d5510df6..f895cf69 100644 --- a/themes/default/checkout.blade.php +++ b/themes/default/checkout.blade.php @@ -28,7 +28,7 @@
-
+
@{{ address.name }} @{{ address.phone }} @@ -37,7 +37,7 @@
@{{ address.country_id }} @{{ address.zone_id }}
已选择 - 编辑 + 编辑
@@ -51,16 +51,14 @@
支付方式
-
- {{-- --}} - {{-- --}} +
- - + +
-
插件名称
-
插件名称,插件名称,插件名称,插件名称,插件名称,
+
@{{ payment.name }}
+
@@ -69,16 +67,14 @@
配送方式
-
- {{-- --}} - {{-- --}} +
- - + +
-
插件名称
-
插件名称,插件名称,插件名称,插件名称,插件名称,
+
@{{ shipping.name }}
+
@@ -177,8 +173,8 @@ form: { shipping_address_id: @json($current['shipping_address_id']), payment_address_id: @json($current['payment_address_id']), - payment_method: @json($current['payment_method']), - shipping_method: @json($current['shipping_method']), + payment_method_code: @json($current['payment_method_code']), + shipping_method_code: @json($current['shipping_method_code']), }, source: { @@ -241,22 +237,18 @@ } const type = this.dialogAddress.form.id ? 'put' : 'post'; + const url = `/admin/customers/{{ $customer_id }}/addresses${type == 'put' ? '/' + this.dialogAddress.form.id : ''}`; - $.ajax({ - url: `/admin/customers/{{ $customer_id }}/addresses${type == 'put' ? '/' + this.dialogAddress.form.id : ''}`, - data: self.dialogAddress.form, - type: type, - success: function(res) { - if (type == 'post') { - self.source.addresses.push(res.data) - } else { - self.source.addresses[self.dialogAddress.index] = res.data - } - self.$message.success(res.message); - self.$refs[form].resetFields(); - self.dialogAddress.show = false - self.dialogAddress.index = null; + $http[type](url, this.dialogAddress.form).then((res) => { + if (type == 'post') { + this.source.addresses.push(res.data) + } else { + this.source.addresses[this.dialogAddress.index] = res.data } + this.$message.success(res.message); + this.$refs[form].resetFields(); + this.dialogAddress.show = false + this.dialogAddress.index = null; }) }); }, @@ -279,8 +271,19 @@ }) }, + updateCheckout(id, key) { + this.form[key] = id + + $http.put('/checkout', this.form).then((res) => { + // console.log(res) + this.form = res.data.current + }) + }, + checkedBtnCheckoutConfirm() { - console.log(1) + $http.post('/checkout', this.form).then((res) => { + // console.log(res) + }) } } })