Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
83a0b731
ShopXO
项目概览
starsw001
/
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,发现更多精彩内容 >>
提交
83a0b731
编写于
7月 02, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
详情页面购买数量优化
上级
1ac70cf7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
50 addition
and
20 deletion
+50
-20
application/index/view/default/goods/index.html
application/index/view/default/goods/index.html
+2
-2
public/static/admin/default/css/order.css
public/static/admin/default/css/order.css
+4
-3
public/static/admin/default/images/sys-item-selected.gif
public/static/admin/default/images/sys-item-selected.gif
+0
-0
public/static/index/default/js/goods.js
public/static/index/default/js/goods.js
+44
-15
未找到文件。
application/index/view/default/goods/index.html
浏览文件 @
83a0b731
...
...
@@ -264,10 +264,10 @@
<dd>
<div
class=
"am-input-group am-input-group-sm number-tag"
>
<button
class=
"am-input-group-label"
id=
"min"
type=
"button"
>
-
</button>
<input
type=
"number"
class=
"am-form-field"
value=
"
1"
id=
"text_box"
min=
"1"
max=
"{{$goods.inventory
}}"
data-original-max=
"{{$goods.inventory}}"
/>
<input
type=
"number"
class=
"am-form-field"
value=
"
{{$goods.buy_min_number}}"
id=
"text_box"
min=
"{{$goods.buy_min_number}}"
max=
"{{if empty($goods['buy_max_number'])}}{{$goods.inventory}}{{else /}}{{$goods.buy_max_number}}{{/if
}}"
data-original-max=
"{{$goods.inventory}}"
/>
<button
class=
"am-input-group-label"
id=
"add"
type=
"button"
>
+
</button>
</div>
<span
class=
"tb-hidden stock-tips"
>
库存
<span
class=
"stock"
data-original-stock=
"{{$goods.inventory}}"
>
{{$goods.inventory}}
</span>
{{$goods.inventory_unit}}
</span>
<span
class=
"tb-hidden stock-tips"
>
库存
<span
class=
"stock"
data-original-stock=
"{{$goods.inventory}}"
data-min-limit=
"{{$goods.buy_min_number}}"
data-max-limit=
"{{$goods.buy_max_number}}"
data-unit=
"{{$goods.inventory_unit}}"
>
{{$goods.inventory}}
</span>
{{$goods.inventory_unit}}
</span>
</dd>
</div>
...
...
public/static/admin/default/css/order.css
浏览文件 @
83a0b731
...
...
@@ -39,7 +39,8 @@ form.am-form .am-form-group { padding-right: 5px; }
.business-item
ul
{
padding
:
10px
3px
5px
5px
;
overflow
:
hidden
;
}
.business-item
ul
li
{
border
:
1px
solid
transparent
;
overflow
:
hidden
;
float
:
left
;
cursor
:
pointer
;
padding
:
5px
;
border
:
1px
solid
#eee
;
margin
:
0
10px
10px
0
;
}
.business-item
ul
li
img
{
width
:
36px
;
height
:
36px
;
vertical-align
:
middle
;
}
.business-item
ul
li
.selected
{
border-color
:
#d2364c
;
position
:
relative
;
}
.business-item
ul
li
:hover
{
border
:
1px
solid
#d2364c
;
box-shadow
:
0px
0
0px
1px
#d2364c
;}
.business-item
ul
li
.selected
{
border-color
:
#d2364c
;
position
:
relative
;
box-shadow
:
0px
0
0px
1px
#d2364c
;
}
.business-item
ul
li
.selected
i
.icon-active
{
position
:
absolute
;
width
:
10px
;
height
:
10px
;
font-size
:
0
;
line-height
:
0
;
right
:
0px
;
bottom
:
0px
;
background
:
url(../images/sys-item-selected.gif)
no-repeat
right
bottom
;
}
@media
only
screen
and
(
min-width
:
640px
)
{
.business-item
ul
li
{
width
:
calc
(
33%
-
5px
);
}
...
...
@@ -60,6 +61,6 @@ form.am-form .am-form-group { padding-right: 5px; }
}
.content-right
ul
{
list-style
:
none
;
padding
:
0
;
margin
:
0
;
padding
:
1px
;
margin
:
10px
0
0
0
;
}
\ No newline at end of file
public/static/admin/default/images/sys
_item_
selected.gif
→
public/static/admin/default/images/sys
-item-
selected.gif
浏览文件 @
83a0b731
文件已移动
public/static/index/default/js/goods.js
浏览文件 @
83a0b731
...
...
@@ -111,10 +111,24 @@ function CartAdd(e)
{
// 参数
var
type
=
e
.
attr
(
'
data-type
'
);
var
stock
=
$
(
'
#text_box
'
).
val
()
||
0
;
if
(
stock
<=
0
||
stock
<
1
)
var
stock
=
parseInt
(
$
(
'
#text_box
'
).
val
())
||
1
;
var
inventory
=
parseInt
(
$
(
'
.stock-tips .stock
'
).
text
());
var
min
=
$
(
'
.stock-tips .stock
'
).
data
(
'
min-limit
'
)
||
1
;
var
max
=
$
(
'
.stock-tips .stock
'
).
data
(
'
max-limit
'
)
||
0
;
var
unit
=
$
(
'
.stock-tips .stock
'
).
data
(
'
unit
'
)
||
''
;
if
(
stock
<
min
)
{
PromptCenter
(
'
购买数量有误
'
);
PromptCenter
(
'
最低起购数量
'
+
min
+
unit
);
return
false
;
}
if
(
max
>
0
&&
stock
>
max
)
{
PromptCenter
(
'
最大限购数量
'
+
max
+
unit
);
return
false
;
}
if
(
stock
>
inventory
)
{
PromptCenter
(
'
库存数量
'
+
inventory
+
unit
);
return
false
;
}
...
...
@@ -375,7 +389,7 @@ $(function() {
$
(
this
).
find
(
'
ul>li
'
).
on
(
'
click
'
,
function
()
{
// 切换规格购买数量清空
$
(
'
#text_box
'
).
val
(
1
);
$
(
'
#text_box
'
).
val
(
$
(
'
.stock-tips .stock
'
).
data
(
'
min-limit
'
)
||
1
);
// 规格处理
var
length
=
$
(
'
.theme-signin-left .sku-items
'
).
length
;
...
...
@@ -574,23 +588,38 @@ $(function() {
});
//获得文本框对象
var
t
=
$
(
'
#text_box
'
);
var
$sotck
=
$
(
'
#text_box
'
);
var
min
=
$
(
'
.stock-tips .stock
'
).
data
(
'
min-limit
'
)
||
1
;
var
max
=
$
(
'
.stock-tips .stock
'
).
data
(
'
max-limit
'
)
||
0
;
var
unit
=
$
(
'
.stock-tips .stock
'
).
data
(
'
unit
'
)
||
''
;
//数量增加操作
$
(
'
#add
'
).
on
(
'
click
'
,
function
()
{
var
stock
=
parseInt
(
$
(
'
.stock-tips .stock
'
).
text
());
var
number
=
parseInt
(
t
.
val
());
if
(
number
<
stock
)
$
(
'
#add
'
).
on
(
'
click
'
,
function
()
{
var
inventory
=
parseInt
(
$
(
'
.stock-tips .stock
'
).
text
());
var
number
=
parseInt
(
$sotck
.
val
())
+
1
;
if
(
max
>
0
&&
number
>
max
)
{
t
.
val
(
number
+
1
)
}
else
{
Prompt
(
'
超出库存数量
'
);
Prompt
(
'
最大限购数量
'
+
max
+
unit
);
return
false
;
}
if
(
number
>
inventory
)
{
Prompt
(
'
库存数量
'
+
inventory
+
unit
);
return
false
;
}
$sotck
.
val
(
number
);
});
//数量减少操作
$
(
'
#min
'
).
on
(
'
click
'
,
function
()
{
var
value
=
parseInt
(
t
.
val
())
-
1
||
1
;
t
.
val
((
value
<=
1
)
?
1
:
value
);
$
(
'
#min
'
).
on
(
'
click
'
,
function
()
{
var
value
=
parseInt
(
$sotckt
.
val
())
-
1
||
1
;
if
(
value
<
min
)
{
Prompt
(
'
最低起购数量
'
+
min
+
unit
);
return
false
;
}
$sotck
.
val
(
value
);
});
// 评论
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录