Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
b76c0541
ShopXO
项目概览
jcy2004x
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b76c0541
编写于
9月 25, 2018
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
订单确认
上级
58b9822f
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
349 addition
and
325 deletion
+349
-325
service/Application/Home/Controller/UserAddressController.class.php
...plication/Home/Controller/UserAddressController.class.php
+5
-34
service/Application/Home/Lang/zh-cn/buy.php
service/Application/Home/Lang/zh-cn/buy.php
+16
-0
service/Application/Home/View/Default/Buy/Index.html
service/Application/Home/View/Default/Buy/Index.html
+99
-154
service/Application/Home/View/Default/Cart/Index.html
service/Application/Home/View/Default/Cart/Index.html
+0
-4
service/Application/Home/View/Default/UserAddress/SaveInfo.html
...e/Application/Home/View/Default/UserAddress/SaveInfo.html
+1
-1
service/Application/Service/UserService.class.php
service/Application/Service/UserService.class.php
+57
-0
service/Public/Common/Css/Common.css
service/Public/Common/Css/Common.css
+5
-1
service/Public/Common/Js/Common.js
service/Public/Common/Js/Common.js
+80
-49
service/Public/Home/Default/Css/Buy.css
service/Public/Home/Default/Css/Buy.css
+43
-78
service/Public/Home/Default/Css/Common.css
service/Public/Home/Default/Css/Common.css
+3
-2
service/Public/Home/Default/Css/UserAddress.css
service/Public/Home/Default/Css/UserAddress.css
+6
-1
service/Public/Home/Default/Js/Buy.js
service/Public/Home/Default/Js/Buy.js
+34
-1
未找到文件。
service/Application/Home/Controller/UserAddressController.class.php
浏览文件 @
b76c0541
...
...
@@ -115,41 +115,12 @@ class UserAddressController extends CommonController
* @date 2018-07-18
* @desc description
*/
public
function
Set
Default
()
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
service/Application/Home/Lang/zh-cn/buy.php
0 → 100644
浏览文件 @
b76c0541
<?php
/**
* 模块语言包-确认订单
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
return
array
(
'buy_user_address_not_data_tips'
=>
'没有地址'
,
'buy_express_not_data_tips'
=>
'没有物流方式'
,
'buy_payment_not_data_tips'
=>
'没有支付方式'
,
'buy_goods_not_data_tips'
=>
'没有商品'
,
);
?>
\ No newline at end of file
service/Application/Home/View/Default/Buy/Index.html
浏览文件 @
b76c0541
...
...
@@ -13,35 +13,35 @@
<include
file=
"Public/GoodsCategory"
/>
<!-- content -->
<div
class=
"am-container
category-list
"
>
<div
class=
"am-container"
>
<!-- 地址 -->
<div
class=
"link-list"
>
<div
class=
"address"
>
<div
class=
"control"
>
<h3>
确认收货地址
</h3>
<button
class=
"am-btn am-btn-danger am-btn-xs address-submit"
type=
"button"
data-url=
"{{:U('Home/UserAddress/SaveInfo')}}"
>
使用新地址
</button>
<notempty
name=
"user_address_list"
>
<button
class=
"am-btn am-btn-danger am-btn-xs address-submit-save"
type=
"button"
data-url=
"{{:U('Home/UserAddress/SaveInfo')}}"
>
使用新地址
</button>
</notempty>
</div>
<notempty
name=
"user_address_list"
>
<ul
class=
"address-list"
>
<foreach
name=
"user_address_list"
item=
"address"
>
<li
class=
"<if condition="
isset
($
address
['
is_default
'])
and
$
address
['
is_default
']
eq
1"
>
address-default
</if>
" id="data-list-{{$address.id}}">
<div
class=
"address-left"
>
<div
class=
"user
DefaultAddr
"
>
<div
class=
"user
-base
"
>
<span
class=
"buy-address-detail"
>
<span
class=
"buy-user"
>
{{$address.name}}
</span>
<span
class=
"buy-phone"
>
{{$address.tel}}
</span>
<span
class=
"buy-user"
>
{{$address.name}}
</span>
<span
class=
"buy-phone"
>
{{$address.tel}}
</span>
</span>
</div>
<div
class=
"default-address DefaultAddr"
>
<div>
<span
class=
"buy-line-title buy-line-title-type"
>
收货地址:
</span>
<span
class=
"buy--address-detail"
>
<span
class=
"province"
>
{{$address.province_name}}
</span>
<span
class=
"city"
>
{{$address.city_name}}
</span>
<span
class=
"dist"
>
{{$address.county_name}}
</span>
<span
class=
"street"
>
{{$address.address}}
</span>
</span>
<span
class=
"province"
>
{{$address.province_name}}
</span>
<span
class=
"city"
>
{{$address.city_name}}
</span>
<span
class=
"dist"
>
{{$address.county_name}}
</span>
<span
class=
"street"
>
{{$address.address}}
</span>
</span>
</div>
<if
condition=
"isset($address['is_default']) and $address['is_default'] eq 1"
>
...
...
@@ -49,13 +49,11 @@
</if>
</div>
<div
class=
"address-right"
>
<a
href=
"../person/address.html"
>
<span
class=
"am-icon-angle-right am-icon-lg"
></span>
</a>
<span
class=
"am-icon-angle-right am-icon-lg"
></span>
</div>
<div
class=
"new-addr-btn"
>
<a
href=
"
#"
class=
"hidden
"
>
设为默认
</a>
<span
class=
"new-addr-bar
hidden
"
>
|
</span>
<a
href=
"
javascript:;"
class=
"address-default-submit"
data-url=
"{{:U('Home/UserAddress/Default')}}"
data-id=
"{{$address.id}}
"
>
设为默认
</a>
<span
class=
"new-addr-bar"
>
|
</span>
<a
href=
"javascript:;"
class=
"address-submit-save"
data-url=
"{{:U('Home/UserAddress/SaveInfo', ['id'=>$address['id']])}}"
>
编辑
</a>
<span
class=
"new-addr-bar"
>
|
</span>
<a
href=
"javascript:;"
class=
"address-submit-delete"
data-url=
"{{:U('Home/UserAddress/Delete')}}"
data-id=
"{{$address.id}}"
>
删除
</a>
...
...
@@ -64,6 +62,12 @@
</foreach>
</ul>
</notempty>
<empty
name=
"user_address_list"
>
<div
class=
"table-no"
>
<i
class=
"am-icon-warning"
></i>
{{:L('buy_user_address_not_data_tips')}}
<button
class=
"am-btn am-btn-secondary am-btn-xs address-submit-save"
type=
"button"
data-url=
"{{:U('Home/UserAddress/SaveInfo')}}"
>
使用新地址
</button></div>
</empty>
</div>
<!-- 物流 -->
...
...
@@ -82,6 +86,9 @@
</foreach>
</ul>
</notempty>
<empty
name=
"express_list"
>
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
{{:L('buy_express_not_data_tips')}}
</div>
</empty>
</div>
<!-- 支付方式 -->
...
...
@@ -100,68 +107,76 @@
</foreach>
</ul>
</notempty>
<empty
name=
"payment_list"
>
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
{{:L('buy_payment_not_data_tips')}}
</div>
</empty>
</div>
<!--订单 -->
<div
class=
"
concent
"
>
<div
id=
"payT
able"
>
<div
class=
"
order-detail
"
>
<div
class=
"goods-t
able"
>
<h3>
确认订单信息
</h3>
<!-- 商品列表 -->
<table
class=
"am-table"
>
<thead>
<tr>
<th>
商品信息
</th>
<th
class=
"am-hide-sm-only"
>
单价
</th>
<th
class=
"am-hide-sm-only"
>
数量
</th>
<th
class=
"am-hide-sm-only"
>
金额
</th>
</tr>
</thead>
<tbody>
<foreach
name=
"goods_list"
item=
"goods"
>
<tr
id=
"data-list-{{$goods.id}}"
data-id=
"{{$goods.id}}"
data-goods-id=
"{{$goods.goods_id}}"
>
<td
class=
"base"
>
<div
class=
"goods-detail"
>
<a
href=
"{{$goods.goods_url}}"
target=
"_blank"
>
<img
src=
"{{$goods.images}}"
>
</a>
<div
class=
"goods-base"
>
<a
href=
"{{$goods.goods_url}}"
target=
"_blank"
class=
"goods-title"
>
{{$goods.title}}
</a>
<notempty
name=
"goods.attribute"
>
<ul
class=
"goods-attr"
>
<foreach
name=
"goods.attribute"
item=
"attr"
>
<li>
{{$attr.attr_type_name}}:{{$attr.attr_name}}
</li>
</foreach>
</ul>
</notempty>
<notempty
name=
"goods_list"
>
<table
class=
"am-table"
>
<thead>
<tr>
<th>
商品信息
</th>
<th
class=
"am-hide-sm-only"
>
单价
</th>
<th
class=
"am-hide-sm-only"
>
数量
</th>
<th
class=
"am-hide-sm-only"
>
金额
</th>
</tr>
</thead>
<tbody>
<foreach
name=
"goods_list"
item=
"goods"
>
<tr
id=
"data-list-{{$goods.id}}"
data-id=
"{{$goods.id}}"
data-goods-id=
"{{$goods.goods_id}}"
>
<td
class=
"base"
>
<div
class=
"goods-detail"
>
<a
href=
"{{$goods.goods_url}}"
target=
"_blank"
>
<img
src=
"{{$goods.images}}"
>
</a>
<div
class=
"goods-base"
>
<a
href=
"{{$goods.goods_url}}"
target=
"_blank"
class=
"goods-title"
>
{{$goods.title}}
</a>
<notempty
name=
"goods.attribute"
>
<ul
class=
"goods-attr"
>
<foreach
name=
"goods.attribute"
item=
"attr"
>
<li>
{{$attr.attr_type_name}}:{{$attr.attr_name}}
</li>
</foreach>
</ul>
</notempty>
</div>
</div>
</div>
<div
class=
"wap-base am-show-sm-only"
>
<div
class=
"wap-base am-show-sm-only"
>
<if
condition=
"$goods['original_price'] gt 0"
>
<span
class=
"original-price"
>
¥{{$goods.original_price}}
</span>
</if>
<strong
class=
"total-price-content"
>
¥{{$goods.price}}
</strong>
<span
class=
"wap-number"
>
x{{$goods.stock}}
</span>
</div>
</td>
<td
class=
"price am-hide-sm-only"
>
<if
condition=
"$goods['original_price'] gt 0"
>
<
span
class=
"original-price"
>
¥{{$goods.original_price}}
</span
>
<
p
class=
"original-price"
>
¥{{$goods.original_price}}
</p
>
</if>
<strong
class=
"total-price-content"
>
¥{{$goods.price}}
</strong>
<span
class=
"wap-number"
>
x{{$goods.stock}}
</span>
</div>
</td>
<td
class=
"price am-hide-sm-only"
>
<if
condition=
"$goods['original_price'] gt 0"
>
<p
class=
"original-price"
>
¥{{$goods.original_price}}
</p>
</if>
<p
class=
"line-price"
>
¥{{$goods.price}}
</p>
</td>
<td
class=
"number am-hide-sm-only"
>
{{$goods.stock}} {{$goods.inventory_unit}}
</td>
<td
class=
"total-price am-hide-sm-only"
>
<strong
class=
"total-price-content"
>
¥{{$goods.total_price}}
</strong>
</td>
</tr>
</foreach>
</tbody>
</table>
<p
class=
"line-price"
>
¥{{$goods.price}}
</p>
</td>
<td
class=
"number am-hide-sm-only"
>
{{$goods.stock}} {{$goods.inventory_unit}}
</td>
<td
class=
"total-price am-hide-sm-only"
>
<strong
class=
"total-price-content"
>
¥{{$goods.total_price}}
</strong>
</td>
</tr>
</foreach>
</tbody>
</table>
</notempty>
<empty
name=
"goods_list"
>
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
{{:L('buy_goods_not_data_tips')}}
</div>
</empty>
<!-- 留言 -->
<div
class=
"buy-message"
>
<!--留言-->
<div
class=
"order-extra"
>
<div
class=
"order-user-info"
>
<div
id=
"holyshit257"
class=
"memo"
>
...
...
@@ -171,22 +186,23 @@
</div>
</div>
</div>
<!--含运费小计 -->
<div
class=
"buy-point-discharge "
>
<p
class=
"price g_price "
>
<!-- 含运费小计 -->
<div
class=
"buy-point-discharge"
>
<p>
合计(含运费)
<span>
¥
</span><em
class=
"pay-sum"
>
{{$base.total_price}}
</em>
</p>
</div>
<!--信息 -->
<div
class=
"order-
go clearfix
"
>
<div
class=
"pay-confirm
clearfix
"
>
<!--
信息 -->
<div
class=
"order-
nav
"
>
<div
class=
"pay-confirm"
>
<div
class=
"box"
>
<div
tabindex=
"0"
class=
"realP
ay"
>
<em
class=
"t"
>
实付款:
</em>
<span
class=
"price
g_price
"
>
<span>
¥
</span>
<em
class=
"style-large-bold-red
"
>
{{$base.total_price}}
</em>
<div
class=
"base-real-p
ay"
>
<em>
实付款:
</em>
<span
class=
"price"
>
<span>
¥
</span>
<em
class=
"nav-total-price
"
>
{{$base.total_price}}
</em>
</span>
</div>
...
...
@@ -221,87 +237,16 @@
</div>
</div>
<div
id=
"holyshit269"
class=
"submitOrder
"
>
<div
class=
"nav-buy-submit
"
>
<div
class=
"go-btn-wrap"
>
<a
id=
"J_Go"
href=
"success.html"
class=
"btn-go"
tabindex=
"0
"
title=
"点击此按钮,提交订单"
>
提交订单
</a>
<a
href=
"javascript:;"
class=
"btn-go
"
title=
"点击此按钮,提交订单"
>
提交订单
</a>
</div>
</div>
<div
class=
"clear"
></div>
</div>
</div>
</div>
<div
class=
"clear"
></div>
</div>
</div>
<div
class=
"theme-popover-mask"
></div>
<div
class=
"theme-popover"
>
<!--标题 -->
<div
class=
"am-cf am-padding"
>
<div
class=
"am-fl am-cf"
><strong
class=
"am-text-danger am-text-lg"
>
新增地址
</strong>
/
<small>
Add address
</small></div>
</div>
<hr/>
<div
class=
"am-u-md-12"
>
<form
class=
"am-form am-form-horizontal"
>
<div
class=
"am-form-group"
>
<label
for=
"user-name"
class=
"am-form-label"
>
收货人
</label>
<div
class=
"am-form-content"
>
<input
type=
"text"
id=
"user-name"
placeholder=
"收货人"
>
</div>
</div>
<div
class=
"am-form-group"
>
<label
for=
"user-phone"
class=
"am-form-label"
>
手机号码
</label>
<div
class=
"am-form-content"
>
<input
id=
"user-phone"
placeholder=
"手机号必填"
type=
"email"
>
</div>
</div>
<div
class=
"am-form-group"
>
<label
for=
"user-phone"
class=
"am-form-label"
>
所在地
</label>
<div
class=
"am-form-content address"
>
<select
data-am-selected
>
<option
value=
"a"
>
浙江省
</option>
<option
value=
"b"
>
湖北省
</option>
</select>
<select
data-am-selected
>
<option
value=
"a"
>
温州市
</option>
<option
value=
"b"
>
武汉市
</option>
</select>
<select
data-am-selected
>
<option
value=
"a"
>
瑞安区
</option>
<option
value=
"b"
>
洪山区
</option>
</select>
</div>
</div>
<div
class=
"am-form-group"
>
<label
for=
"user-intro"
class=
"am-form-label"
>
详细地址
</label>
<div
class=
"am-form-content"
>
<textarea
class=
""
rows=
"3"
id=
"user-intro"
placeholder=
"输入详细地址"
></textarea>
<small>
100字以内写出你的详细地址...
</small>
</div>
</div>
<div
class=
"am-form-group theme-poptit"
>
<div
class=
"am-u-sm-9 am-u-sm-push-3"
>
<div
class=
"am-btn am-btn-danger"
>
保存
</div>
<div
class=
"am-btn am-btn-danger close"
>
取消
</div>
</div>
</div>
</form>
</div>
</div>
<!-- <notempty name="goods_category_list">
<else />
<div class="table-no"><i class="am-icon-warning"></i> {{:L('common_not_data_tips')}}</div>
</notempty> -->
</div>
<!-- footer start -->
...
...
service/Application/Home/View/Default/Cart/Index.html
浏览文件 @
b76c0541
...
...
@@ -124,10 +124,6 @@
</notempty>
</div>
<!-- 罩层 -->
<div
class=
"theme-popover-mask"
style=
"display:none;"
></div>
<!-- footer start -->
<include
file=
"Public/Footer"
/>
<!-- footer end -->
\ No newline at end of file
service/Application/Home/View/Default/UserAddress/SaveInfo.html
浏览文件 @
b76c0541
...
...
@@ -25,7 +25,7 @@
</span>
</div>
</div>
<div
id=
"map"
data-level=
"17"
class=
"am-form-group"
style=
"width: 100%; height: 260px;"
></div>
<div
id=
"map"
data-level=
"17"
class=
"am-form-group"
></div>
<div
class=
"am-form-group"
>
<label>
{{:L('useraddress_alias_text')}}
</label>
...
...
service/Application/Service/UserService.class.php
浏览文件 @
b76c0541
...
...
@@ -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
service/Public/Common/Css/Common.css
浏览文件 @
b76c0541
...
...
@@ -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
;
}
}
/**
...
...
service/Public/Common/Js/Common.js
浏览文件 @
b76c0541
...
...
@@ -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
));
});
/**
...
...
service/Public/Home/Default/Css/Buy.css
浏览文件 @
b76c0541
.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
(
4
n
)
{
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
(
2
n
)
{
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%
;
}
}
}
service/Public/Home/Default/Css/Common.css
浏览文件 @
b76c0541
...
...
@@ -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
:
10
99
;
margin
:
0px
auto
;
background
:
#fff
;
padding-top
:
5px
;
position
:
relative
;}
.nav-search
{
top
:
0
;
left
:
0
;
width
:
100%
;
z-index
:
10
60
;
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
:
37
2px
;
left
:
calc
(
50%
-
200px
);
top
:
calc
(
50%
-
186
px
);
margin-left
:
0
;
margin-top
:
0
;
}
.common-login-modal
{
max-width
:
400px
;
height
:
37
8px
;
left
:
calc
(
50%
-
200px
);
top
:
calc
(
50%
-
189
px
);
margin-left
:
0
;
margin-top
:
0
;
}
}
/**
...
...
service/Public/Home/Default/Css/UserAddress.css
浏览文件 @
b76c0541
.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
service/Public/Home/Default/Js/Buy.js
浏览文件 @
b76c0541
...
...
@@ -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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录