Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
a8aeb3dc
提交
a8aeb3dc
authored
9月 30, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
广告投放页管理
上级
6da7ef85
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
366 行增加
和
89 行删除
+366
-89
AdvertisementController.java
...java/com/platform/controller/AdvertisementController.java
+27
-6
AdvertisementItemController.java
.../com/platform/controller/AdvertisementItemController.java
+13
-0
AdvertisementItemDao.java
.../src/main/java/com/platform/dao/AdvertisementItemDao.java
+4
-0
TbCfStationItemDao.java
...in/src/main/java/com/platform/dao/TbCfStationItemDao.java
+3
-0
AdvertisementItemService.java
...n/java/com/platform/service/AdvertisementItemService.java
+4
-0
AdvertisementService.java
.../main/java/com/platform/service/AdvertisementService.java
+2
-2
TbCfStationItemService.java
...ain/java/com/platform/service/TbCfStationItemService.java
+2
-0
AdvertisementItemServiceImpl.java
...m/platform/service/impl/AdvertisementItemServiceImpl.java
+10
-1
AdvertisementServiceImpl.java
...a/com/platform/service/impl/AdvertisementServiceImpl.java
+3
-9
TbCfStationItemServiceImpl.java
...com/platform/service/impl/TbCfStationItemServiceImpl.java
+6
-0
AdvertisementItemDao.xml
.../main/resources/com/platform/dao/AdvertisementItemDao.xml
+53
-41
TbCfStationItemDao.xml
...rc/main/resources/com/platform/dao/TbCfStationItemDao.xml
+42
-0
advertisement.html
...admin/src/main/webapp/WEB-INF/page/sys/advertisement.html
+58
-29
advertisement.js
platform-admin/src/main/webapp/js/sys/advertisement.js
+139
-1
没有找到文件。
platform-admin/src/main/java/com/platform/controller/AdvertisementController.java
浏览文件 @
a8aeb3dc
package
com
.
platform
.
controller
;
package
com
.
platform
.
controller
;
import
com.platform.entity.AdvertisementEntity
;
import
com.platform.entity.AdvertisementEntity
;
import
com.platform.entity.TbCfStationItemEntity
;
import
com.platform.service.AdvertisementItemService
;
import
com.platform.service.AdvertisementItemService
;
import
com.platform.service.AdvertisementService
;
import
com.platform.service.AdvertisementService
;
import
com.platform.service.TbCfStationItemService
;
import
com.platform.utils.PageUtils
;
import
com.platform.utils.PageUtils
;
import
com.platform.utils.Query
;
import
com.platform.utils.Query
;
import
com.platform.utils.R
;
import
com.platform.utils.R
;
...
@@ -31,6 +33,12 @@ public class AdvertisementController {
...
@@ -31,6 +33,12 @@ public class AdvertisementController {
@Autowired
@Autowired
private
AdvertisementService
advertisementService
;
private
AdvertisementService
advertisementService
;
@Autowired
private
TbCfStationItemService
tbCfStationItemService
;
@Autowired
private
AdvertisementItemService
advertisementItemService
;
/**
/**
* 查看列表
* 查看列表
*/
*/
...
@@ -68,9 +76,7 @@ public class AdvertisementController {
...
@@ -68,9 +76,7 @@ public class AdvertisementController {
@RequiresPermissions
(
"advertisement:save"
)
@RequiresPermissions
(
"advertisement:save"
)
@ResponseBody
@ResponseBody
public
R
save
(
@RequestBody
AdvertisementEntity
advertisement
)
{
public
R
save
(
@RequestBody
AdvertisementEntity
advertisement
)
{
int
length
=
advertisement
.
getItemIds
().
length
();
advertisementService
.
save
(
advertisement
);
String
itemIds
=
advertisement
.
getItemIds
().
substring
(
1
,
length
-
1
);
advertisementService
.
save
(
itemIds
,
advertisement
);
return
R
.
ok
();
return
R
.
ok
();
}
}
...
@@ -82,9 +88,7 @@ public class AdvertisementController {
...
@@ -82,9 +88,7 @@ public class AdvertisementController {
@RequiresPermissions
(
"advertisement:update"
)
@RequiresPermissions
(
"advertisement:update"
)
@ResponseBody
@ResponseBody
public
R
update
(
@RequestBody
AdvertisementEntity
advertisement
)
{
public
R
update
(
@RequestBody
AdvertisementEntity
advertisement
)
{
int
length
=
advertisement
.
getItemIds
().
length
();
advertisementService
.
update
(
advertisement
);
String
itemIds
=
advertisement
.
getItemIds
().
substring
(
1
,
length
-
1
);
advertisementService
.
update
(
itemIds
,
advertisement
);
return
R
.
ok
();
return
R
.
ok
();
}
}
...
@@ -112,4 +116,21 @@ public class AdvertisementController {
...
@@ -112,4 +116,21 @@ public class AdvertisementController {
return
R
.
ok
().
put
(
"list"
,
list
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
}
/**
* 查询广告投放页的所有商品
*
* @return
*/
@RequestMapping
(
"/getAdvertisementItem"
)
@ResponseBody
public
R
getAdvertisementItem
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
Query
query
=
new
Query
(
params
);
List
<
TbCfStationItemEntity
>
itemList
=
tbCfStationItemService
.
getAdvertisementItem
(
params
.
get
(
"adId"
).
toString
());
int
count
=
advertisementItemService
.
getAdItemCount
(
params
.
get
(
"adId"
).
toString
(),
null
);
PageUtils
pageUtil
=
new
PageUtils
(
itemList
,
count
,
query
.
getLimit
(),
query
.
getPage
());
return
R
.
ok
().
put
(
"page"
,
pageUtil
);
}
}
}
platform-admin/src/main/java/com/platform/controller/AdvertisementItemController.java
浏览文件 @
a8aeb3dc
...
@@ -75,6 +75,9 @@ public class AdvertisementItemController {
...
@@ -75,6 +75,9 @@ public class AdvertisementItemController {
public
R
saveBatch
(
@RequestParam
(
"aId"
)
String
aId
,
@RequestParam
(
"itemIds"
)
String
itemIds
)
{
public
R
saveBatch
(
@RequestParam
(
"aId"
)
String
aId
,
@RequestParam
(
"itemIds"
)
String
itemIds
)
{
String
itemIdArr
[]
=
itemIds
.
split
(
","
);
String
itemIdArr
[]
=
itemIds
.
split
(
","
);
for
(
int
i
=
0
;
i
<
itemIdArr
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
itemIdArr
.
length
;
i
++)
{
int
count
=
advertisementItemService
.
getAdItemCount
(
aId
,
itemIdArr
[
i
]);
if
(
count
>
0
)
continue
;
AdvertisementItemEntity
advertisementItem
=
new
AdvertisementItemEntity
();
AdvertisementItemEntity
advertisementItem
=
new
AdvertisementItemEntity
();
advertisementItem
.
setAdId
(
aId
);
advertisementItem
.
setAdId
(
aId
);
advertisementItem
.
setItemId
(
itemIdArr
[
i
]);
advertisementItem
.
setItemId
(
itemIdArr
[
i
]);
...
@@ -119,4 +122,14 @@ public class AdvertisementItemController {
...
@@ -119,4 +122,14 @@ public class AdvertisementItemController {
return
R
.
ok
().
put
(
"list"
,
list
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
}
@RequestMapping
(
"/deleteByItem"
)
@ResponseBody
public
R
deleteByItem
(
@RequestParam
(
"itemId"
)
String
itemId
)
{
int
res
=
advertisementItemService
.
deleteByItem
(
itemId
);
if
(
res
>
0
)
{
return
R
.
ok
();
}
return
R
.
error
(
"操作失败"
);
}
}
}
platform-admin/src/main/java/com/platform/dao/AdvertisementItemDao.java
浏览文件 @
a8aeb3dc
package
com
.
platform
.
dao
;
package
com
.
platform
.
dao
;
import
com.platform.entity.AdvertisementItemEntity
;
import
com.platform.entity.AdvertisementItemEntity
;
import
org.apache.ibatis.annotations.Param
;
/**
/**
* Dao
* Dao
...
@@ -10,4 +11,7 @@ import com.platform.entity.AdvertisementItemEntity;
...
@@ -10,4 +11,7 @@ import com.platform.entity.AdvertisementItemEntity;
*/
*/
public
interface
AdvertisementItemDao
extends
BaseDao
<
AdvertisementItemEntity
>
{
public
interface
AdvertisementItemDao
extends
BaseDao
<
AdvertisementItemEntity
>
{
int
getAdItemCount
(
@Param
(
"adId"
)
String
adId
,
@Param
(
"itemId"
)
String
itemId
);
int
deleteByItem
(
String
itemId
);
}
}
platform-admin/src/main/java/com/platform/dao/TbCfStationItemDao.java
浏览文件 @
a8aeb3dc
...
@@ -40,4 +40,7 @@ public interface TbCfStationItemDao extends BaseDao<TbCfStationItemEntity> {
...
@@ -40,4 +40,7 @@ public interface TbCfStationItemDao extends BaseDao<TbCfStationItemEntity> {
TbCfStationItemEntity
upSortItem
(
Integer
sort
);
TbCfStationItemEntity
upSortItem
(
Integer
sort
);
TbCfStationItemEntity
downSortItem
(
Integer
sort
);
TbCfStationItemEntity
downSortItem
(
Integer
sort
);
List
<
TbCfStationItemEntity
>
getAdvertisementItem
(
String
adId
);
}
}
platform-admin/src/main/java/com/platform/service/AdvertisementItemService.java
浏览文件 @
a8aeb3dc
...
@@ -68,4 +68,8 @@ public interface AdvertisementItemService {
...
@@ -68,4 +68,8 @@ public interface AdvertisementItemService {
* @return 删除条数
* @return 删除条数
*/
*/
int
deleteBatch
(
String
[]
adIds
);
int
deleteBatch
(
String
[]
adIds
);
int
getAdItemCount
(
String
adId
,
String
itemId
);
int
deleteByItem
(
String
itemId
);
}
}
platform-admin/src/main/java/com/platform/service/AdvertisementService.java
浏览文件 @
a8aeb3dc
...
@@ -43,7 +43,7 @@ public interface AdvertisementService {
...
@@ -43,7 +43,7 @@ public interface AdvertisementService {
* @param advertisement 实体
* @param advertisement 实体
* @return 保存条数
* @return 保存条数
*/
*/
int
save
(
String
itemIds
,
AdvertisementEntity
advertisement
);
int
save
(
AdvertisementEntity
advertisement
);
/**
/**
* 根据主键更新实体
* 根据主键更新实体
...
@@ -51,7 +51,7 @@ public interface AdvertisementService {
...
@@ -51,7 +51,7 @@ public interface AdvertisementService {
* @param advertisement 实体
* @param advertisement 实体
* @return 更新条数
* @return 更新条数
*/
*/
int
update
(
String
itemIds
,
AdvertisementEntity
advertisement
);
int
update
(
AdvertisementEntity
advertisement
);
/**
/**
* 根据主键删除
* 根据主键删除
...
...
platform-admin/src/main/java/com/platform/service/TbCfStationItemService.java
浏览文件 @
a8aeb3dc
...
@@ -109,4 +109,6 @@ public interface TbCfStationItemService {
...
@@ -109,4 +109,6 @@ public interface TbCfStationItemService {
int
itemDownward
(
String
itemId
);
int
itemDownward
(
String
itemId
);
int
exchangeItemSort
(
String
itemId
,
Integer
sort
);
int
exchangeItemSort
(
String
itemId
,
Integer
sort
);
List
<
TbCfStationItemEntity
>
getAdvertisementItem
(
String
adId
);
}
}
platform-admin/src/main/java/com/platform/service/impl/AdvertisementItemServiceImpl.java
浏览文件 @
a8aeb3dc
...
@@ -38,7 +38,6 @@ public class AdvertisementItemServiceImpl implements AdvertisementItemService {
...
@@ -38,7 +38,6 @@ public class AdvertisementItemServiceImpl implements AdvertisementItemService {
@Override
@Override
public
int
save
(
AdvertisementItemEntity
advertisementItem
)
{
public
int
save
(
AdvertisementItemEntity
advertisementItem
)
{
advertisementItem
.
setAdId
(
IdUtil
.
createIdbyUUID
());
return
advertisementItemDao
.
save
(
advertisementItem
);
return
advertisementItemDao
.
save
(
advertisementItem
);
}
}
...
@@ -56,4 +55,14 @@ public class AdvertisementItemServiceImpl implements AdvertisementItemService {
...
@@ -56,4 +55,14 @@ public class AdvertisementItemServiceImpl implements AdvertisementItemService {
public
int
deleteBatch
(
String
[]
adIds
)
{
public
int
deleteBatch
(
String
[]
adIds
)
{
return
advertisementItemDao
.
deleteBatch
(
adIds
);
return
advertisementItemDao
.
deleteBatch
(
adIds
);
}
}
@Override
public
int
getAdItemCount
(
String
adId
,
String
itemId
)
{
return
advertisementItemDao
.
getAdItemCount
(
adId
,
itemId
);
}
@Override
public
int
deleteByItem
(
String
itemId
)
{
return
advertisementItemDao
.
deleteByItem
(
itemId
);
}
}
}
platform-admin/src/main/java/com/platform/service/impl/AdvertisementServiceImpl.java
浏览文件 @
a8aeb3dc
...
@@ -43,12 +43,9 @@ public class AdvertisementServiceImpl implements AdvertisementService {
...
@@ -43,12 +43,9 @@ public class AdvertisementServiceImpl implements AdvertisementService {
}
}
@Override
@Override
public
int
save
(
String
itemIds
,
AdvertisementEntity
advertisement
)
{
public
int
save
(
AdvertisementEntity
advertisement
)
{
String
aId
=
IdUtil
.
createIdbyUUID
();
advertisement
.
setId
(
aId
);
advertisement
.
setCreateTime
(
new
Date
());
advertisement
.
setCreateTime
(
new
Date
());
advertisement
.
setUpdateTime
(
new
Date
());
advertisement
.
setUpdateTime
(
new
Date
());
saveAd
(
aId
,
itemIds
);
return
advertisementDao
.
save
(
advertisement
);
return
advertisementDao
.
save
(
advertisement
);
}
}
...
@@ -57,17 +54,14 @@ public class AdvertisementServiceImpl implements AdvertisementService {
...
@@ -57,17 +54,14 @@ public class AdvertisementServiceImpl implements AdvertisementService {
for
(
int
i
=
0
;
i
<
idArr
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
idArr
.
length
;
i
++)
{
AdvertisementItemEntity
advertisementItem
=
new
AdvertisementItemEntity
();
AdvertisementItemEntity
advertisementItem
=
new
AdvertisementItemEntity
();
advertisementItem
.
setAdId
(
aId
);
advertisementItem
.
setAdId
(
aId
);
advertisementItem
.
setItemId
(
idArr
[
i
].
substring
(
1
,
idArr
[
i
].
length
()-
1
));
advertisementItem
.
setItemId
(
idArr
[
i
].
substring
(
1
,
idArr
[
i
].
length
()
-
1
));
advertisementItemDao
.
save
(
advertisementItem
);
advertisementItemDao
.
save
(
advertisementItem
);
}
}
}
}
@Override
@Override
public
int
update
(
String
itemIds
,
AdvertisementEntity
advertisement
)
{
public
int
update
(
AdvertisementEntity
advertisement
)
{
String
aId
=
advertisement
.
getId
();
advertisement
.
setUpdateTime
(
new
Date
());
advertisement
.
setUpdateTime
(
new
Date
());
advertisementItemDao
.
delete
(
advertisement
.
getId
());
saveAd
(
aId
,
itemIds
);
return
advertisementDao
.
update
(
advertisement
);
return
advertisementDao
.
update
(
advertisement
);
}
}
...
...
platform-admin/src/main/java/com/platform/service/impl/TbCfStationItemServiceImpl.java
浏览文件 @
a8aeb3dc
...
@@ -564,6 +564,12 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
...
@@ -564,6 +564,12 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
return
tbCfStationItemDao
.
update
(
sourceItem
);
return
tbCfStationItemDao
.
update
(
sourceItem
);
}
}
@Override
public
List
<
TbCfStationItemEntity
>
getAdvertisementItem
(
String
adId
)
{
return
tbCfStationItemDao
.
getAdvertisementItem
(
adId
);
}
}
}
platform-admin/src/main/resources/com/platform/dao/AdvertisementItemDao.xml
浏览文件 @
a8aeb3dc
...
@@ -16,6 +16,18 @@
...
@@ -16,6 +16,18 @@
where ad_id = #{id}
where ad_id = #{id}
</select>
</select>
<select
id=
"getAdItemCount"
resultType=
"int"
>
select count(1) from advertisement_item where ad_id = #{adId}
<if
test=
"itemId != null and itemId.trim() != ''"
>
and item_id=#{itemId}
</if>
</select>
<delete
id=
"deleteByItem"
>
delete from advertisement_item where item_id=#{itemId}
</delete>
<select
id=
"queryList"
resultType=
"com.platform.entity.AdvertisementItemEntity"
>
<select
id=
"queryList"
resultType=
"com.platform.entity.AdvertisementItemEntity"
>
select
select
`ad_id`,
`ad_id`,
...
...
platform-admin/src/main/resources/com/platform/dao/TbCfStationItemDao.xml
浏览文件 @
a8aeb3dc
...
@@ -60,6 +60,48 @@
...
@@ -60,6 +60,48 @@
from tb_cf_station_item i left join tb_cf_item_desc d on i.item_id=d.item_id
from tb_cf_station_item i left join tb_cf_item_desc d on i.item_id=d.item_id
where i.item_id = #{id}
where i.item_id = #{id}
</select>
</select>
<select
id=
"getAdvertisementItem"
resultType=
"com.platform.entity.TbCfStationItemEntityExtends"
>
select
i.`item_id`,
i.`item_code`,
i.`item_name`,
i.`item_brief`,
i.`item_category`,
i.`item_price`,
i.`discount_price`,
i.`cost_price`,
i.`item_url`,
i.`item_img`,
i.`item_tags`,
i.`item_label`,
i.`item_num`,
i.`item_collection_num`,
i.`item_count`,
i.`item_sku`,
i.`item_top`,
i.`sort`,
i.`supplier`,
i.`template`,
i.`sku_imgs`,
i.`platform_code`,
i.`platform_name`,
i.`enable_flag`,
i.`create_time`,
i.`item_categorytwo`,
i.`item_descrition_id`,
i.`creator`,
d.descripition_name dname,
t.goodstwotype_title title,
o.goodstype_title goodtype
from advertisement_item a
left join tb_cf_station_item i on i.item_id=a.item_id
left JOIN tb_cf_goodstype o ON o.goodstype_id = i.item_category
left JOIN tb_cf_goodstwotype t ON i.item_categorytwo=t.goodstwotype_id
left JOIN tb_cf_descripiton d ON i.item_descrition_id=d.descripition_id
where a.ad_id=#{adId} and i.enable_flag!=0
</select>
<select
id=
"queryByItems"
resultType=
"com.platform.entity.TbCfStationItemEntityExtends"
>
<select
id=
"queryByItems"
resultType=
"com.platform.entity.TbCfStationItemEntityExtends"
>
SELECT
SELECT
i.item_id,
i.item_id,
...
...
platform-admin/src/main/webapp/WEB-INF/page/sys/advertisement.html
浏览文件 @
a8aeb3dc
...
@@ -5,66 +5,85 @@
...
@@ -5,66 +5,85 @@
#parse("sys/header.html")
#parse("sys/header.html")
</head>
</head>
<style>
<style>
body
{
body
{
background
:
#f9f9f9
;
background
:
#f9f9f9
;
}
}
ul
li
{
ul
li
{
list-style
:
none
;
list-style
:
none
;
text-align
:
center
;
text-align
:
center
;
}
}
#app
{
#app
{
box-sizing
:
border-box
;
box-sizing
:
border-box
;
min-width
:
1200px
;
min-width
:
1200px
;
margin
:
0
auto
;
margin
:
0
auto
;
}
}
.category-container
{
min-height
:
600px
;
.category-container
{
min-height
:
600px
;
padding-bottom
:
80px
;
padding-bottom
:
80px
;
}
}
.edit-container
{
.edit-container
{
position
:
relative
;
position
:
relative
;
height
:
500px
;
height
:
500px
;
}
}
.btn-container
{
.btn-container
{
position
:
absolute
;
position
:
absolute
;
bottom
:
0
;
bottom
:
0
;
right
:
0
;
right
:
0
;
}
}
.productList
{
.productList
{
padding-bottom
:
10px
;
padding-bottom
:
10px
;
}
}
.productList
,
.search
{
.productList
,
.search
{
display
:
flex
;
display
:
flex
;
justify-content
:
start
;
justify-content
:
start
;
}
}
.productList-style-start
{
.productList-style-start
{
display
:
flex
;
display
:
flex
;
justify-content
:
start
;
justify-content
:
start
;
}
}
.vRadio
{
.vRadio
{
display
:
inline-block
;
display
:
inline-block
;
width
:
20px
;
width
:
20px
;
height
:
20px
;
height
:
20px
;
background
:
#eeeeee
;
background
:
#eeeeee
;
border-radius
:
4px
;
border-radius
:
4px
;
transition
:
all
0.4s
;
transition
:
all
0.4s
;
}
}
.vradio-wrapper
{
.vradio-wrapper
{
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.vRadio-active
{
background
:
#000
;
.vRadio-active
{
background
:
#000
;
opacity
:
0.6
;
opacity
:
0.6
;
}
}
.vradio-wrapper
>
i
{
vertical-align
:
top
;
.vradio-wrapper
>
i
{
vertical-align
:
top
;
}
}
#searchjqGrid
{
width
:
100%
;
#searchjqGrid
{
margin-top
:
10px
;
width
:
100%
;
margin-top
:
10px
;
}
}
#showItems
{
margin-top
:
20px
;
#adItemjqGrid
{
width
:
100%
;
margin-top
:
10px
;
}
#showItems
{
margin-top
:
20px
;
}
}
</style>
</style>
...
@@ -104,7 +123,10 @@
...
@@ -104,7 +123,10 @@
<i-input
v-model=
"advertisement.adLink"
placeholder=
"广告链接"
style=
"width: 800px"
/>
<i-input
v-model=
"advertisement.adLink"
placeholder=
"广告链接"
style=
"width: 800px"
/>
</Form-item>
</Form-item>
<Form-item
label=
"状态"
prop=
"status"
>
<Form-item
label=
"状态"
prop=
"status"
>
<i-input
v-model=
"advertisement.status"
placeholder=
"状态"
style=
"width: 800px"
/>
<!--<i-input v-model="advertisement.status" placeholder="状态" style="width: 800px"/>-->
<i-select
v-model=
"advertisement.status"
placeholder=
"请选择"
style=
"width: 800px"
/>
<i-option
v-for=
"v in versionList"
:value=
"v.value"
>
{{v.label}}
</i-option>
</i-select>
</Form-item>
</Form-item>
<!--<Form-item label="banner图" prop="picture">
<!--<Form-item label="banner图" prop="picture">
<i-input v-model="advertisement.picture" placeholder="banner图"/>
<i-input v-model="advertisement.picture" placeholder="banner图"/>
...
@@ -225,6 +247,7 @@
...
@@ -225,6 +247,7 @@
<section
id=
"showItems"
>
<section
id=
"showItems"
>
<table
id=
"searchjqGrid"
></table>
<table
id=
"searchjqGrid"
></table>
</section>
</section>
</div>
</div>
<div
v-else-if=
"typeActive==3"
>
<div
v-else-if=
"typeActive==3"
>
<div>
<div>
...
@@ -239,6 +262,12 @@
...
@@ -239,6 +262,12 @@
</section>
</section>
</Card>
</Card>
</div>
</div>
<br/>
<i-button
type=
"info"
@
click=
"addItems"
>
添加商品
</i-button>
<br/>
<table
id=
"adItemjqGrid"
></table>
<br/>
<br/>
<Form-item
label=
"活动开始时间"
prop=
"startTime"
>
<Form-item
label=
"活动开始时间"
prop=
"startTime"
>
<Date-picker
v-model=
"advertisement.startTime"
type=
"datetime"
placeholder=
"活动开始时间"
<Date-picker
v-model=
"advertisement.startTime"
type=
"datetime"
placeholder=
"活动开始时间"
...
...
platform-admin/src/main/webapp/js/sys/advertisement.js
浏览文件 @
a8aeb3dc
...
@@ -18,6 +18,17 @@ $(function () {
...
@@ -18,6 +18,17 @@ $(function () {
let
vm
=
new
Vue
({
let
vm
=
new
Vue
({
el
:
'#rrapp'
,
el
:
'#rrapp'
,
data
:
{
data
:
{
versionList
:
[
{
value
:
1
,
label
:
'开启活动'
},
{
value
:
2
,
label
:
'关闭活动'
}
],
tempId
:
''
,
typeActive
:
2
,
//显示索引
typeActive
:
2
,
//显示索引
items
:
[],
items
:
[],
/*
/*
...
@@ -119,6 +130,52 @@ let vm = new Vue({
...
@@ -119,6 +130,52 @@ let vm = new Vue({
}
}
},
},
methods
:
{
methods
:
{
delItem
(
id
)
{
confirm
(
'确定要删除选中的记录?'
,
function
()
{
Ajax
.
request
({
url
:
"../advertisementitem/deleteByItem?itemId="
+
id
,
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
()
{
alert
(
'操作成功'
,
function
(
index
)
{
let
page
=
$
(
"#adItemjqGrid"
).
jqGrid
(
'getGridParam'
,
'page'
);
$
(
"#adItemjqGrid"
).
jqGrid
(
'setGridParam'
,
{
page
:
page
}).
trigger
(
"reloadGrid"
);
});
}
});
});
},
addItems
()
{
$
(
"#adItemjqGrid"
).
jqGrid
(
"clearGridData"
);
let
ids
=
getSelectedRows
(
"#searchjqGrid"
);
if
(
ids
==
null
)
{
return
;
}
let
id
=
vm
.
advertisement
.
id
;
if
(
id
==
null
||
id
==
''
||
id
==
'undefined'
)
{
id
=
vm
.
tempId
;
}
console
.
log
(
'vm.advertisement.id'
,
vm
.
advertisement
.
id
)
console
.
log
(
'vm.tempId'
,
vm
.
tempId
)
Ajax
.
request
({
url
:
"../advertisementitem/saveBatch?aId="
+
id
+
'&itemIds='
+
ids
,
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
()
{
alert
(
'操作成功'
,
function
(
index
)
{
$
(
"#searchjqGrid"
).
jqGrid
(
'resetSelection'
);
// let page = $("#adItemjqGrid").jqGrid('getGridParam', 'page');
// $("#adItemjqGrid").jqGrid('setGridParam', {
// page: page
// }).trigger("reloadGrid");
vm
.
btn_Search
(
id
);
});
}
});
},
tirggerFile
:
function
(
event
)
{
tirggerFile
:
function
(
event
)
{
var
file
=
event
.
target
.
files
[
0
];
// (利用console.log输出看file文件对象)
var
file
=
event
.
target
.
files
[
0
];
// (利用console.log输出看file文件对象)
var
formData
=
new
FormData
();
var
formData
=
new
FormData
();
...
@@ -145,12 +202,52 @@ let vm = new Vue({
...
@@ -145,12 +202,52 @@ let vm = new Vue({
query
:
function
()
{
query
:
function
()
{
vm
.
reload
();
vm
.
reload
();
},
},
guid
()
{
return
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
.
replace
(
/
[
xy
]
/g
,
function
(
c
)
{
var
r
=
Math
.
random
()
*
32
|
0
,
v
=
c
==
'x'
?
r
:
(
r
&
0x3
|
0x8
);
return
v
.
toString
(
32
);
});
},
add
:
function
()
{
add
:
function
()
{
this
.
commodityCategoryLists3
=
[];
this
.
commodityCategoryLists2
=
[];
this
.
commodityCategoryLists1
=
[];
vm
.
tempId
=
this
.
guid
();
vm
.
showList
=
false
;
vm
.
showList
=
false
;
vm
.
title
=
"新增"
;
vm
.
title
=
"新增"
;
vm
.
advertisement
=
{};
vm
.
advertisement
=
{};
$
(
"#adItemjqGrid"
).
jqGrid
(
"clearGridData"
);
$
(
"#searchjqGrid"
).
jqGrid
(
"clearGridData"
);
$
(
"#adItemjqGrid"
).
Grid
({
url
:
'../advertisement/getAdvertisementItem?adId='
+
vm
.
tempId
,
colModel
:
[
{
label
:
'itemId'
,
name
:
'itemId'
,
index
:
'item_id'
,
key
:
true
,
hidden
:
true
},
{
label
:
'商品图片'
,
name
:
'itemImg'
,
index
:
'item_img'
,
width
:
100
,
formatter
:
imageFormat
},
{
label
:
'商品编号'
,
name
:
'itemCode'
,
index
:
'item_code'
,
width
:
160
},
{
label
:
'商品名称'
,
name
:
'itemName'
,
index
:
'item_name'
,
width
:
160
},
/* {label: '商品标题', name: 'itemBrief', index: 'item_brief', width: 120},*/
/*{label: '商品链接', name: 'itemUrl', index: 'item_url', width: 80,formatter:linkFormat},*/
{
label
:
'商品原价'
,
name
:
'itemPrice'
,
index
:
'item_price'
,
width
:
100
},
{
label
:
'商品现价'
,
name
:
'discountPrice'
,
index
:
'discount_price'
,
width
:
100
},
/*{label: '所属平台', name: 'platformCode', index: 'platform_code', width: 80},
{label: '平台名', name: 'platformName', index: 'platform_name', width: 80},*/
{
label
:
'供应商'
,
name
:
'supplier'
,
index
:
'supplier'
,
width
:
120
},
{
label
:
'商品一级分类'
,
name
:
'goodtype'
,
index
:
'goodtype'
,
width
:
120
},
{
label
:
'商品二级分类'
,
name
:
'title'
,
index
:
'title'
,
width
:
120
},
{
label
:
'商品品名'
,
name
:
'dname'
,
index
:
'itemDescritionId'
,
width
:
120
},
{
label
:
'操作'
,
index
:
'operate'
,
width
:
120
,
formatter
:
function
(
value
,
grid
,
rows
)
{
return
'<span class="label label-info pointer" onclick="vm.delItem(
\'
'
+
rows
.
itemId
+
'
\'
)">移除</span> '
}
}
],
// beforeSelectRow: beforeSelectRow,
});
},
},
update
:
function
(
event
)
{
update
:
function
(
event
)
{
$
(
"#searchjqGrid"
).
jqGrid
(
"clearGridData"
);
let
id
=
getSelectedRow
(
"#jqGrid"
);
let
id
=
getSelectedRow
(
"#jqGrid"
);
if
(
id
==
null
)
{
if
(
id
==
null
)
{
return
;
return
;
...
@@ -163,7 +260,10 @@ let vm = new Vue({
...
@@ -163,7 +260,10 @@ let vm = new Vue({
saveOrUpdate
:
function
(
event
)
{
saveOrUpdate
:
function
(
event
)
{
let
url
=
vm
.
advertisement
.
id
==
null
?
"../advertisement/save"
:
"../advertisement/update"
;
let
url
=
vm
.
advertisement
.
id
==
null
?
"../advertisement/save"
:
"../advertisement/update"
;
let
ids
=
getSelectedRows
(
"#searchjqGrid"
);
let
ids
=
getSelectedRows
(
"#searchjqGrid"
);
vm
.
advertisement
.
itemIds
=
ids
;
vm
.
advertisement
.
itemIds
=
ids
;
if
(
vm
.
advertisement
.
id
==
null
||
vm
.
advertisement
.
id
==
''
||
vm
.
advertisement
.
id
==
'undefined'
)
{
vm
.
advertisement
.
id
=
vm
.
tempId
;
}
Ajax
.
request
({
Ajax
.
request
({
url
:
url
,
url
:
url
,
params
:
JSON
.
stringify
(
vm
.
advertisement
),
params
:
JSON
.
stringify
(
vm
.
advertisement
),
...
@@ -205,6 +305,42 @@ let vm = new Vue({
...
@@ -205,6 +305,42 @@ let vm = new Vue({
vm
.
advertisement
=
r
.
advertisement
;
vm
.
advertisement
=
r
.
advertisement
;
}
}
});
});
this
.
getItems
(
id
);
this
.
btn_Search
(
id
);
},
btn_Search
(
id
)
{
$
(
"#adItemjqGrid"
).
jqGrid
(
'setGridParam'
,
{
url
:
'../advertisement/getAdvertisementItem?adId='
+
id
,
page
:
1
}).
trigger
(
'reloadGrid'
);
},
getItems
(
id
)
{
$
(
"#adItemjqGrid"
).
Grid
({
url
:
'../advertisement/getAdvertisementItem?adId='
+
id
,
colModel
:
[
{
label
:
'itemId'
,
name
:
'itemId'
,
index
:
'item_id'
,
key
:
true
,
hidden
:
true
},
{
label
:
'商品图片'
,
name
:
'itemImg'
,
index
:
'item_img'
,
width
:
100
,
formatter
:
imageFormat
},
{
label
:
'商品编号'
,
name
:
'itemCode'
,
index
:
'item_code'
,
width
:
160
},
{
label
:
'商品名称'
,
name
:
'itemName'
,
index
:
'item_name'
,
width
:
160
},
/* {label: '商品标题', name: 'itemBrief', index: 'item_brief', width: 120},*/
/*{label: '商品链接', name: 'itemUrl', index: 'item_url', width: 80,formatter:linkFormat},*/
{
label
:
'商品原价'
,
name
:
'itemPrice'
,
index
:
'item_price'
,
width
:
100
},
{
label
:
'商品现价'
,
name
:
'discountPrice'
,
index
:
'discount_price'
,
width
:
100
},
/*{label: '所属平台', name: 'platformCode', index: 'platform_code', width: 80},
{label: '平台名', name: 'platformName', index: 'platform_name', width: 80},*/
{
label
:
'供应商'
,
name
:
'supplier'
,
index
:
'supplier'
,
width
:
120
},
{
label
:
'商品一级分类'
,
name
:
'goodtype'
,
index
:
'goodtype'
,
width
:
120
},
{
label
:
'商品二级分类'
,
name
:
'title'
,
index
:
'title'
,
width
:
120
},
{
label
:
'商品品名'
,
name
:
'dname'
,
index
:
'itemDescritionId'
,
width
:
120
},
{
label
:
'操作'
,
index
:
'operate'
,
width
:
120
,
formatter
:
function
(
value
,
grid
,
rows
)
{
return
'<span class="label label-info pointer" onclick="vm.delItem(
\'
'
+
rows
.
itemId
+
'
\'
)">移除</span> '
}
}
],
// beforeSelectRow: beforeSelectRow,
});
},
},
reload
:
function
(
event
)
{
reload
:
function
(
event
)
{
vm
.
showList
=
true
;
vm
.
showList
=
true
;
...
@@ -316,8 +452,10 @@ let vm = new Vue({
...
@@ -316,8 +452,10 @@ let vm = new Vue({
});
});
});
});
})()
:
alert
(
'未输入搜索内容~'
);
})()
:
alert
(
'未输入搜索内容~'
);
},
},
//获取分类子页面二级分类数据
//获取分类子页面二级分类数据
changeSubCateType
(
callback
=
null
)
{
changeSubCateType
(
callback
=
null
)
{
let
ID
=
null
;
let
ID
=
null
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论