From 3d06f305db84fcd84c848fc69617ca1a242012fc Mon Sep 17 00:00:00 2001 From: pushuo <229102104@qq.com> Date: Mon, 4 Jul 2022 18:20:01 +0800 Subject: [PATCH] wip --- public/build/beike/shop/default/css/app.css | 2 +- .../beike/shop/default/css/page-checkout.scss | 2 +- themes/default/checkout.blade.php | 26 +++++++++---------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/public/build/beike/shop/default/css/app.css b/public/build/beike/shop/default/css/app.css index de77b9e7..0a903a68 100644 --- a/public/build/beike/shop/default/css/app.css +++ b/public/build/beike/shop/default/css/app.css @@ -576,7 +576,7 @@ body.page-checkout .total-wrap .totals > li > span:last-of-type { body.page-checkout .addresses-wrap .item { position: relative; padding: 10px 20px; - margin-bottom: 10px; + margin-bottom: 1.3rem; border: 1px solid #e8e8e8; height: 125px; cursor: pointer; diff --git a/resources/beike/shop/default/css/page-checkout.scss b/resources/beike/shop/default/css/page-checkout.scss index ad059eda..9878e2f3 100644 --- a/resources/beike/shop/default/css/page-checkout.scss +++ b/resources/beike/shop/default/css/page-checkout.scss @@ -116,7 +116,7 @@ body.page-checkout { .item { position: relative; padding: 10px 20px; - margin-bottom: 10px; + margin-bottom: 1.3rem; border: 1px solid #e8e8e8; height: 125px; cursor: pointer; diff --git a/themes/default/checkout.blade.php b/themes/default/checkout.blade.php index f895cf69..10c316b1 100644 --- a/themes/default/checkout.blade.php +++ b/themes/default/checkout.blade.php @@ -27,7 +27,7 @@
地址
-
+
@{{ address.name }} @@ -41,7 +41,7 @@
-
+
添加新地址
@@ -192,7 +192,7 @@ form: { name: '', phone: '', - country_id: @json(setting('country_id')) * 1, + country_id: @json($country_id), zipcode: '', zone_id: '', city_id: '', @@ -241,9 +241,9 @@ $http[type](url, this.dialogAddress.form).then((res) => { if (type == 'post') { - this.source.addresses.push(res.data) + this.source.addresses.push(res.data.data) } else { - this.source.addresses[this.dialogAddress.index] = res.data + this.source.addresses[this.dialogAddress.index] = res.data.data } this.$message.success(res.message); this.$refs[form].resetFields(); @@ -257,17 +257,16 @@ this.$refs[form].resetFields(); this.dialogAddress.show = false this.dialogAddress.index = null; + + Object.keys(this.dialogAddress.form).forEach(key => this.dialogAddress.form[key] = '') + this.dialogAddress.form.country_id = @json($country_id) }, countryChange(e) { const self = this; - $.ajax({ - url: `/admin/countries/${e}/zones`, - type: 'get', - success: function(res) { - self.source.zones = res.data.zones; - } + $http.get(`/admin/countries/${e}/zones`).then((res) => { + this.source.zones = res.data.data.zones; }) }, @@ -275,14 +274,13 @@ this.form[key] = id $http.put('/checkout', this.form).then((res) => { - // console.log(res) this.form = res.data.current }) }, checkedBtnCheckoutConfirm() { - $http.post('/checkout', this.form).then((res) => { - // console.log(res) + $http.post('/checkout/confirm', this.form).then((res) => { + console.log(res) }) } }