Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
bc233a4b
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 搜索 >>
提交
bc233a4b
编写于
5月 27, 2021
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
价格正则增加到8位数
上级
ed768ae8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
7 deletion
+13
-7
application/admin/controller/Common.php
application/admin/controller/Common.php
+3
-0
application/admin/view/default/goods/spec.html
application/admin/view/default/goods/spec.html
+6
-6
application/index/controller/Common.php
application/index/controller/Common.php
+3
-0
application/lang/zh-cn.php
application/lang/zh-cn.php
+1
-1
未找到文件。
application/admin/controller/Common.php
浏览文件 @
bc233a4b
...
...
@@ -244,6 +244,9 @@ class Common extends Controller
$module_js
.
=
file_exists
(
ROOT_PATH
.
'static'
.
DS
.
$module_js
.
'.'
.
$this
->
action_name
.
'.js'
)
?
'.'
.
$this
->
action_name
.
'.js'
:
'.js'
;
$this
->
assign
(
'module_js'
,
file_exists
(
ROOT_PATH
.
'static'
.
DS
.
$module_js
)
?
$module_js
:
''
);
// 价格正则
$this
->
assign
(
'default_price_regex'
,
lang
(
'common_regex_price'
));
// 附件host地址
$this
->
assign
(
'attachment_host'
,
config
(
'shopxo.attachment_host'
));
...
...
application/admin/view/default/goods/spec.html
浏览文件 @
bc233a4b
...
...
@@ -91,7 +91,7 @@
{{if empty($specifications['value'])}}
<tr
class=
"line-0"
data-line-tag=
".line-0"
>
<td
class=
"am-text-middle 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
/>
<input
type=
"text"
name=
"specifications_price[]"
placeholder=
"价格"
class=
"am-radius"
pattern=
"
{{$default_price_regex}}
"
data-validation-message=
"请填写有效的销售金额"
required
/>
</td>
<td
class=
"am-text-middle"
>
<input
type=
"number"
name=
"specifications_weight[]"
placeholder=
"重量"
class=
"am-radius"
maxlength=
"80"
min=
"0.00"
max=
"100000000.00"
step=
"0.01"
data-validation-message=
"规格重量 0.00~100000000.00"
/>
...
...
@@ -103,7 +103,7 @@
<input
type=
"text"
name=
"specifications_barcode[]"
placeholder=
"条形码"
class=
"am-radius"
maxlength=
"80"
data-validation-message=
"条形码最多80个字符"
/>
</td>
<td
class=
"am-text-middle"
>
<input
type=
"text"
name=
"specifications_original_price[]"
placeholder=
"原价"
class=
"am-radius"
pattern=
"
^([0-9]{1}\d{0,6})(\.\d{1,2})?$
"
data-validation-message=
"请填写有效的原价"
/>
<input
type=
"text"
name=
"specifications_original_price[]"
placeholder=
"原价"
class=
"am-radius"
pattern=
"
{{$default_price_regex}}
"
data-validation-message=
"请填写有效的原价"
/>
</td>
<td
class=
"am-text-middle"
>
<input
type=
"hidden"
name=
"specifications_extends[]"
value=
""
class=
"line-extend-input"
/>
...
...
@@ -132,7 +132,7 @@
{{case base}}
<td
class=
"am-text-middle 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
/>
<input
type=
"text"
name=
"specifications_price[]"
placeholder=
"价格"
class=
"am-radius"
pattern=
"
{{$default_price_regex}}
"
data-validation-message=
"请填写有效的销售金额"
value=
"{{$v.data.price}}"
required
/>
</td>
<td
class=
"am-text-middle"
>
<input
type=
"number"
name=
"specifications_weight[]"
placeholder=
"重量"
class=
"am-radius"
min=
"0.00"
max=
"100000000.00"
step=
"0.01"
data-validation-message=
"规格重量 0.00~100000000.00"
value=
"{{if $v['data']['weight'] gt 0}}{{$v.data.weight}}{{/if}}"
/>
...
...
@@ -144,7 +144,7 @@
<input
type=
"text"
name=
"specifications_barcode[]"
placeholder=
"条形码"
class=
"am-radius"
maxlength=
"80"
data-validation-message=
"条形码最多80个字符"
value=
"{{$v.data.barcode}}"
/>
</td>
<td
class=
"am-text-middle"
>
<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}}"
/>
<input
type=
"text"
name=
"specifications_original_price[]"
placeholder=
"原价"
class=
"am-radius"
pattern=
"
{{$default_price_regex}}
"
data-validation-message=
"请填写有效的原价"
value=
"{{if $v['data']['original_price'] gt 0}}{{$v.data.original_price}}{{/if}}"
/>
</td>
<td
class=
"am-text-middle"
>
<input
type=
"hidden"
name=
"specifications_extends[]"
value=
"{{$v.data.extends}}"
class=
"line-extend-input"
/>
...
...
@@ -212,7 +212,7 @@
<div
class=
"am-alert am-alert-secondary spec-title-container"
></div>
<div
class=
"am-form-group"
>
<label
class=
"block"
>
销售价格
</label>
<input
type=
"text"
placeholder=
"价格"
class=
"am-radius popup_all_price"
pattern=
"
^([0-9]{1}\d{0,6})(\.\d{1,2})?$
"
data-validation-message=
"请填写有效的销售金额"
/>
<input
type=
"text"
placeholder=
"价格"
class=
"am-radius popup_all_price"
pattern=
"
{{$default_price_regex}}
"
data-validation-message=
"请填写有效的销售金额"
/>
</div>
<div
class=
"am-form-group"
>
<label
class=
"block"
>
重量
</label>
...
...
@@ -228,7 +228,7 @@
</div>
<div
class=
"am-form-group"
>
<label
class=
"block"
>
原价
</label>
<input
type=
"text"
placeholder=
"原价"
class=
"am-radius popup_all_original_price"
pattern=
"
^([0-9]{1}\d{0,6})(\.\d{1,2})?$
"
data-validation-message=
"请填写有效的原价"
/>
<input
type=
"text"
placeholder=
"原价"
class=
"am-radius popup_all_original_price"
pattern=
"
{{$default_price_regex}}
"
data-validation-message=
"请填写有效的原价"
/>
</div>
<div
class=
"am-form-group am-form-group-refreshing am-text-center"
>
<button
type=
"button"
class=
"am-btn am-btn-warning am-radius am-btn-sm am-margin-right-lg"
data-am-modal-close
>
取消
</button>
...
...
application/index/controller/Common.php
浏览文件 @
bc233a4b
...
...
@@ -358,6 +358,9 @@ class Common extends Controller
$this
->
assign
(
'is_header'
,
1
);
$this
->
assign
(
'is_footer'
,
1
);
// 价格正则
$this
->
assign
(
'default_price_regex'
,
lang
(
'common_regex_price'
));
// 附件host地址
$this
->
assign
(
'attachment_host'
,
config
(
'shopxo.attachment_host'
));
...
...
application/lang/zh-cn.php
浏览文件 @
bc233a4b
...
...
@@ -405,7 +405,7 @@ return [
'common_regex_id_card'
=>
'^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$'
,
// 价格格式
'common_regex_price'
=>
'^([0-9]{1}\d{0,
6
})(\.\d{1,2})?$'
,
'common_regex_price'
=>
'^([0-9]{1}\d{0,
7
})(\.\d{1,2})?$'
,
// ip
'common_regex_ip'
=>
'^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录