Toggle navigation
Toggle navigation
This project
Loading...
Sign in
liuloulou
/
yohobuy-portal-fe2
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
leo
9 years ago
Commit
436b4532a2e5d9b6759c9bfcc565050f43fcf19b
1 parent
c3b3920e
Update: 新增秒杀功能
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
233 additions
and
0 deletions
code/apps/marketing/views/SecKill/Batch.html
code/apps/marketing/views/SecKill/Index.html
code/static/js.jquery/module/marketing/SecKill/Batch.js
code/static/js.jquery/module/marketing/SecKill/Index.js
code/apps/marketing/views/SecKill/Batch.html
0 → 100644
View file @
436b453
<
%include '../../common/views/__ui/header'%>
<
%include '../../common/views/__partail/ListHeader'%>
<div
class=
"contentpanel"
>
<div
class=
"panel panel-default"
style=
"margin-bottom:10px;"
>
<div
class=
"panel-body"
>
<a
href=
"javascript:;"
class=
"btn btn-info return-btn"
>
返回列表
</a>
<div
class=
"row"
>
<span>
选择时间:
</span>
<div
class=
"panel-col"
>
<input
type=
"text"
id=
"beginTime"
class=
"form-control panel-input hasDatepicker"
name=
"start_time"
placeholder=
"开始时间"
value=
""
kl_vkbd_parsed=
"true"
>
</div>
<div
class=
"panel-col"
>
<input
type=
"text"
id=
"endTime"
class=
"form-control panel-input hasDatepicker"
name=
"end_time"
placeholder=
"结束时间"
value=
""
kl_vkbd_parsed=
"true"
>
</div>
</div>
<table
class=
"table table-bordered"
>
<tr>
<td
rowspan=
"2"
>
秒杀配置
</td>
<td>
上传EXCEL:
</td>
<td
style=
"position: relative;"
><input
id=
"seckill-file"
name=
"file"
data-type=
"seckill"
type=
"file"
style=
"cursor: pointer; height: 37px; top: 8px;"
></td>
</tr>
<tr>
<td>
说明:
</td>
<td
colspan=
"2"
>
1、上传文件必须是
<span
style=
"color:red;"
>
.xlsx
</span>
文件
<br>
2、Excel表头为:
<span
style=
"color: #67D267;"
>
SKN SKU 秒杀价 秒杀库存 排序值
</span><br>
3、第一行为表头内容,第二行开始为正式内容
<br>
4、每个文件控制在2500行以内
<br>
5、
<a
href=
"/ajax/link/seckill"
>
下载样例
</a>
</td>
</tr>
</table>
</div>
</div>
</div>
<
%include '../../../common/views/__ui/footer'%>
\ No newline at end of file
...
...
code/apps/marketing/views/SecKill/Index.html
0 → 100644
View file @
436b453
<
%include '../../common/views/__ui/header'%>
<
%include '../../common/views/__partail/ListHeader'%>
<div
class=
"contentpanel"
>
<div
class=
"panel panel-default"
style=
"margin-bottom:10px;"
>
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"panel-col"
>
<input
type=
"text"
id=
"beginTime"
class=
"form-control panel-input hasDatepicker"
name=
"start_time"
placeholder=
"开始时间"
value=
""
kl_vkbd_parsed=
"true"
>
</div>
<div
class=
"panel-col"
>
<input
type=
"text"
id=
"endTime"
class=
"form-control panel-input hasDatepicker"
name=
"end_time"
placeholder=
"结束时间"
value=
""
kl_vkbd_parsed=
"true"
>
</div>
<div
class=
"panel-col"
>
<input
id=
"productSkn"
class=
"form-control panel-input"
type=
"text"
placeholder=
"请输入SKN"
onkeyup=
"this.value=this.value.replace(/\D/gi,'')"
>
</div>
<div
class=
"panel-col"
>
<a
id=
"filter-btn"
href=
"javascript:;"
class=
"btn btn-info"
>
筛选
</a>
<a
id=
"all-btn"
href=
""
class=
"btn btn-info"
>
全部
</a>
</div>
<div
class=
"panel-col2"
>
<a
id=
"import-btn"
href=
"/marketing/buynow/batch"
class=
"btn btn-primary large"
>
批量导入
</a>
</div>
</div>
</div>
</div>
<div
class=
"panel"
>
<div
class=
"panel-body nopadding"
>
<div
class=
"dataTab_wrapper"
id=
"basicTab"
style=
"margin-bottom: 10px"
></div>
<div
class=
"dataTables_wrapper no-footer"
id=
"basicTable"
></div>
</div>
</div>
</div>
<
%include '../../common/views/__ui/footer'%>
\ No newline at end of file
...
...
code/static/js.jquery/module/marketing/SecKill/Batch.js
0 → 100644
View file @
436b453
'use strict'
;
var
$
=
require
(
'jquery'
),
common
=
require
(
'../../../common/common'
);
$
(
'input[type="file"]'
).
after
(
'<div class="file-name btn btn-default">请选择文件</div>'
);
function
batchExport
(
el
,
type
)
{
var
loadModal
=
null
;
return
{
params
:
{
type
:
type
,
__type
:
"batch-import"
},
onStart
:
function
()
{
loadModal
=
common
.
dialog
.
load
();
$
(
el
).
parents
(
'td'
).
find
(
'.file-name'
).
text
(
$
(
el
).
val
().
replace
(
"C:\\fakepath\\"
,
""
));
},
onComplete
:
function
(
response
)
{
console
.
log
(
response
);
if
(
loadModal
)
{
loadModal
.
close
();
}
if
(
response
.
code
==
200
)
{
common
.
util
.
__tip
(
response
.
message
,
'success'
);
}
else
{
common
.
util
.
__tip
(
response
.
message
,
'warning'
);
}
}
}
}
common
.
edit
.
ajaxfileupload
(
'#seckill-file'
,
batchExport
(
'#seckill-file'
,
'seckill'
));
\ No newline at end of file
...
...
code/static/js.jquery/module/marketing/SecKill/Index.js
0 → 100644
View file @
436b453
'use strict'
;
var
$
=
require
(
'jquery'
),
common
=
require
(
'../../../common/common'
);
var
ENUM
=
{
tab
:
{
'1'
:
0
,
'2'
:
0
,
'3'
:
0
}
};
// 待审核、审核通过、驳回
var
t
=
new
common
.
tab2
({
el
:
"#basicTab"
,
active
:
0
,
click
:
function
()
{
var
columnname
=
t
.
options
.
columns
[
t
.
options
.
active
].
name
;
if
(
columnname
==
1
||
columnname
==
2
)
{
g
.
options
.
columns
[
7
].
hidden
=
true
;
}
else
{
g
.
options
.
columns
[
7
].
hidden
=
false
;
}
// g.init("/goods/netsale/getList");
},
columns
:
[{
name
:
"0"
,
value
:
'0'
,
display
:
"待审核({1})"
},
{
name
:
"1"
,
value
:
'1'
,
display
:
"审核通过({2})"
},
{
name
:
"2"
,
value
:
'2'
,
display
:
"驳回({3})"
}]
}).
init
(
ENUM
.
tab
);
var
g
=
new
common
.
grid
({
el
:
"#basicTable"
,
usepagesize
:
true
,
parms
:
function
()
{
return
{
productSkn
:
common
.
util
.
__input
(
"productSkn"
),
beginTime
:
common
.
util
.
__input
(
'beginTime'
),
endTime
:
common
.
util
.
__input
(
'endTime'
)
};
},
columns
:
[{
display
:
''
,
type
:
'checkbox'
},{
display
:
'skn'
,
name
:
'productSkn'
},{
display
:
'秒杀时间'
,
render
:
function
(
item
)
{
return
item
.
beginTime
+
"<br>"
+
item
.
endTime
;
}
},{
display
:
'商品信息'
,
render
:
function
(
item
)
{
var
productName
=
item
.
productName
?
item
.
productName
:
''
,
brandName
=
item
.
brandName
?
item
.
brandName
:
''
;
return
"名称: "
+
productName
+
"<br>"
+
"品牌: "
+
brandName
;
}
},{
display
:
'价格'
,
render
:
function
(
item
)
{
var
retailPrice
=
item
.
retailPrice
?
item
.
retailPrice
:
''
,
// 吊牌价
salesPrice
=
item
.
salesPrice
?
item
.
salesPrice
:
''
,
// 销售价
seckillPrice
=
item
.
seckillPrice
?
item
.
seckillPrice
:
''
;
// 秒杀价
return
"吊牌价: "
+
retailPrice
+
"<br>销售价: "
+
salesPrice
+
"<br>秒杀价: "
+
seckillPrice
;
}
},{
display
:
'库存'
,
render
:
function
(
item
)
{
var
storage
=
item
.
storage
?
item
.
storage
:
''
,
// 库存
seckillStorage
=
item
.
seckillStorage
?
item
.
seckillStorage
:
''
;
// 秒杀库存
return
"库存: "
+
storage
+
"<br>秒杀库存: "
+
seckillStorage
;
}
},{
display
:
'原因'
,
render
:
function
(
item
)
{
var
rejectReason
=
item
.
rejectReason
?
item
.
rejectReason
:
''
;
return
rejectReason
;
}
},{
display
:
'操作'
,
render
:
function
(
item
)
{
var
htmlArr
=
[];
var
audStatus
=
item
.
status
;
// 审核状态: 0---待审核, 1---审核通过, 2---驳回
var
seckillStatus
=
0
;
// 秒杀状态: 0---未开始, 1---进行中,2---已结束
if
(
audStatus
===
0
)
{
htmlArr
.
push
(
'<a class="btn btn-success btn-xs">通过</a>'
);
htmlArr
.
push
(
'<a class="btn btn-danger btn-xs">驳回</a>'
);
htmlArr
.
push
(
'<a class="btn btn-info btn-xs">秒杀库存明细</a>'
);
}
else
if
(
audStatus
===
1
)
{
htmlArr
.
push
(
'<a class="btn btn-info btn-xs">秒杀库存明细</a>'
);
if
(
seckillStatus
===
0
)
{
// 只有在未开始的秒杀,才能作废
htmlArr
.
push
(
'<a class="btn btn-danger btn-xs">作废</a>'
);
}
}
else
{
htmlArr
.
push
(
'<a class="btn btn-default btn-xs">编辑</a>'
);
}
return
htmlArr
.
join
(
' '
);
}
}]
});
...
...
Please
register
or
login
to post a comment