Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
5c9178a7
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5c9178a7
编写于
8月 29, 2022
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
url替换方法支持锚点,下单确认页面业务选择自动定位锚点
上级
2cff734c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
17 deletion
+33
-17
app/index/view/default/buy/index.html
app/index/view/default/buy/index.html
+4
-4
public/static/common/js/common.js
public/static/common/js/common.js
+15
-5
public/static/index/default/js/buy.js
public/static/index/default/js/buy.js
+14
-8
未找到文件。
app/index/view/default/buy/index.html
浏览文件 @
5c9178a7
...
...
@@ -47,7 +47,7 @@
<!-- 销售+自提 -->
{{if $common_site_type eq 4}}
<div
data-am-widget=
"tabs"
class=
"am-tabs am-tabs-d2 buy-header-nav"
>
<div
id=
"buy-items-tabs"
data-am-widget=
"tabs"
class=
"am-tabs am-tabs-d2 buy-header-nav"
>
<ul
class=
"am-tabs-nav am-cf"
>
<li
{{
if
isset
($
base
['
site_model
'])
and
$
base
['
site_model
']
eq
0}}
class=
"am-active"
{{/
if
}}
><a
href=
"javascript:;"
data-value=
"0"
>
快递邮寄
</a></li>
<li
{{
if
isset
($
base
['
site_model
'])
and
$
base
['
site_model
']
eq
2}}
class=
"am-active"
{{/
if
}}
><a
href=
"javascript:;"
data-value=
"2"
>
自提点取货
</a></li>
...
...
@@ -57,7 +57,7 @@
<!-- 快递 - 用户地址 -->
{{if isset($base['site_model']) and $base['site_model'] eq 0}}
<div
class=
"address user-address-container"
>
<div
id=
"buy-items-address"
class=
"address user-address-container"
>
<div
class=
"control"
>
<h3>
确认收货地址
...
...
@@ -118,7 +118,7 @@
<!-- 自提点 - 自提地址 -->
{{if isset($base['site_model']) and $base['site_model'] eq 2}}
<div
class=
"address extraction-address-container"
>
<div
id=
"buy-items-address"
class=
"address extraction-address-container"
>
<div
class=
"control"
>
<h3>
确认自提点地址
</h3>
{{if !empty($base['address'])}}
...
...
@@ -522,7 +522,7 @@
<!-- 支付方式 -->
{{if $base['actual_price'] gt 0 and $common_order_is_booking neq 1}}
<div
class=
"buy-items business-item payment"
data-field=
"payment_id"
>
<div
id=
"buy-items-payment"
class=
"buy-items business-item payment"
data-field=
"payment_id"
>
<h3>
选择支付
</h3>
{{if !empty($payment_list)}}
<ul
class=
"payment-list"
>
...
...
public/static/common/js/common.js
浏览文件 @
5c9178a7
...
...
@@ -1508,20 +1508,30 @@ function FullscreenEscEvent()
* @param {[string]} field [字段名称]
* @param {[string]} value [字段值, null 则去除字段]
* @param {[string]} url [自定义url]
* @param {[string]} anchor[锚点、传入空字符串则表示去除已存在的锚点]
*/
function
UrlFieldReplace
(
field
,
value
,
url
)
function
UrlFieldReplace
(
field
,
value
,
url
=
null
,
anchor
=
null
)
{
// 当前页面url地址
url
=
url
||
window
.
location
.
href
;
// 锚点
var
anchor
=
''
;
if
(
url
.
indexOf
(
'
#
'
)
>=
0
)
if
(
url
.
indexOf
(
'
#
'
)
!=
-
1
)
{
anchor
=
url
.
substr
(
url
.
indexOf
(
'
#
'
));
url
=
url
.
substr
(
0
,
url
.
indexOf
(
'
#
'
));
var
temp_url
=
url
.
split
(
'
#
'
);
url
=
temp_url
[
0
];
// 未指定锚点则使用url自带的
if
(
temp_url
.
length
>
1
&&
anchor
===
null
)
{
anchor
=
temp_url
[
1
];
}
}
if
((
anchor
||
null
)
!=
null
&&
anchor
.
indexOf
(
'
#
'
)
==
-
1
)
{
anchor
=
'
#
'
+
anchor
;
}
// 是否存在问号参数
if
(
url
.
indexOf
(
'
?
'
)
>=
0
)
{
var
str
=
url
.
substr
(
0
,
url
.
lastIndexOf
(
'
.
'
+
__seo_url_suffix__
));
...
...
public/static/index/default/js/buy.js
浏览文件 @
5c9178a7
...
...
@@ -17,7 +17,8 @@ $(function()
if
(
store_address_use_status
<
$
(
'
ul.address-list li
'
).
length
)
{
store
.
set
(
store_use_new_address_status_key
,
undefined
);
window
.
location
.
href
=
UrlFieldReplace
(
'
address_id
'
,
$
(
'
ul.address-list li:first
'
).
data
(
'
value
'
));
var
anchor
=
$
(
'
.address
'
).
attr
(
'
id
'
)
||
''
;
window
.
location
.
href
=
UrlFieldReplace
(
'
address_id
'
,
$
(
'
ul.address-list li:first
'
).
data
(
'
value
'
),
null
,
anchor
);
}
}
}
...
...
@@ -34,15 +35,16 @@ $(function()
e
.
stopPropagation
();
}
}
else
{
// 底部地址同步
window
.
location
.
href
=
UrlFieldReplace
(
'
address_id
'
,
$
(
this
).
data
(
'
value
'
));
var
anchor
=
$
(
this
).
parents
(
'
.address
'
).
attr
(
'
id
'
)
||
''
;
window
.
location
.
href
=
UrlFieldReplace
(
'
address_id
'
,
$
(
this
).
data
(
'
value
'
)
,
null
,
anchor
);
}
});
// 手机模式下选择地址
$
(
'
.address
'
).
on
(
'
click
'
,
'
ul.address-list li
'
,
function
()
{
window
.
location
.
href
=
UrlFieldReplace
(
'
address_id
'
,
$
(
this
).
data
(
'
value
'
));
var
anchor
=
$
(
this
).
parents
(
'
.address
'
).
attr
(
'
id
'
)
||
''
;
window
.
location
.
href
=
UrlFieldReplace
(
'
address_id
'
,
$
(
this
).
data
(
'
value
'
),
null
,
anchor
);
});
// 手机模式下关闭地址选中
...
...
@@ -62,11 +64,13 @@ $(function()
// 混合列表选择
$
(
'
.business-item ul li
'
).
on
(
'
click
'
,
function
()
{
var
field
=
$
(
this
).
parents
(
'
.business-item
'
).
data
(
'
field
'
)
||
null
;
var
$parent
=
$
(
this
).
parents
(
'
.business-item
'
);
var
field
=
$parent
.
data
(
'
field
'
)
||
null
;
var
value
=
$
(
this
).
data
(
'
value
'
)
||
null
;
if
(
field
!=
null
&&
value
!=
null
)
{
window
.
location
.
href
=
UrlFieldReplace
(
field
,
value
);
var
anchor
=
$parent
.
attr
(
'
id
'
)
||
''
;
window
.
location
.
href
=
UrlFieldReplace
(
field
,
value
,
null
,
anchor
);
}
});
...
...
@@ -125,7 +129,8 @@ $(function()
$extraction_popup
=
$
(
'
#extraction-address-popup
'
);
$extraction_popup
.
find
(
'
.extraction-address-item button
'
).
on
(
'
click
'
,
function
()
{
window
.
location
.
href
=
UrlFieldReplace
(
'
address_id
'
,
$
(
this
).
data
(
'
value
'
));
var
anchor
=
$
(
this
).
parents
(
'
.address
'
).
attr
(
'
id
'
)
||
''
;
window
.
location
.
href
=
UrlFieldReplace
(
'
address_id
'
,
$
(
this
).
data
(
'
value
'
),
null
,
anchor
);
});
$
(
'
.extraction-default .extraction-address-item
'
).
on
(
'
click
'
,
function
(
e
)
{
...
...
@@ -140,6 +145,7 @@ $(function()
{
var
value
=
$
(
this
).
data
(
'
value
'
)
||
0
;
var
url
=
UrlFieldReplace
(
'
address_id
'
,
null
);
window
.
location
.
href
=
UrlFieldReplace
(
'
site_model
'
,
value
,
url
);
var
anchor
=
$
(
this
).
parents
(
'
.buy-header-nav
'
).
attr
(
'
id
'
)
||
''
;
window
.
location
.
href
=
UrlFieldReplace
(
'
site_model
'
,
value
,
url
,
anchor
);
});
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录