From b76c0541228f6af3da61288d0975967dc41b33b5 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Tue, 25 Sep 2018 17:04:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UserAddressController.class.php | 39 +-- service/Application/Home/Lang/zh-cn/buy.php | 16 ++ .../Home/View/Default/Buy/Index.html | 255 +++++++----------- .../Home/View/Default/Cart/Index.html | 4 - .../View/Default/UserAddress/SaveInfo.html | 2 +- .../Application/Service/UserService.class.php | 57 ++++ service/Public/Common/Css/Common.css | 6 +- service/Public/Common/Js/Common.js | 129 +++++---- service/Public/Home/Default/Css/Buy.css | 121 +++------ service/Public/Home/Default/Css/Common.css | 5 +- .../Public/Home/Default/Css/UserAddress.css | 7 +- service/Public/Home/Default/Js/Buy.js | 35 ++- 12 files changed, 350 insertions(+), 326 deletions(-) create mode 100644 service/Application/Home/Lang/zh-cn/buy.php diff --git a/service/Application/Home/Controller/UserAddressController.class.php b/service/Application/Home/Controller/UserAddressController.class.php index ed4202155..4925a6c1a 100644 --- a/service/Application/Home/Controller/UserAddressController.class.php +++ b/service/Application/Home/Controller/UserAddressController.class.php @@ -115,41 +115,12 @@ class UserAddressController extends CommonController * @date 2018-07-18 * @desc description */ - public function SetDefault() + public function Default() { - // 请求参数 - $params = [ - [ - 'checked_type' => 'empty', - 'key_name' => 'address_id', - 'error_msg' => '地址ID不能为空', - ] - ]; - $ret = params_checked($_POST, $params); - if($ret !== true) - { - $this->ajaxReturn($ret); - } - - // 模型 - $m = M('UserAddress'); - - // 开启事务 - $m->startTrans(); - - // 先全部设置为0 再将当前设置为1 - $all_status = $m->where(['user_id' => $this->user['id']])->save(['is_default'=>0]); - $my_status = $m->where(['user_id' => $this->user['id'], 'id'=>$_POST['address_id']])->save(['is_default'=>1]); - if($all_status && $my_status) - { - // 提交事务 - $m->commit(); - $this->ajaxReturn(L('common_operation_set_success'), 0); - } else { - // 回滚事务 - $m->rollback(); - $this->ajaxReturn(L('common_operation_delete_error'), -100); - } + $params = $_POST; + $params['user'] = $this->user; + $ret = UserService::UserAddressDefault($params); + $this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']); } } ?> \ No newline at end of file diff --git a/service/Application/Home/Lang/zh-cn/buy.php b/service/Application/Home/Lang/zh-cn/buy.php new file mode 100644 index 000000000..32ecc2c5e --- /dev/null +++ b/service/Application/Home/Lang/zh-cn/buy.php @@ -0,0 +1,16 @@ + '没有地址', + 'buy_express_not_data_tips' => '没有物流方式', + 'buy_payment_not_data_tips' => '没有支付方式', + 'buy_goods_not_data_tips' => '没有商品', +); +?> \ No newline at end of file diff --git a/service/Application/Home/View/Default/Buy/Index.html b/service/Application/Home/View/Default/Buy/Index.html index 51babbb34..e3de1d3c4 100644 --- a/service/Application/Home/View/Default/Buy/Index.html +++ b/service/Application/Home/View/Default/Buy/Index.html @@ -13,35 +13,35 @@ -
+
@@ -100,68 +107,76 @@ + +
{{:L('buy_payment_not_data_tips')}}
+
-
-
+
+

确认订单信息

- - - - - - - - - - - - - - - - + +
商品信息单价数量金额
-
- - - -
- {{$goods.title}} - -
    - -
  • {{$attr.attr_type_name}}:{{$attr.attr_name}}
  • -
    -
-
-
-
-
- - ¥{{$goods.original_price}} - - ¥{{$goods.price}} - x{{$goods.stock}} -
-
- -

¥{{$goods.original_price}}

-
-

¥{{$goods.price}}

-
- {{$goods.stock}} {{$goods.inventory_unit}} - - ¥{{$goods.total_price}} -
+ + + + + + - - -
商品信息单价数量金额
+ + + + + +
+ + + +
+ {{$goods.title}} + +
    + +
  • {{$attr.attr_type_name}}:{{$attr.attr_name}}
  • +
    +
+
+
+
+
+ + ¥{{$goods.original_price}} + + ¥{{$goods.price}} + x{{$goods.stock}} +
+ + + +

¥{{$goods.original_price}}

+
+

¥{{$goods.price}}

+ + + {{$goods.stock}} {{$goods.inventory_unit}} + + + ¥{{$goods.total_price}} + + +
+ + + + +
{{:L('buy_goods_not_data_tips')}}
+
+
-
- -
-

+ + +

+

合计(含运费) ¥{{$base.total_price}}

- -
-
+ +
+
-
- 实付款: - - ¥ - {{$base.total_price}} +
+ 实付款: + + ¥ + {{$base.total_price}}
@@ -221,87 +237,16 @@
-
- -
- -
-
- - -
-
新增地址 / Add address
-
-
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- - - -
-
- -
- -
- - 100字以内写出你的详细地址... -
-
- -
-
-
保存
-
取消
-
-
-
-
-
- -
diff --git a/service/Application/Home/View/Default/Cart/Index.html b/service/Application/Home/View/Default/Cart/Index.html index 011893660..532180fec 100644 --- a/service/Application/Home/View/Default/Cart/Index.html +++ b/service/Application/Home/View/Default/Cart/Index.html @@ -124,10 +124,6 @@
- - - - \ No newline at end of file diff --git a/service/Application/Home/View/Default/UserAddress/SaveInfo.html b/service/Application/Home/View/Default/UserAddress/SaveInfo.html index 82250928b..13917b6e2 100644 --- a/service/Application/Home/View/Default/UserAddress/SaveInfo.html +++ b/service/Application/Home/View/Default/UserAddress/SaveInfo.html @@ -25,7 +25,7 @@
-
+
diff --git a/service/Application/Service/UserService.class.php b/service/Application/Service/UserService.class.php index cde0ec534..b11282c53 100644 --- a/service/Application/Service/UserService.class.php +++ b/service/Application/Service/UserService.class.php @@ -209,6 +209,8 @@ class UserService 'lat' => floatval(I('lat')), ]; + $m->startTrans(); + // 默认地址处理 if($is_default == 1) { @@ -222,16 +224,20 @@ class UserService $data['add_time'] = time(); if($m->add($data) > 0) { + $m->commit(); return DataReturn(L('common_operation_add_success'), 0); } else { + $m->rollback(); return DataReturn(L('common_operation_add_error')); } } else { $data['upd_time'] = time(); if($m->where($where)->save($data)) { + $m->commit(); return DataReturn(L('common_operation_update_success'), 0); } else { + $m->rollback(); return DataReturn(L('common_operation_update_error')); } } @@ -276,5 +282,56 @@ class UserService return DataReturn(L('common_operation_delete_error'), -100); } } + + /** + * 用户地址设置默认地址 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-09-25 + * @desc description + * @param [array] $params [输入参数] + */ + public static function UserAddressDefault($params = []) + { + // 请求参数 + $p = [ + [ + 'checked_type' => 'empty', + 'key_name' => 'id', + 'error_msg' => '地址id不能为空', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'user', + 'error_msg' => '用户信息有误', + ], + ]; + $ret = params_checked($params, $p); + if($ret !== true) + { + return DataReturn($ret); + } + + // 模型 + $m = M('UserAddress'); + + // 开启事务 + $m->startTrans(); + + // 先全部设置为0 再将当前设置为1 + $all_status = $m->where(['user_id' => $params['user']['id']])->save(['is_default'=>0]); + $my_status = $m->where(['user_id' => $params['user']['id'], 'id'=>$params['id']])->save(['is_default'=>1]); + if($all_status && $my_status) + { + // 提交事务 + $m->commit(); + return DataReturn(L('common_operation_set_success'), 0); + } else { + // 回滚事务 + $m->rollback(); + return DataReturn(L('common_operation_set_error'), -100); + } + } } ?> \ No newline at end of file diff --git a/service/Public/Common/Css/Common.css b/service/Public/Common/Css/Common.css index 96a8974ae..c190c0eaa 100755 --- a/service/Public/Common/Css/Common.css +++ b/service/Public/Common/Css/Common.css @@ -49,7 +49,6 @@ * iframe */ iframe { width: 100%; height: 100%; border: 0; } -.popup-iframe .am-popup-inner { overflow: hidden; } /** @@ -69,6 +68,11 @@ iframe { width: 100%; height: 100%; border: 0; } /* 地址联动 */ .region-linkage select { width: 33%; display: -webkit-inline-box; } + + /** + * 弹窗iframe + */ + .popup-iframe .am-popup-inner { overflow: hidden; } } /** diff --git a/service/Public/Common/Js/Common.js b/service/Public/Common/Js/Common.js index b19d71e90..fead778ac 100755 --- a/service/Public/Common/Js/Common.js +++ b/service/Public/Common/Js/Common.js @@ -725,6 +725,84 @@ function DataDelete(e) }); } +/** + * [ConfirmNetworkAjax 确认网络请求] + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2018-09-24T08:24:58+0800 + * @param {[object]} e [当前元素对象] + */ +function ConfirmNetworkAjax(e) +{ + var id = e.data('id'); + var value = e.data('value') || ''; + var url = e.data('url'); + var view = e.data('view') || ''; + var title = e.data('title') || '温馨提示'; + var msg = e.data('msg') || '操作后不可恢复、确认操作吗?'; + + AMUI.dialog.confirm({ + title: title, + content: msg, + onConfirm: function(e) + { + // ajax + $.ajax({ + url:url, + type:'POST', + dataType:"json", + timeout:10000, + data:{id:id, value: value}, + success:function(result) + { + if(result.code == 0) + { + switch(view) + { + // 成功则删除数据列表 + case 'delete' : + Prompt(result.msg, 'success'); + $('#data-list-'+id).remove(); + break; + + // 刷新 + case 'reload' : + Prompt(result.msg, 'success'); + setTimeout(function() + { + window.location.reload(); + }, 1500); + break; + + // 回调函数 + case 'fun' : + if(IsExitsFunction(value)) + { + window[value](result); + } else { + Prompt('['+value+']配置方法未定义'); + } + break; + + // 默认提示成功 + default : + Prompt(result.msg, 'success'); + } + } else { + Prompt(result.msg); + } + }, + error:function(xhr, type) + { + Prompt('网络异常出错'); + } + }); + }, + onCancel: function(){} + }); +} + // 公共数据操作 $(function() @@ -1029,59 +1107,12 @@ $(function() * @version 0.0.1 * @datetime 2016-12-10T14:22:39+0800 * @param {[int] [data-id] [数据id]} - * @param {[int] [data-view] [完成操作(delete删除数据, reload刷新页面]} + * @param {[int] [data-view] [完成操作(delete删除数据, reload刷新页面, fun方法回调(data-value)]} * @param {[string] [data-url] [请求地址]} */ $(document).on('click', '.submit-ajax', function() { - var id = $(this).data('id'); - var value = $(this).data('value') || ''; - var url = $(this).data('url'); - var view = $(this).data('view') || 'reload'; - var title = $(this).data('title') || '温馨提示'; - var msg = $(this).data('msg') || '操作后不可恢复、确认操作吗?'; - - AMUI.dialog.confirm({ - title: title, - content: msg, - onConfirm: function(e) - { - // ajax - $.ajax({ - url:url, - type:'POST', - dataType:"json", - timeout:10000, - data:{id:id, value: value}, - success:function(result) - { - if(result.code == 0) - { - Prompt(result.msg, 'success'); - - if(view == 'delete') - { - // 成功则删除数据列表 - $('#data-list-'+id).remove(); - } else if(view == 'reload') - { - setTimeout(function() - { - window.location.reload(); - }, 1500); - } - } else { - Prompt(result.msg); - } - }, - error:function(xhr, type) - { - Prompt('网络异常出错'); - } - }); - }, - onCancel: function(){} - }); + ConfirmNetworkAjax($(this)); }); /** diff --git a/service/Public/Home/Default/Css/Buy.css b/service/Public/Home/Default/Css/Buy.css index 8afce585a..8a2a25997 100644 --- a/service/Public/Home/Default/Css/Buy.css +++ b/service/Public/Home/Default/Css/Buy.css @@ -1,19 +1,18 @@ -.hidden { display: none !important;} -.address-default { display:block !important;} -/*地址管理*/ -.concent h3,.business-item h3{border-bottom: 3px solid #e3e3e3; margin-top:15px;} + /*地址管理*/ +.order-detail h3,.business-item h3{border-bottom: 3px solid #e3e3e3; margin-top:15px;} h3 { font-size: 14px;font-weight: 700;} .address h3 { border-bottom:none;} ul.address-list li{display:none;width:100%;padding:10px;position: relative;min-height:80px;} .address-left{ width:90%;float:left;position: relative;} -.user.DefaultAddr {font-size: 14px;font-weight: 700;} +ul.address-list li .user-base {font-size: 14px;font-weight: 700;} .address-right{ float:right; margin-right:5px;padding-top:15px ;} .deftip {position: absolute;top: 0px;right: 0px;padding: 0px 2px;text-decoration: none;opacity: 0.7; z-index: 3;background: #CCC none repeat scroll 0% 0%; color: #FFF;} /*地址操作-编辑删除*/ .new-addr-btn {display:none;font-size: 12px;color: #282828;text-align: right; padding-right:5px ;} -.new-addr-bar {padding: 0px 5px;vertical-align: top;} +.new-addr-bar {padding: 0px 5px;vertical-align: top;} +.address-default { display:block !important;} /*物流*/ .business-item ul li { border:1px solid transparent ;overflow: hidden; } @@ -39,29 +38,31 @@ ul.logistics-list li img, ul.payment-list li img { width: 36px; height: 36px; } .memo-input{width:calc(100% - 64px);border: 1px solid #ccc;padding: 5px;outline:none;border-radius: 2px;} /*合计*/ -.buy-point-discharge{font-size:14px ;font-weight: 700;padding:10px 0px;text-align: right;} -.pay-sum{color:#F64000;margin-left:5px ;} - -.pay-confirm.clearfix{width: 100%;} +.buy-point-discharge{font-size:14px ;font-weight: 700;padding:10px 5px;text-align: right;} +.pay-sum{color:#d2364c;margin-left:5px ;} .box{float:left;width:70%;height:40px ;line-height:40px ;font-size: 14px;text-align: right;padding-right:10px ;} .pay-address{display: none;} -.submitOrder a{float:left;width:30%;color:#fff ;background:#f40 ;text-align: center;height:40px ;line-height:40px ;font-size: 14px;} - -.td.td-coupon select, .td.td-bonus select{border-color:#CCC;line-height: 24px;height:24px;margin-top:4px;} -.coupon-title,.bonus-title{line-height: 24px;height:24px} -.order-go{position: fixed;bottom: 0;width:100% ;background: #fff;border-top:1px solid #F5F5F5 ;} - -.theme-popover{display: none;} +.nav-buy-submit a{float:left;width:30%;color:#fff ;background:#d2364c ;text-align: center;height:40px ;line-height:40px ;font-size: 14px;} +.order-nav{position: fixed; left: 0; bottom: 0;width:100%; } +.nav-buy-submit a:hover, .nav-buy-submit a:focus { color: #fff !important; text-decoration: none; } .link-list h3 { padding: 0 0 5px 5px; } ul.address-list, .business-item ul { overflow: hidden; } +/** + * 手机下选择地址 + */ +.mobile-address { position: fixed; left: 0; bottom: 0; background-color: #fff; width: 100%; height: 100%; z-index: 1099; padding-top: 0 !important; margin-top: 0 !important; border-top: 0 !important; overflow-y: scroll; overflow-x: hidden; padding-bottom: 28px; } +.mobile-address .control { margin-bottom: 10px; } +.mobile-address .control h3 { background-color: #eee; padding: 5px; } +.mobile-address .control, .mobile-address ul.address-list li, .mobile-address ul.address-list li .new-addr-btn { display: block !important; } +.mobile-address .control .address-submit-save { position: fixed; left: 0; bottom: 0; width: 100%; z-index: 100; } +.mobile-address ul.address-list li { border-bottom: 1px solid #eee; padding-top: 5px; } +.mobile-address ul.address-list li .address-left { width: 100%; } +.mobile-address ul.address-list li .address-right { display: none; } + @media only screen and (min-width:640px) { - .pay-way{float: right;} - #payTable .th{border-top: none;} - .th .td-inner{padding-left:0px ;} - .wp{padding: 0px 10px;background: #F5F5F5;} /*地址操作*/ .address { padding: 0 1px 0 5px; } .address .control { margin-bottom: 10px; } @@ -75,62 +76,29 @@ ul.address-list, .business-item ul { overflow: hidden; } .business-item ul li {width:calc(25% - 8px); } .business-item ul li:nth-child(4n) { margin-right: 0; } - - /*订单管理*/ - - .td.td-info {width: 50%;} - .pay-phone{overflow:visible;padding-bottom:0px;margin-bottom:0px;} - .th.th-item,.td.td-amount .amount-wrapper .sl{text-align: center;width: auto;} - .item-content .price-now {line-height:18px ;font-size:12px ;font-weight: 100;} - - .th.th-item{width:50%;margin-right:0;} - .th.th-price, .td.td-price ,.th.th-sum, .td.td-sum {width: 10%;} - .th.th-amount, .td.td-amount {width:20%;} - .th.th-oplist,.td.td-oplist{width:10%;text-align: center;padding-left:0 ;} - - /*文字说明布局*/ - .td.td-amount .phone-title,.td.td-oplist .phone-title{display: none;} - .td.td-oplist .pay-logis,.td.td-amount .sl,.td.td-coupon select,.td.td-bonus select{position: static;} - .td.td-amount .amount-wrapper, .td.td-oplist{padding:0px ; border: none;} - /*留言*/ .buy-message{border:1px solid #eee; overflow: hidden;padding: 10px; margin: 0 5px;} .order-extra{border: none;float: left;width: 60%;} .memo-input{min-width:280px ;width:80%; } /*带个人信息的结算*/ - .box ,.submitOrder a{float:right;width:auto;height:auto;padding:10px 10px;} + .box ,.nav-buy-submit a{float:right;width:auto;height:auto;padding:10px 10px;} .pay-address{display:block;} - .box{font-size:12px;overflow: hidden;border: 2px solid #f40;} + .box{font-size:12px;overflow: hidden;border: 2px solid #de9ba2;} - .order-go {clear: both;text-align: right;position: relative;margin-top: 10px;border: none;} - .order-go .address-confirm .box{position: relative;float: right;z-index: 100;padding-right:2%; padding-bottom:10px;border: 1px solid #f50;font-family: tahoma;display: inline-block;right: 0;background-color: #fff0e8;} + .order-nav {clear: both;text-align: right;position: relative;margin-top: 10px;border: none;} + .order-nav .address-confirm .box{position: relative;float: right;z-index: 100;padding-right:2%; padding-bottom:10px;border: 1px solid #f50;font-family: tahoma;display: inline-block;right: 0;background-color: #fff0e8;} - .submitOrder .go-btn-wrap {width:100%;overflow: hidden;padding-top:10px;margin-bottom: 10px;} - .submitOrder .btn-go {display: block;padding: 0 26px;height: 36px;font: 400 18px/36px arial;font-size: 18px;background-color: #f50;color: #fff;text-align: center;cursor: pointer;outline: 0; z-index:999;} - .realPay {line-height: 16px;margin: 0px 0px 15px;position: relative;} - .realPay .g_price span {font-size: 26px;} - .price .style-large-bold-red {color: #FF4200;font: 700 26px tahoma;} - .order-go .buy-footer-address .buy-line-title {color: #404040;font-weight: 700;} - .td.td-coupon select, .td.td-bonus select {margin-top:0 ;} - - - .theme-popover-mask{z-index:10000000;position:fixed;left:0;top:0;width:100%;height:100%;background:#000;opacity:0.5;filter:alpha(opacity=50);-moz-opacity:0.5;display:none;} - .theme-popover{z-index:10000009;position:fixed;bottom:50%;left:50%;width:500px;height:400px;margin-bottom:-200px;margin-left:-250px;display:none;background:#fff;overflow: hidden;} - .theme-poptit{padding:12px;position:relative;} - .theme-poptit .close:hover{color:#444;} - - .theme-popover .am-form-content.address select{width:32.3333%;margin-right:1%;float: left;} - .am-padding { padding: 10px 10px;} - hr {margin: 5px 0px;} - .am-form-group {margin-bottom: 10px} - - - .td.td-amount{margin-top: 15px} + .nav-buy-submit .go-btn-wrap {width:100%;overflow: hidden;padding-top:10px;margin-bottom: 10px;} + .nav-buy-submit .btn-go {display: block;padding: 0 26px;height: 36px;font: 400 18px/36px arial;font-size: 18px;background-color: #d2364c;color: #fff;text-align: center;cursor: pointer;outline: 0; z-index:999;} + .base-real-pay {line-height: 16px;margin: 0px 0px 10px;position: relative;} + .base-real-pay .g_price span {font-size: 26px;} + .price .nav-total-price {color: #d2364c;font: 700 26px tahoma;} + .order-nav .buy-footer-address .buy-line-title {color: #404040;font-weight: 700;} .link-list{margin:0px auto;} - /*地址管理*/ + /*地址管理*/ .address ul{margin-top:10px ;} ul.address-list li{display:block; width: calc(33% - 5px);height: 150px;float: left;background-image: url(../Images/peraddbg.png); background-repeat: no-repeat; background-size: 100% 100%; margin:0 10px 10px 0 ;padding:10px;} ul.address-list li.address-default{background-image: url(../Images/peraddressbg.png);} @@ -140,11 +108,7 @@ ul.address-list, .business-item ul { overflow: hidden; } /*地址操作*/ .new-addr-btn {display:block;position: absolute;bottom:25px ;right:10px ;} - .new-addr-bar {padding: 0px 5px;vertical-align: top;} - - .td.td-item ,.td.td-info{width: 50%;} - .td.td-info{position: absolute;margin-top:0px;} - .td.td-info .item-props{text-align: left;padding-top:0px ;} + .new-addr-bar {padding: 0px 5px;vertical-align: top;} .address-right .am-icon-angle-right { display: none; } } @@ -162,19 +126,25 @@ ul.address-list, .business-item ul { overflow: hidden; } .business-item ul { padding: 10px 0 0 0; } .link-list h3 { padding: 0 0 5px 0; } .buy-message { margin: 0; } + .buy-point-discharge { padding: 10px 0px; } } @media only screen and (max-width:640px) { - .address { margin-top: 10px; padding-top: 10px; } + .cart-content table tr .base { width: 100%; } + + .address { margin-top: 10px; } .address, .buy-message { border-top: 1px solid #eee; } .address .control { display: none; } .address-default {background: url(../Images/peraddress.png) repeat-x; background-position: bottom; } - ul.address-list li { padding: 0 5px; min-height: 65px; } + ul.address-list li { padding: 5px; min-height: 60px; overflow: hidden; } .business-item ul li { width: calc(50% - 6px); } .business-item ul li:nth-child(2n) { margin-right: 0; } .buy-message { padding-top: 10px; } + .pay-confirm em { font-size: 12px; } + .pay-confirm .nav-total-price { color: #d2364c; font-weight: 700; } + .order-nav { background: #f5f5f5; } } @@ -202,10 +172,5 @@ strong.total-price-content { color: #d2364c; font-size: 16px; } .cart-content table tr .number { width: 20%; } .cart-content table tr .total-price { width: 20%; } .cart-content { margin-top: 20px; } -} - -@media only screen and (max-width:640px) { - .cart-content table tr .base { width: 100%; } -} - +} diff --git a/service/Public/Home/Default/Css/Common.css b/service/Public/Home/Default/Css/Common.css index d4fb121ea..fa56ee227 100755 --- a/service/Public/Home/Default/Css/Common.css +++ b/service/Public/Home/Default/Css/Common.css @@ -18,6 +18,7 @@ time, mark, audio, video { vertical-align: baseline; font-family: arial,"Lantinghei SC","Microsoft Yahei"; } +li { list-style-type: none; } *, body, .am-btn { font-size: 12px; } @@ -71,7 +72,7 @@ color: #555555;background:none;border-color:transparent;cursor: default;} .goods-category-s{display: none;} /*浮动框*/ -.nav-search{top:0;left:0;width:100%;z-index:1099; margin:0px auto;background:#fff; padding-top: 5px; position: relative;} +.nav-search{top:0;left:0;width:100%;z-index:1060; margin:0px auto;background:#fff; padding-top: 5px; position: relative;} .nav-search .logo{height:36px;width:95px; margin: 0 auto; display: -webkit-inline-box;} .logoBig{display:none;} .logo img{width:100%} @@ -486,7 +487,7 @@ background:url(../Images/ibar_sprites.png) no-repeat;background-position:0px -23 /** * 公共登录窗口 */ - .common-login-modal { max-width: 400px; height: 372px; left: calc(50% - 200px); top: calc(50% - 186px); margin-left: 0; margin-top: 0; } + .common-login-modal { max-width: 400px; height: 378px; left: calc(50% - 200px); top: calc(50% - 189px); margin-left: 0; margin-top: 0; } } /** diff --git a/service/Public/Home/Default/Css/UserAddress.css b/service/Public/Home/Default/Css/UserAddress.css index d7e90e9a8..632973228 100644 --- a/service/Public/Home/Default/Css/UserAddress.css +++ b/service/Public/Home/Default/Css/UserAddress.css @@ -1,3 +1,8 @@ .my-content { padding: 15px 10px; } .region-linkage .chosen-select { display: -webkit-inline-box; width: calc(33.3% - 3px) !important; } -.region-linkage .chosen-select .chosen-single { width: 100%; } \ No newline at end of file +.region-linkage .chosen-select .chosen-single { width: 100%; } + +#map { width: 100%; height: 260px; } +@media only screen and (max-width:640px) { + #map { width: 100%; height: 160px; } +} \ No newline at end of file diff --git a/service/Public/Home/Default/Js/Buy.js b/service/Public/Home/Default/Js/Buy.js index ebaf7d7aa..09e20731b 100644 --- a/service/Public/Home/Default/Js/Buy.js +++ b/service/Public/Home/Default/Js/Buy.js @@ -34,8 +34,14 @@ $(function() } } + // 地址不为空,并且未设置默认,并且没有选择 默认选中第一个 + if($('ul.address-list li').length > 0 && $('ul.address-list li.address-default').length == 0) + { + $('ul.address-list li').eq(0).addClass('address-default'); + } + // 地址选择 - $('ul.address-list li').click(function() + $('ul.address-list li').on('click', function() { $(this).addClass('address-default').siblings().removeClass('address-default'); store.set(store_address_key, $(this).index()); @@ -87,6 +93,33 @@ $(function() e.stopPropagation(); }); + + // 手机模式下选择地址 + $('ul.address-list li').on('click', function(e) + { + if($(window).width() < 640) + { + if(!$('.address').hasClass('mobile-address')) + { + $('.address').addClass('mobile-address'); + $(document.body).css({"overflow": "hidden", "position":"fixed"}); + e.stopPropagation(); + } + } + }); + $('.address').on('click', 'ul.address-list li', function() + { + $('.address').removeClass('mobile-address'); + $(document.body).css({"overflow": "auto", "position":"unset"}); + $('body').scrollTop(0); + }); + + // 设为默认地址 + $('.address-default-submit').on('click', function(e) + { + ConfirmNetworkAjax($(this)); + e.stopPropagation(); + }); }); \ No newline at end of file