Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
6a419a66
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,发现更多精彩内容 >>
提交
6a419a66
编写于
12月 25, 2018
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
goods
上级
7790be58
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
182 addition
and
119 deletion
+182
-119
application/admin/view/default/goods/save_info.html
application/admin/view/default/goods/save_info.html
+105
-112
application/admin/view/default/public/header.html
application/admin/view/default/public/header.html
+3
-0
public/static/admin/default/css/goods.css
public/static/admin/default/css/goods.css
+14
-2
public/static/admin/default/js/goods.js
public/static/admin/default/js/goods.js
+60
-5
未找到文件。
application/admin/view/default/goods/save_info.html
浏览文件 @
6a419a66
...
...
@@ -153,124 +153,117 @@
</div>
<!-- 规格 -->
<div
id=
"goods-nav-operations"
class=
"division-block
goods-specifications
"
>
<div
id=
"goods-nav-operations"
class=
"division-block"
>
<label
class=
"block nav-detail-title"
>
商品规格
</label>
<span
class=
"business-operations-submit specifications-nav-title-add"
>
+添加规格
</span>
<div
class=
"spec-images-tips"
>
<label
class=
"am-checkbox c-p"
>
<input
type=
"checkbox"
value=
"1"
data-am-ucheck
/>
<span
class=
"fs-12"
>
首个规格选择添加图片
</span>
</label>
</div>
<table
class=
"am-table am-table-bordered am-table-centered specifications-table m-t-10 m-b-10"
>
<thead
class=
"title-nav"
>
<tr>
{{if !empty($specifications['type'])}}
{{foreach $specifications.type as $type_v}}
<th
class=
"table-title table-title-{{$type_v.id}}"
>
<i
class=
"am-close am-close-spin title-nav-remove"
data-index=
"{{$type_v.id}}"
>
×
</i>
<input
type=
"text"
name=
"specifications_name_{{$type_v.id}}"
placeholder=
"规格名"
value=
"{{$type_v.name}}"
/>
</th>
{{/foreach}}
{{/if}}
<th
class=
"title-start"
>
价格(元)
</th>
<th>
库存
</th>
<th>
规格编码
</th>
<th>
条形码
</th>
<th>
原价(元)
</th>
<th
class=
"operation-btn"
>
操作
</th>
</tr>
</thead>
<tbody>
{{if empty($specifications['value'])}}
<div
class=
"goods-specifications"
>
<div
class=
"spec-images-tips"
>
<label
class=
"am-checkbox c-p"
>
<input
type=
"checkbox"
value=
"1"
data-am-ucheck
/>
<span
class=
"fs-12 msg-tips"
>
首个规格选择添加图片
</span>
</label>
</div>
<table
class=
"am-table am-table-bordered am-table-centered specifications-table m-t-10 m-b-10"
>
<thead
class=
"title-nav"
>
<tr>
<td
class=
"value-start"
>
<input
type=
"text"
name=
"specifications_price[]"
placeholder=
"价格"
class=
"am-radius"
pattern=
"^([0-9]{1}\d{0,6})(\.\d{1,2})?$"
data-validation-message=
"请填写有效的销售金额"
required
/>
</td>
<td>
<input
type=
"number"
name=
"specifications_number[]"
placeholder=
"库存"
class=
"am-radius"
min=
"1"
max=
"100000000"
pattern=
"^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$"
data-validation-message=
"库存数量 1~100000000"
required
/>
</td>
<td>
<input
type=
"text"
name=
"specifications_coding[]"
placeholder=
"规格编码"
class=
"am-radius"
maxlength=
"80"
data-validation-message=
"规格编码最多80个字符"
/>
</td>
<td>
<input
type=
"text"
name=
"specifications_barcode[]"
placeholder=
"条形码"
class=
"am-radius"
maxlength=
"80"
data-validation-message=
"条形码最多80个字符"
/>
</td>
<td>
<input
type=
"text"
name=
"specifications_original_price[]"
placeholder=
"原价"
class=
"am-radius"
pattern=
"^([0-9]{1}\d{0,6})(\.\d{1,2})?$"
data-validation-message=
"请填写有效的销售金额"
/>
</td>
<td>
<!--operation-->
</td>
{{if !empty($specifications['type'])}}
{{foreach $specifications.type as $type_v}}
<th
class=
"table-title table-title-{{$type_v.id}}"
>
<i
class=
"am-close am-close-spin title-nav-remove"
data-index=
"{{$type_v.id}}"
>
×
</i>
<input
type=
"text"
name=
"specifications_name_{{$type_v.id}}"
placeholder=
"规格名"
value=
"{{$type_v.name}}"
/>
</th>
{{/foreach}}
{{/if}}
<th
class=
"title-start"
>
价格(元)
</th>
<th>
库存
</th>
<th>
规格编码
</th>
<th>
条形码
</th>
<th>
原价(元)
</th>
<th
class=
"operation-btn"
>
操作
</th>
</tr>
{{/if}}
</thead>
<tbody>
{{if empty($specifications['value'])}}
<tr>
<td
class=
"value-start"
>
<input
type=
"text"
name=
"specifications_price[]"
placeholder=
"价格"
class=
"am-radius"
pattern=
"^([0-9]{1}\d{0,6})(\.\d{1,2})?$"
data-validation-message=
"请填写有效的销售金额"
required
/>
</td>
<td>
<input
type=
"number"
name=
"specifications_number[]"
placeholder=
"库存"
class=
"am-radius"
min=
"1"
max=
"100000000"
pattern=
"^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$"
data-validation-message=
"库存数量 1~100000000"
required
/>
</td>
<td>
<input
type=
"text"
name=
"specifications_coding[]"
placeholder=
"规格编码"
class=
"am-radius"
maxlength=
"80"
data-validation-message=
"规格编码最多80个字符"
/>
</td>
<td>
<input
type=
"text"
name=
"specifications_barcode[]"
placeholder=
"条形码"
class=
"am-radius"
maxlength=
"80"
data-validation-message=
"条形码最多80个字符"
/>
</td>
<td>
<input
type=
"text"
name=
"specifications_original_price[]"
placeholder=
"原价"
class=
"am-radius"
pattern=
"^([0-9]{1}\d{0,6})(\.\d{1,2})?$"
data-validation-message=
"请填写有效的销售金额"
/>
</td>
<td>
<!--operation-->
</td>
</tr>
{{/if}}
{{if !empty($specifications['value'])}}
{{foreach $specifications.value as $line_k=>$line_v}}
<tr
{{
if
$
line_k
gt
0}}
class=
"line-not-first"
{{/
if
}}
>
{{foreach $line_v as $v}}
{{if isset($v['data_type'])}}
{{switch v.data_type}}
{{case spec}}
<td
class=
"table-value table-value-{{$v.data.key}}"
>
<input
type=
"text"
name=
"specifications_value_{{$v.data.key}}[]"
placeholder=
"规格值"
value=
"{{$v.data.value}}"
/>
</td>
{{/case}}
{{if !empty($specifications['value'])}}
{{foreach $specifications.value as $line_k=>$line_v}}
<tr
{{
if
$
line_k
gt
0}}
class=
"line-not-first"
{{/
if
}}
>
{{foreach $line_v as $v}}
{{if isset($v['data_type'])}}
{{switch v.data_type}}
{{case spec}}
<td
class=
"table-value table-value-{{$v.data.key}}"
>
<input
type=
"text"
name=
"specifications_value_{{$v.data.key}}[]"
placeholder=
"规格值"
value=
"{{$v.data.value}}"
/>
</td>
{{/case}}
{{case base}}
<td
class=
"value-start"
>
<input
type=
"text"
name=
"specifications_price[]"
placeholder=
"价格"
class=
"am-radius"
pattern=
"^([0-9]{1}\d{0,6})(\.\d{1,2})?$"
data-validation-message=
"请填写有效的销售金额"
value=
"{{$v.data.price}}"
required
/>
</td>
<td>
<input
type=
"number"
name=
"specifications_number[]"
placeholder=
"库存"
class=
"am-radius"
min=
"0"
max=
"100000000"
data-validation-message=
"库存数量 0~100000000"
value=
"{{$v.data.inventory}}"
required
/>
</td>
<td>
<input
type=
"text"
name=
"specifications_coding[]"
placeholder=
"规格编码"
class=
"am-radius"
maxlength=
"80"
data-validation-message=
"规格编码最多80个字符"
value=
"{{$v.data.coding}}"
/>
</td>
<td>
<input
type=
"text"
name=
"specifications_barcode[]"
placeholder=
"条形码"
class=
"am-radius"
maxlength=
"80"
data-validation-message=
"条形码最多80个字符"
value=
"{{$v.data.barcode}}"
/>
</td>
<td>
<input
type=
"text"
name=
"specifications_original_price[]"
placeholder=
"原价"
class=
"am-radius"
pattern=
"^([0-9]{1}\d{0,6})(\.\d{1,2})?$"
data-validation-message=
"请填写有效的销售金额"
value=
"{{if $v['data']['original_price'] gt 0}}{{$v.data.original_price}}{{/if}}"
/>
</td>
<td>
{{if $line_k gt 0}}
<span
class=
"fs-12 cr-blue c-p m-r-5 line-copy"
>
复制
</span>
<span
class=
"fs-12 cr-red c-p line-remove"
>
移除
</span>
{{else /}}
<!--operation-->
{{/if}}
</td>
{{/case}}
{{/switch}}
{{/if}}
{{case base}}
<td
class=
"value-start"
>
<input
type=
"text"
name=
"specifications_price[]"
placeholder=
"价格"
class=
"am-radius"
pattern=
"^([0-9]{1}\d{0,6})(\.\d{1,2})?$"
data-validation-message=
"请填写有效的销售金额"
value=
"{{$v.data.price}}"
required
/>
</td>
<td>
<input
type=
"number"
name=
"specifications_number[]"
placeholder=
"库存"
class=
"am-radius"
min=
"0"
max=
"100000000"
data-validation-message=
"库存数量 0~100000000"
value=
"{{$v.data.inventory}}"
required
/>
</td>
<td>
<input
type=
"text"
name=
"specifications_coding[]"
placeholder=
"规格编码"
class=
"am-radius"
maxlength=
"80"
data-validation-message=
"规格编码最多80个字符"
value=
"{{$v.data.coding}}"
/>
</td>
<td>
<input
type=
"text"
name=
"specifications_barcode[]"
placeholder=
"条形码"
class=
"am-radius"
maxlength=
"80"
data-validation-message=
"条形码最多80个字符"
value=
"{{$v.data.barcode}}"
/>
</td>
<td>
<input
type=
"text"
name=
"specifications_original_price[]"
placeholder=
"原价"
class=
"am-radius"
pattern=
"^([0-9]{1}\d{0,6})(\.\d{1,2})?$"
data-validation-message=
"请填写有效的销售金额"
value=
"{{if $v['data']['original_price'] gt 0}}{{$v.data.original_price}}{{/if}}"
/>
</td>
<td>
{{if $line_k gt 0}}
<span
class=
"fs-12 cr-blue c-p m-r-5 line-copy"
>
复制
</span>
<span
class=
"fs-12 cr-red c-p line-remove"
>
移除
</span>
{{else /}}
<!--operation-->
{{/if}}
</td>
{{/case}}
{{/switch}}
{{/if}}
{{/foreach}}
</tr>
{{/foreach}}
</tr>
{{/foreach}}
{{/if}}
</tbody>
</table>
<span
class=
"business-operations-submit specifications-line-add"
>
+添加一行
</span>
<ul
class=
"spec-images-list"
>
<li>
<ul
class=
"plug-file-upload-view spec-images-view"
data-form-name=
"spec_images[]"
data-max-number=
"1"
data-dialog-type=
"images"
>
<li>
<input
type=
"hidden"
name=
"spec_images[]"
value=
""
/>
<img
src=
"{{$image_host}}/static/admin/default/images/default-images.png"
/>
</li>
</ul>
<div
class=
"plug-file-upload-submit"
data-view-tag=
"ul.spec-images-view"
>
+上传图片
</div>
</li>
<li>
<ul
class=
"plug-file-upload-view spec-images-view"
data-form-name=
"spec_images[]"
data-max-number=
"1"
data-dialog-type=
"images"
>
<li>
<input
type=
"hidden"
name=
"spec_images[]"
value=
""
/>
<img
src=
"{{$image_host}}/static/admin/default/images/default-images.png"
/>
</li>
</ul>
<div
class=
"plug-file-upload-submit"
data-view-tag=
"ul.spec-images-view"
>
+上传图片
</div>
</li>
</ul>
{{/if}}
</tbody>
</table>
<span
class=
"business-operations-submit specifications-nav-title-add"
>
+添加规格
</span>
<span
class=
"business-operations-submit specifications-line-add"
>
+添加一行
</span>
<ul
class=
"spec-images-list"
>
<!-- <li>
<ul class="plug-file-upload-view spec-images-view" data-form-name="spec_images[]" data-max-number="1" data-delete='0' data-dialog-type="images">
<li>
<input type="hidden" name="spec_images[]" value="" />
<img src="{{$image_host}}/static/admin/default/images/default-images.png" />
</li>
</ul>
<div class="plug-file-upload-submit" data-view-tag="ul.spec-images-view">+上传图片</div>
</li> -->
</ul>
</div>
</div>
<!-- 相册 -->
...
...
application/admin/view/default/public/header.html
浏览文件 @
6a419a66
...
...
@@ -16,4 +16,7 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{$Think.__MY_ROOT__}}static/{{$module_css}}"
/>
{{/if}}
</head>
<script
type=
"text/javascript"
>
var
__image_host__
=
'
{{$image_host}}
'
;
</script>
<body>
\ No newline at end of file
public/static/admin/default/css/goods.css
浏览文件 @
6a419a66
...
...
@@ -66,8 +66,8 @@
}
.spec-images-tips
{
position
:
absolute
;
left
:
100
px
;
top
:
6
0px
;
left
:
9
px
;
top
:
3
0px
;
z-index
:
2
;
padding
:
2px
5px
;
white-space
:
nowrap
;
...
...
@@ -101,10 +101,20 @@
.spec-images-tips
.am-checkbox
{
margin
:
0px
;
min-height
:
auto
;
height
:
15px
;
line-height
:
15px
;
}
.spec-images-tips
.am-ucheck-icons
{
width
:
15px
;
height
:
15px
;
line-height
:
15px
;
}
.spec-images-tips
.am-checkbox
input
[
type
=
"checkbox"
]
{
margin
:
0
0
0
-4px
;
}
.spec-images-tips
.msg-tips
{
vertical-align
:
super
;
}
.spec-images-list
{
border
:
1px
solid
#eee
;
padding
:
10px
;
...
...
@@ -112,6 +122,8 @@
}
.spec-images-list
li
{
display
:
inline-block
;
width
:
100px
;
margin
:
0
10px
3px
0
;
}
/**
...
...
public/static/admin/default/js/goods.js
浏览文件 @
6a419a66
...
...
@@ -29,6 +29,9 @@ $(function()
html
+=
'
<input type="text" name="specifications_value_
'
+
index
+
'
[]" placeholder="规格值" />
'
;
html
+=
'
</td>
'
;
$
(
'
.value-start
'
).
before
(
html
);
// 规格图片
SpecImagesHandle
();
});
// 规格列移除
...
...
@@ -42,6 +45,9 @@ $(function()
{
$
(
'
.specifications-table tr.line-not-first
'
).
remove
();
}
// 规格图片
SpecImagesHandle
();
});
// 添加一行规格值
...
...
@@ -66,6 +72,9 @@ $(function()
{
$
(
this
).
attr
(
'
value
'
,
''
);
});
// 规格图片
SpecImagesHandle
();
});
// 规格行复制
...
...
@@ -77,6 +86,9 @@ $(function()
$
(
this
).
attr
(
'
value
'
,
$
(
this
).
val
());
});
$parent
.
after
(
$parent
.
prop
(
'
outerHTML
'
));
// 规格图片
SpecImagesHandle
();
});
// 规格行移除
...
...
@@ -89,19 +101,62 @@ $(function()
$
(
'
.specifications-table th.table-title
'
).
remove
();
$
(
'
.specifications-table td.table-value
'
).
remove
();
}
// 规格图片
SpecImagesHandle
();
});
// 规格首列事件
$
(
'
.spec-images-tips
'
).
on
(
'
change
'
,
'
input
'
,
function
()
{
if
(
$
(
this
).
prop
(
'
checked
'
))
// 规格图片
SpecImagesHandle
();
});
// 规格第一列输入事件
$
(
'
.specifications-table tbody tr
'
).
on
(
'
change
'
,
'
td:eq(0) input
'
,
function
()
{
// 规格图片
SpecImagesHandle
();
});
// 规格图片
function
SpecImagesHandle
()
{
if
(
$
(
'
.spec-images-tips input
'
).
prop
(
'
checked
'
))
{
console
.
log
(
1
);
var
temp_spec_all
=
{},
spec_all
=
[];
$
(
'
.specifications-table tbody tr
'
).
each
(
function
(
k
,
v
)
{
var
value
=
$
(
this
).
find
(
'
td:eq(0) input
'
).
val
();
temp_spec_all
[
value
]
=
value
;
});
spec_all
=
Object
.
keys
(
temp_spec_all
);
if
(
spec_all
.
length
>
0
)
{
for
(
var
i
in
spec_all
)
{
var
temp_class
=
'
spec-images-items-
'
+
spec_all
[
i
];
if
(
$
(
'
ul.spec-images-list
'
).
find
(
'
.
'
+
temp_class
).
length
<=
0
)
{
var
html
=
'
<li class="
'
+
temp_class
+
'
">
'
;
html
+=
'
<input type="text" value="
'
+
spec_all
[
i
]
+
'
" disabled="disabled" />
'
html
+=
'
<ul class="plug-file-upload-view spec-images-view-
'
+
spec_all
[
i
]
+
'
" data-form-name="spec_images[]" data-max-number="1" data-delete="0" data-dialog-type="images">
'
;
html
+=
'
<li>
'
;
html
+=
'
<input type="hidden" name="spec_images[]" value="" />
'
;
html
+=
'
<img src="
'
+
__image_host__
+
'
/static/admin/default/images/default-images.png" />
'
;
html
+=
'
</li>
'
;
html
+=
'
</ul>
'
;
html
+=
'
<div class="plug-file-upload-submit" data-view-tag="ul.spec-images-view-
'
+
spec_all
[
i
]
+
'
">+上传图片</div>
'
;
html
+=
'
</li>
'
;
$
(
'
ul.spec-images-list
'
).
append
(
html
);
}
}
}
}
else
{
console
.
log
(
0
);
$
(
'
ul.spec-images-list
'
).
html
(
''
);
}
});
}
// 手机详情添加
$
(
document
).
on
(
'
click
'
,
'
.content-app-items-add-sub
'
,
function
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录