Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
farming
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑云飞
farming
Commits
697f0488
Commit
697f0488
authored
May 17, 2023
by
郑云飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后管团购小区功能完成
parent
ce955462
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
2345 additions
and
132 deletions
+2345
-132
src/main/java/com/yunniu/farming/app/GroupBuyAppController.java
+1
-1
src/main/java/com/yunniu/farming/webadmin/controller/GroupAreaController.java
+19
-4
src/main/java/com/yunniu/farming/webadmin/controller/GroupBuyController.java
+15
-2
src/main/java/com/yunniu/farming/webadmin/controller/GroupOrderController.java
+80
-1
src/main/java/com/yunniu/farming/webadmin/dao/GroupAreaDao.java
+1
-2
src/main/java/com/yunniu/farming/webadmin/dao/GroupOrderDao.java
+5
-0
src/main/java/com/yunniu/farming/webadmin/model/GroupBuy.java
+3
-0
src/main/java/com/yunniu/farming/webadmin/model/GroupOrder.java
+46
-1
src/main/java/com/yunniu/farming/webadmin/service/GroupAreaService.java
+4
-0
src/main/java/com/yunniu/farming/webadmin/service/GroupBuyService.java
+1
-1
src/main/java/com/yunniu/farming/webadmin/service/GroupOrderService.java
+7
-0
src/main/java/com/yunniu/farming/webadmin/service/impl/GroupAreaServiceimpl.java
+21
-0
src/main/java/com/yunniu/farming/webadmin/service/impl/GroupBuyServiceimpl.java
+1
-1
src/main/java/com/yunniu/farming/webadmin/service/impl/GroupOrderServiceImpl.java
+21
-2
src/main/resources/mappings/GroupAreaMapper.xml
+7
-1
src/main/resources/mappings/GroupBuyMapper.xml
+2
-1
src/main/resources/mappings/GroupOrderMapper.xml
+38
-1
src/main/resources/templates/groupArea/addOrEdit.html
+167
-0
src/main/resources/templates/groupArea/list.html
+399
-0
src/main/resources/templates/groupBuy/addOrEdit.html
+280
-0
src/main/resources/templates/groupBuy/list.html
+231
-114
src/main/resources/templates/groupOrder/detail.html
+156
-0
src/main/resources/templates/groupOrder/detailList.html
+381
-0
src/main/resources/templates/groupOrder/list.html
+459
-0
No files found.
src/main/java/com/yunniu/farming/app/GroupBuyAppController.java
View file @
697f0488
...
...
@@ -88,7 +88,7 @@ public class GroupBuyAppController {
*/
@RequestMapping
(
value
=
"/detail"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Result
detail
(
@RequestParam
Integer
id
)
{
public
Result
detail
(
@RequestParam
Long
id
)
{
GroupBuy
groupBuy
=
groupBuyService
.
findById
(
id
);
return
Result
.
success
(
groupBuy
);
}
...
...
src/main/java/com/yunniu/farming/webadmin/controller/GroupAreaController.java
View file @
697f0488
...
...
@@ -3,8 +3,10 @@ package com.yunniu.farming.webadmin.controller;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.yunniu.farming.common.plugin.PageInfo
;
import
com.yunniu.farming.result.Result
;
import
com.yunniu.farming.webadmin.model.Banner
;
import
com.yunniu.farming.webadmin.model.GroupArea
;
import
com.yunniu.farming.webadmin.model.GroupBuy
;
import
com.yunniu.farming.webadmin.model.Product
;
import
com.yunniu.farming.webadmin.service.GroupAreaService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -32,6 +34,18 @@ public class GroupAreaController {
return
"groupArea/list"
;
}
@RequestMapping
(
value
=
"/addOrEdit"
)
public
String
addOrEdit
(
Model
model
,
Long
areaId
)
{
model
.
addAttribute
(
"areaId"
,
areaId
);
if
(
areaId
==
null
||
areaId
.
equals
(
""
))
{
model
.
addAttribute
(
"obj"
,
new
GroupArea
());
}
else
{
GroupArea
area
=
groupAreaService
.
findById
(
areaId
);
model
.
addAttribute
(
"obj"
,
area
);
}
return
"/groupArea/addOrEdit"
;
}
/**
* 分页查询
* @return
...
...
@@ -66,7 +80,7 @@ public class GroupAreaController {
item
.
setPageinfo
(
pinfo
);
}
List
<
GroupArea
>
list
=
groupAreaService
.
find
PageList
(
item
);
List
<
GroupArea
>
list
=
groupAreaService
.
get
PageList
(
item
);
// 3.将查询结果的 分页数据封装后返回
int
totalRs
=
pinfo
.
getTotalRecords
();
//总记录数
...
...
@@ -85,9 +99,10 @@ public class GroupAreaController {
}
@RequestMapping
(
value
=
"/addOrEdit"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/addOrUpdate"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Result
addOr
Edit
(
@RequestBody
GroupArea
item
)
{
public
Result
addOr
Update
(
@RequestBody
GroupArea
item
)
{
if
(
StringUtils
.
isEmpty
(
item
.
getAreaName
()))
{
return
Result
.
error
(
"小区名称不能为空"
);
}
...
...
@@ -97,7 +112,7 @@ public class GroupAreaController {
return
this
.
groupAreaService
.
addOrEdit
(
item
);
}
@RequestMapping
(
value
=
"/delete/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/delete/{id}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Result
delete
(
@PathVariable
Integer
id
)
{
if
(
id
==
null
)
{
...
...
src/main/java/com/yunniu/farming/webadmin/controller/GroupBuyController.java
View file @
697f0488
...
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yunniu.farming.common.plugin.PageInfo
;
import
com.yunniu.farming.result.Result
;
import
com.yunniu.farming.webadmin.model.GroupArea
;
import
com.yunniu.farming.webadmin.model.GroupBuy
;
import
com.yunniu.farming.webadmin.model.Product
;
import
com.yunniu.farming.webadmin.service.GroupBuyService
;
...
...
@@ -35,6 +36,18 @@ public class GroupBuyController {
return
"groupBuy/list"
;
}
@RequestMapping
(
value
=
"/addOrEdit"
)
public
String
addOrEdit
(
Model
model
,
Long
id
)
{
model
.
addAttribute
(
"id"
,
id
);
if
(
id
==
null
||
id
.
equals
(
""
))
{
model
.
addAttribute
(
"obj"
,
new
GroupBuy
());
}
else
{
GroupBuy
groupBuy
=
groupBuyService
.
findById
(
id
);
model
.
addAttribute
(
"obj"
,
groupBuy
);
}
return
"/groupBuy/addOrEdit"
;
}
/**
* 分页查询
* @return
...
...
@@ -92,9 +105,9 @@ public class GroupBuyController {
* @param item
* @return
*/
@RequestMapping
(
value
=
"/addOr
Edit
"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/addOr
Update
"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Result
addOr
Edit
(
@RequestBody
GroupBuy
item
)
{
public
Result
addOr
Update
(
@RequestBody
GroupBuy
item
)
{
if
(
StringUtils
.
isEmpty
(
item
.
getGroupBuyTitle
()))
{
return
Result
.
error
(
"活动标题不能为空"
);
}
...
...
src/main/java/com/yunniu/farming/webadmin/controller/GroupOrderController.java
View file @
697f0488
package
com
.
yunniu
.
farming
.
webadmin
.
controller
;
import
com.yunniu.farming.common.plugin.PageInfo
;
import
com.yunniu.farming.result.Result
;
import
com.yunniu.farming.webadmin.model.GroupBuy
;
import
com.yunniu.farming.webadmin.model.GroupOrder
;
import
com.yunniu.farming.webadmin.service.GroupOrderService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author zyf
...
...
@@ -13,4 +24,72 @@ import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping
(
"/groupOrder"
)
public
class
GroupOrderController
{
@Autowired
private
GroupOrderService
groupOrderService
;
@RequestMapping
(
"/list"
)
public
String
list
(
Model
model
)
{
return
"groupOrder/list"
;
}
@RequestMapping
(
value
=
"/orderDetail"
)
public
String
addOrEdit
(
Model
model
,
Long
id
)
{
model
.
addAttribute
(
"id"
,
id
);
if
(
id
==
null
||
id
.
equals
(
""
))
{
model
.
addAttribute
(
"obj"
,
new
GroupOrder
());
}
else
{
GroupOrder
order
=
groupOrderService
.
findById
(
id
);
model
.
addAttribute
(
"obj"
,
order
);
}
return
"/groupOrder/detail"
;
}
@RequestMapping
(
value
=
"/findPageList"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Result
findPageList
(
@RequestBody
GroupOrder
item
)
{
//这里对返回对象用Map处理,map.pageinfo=>分页信息;map.items=>结果数据集;
Map
<
String
,
Object
>
rmap
=
new
HashMap
<
String
,
Object
>(
2
);
//传入当前页数,适配PC端Layui分页
if
(
item
.
getCurpage
()
!=
null
||
item
.
getPagesize
()
!=
null
)
{
PageInfo
pinfo
=
new
PageInfo
();
if
(
item
.
getCurpage
()
!=
null
)
{
pinfo
.
setCurPage
(
item
.
getCurpage
());
}
if
(
item
.
getPagesize
()
!=
null
)
{
pinfo
.
setPageSize
(
item
.
getPagesize
());
}
item
.
setPageinfo
(
pinfo
);
}
// 1.查询前 需要对分页对象 做处理,主要是 分页 开始记录数 limit arg0开始记录,arg1每页几条记录
PageInfo
pinfo
=
item
.
getPageinfo
();
if
(
pinfo
==
null
)
{
pinfo
=
new
PageInfo
();
item
.
setPageinfo
(
pinfo
);
}
else
{
// 分页开始记录数
int
curRecord
=
(
pinfo
.
getCurPage
()
-
1
)
*
pinfo
.
getPageSize
();
pinfo
.
setCurRecord
(
curRecord
);
item
.
setPageinfo
(
pinfo
);
}
List
<
GroupOrder
>
list
=
groupOrderService
.
findPageList
(
item
);
// 3.将查询结果的 分页数据封装后返回
int
totalRs
=
pinfo
.
getTotalRecords
();
//总记录数
int
totalPs
=
0
;
//总页数
if
(
totalRs
%
pinfo
.
getPageSize
()
==
0
)
{
//总页数计算
totalPs
=
totalRs
/
pinfo
.
getPageSize
();
}
else
{
totalPs
=
1
+
totalRs
/
pinfo
.
getPageSize
();
}
pinfo
.
setTotalPages
(
totalPs
);
// 4.将分页对象、结果集合 封装后返回前台
rmap
.
put
(
"pageinfo"
,
pinfo
);
rmap
.
put
(
"items"
,
list
);
return
Result
.
success
(
rmap
);
}
}
src/main/java/com/yunniu/farming/webadmin/dao/GroupAreaDao.java
View file @
697f0488
...
...
@@ -18,6 +18,5 @@ public interface GroupAreaDao extends BaseMapper<GroupArea> {
List
<
GroupArea
>
findPageList
(
GroupArea
item
);
@Update
(
"udpate group_area set area_status = 1 where id = #{id}"
)
String
deleteArea
(
Integer
id
);
int
deleteArea
(
Integer
id
);
}
src/main/java/com/yunniu/farming/webadmin/dao/GroupOrderDao.java
View file @
697f0488
...
...
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.yunniu.farming.webadmin.model.GroupOrder
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* @author zyf
* @date 2023/5/16
...
...
@@ -12,4 +14,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public
interface
GroupOrderDao
extends
BaseMapper
<
GroupOrder
>
{
List
<
GroupOrder
>
findPageList
(
GroupOrder
item
);
GroupOrder
detailById
(
Long
id
);
}
src/main/java/com/yunniu/farming/webadmin/model/GroupBuy.java
View file @
697f0488
...
...
@@ -130,4 +130,7 @@ public class GroupBuy {
@TableField
(
exist
=
false
)
private
BigDecimal
maxprice
;
@TableField
(
exist
=
false
)
private
String
startAndEndTime
;
}
src/main/java/com/yunniu/farming/webadmin/model/GroupOrder.java
View file @
697f0488
package
com
.
yunniu
.
farming
.
webadmin
.
model
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.yunniu.farming.common.plugin.PageInfo
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
...
...
@@ -14,17 +18,58 @@ public class GroupOrder {
private
Long
id
;
private
String
orderCode
;
private
Long
groupBuyId
;
private
Long
areaId
;
private
Integer
groupSize
;
private
Integer
groupStatus
;
private
String
groupStatus
;
private
Date
successTime
;
private
Date
createTime
;
private
String
createBy
;
/**
* 辅助对象:分页信息对象
*/
@TableField
(
exist
=
false
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
private
PageInfo
pageinfo
;
/**
* 分页页码
*/
@TableField
(
exist
=
false
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
private
Integer
curpage
;
/**
* 分页个数
*/
@TableField
(
exist
=
false
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
private
Integer
pagesize
;
/**
* 活动标题
*/
@TableField
(
exist
=
false
)
private
String
groupBuyTitle
;
/**
* 小区名称
*/
@TableField
(
exist
=
false
)
private
String
areaName
;
/**
* 订单实付金额
*/
@TableField
(
exist
=
false
)
private
BigDecimal
sumDactmoney
;
}
src/main/java/com/yunniu/farming/webadmin/service/GroupAreaService.java
View file @
697f0488
...
...
@@ -19,4 +19,8 @@ public interface GroupAreaService {
Result
addOrEdit
(
GroupArea
item
);
Result
delete
(
Integer
id
);
List
<
GroupArea
>
getPageList
(
GroupArea
item
);
GroupArea
findById
(
Long
areaId
);
}
src/main/java/com/yunniu/farming/webadmin/service/GroupBuyService.java
View file @
697f0488
...
...
@@ -24,5 +24,5 @@ public interface GroupBuyService {
* @param id 团购id
* @return
*/
GroupBuy
findById
(
Integer
id
);
GroupBuy
findById
(
Long
id
);
}
src/main/java/com/yunniu/farming/webadmin/service/GroupOrderService.java
View file @
697f0488
package
com
.
yunniu
.
farming
.
webadmin
.
service
;
import
com.yunniu.farming.webadmin.model.GroupBuy
;
import
com.yunniu.farming.webadmin.model.GroupOrder
;
import
com.yunniu.farming.webadmin.model.OrderMain
;
import
java.util.List
;
/**
* @author zyf
* @date 2023/5/16
...
...
@@ -11,4 +14,8 @@ import com.yunniu.farming.webadmin.model.OrderMain;
public
interface
GroupOrderService
{
GroupOrder
addGroupOrder
(
OrderMain
item
);
List
<
GroupOrder
>
findPageList
(
GroupOrder
item
);
GroupOrder
findById
(
Long
id
);
}
src/main/java/com/yunniu/farming/webadmin/service/impl/GroupAreaServiceimpl.java
View file @
697f0488
...
...
@@ -28,6 +28,12 @@ public class GroupAreaServiceimpl implements GroupAreaService {
private
GroupAreaDao
mapper
;
@Autowired
private
GroupBuyDao
groupBuyDao
;
/**
* 小程序查询
* @param item
* @return
*/
@Override
public
List
<
GroupArea
>
findPageList
(
GroupArea
item
)
{
GroupBuy
groupBuy
=
groupBuyDao
.
selectById
(
item
.
getGroupBuyId
());
...
...
@@ -57,4 +63,19 @@ public class GroupAreaServiceimpl implements GroupAreaService {
return
Result
.
success
(
this
.
mapper
.
deleteArea
(
id
));
}
/**
* 后管分页查询
* @param item
* @return
*/
@Override
public
List
<
GroupArea
>
getPageList
(
GroupArea
item
)
{
return
mapper
.
findPageList
(
item
);
}
@Override
public
GroupArea
findById
(
Long
areaId
)
{
return
mapper
.
selectById
(
areaId
);
}
}
src/main/java/com/yunniu/farming/webadmin/service/impl/GroupBuyServiceimpl.java
View file @
697f0488
...
...
@@ -79,7 +79,7 @@ public class GroupBuyServiceimpl implements GroupBuyService {
* @return
*/
@Override
public
GroupBuy
findById
(
Integer
id
)
{
public
GroupBuy
findById
(
Long
id
)
{
// 团购基础信息
GroupBuy
groupBuy
=
this
.
mapper
.
selectById
(
id
);
// 团购商品
...
...
src/main/java/com/yunniu/farming/webadmin/service/impl/GroupOrderServiceImpl.java
View file @
697f0488
...
...
@@ -5,6 +5,7 @@ import com.aliyun.oss.ServiceException;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.mysql.cj.xdevapi.Warning
;
import
com.yunniu.farming.util.StringHelper
;
import
com.yunniu.farming.webadmin.dao.GroupAreaDao
;
import
com.yunniu.farming.webadmin.dao.GroupBuyDao
;
import
com.yunniu.farming.webadmin.dao.GroupOrderDao
;
...
...
@@ -67,20 +68,38 @@ public class GroupOrderServiceImpl implements GroupOrderService {
throw
new
ServiceException
(
"小区不存在"
);
}
GroupOrder
order
=
new
GroupOrder
();
order
.
setOrderCode
(
StringHelper
.
getOrderno
());
order
.
setAreaId
(
item
.
getAreaId
());
order
.
setGroupBuyId
(
item
.
getGroupBuyId
());
order
.
setGroupSize
(
1
);
order
.
setGroupStatus
(
0
);
order
.
setGroupStatus
(
"0"
);
order
.
setCreateTime
(
new
Date
());
orderDao
.
insert
(
order
);
return
order
;
}
else
{
groupOrder
.
setGroupSize
(
groupOrder
.
getGroupSize
()
+
1
);
if
(
Objects
.
equals
(
groupOrder
.
getGroupSize
(),
groupBuy
.
getGroupSize
()))
{
groupOrder
.
setGroupStatus
(
1
);
groupOrder
.
setGroupStatus
(
"1"
);
groupOrder
.
setSuccessTime
(
new
Date
());
}
return
groupOrder
;
}
}
/**
* 查询团购订单列表
* @param item
* @return
*/
@Override
public
List
<
GroupOrder
>
findPageList
(
GroupOrder
item
)
{
return
orderDao
.
findPageList
(
item
);
}
@Override
public
GroupOrder
findById
(
Long
id
)
{
GroupOrder
order
=
orderDao
.
detailById
(
id
);
return
order
;
}
}
src/main/resources/mappings/GroupAreaMapper.xml
View file @
697f0488
...
...
@@ -10,7 +10,7 @@
and area_name like concat('%', #{areaName,jdbcType=VARCHAR}, '%')
</if>
<if
test=
"areaAddress != null and areaAddress != ''"
>
and area
A
ddress like concat('%', #{areaAddress,jdbcType=VARCHAR}, '%')
and area
_a
ddress like concat('%', #{areaAddress,jdbcType=VARCHAR}, '%')
</if>
<if
test=
"areaIds != null and areaIds.size > 0"
>
and id in
...
...
@@ -19,5 +19,10 @@
</foreach>
</if>
</where>
order by create_time desc
</select>
<delete
id=
"deleteArea"
>
update group_area set area_status =1 where id = #{id,jdbcType=INTEGER}
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mappings/GroupBuyMapper.xml
View file @
697f0488
...
...
@@ -5,11 +5,12 @@
<select
id=
"findPageList"
resultType=
"com.yunniu.farming.webadmin.model.GroupBuy"
>
select *,
concat(start_time, '~', end_time) as startAndEndTime,
(select min(product_price) from group_buy_product where group_buy_id = a.id) minPrice,
(select max(product_price) from group_buy_product where group_buy_id = a.id) maxPrice
from group_buy a
<where>
<if
test=
"groupBuyCode != null and groupBuy
c
ode != ''"
>
<if
test=
"groupBuyCode != null and groupBuy
C
ode != ''"
>
and group_buy_code = #{groupBuyCode,jdbcType=VARCHAR}
</if>
<if
test=
"groupBuyTitle != null and groupBuyTitle != ''"
>
...
...
src/main/resources/mappings/GroupOrderMapper.xml
View file @
697f0488
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.yunniu.farming.webadmin.dao.GroupOrderDao"
>
<select
id=
"findPageList"
resultType=
"com.yunniu.farming.webadmin.model.GroupOrder"
>
select
go.*,
gb.group_buy_title as groupBuyTitle,
ga.area_name as areaName,
sum(om.dactmoney) as sumDactmoney
from group_order go
left join group_buy gb on go.group_buy_id = gb.id
left join group_area ga on go.area_id = ga.id
left join order_main om on go.id = om.group_order_id
<where>
<if
test=
"orderCode != null and orderCode != ''"
>
and go.order_code like concat('%', #{orderCode,jdbcType=VARCHAR},'%')
</if>
<if
test=
"groupBuyTitle != null and groupBuyTitle != ''"
>
and gb.group_buy_title like concat('%', #{groupBuyTitle,jdbcType=VARCHAR},'%')
</if>
<if
test=
"groupStatus != null"
>
and go.group_status = #{groupStatus,jdbcType=INTEGER}
</if>
</where>
group by go.id
order by go.create_time desc
</select>
<select
id=
"detailById"
resultType=
"com.yunniu.farming.webadmin.model.GroupOrder"
>
select
go.*,
(case go.group_status when 0 then '待成团' when 1 then '待发货' when 2 then '已发货' when 3 then '已完成' else '已取消' end) as groupStatus,
gb.group_buy_title as groupBuyTitle,
ga.area_name as areaName,
sum(om.dactmoney) as sumDactmoney
from group_order go
left join group_buy gb on go.group_buy_id = gb.id
left join group_area ga on go.area_id = ga.id
left join order_main om on go.id = om.group_order_id
where go.id = #{id,jdbcType=BIGINT}
</select>
</mapper>
\ No newline at end of file
src/main/resources/templates/groupArea/addOrEdit.html
0 → 100644
View file @
697f0488
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
后台管理系统
</title>
<meta
name=
"renderer"
content=
"webkit"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<link
rel=
"shortcut icon"
th:href=
"@{/images/logo.jpg}"
/>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/layui.css}"
>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/admin.css}"
>
<script
type=
"text/javascript"
th:src=
"@{/js/jquery-3.3.1.min.js}"
></script>
<script
th:src=
"@{/js/layui/layui.js}"
charset=
"utf-8"
></script>
</head>
<body>
<div
class=
"layui-form"
style=
"padding: 20px 0 0 0;"
>
<form
id=
"formId"
onsubmit=
"return false;"
>
<input
type=
"hidden"
class=
"layui-input"
th:value=
"${obj.id}"
name=
"id"
>
<div
class=
"layui-input-inline"
>
<label
class=
"layui-form-label"
>
小区名称
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
class=
"layui-input"
id=
"areaName"
th:value=
"${obj.areaName}"
placeholder=
"请输入小区名称"
name=
"areaName"
style=
"width: 300px"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-inline"
>
<label
class=
"layui-form-label"
>
小区地址
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
class=
"layui-input"
id=
"province"
th:value=
"${obj.province}"
placeholder=
"省"
name=
"province"
style=
"width: 100px"
>
</div>
</div>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
class=
"layui-input"
id=
"city"
th:value=
"${obj.city}"
placeholder=
"市"
name=
"city"
style=
"width: 100px"
>
</div>
</div>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
class=
"layui-input"
id=
"region"
th:value=
"${obj.region}"
placeholder=
"区"
name=
"region"
style=
"width: 100px"
>
</div>
</div>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
class=
"layui-input"
id=
"areaAddress"
th:value=
"${obj.areaAddress}"
placeholder=
"详细地址"
name=
"areaAddress"
style=
"width: 300px"
>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
联系人
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
class=
"layui-input"
id=
"liaisonMan"
th:value=
"${obj.liaisonMan}"
placeholder=
"联系人"
name=
"liaisonMan"
style=
"width: 300px"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
联系电话
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
class=
"layui-input"
id=
"liaisonPhone"
th:value=
"${obj.liaisonPhone}"
placeholder=
"联系电话"
name=
"liaisonPhone"
style=
"width: 300px"
>
</div>
</div>
<button
class=
"layui-btn"
style=
"display: none;"
id=
"saveBtn"
onclick=
"save()"
>
保存
</button>
</form>
</div>
<script>
layui
.
use
(
'form'
,
function
()
{
var
form
=
layui
.
form
;
form
.
render
();
});
function
save
()
{
var
id
=
'[[${obj.id}]]'
;
var
areaName
=
$
(
"#areaName"
).
val
().
trim
();
if
(
areaName
==
''
)
{
layer
.
msg
(
"小区名称不能为空!"
);
return
false
;
}
var
province
=
$
(
"#province"
).
val
().
trim
();
if
(
province
==
''
)
{
layer
.
msg
(
"省份不能为空!"
);
return
false
;
}
var
city
=
$
(
"#city"
).
val
().
trim
();
if
(
city
==
''
)
{
layer
.
msg
(
"城市不能为空!"
);
return
false
;
}
var
region
=
$
(
"#region"
).
val
().
trim
();
if
(
region
==
''
)
{
layer
.
msg
(
"区域不能为空!"
);
return
false
;
}
var
areaAddress
=
$
(
"#areaAddress"
).
val
().
trim
();
if
(
areaAddress
==
''
)
{
layer
.
msg
(
"详细地址不能为空!"
);
return
false
;
}
var
liaisonMan
=
$
(
"#liaisonMan"
).
val
().
trim
();
if
(
liaisonMan
==
''
)
{
layer
.
msg
(
"联系人不能为空!"
);
return
false
;
}
var
liaisonPhone
=
$
(
"#liaisonPhone"
).
val
().
trim
();
if
(
liaisonPhone
==
''
)
{
layer
.
msg
(
"联系电话不能为空!"
);
return
false
;
}
var
param
=
{};
param
.
id
=
id
;
param
.
areaName
=
areaName
;
param
.
province
=
province
;
param
.
city
=
city
;
param
.
region
=
region
;
param
.
areaAddress
=
areaAddress
;
param
.
liaisonMan
=
liaisonMan
;
param
.
liaisonPhone
=
liaisonPhone
;
$
.
ajax
({
url
:
"addOrUpdate"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
0
)
{
layer
.
msg
(
"恭喜您,提交成功"
,
{
icon
:
6
,
time
:
1000
},
function
()
{
closeLayer
();
parent
.
layui
.
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
}
function
closeLayer
()
{
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
//关闭当前frame
parent
.
layer
.
close
(
index
);
}
</script>
</body>
</html>
\ No newline at end of file
src/main/resources/templates/groupArea/list.html
0 → 100644
View file @
697f0488
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<!--<head th:replace="common/common_header :: common_header"></head>-->
<head>
<meta
charset=
"UTF-8"
>
<title>
后台管理系统
</title>
<meta
name=
"renderer"
content=
"webkit"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<link
rel=
"shortcut icon"
th:href=
"@{/images/logo.jpg}"
/>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/layui.css}"
>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/admin.css}"
>
<script
type=
"text/javascript"
th:src=
"@{/js/jquery-3.3.1.min.js}"
></script>
<script
th:src=
"@{/js/layui/layui.js}"
charset=
"utf-8"
></script>
<style
type=
"text/css"
>
img
{
height
:
25px
;
}
</style>
</head>
<body>
<div
class=
"layui-fluid"
>
<div
class=
"layui-card"
>
<div
class=
"layui-form layui-card-header layuiadmin-card-header-auto"
>
<div
class=
"layui-form-item"
>
<!-- <input type="hidden" name="isLease" id="isLease" class="layui-input" th:value="${isLease}">-->
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
小区名称
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"areaName"
class=
"layui-input"
placeholder=
"请输入小区名称"
>
</div>
</div>
<div
class=
"layui-inline"
>
<button
class=
"layui-btn layuiadmin-button-btn"
lay-submit
lay-filter=
"The-search"
>
<i
class=
"layui-icon layui-icon-search layuiadmin-button-btn"
>
</i>
</button>
</div>
<div
class=
"layui-inline"
>
<button
class=
"layui-btn layuiadmin-button-btn"
onclick=
"javascript:location.replace(location.href);"
>
<i
class=
"layui-icon layui-icon-refresh-3 layuiadmin-button-btn"
>
</i>
</button>
</div>
</div>
</div>
</div>
<div
class=
"layui-card-body"
>
<table
class=
"layui-hide"
id=
"tableId"
lay-filter=
"tableId"
></table>
</div>
</div>
</div>
<script
type=
"text/html"
id=
"toolbarUtil"
>
<
div
class
=
"layui-btn-container"
>
<
button
class
=
"layui-btn layui-btn"
lay
-
event
=
"add"
>
新增
<
/button
>
<
/div
>
</script>
<script
type=
"text/html"
id=
"table-handle"
>
<
i
class
=
"layui-icon layui-icon-edit"
lay
-
event
=
"edit"
title
=
"编辑"
><
/i
>
<
i
class
=
"layui-icon layui-icon-delete"
lay
-
event
=
"del"
title
=
"删除"
><
/i
>
</script>
<script>
var
field
;
layui
.
use
([
'table'
,
'form'
],
function
()
{
var
form
=
layui
.
form
,
table
=
layui
.
table
;
//监听搜索
form
.
on
(
'submit(The-search)'
,
function
(
data
)
{
field
=
data
.
field
;
//执行重载
table
.
reload
(
'tableId'
,
{
where
:
field
,
page
:
{
curr
:
1
}
});
});
table
.
render
({
elem
:
'#tableId'
,
url
:
'findPageList'
,
where
:
{}
,
method
:
'post'
,
contentType
:
"application/json"
// 内容编码, json格式
,
height
:
500
,
toolbar
:
'#toolbarUtil'
//开启头部工具栏,并为其绑定左侧模板
,
defaultToolbar
:
[
'filter'
]
,
cellMinWidth
:
20
//全局定义常规单元格的最小宽度,layui 2.2.1 新增
,
skin
:
'line '
//表格风格 line (行边框风格)row (列边框风格)nob (无边框风格)
,
even
:
true
//隔行换色
,
limit
:
20
//每页默认显示的数量
,
page
:
true
,
request
:
{
pageName
:
"curpage"
,
// 页码的参数名称,默认:page
limitName
:
"pagesize"
// 每页数据量的参数名,默认:limit
}
,
response
:
{
statusName
:
"code"
,
// 规定数据状态的字段名称,默认:code
statusCode
:
100
,
// 规定成功的状态码,默认:0
msgName
:
"msg"
,
// 规定状态信息的字段名称,默认:msg
countName
:
"count"
,
// 规定数据总数的字段名称,默认:count
dataName
:
"data"
// 规定数据列表的字段名称,默认:data
}
,
parseData
:
function
(
res
)
{
// res 即为原始返回的数据
return
{
"code"
:
res
.
code
,
// 解析接口状态
"msg"
:
res
.
msg
,
// 解析提示文本
"count"
:
res
.
data
.
pageinfo
.
totalRecords
,
// 解析数据长度
"data"
:
res
.
data
.
items
// 解析数据列表
};
}
,
limits
:
[
10
,
20
,
50
,
100
]
//每页条数的选择项,默认:[10,20,30,40,50,60,70,80,90]。
,
cols
:
[
[
//{type: 'checkbox', field: 'goodsId', fixed: "left"}
{
type
:
'checkbox'
,
field
:
'id'
}
,
{
field
:
'areaName'
,
title
:
'小区名称'
}
,
{
field
:
'province'
,
title
:
'省'
}
,
{
field
:
'city'
,
title
:
'市'
}
,
{
field
:
'region'
,
title
:
'区'
}
,
{
field
:
'areaAddress'
,
title
:
'详细地址'
}
,
{
field
:
'liaisonMan'
,
title
:
'联系人'
}
,
{
field
:
'liaisonPhone'
,
title
:
'联系电话'
}
// , {field: 'sicon', title: '图片', toolbar: '#sicon'}
,
{
field
:
''
,
width
:
100
,
title
:
'操作'
,
toolbar
:
'#table-handle'
,
fixed
:
'right'
}
]
]
});
//头工具栏事件
table
.
on
(
'toolbar(tableId)'
,
function
(
obj
)
{
var
checkStatus
=
table
.
checkStatus
(
obj
.
config
.
id
);
switch
(
obj
.
event
)
{
case
'add'
:
var
w
=
(
$
(
window
).
width
()
*
0.9
);
var
h
=
(
$
(
window
).
height
()
*
0.9
);
layer
.
open
({
type
:
2
,
title
:
'新增'
,
content
:
'addOrEdit'
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
,
maxmin
:
true
,
shadeClose
:
true
,
shade
:
0.4
,
btn
:
[
'保存'
,
'关闭'
]
,
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
//得到iframe页面层的BODY
var
iframeBtn
=
body
.
find
(
'#saveBtn'
);
//得到iframe页面层的提交按钮
iframeBtn
.
click
();
//模拟iframe页面层的提交按钮点击
}
});
break
;
case
'del'
:
var
data
=
checkStatus
.
data
;
var
id
=
''
;
if
(
data
.
length
>
0
)
{
for
(
var
j
=
0
;
j
<
data
.
length
;
j
++
)
{
id
=
id
+
","
+
data
[
j
].
goodsId
;
}
}
else
{
layer
.
msg
(
"请至少选择一条数据!"
);
return
false
;
}
layer
.
confirm
(
'确定要彻底删除选中的数据吗?'
,
function
(
index
)
{
$
.
ajax
({
url
:
"delete/"
+
id
,
// data: {"id": id},
type
:
"delete"
,
dataType
:
"json"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
layer
.
close
(
index
);
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
break
;
}
;
});
//监听行工具事件
table
.
on
(
'tool(tableId)'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
//console.log(obj)
if
(
obj
.
event
===
'del'
)
{
layer
.
confirm
(
'删除后无法撤销,确定继续吗?'
,
function
(
index
)
{
$
.
ajax
({
url
:
"/groupArea/delete/"
+
obj
.
data
.
id
,
type
:
"GET"
,
dataType
:
"json"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'edit'
)
{
console
.
log
(
"1111111111111111111 ="
,
obj
.
data
.
id
);
var
id
=
obj
.
data
.
id
;
var
w
=
(
$
(
window
).
width
()
*
0.9
);
var
h
=
(
$
(
window
).
height
()
*
0.9
);
layer
.
open
({
type
:
2
,
title
:
'编辑产品'
,
content
:
'addOrEdit?areaId='
+
id
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
,
maxmin
:
true
,
shadeClose
:
true
,
shade
:
0.4
,
btn
:
[
'保存'
,
'关闭'
]
,
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
//得到iframe页面层的BODY
var
iframeBtn
=
body
.
find
(
'#saveBtn'
);
//得到iframe页面层的提交按钮
iframeBtn
.
click
();
//模拟iframe页面层的提交按钮点击
}
});
}
else
if
(
obj
.
event
===
'spec'
)
{
var
id
=
obj
.
data
.
goodsId
;
var
w
=
(
$
(
window
).
width
()
*
0.9
);
var
h
=
(
$
(
window
).
height
()
*
0.9
);
layer
.
open
({
type
:
2
,
title
:
'添加商品规格'
,
content
:
'toSpec?id='
+
id
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
,
maxmin
:
true
,
shadeClose
:
true
,
shade
:
0.4
,
btn
:
[
'保存'
,
'关闭'
]
,
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
//得到iframe页面层的BODY
var
iframeBtn
=
body
.
find
(
'#saveBtn'
);
//得到iframe页面层的提交按钮
iframeBtn
.
click
();
//模拟iframe页面层的提交按钮点击
}
});
}
else
if
(
obj
.
event
===
'abolish1'
)
{
var
data
=
'abolishState=0&goodsId='
+
obj
.
data
.
goodsId
updateAbolishState
(
data
);
}
else
if
(
obj
.
event
===
'abolish0'
)
{
var
data
=
'abolishState=1&goodsId='
+
obj
.
data
.
goodsId
updateAbolishState
(
data
);
}
else
if
(
obj
.
event
===
'setTj'
)
{
layer
.
confirm
(
'确定设为推荐吗?'
,
function
(
index
)
{
var
param
=
{};
param
.
id
=
obj
.
data
.
id
;
param
.
ishot
=
1
;
$
.
ajax
({
url
:
"update"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
"设置成功"
,
{
icon
:
6
,
time
:
1000
},
function
()
{
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'calTj'
)
{
layer
.
confirm
(
'确定设为推荐吗?'
,
function
(
index
)
{
var
param
=
{};
param
.
id
=
obj
.
data
.
id
;
param
.
ishot
=
0
;
$
.
ajax
({
url
:
"update"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
"设置成功"
,
{
icon
:
6
,
time
:
1000
},
function
()
{
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'setXj'
)
{
layer
.
confirm
(
'确定要下架吗?'
,
function
(
index
)
{
var
param
=
{};
param
.
id
=
obj
.
data
.
id
;
param
.
istatus
=
3
;
$
.
ajax
({
url
:
"update"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
"下架成功"
,
{
icon
:
6
,
time
:
1000
},
function
()
{
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'setSj'
)
{
layer
.
confirm
(
'确定要上架吗?'
,
function
(
index
)
{
var
param
=
{};
param
.
id
=
obj
.
data
.
id
;
param
.
istatus
=
1
;
$
.
ajax
({
url
:
"update"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
"上架成功"
,
{
icon
:
6
,
time
:
1000
},
function
()
{
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
});
});
function
updateAbolishState
(
data
)
{
$
.
ajax
({
url
:
"changeAbolishState"
,
data
:
data
,
type
:
"POST"
,
dataType
:
"json"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
location
.
replace
(
location
.
href
)
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
}
</script>
</body>
</html>
\ No newline at end of file
src/main/resources/templates/groupBuy/addOrEdit.html
0 → 100644
View file @
697f0488
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
后台管理系统
</title>
<meta
name=
"renderer"
content=
"webkit"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<link
rel=
"shortcut icon"
th:href=
"@{/images/logo.jpg}"
/>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/layui.css}"
>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/admin.css}"
>
<link
rel=
"stylesheet"
th:href=
"@{/js/upload_img/css/index.css}"
>
<script
type=
"text/javascript"
th:src=
"@{/js/jquery-3.3.1.min.js}"
></script>
<script
th:src=
"@{/js/layui/layui.js}"
charset=
"utf-8"
></script>
<link
rel=
"stylesheet"
th:href=
"@{/js/ueditor/themes/default/css/ueditor.css}"
type=
"text/css"
/>
<script
type=
"text/javascript"
th:src=
"@{/js/ueditor/ueditor.config.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/js/ueditor/ueditor.all.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/js/ueditor/lang/zh-cn/zh-cn.js}"
></script>
<script
src=
"http://www.jq22.com/jquery/jquery-1.7.1.js"
></script>
<style>
.layui-form-label
{
width
:
120px
;
}
#editor
{
height
:
600px
;
width
:
700px
;
}
</style>
</head>
<body>
<div
class=
"layui-form"
style=
"padding: 20px 0 0 0;"
>
<form
id=
"formId"
onsubmit=
"return false;"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
style=
"color: red"
>
*
</span>
活动标题
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
class=
"layui-input"
name=
"groupBuyTitle"
id=
"groupBuyTitle"
th:value=
"${obj.groupBuyTitle}"
>
</div>
<label
class=
"layui-form-label"
><span
style=
"color: red"
>
*
</span>
最低起送人数
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"number"
step=
"1"
class=
"layui-input"
name=
"groupSize"
id=
"groupSize"
th:value=
"${obj.groupSize}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
style=
"color: red"
>
*
</span>
团购活动有效期
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"date"
class=
"layui-input"
name=
"startTime"
id=
"startTime"
th:value=
"${obj.startTime}"
>
</div>
<label
class=
"layui-form-label"
>
至
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"date"
class=
"layui-input"
name=
"endTime"
id=
"endTime"
th:value=
"${obj.endTime}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
style=
"color: red"
>
*
</span>
配送小区
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"goodsClassPid"
id=
"areaIdList"
lay-filter=
"catalogid"
lay-search
>
<option
th:each=
"list:${goodsClassList}"
th:value=
"${list.id}"
th:text=
"${list.sname }"
th:selected=
"${list.id}==${obj.catalogid}"
></option>
</select>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
<span
style=
"color: red"
>
*
</span>
商品图片
</label>
<div
class=
"layui-input-inline"
style=
"width: 700px"
>
<div
class=
"main"
>
<div
id=
"showimg"
>
<ul
id=
"showui"
>
</ul>
<div
id=
"showinput"
>
</div>
</div>
<br>
<a
class=
"layui-btn layui-btn"
onclick=
"uploadImg()"
><i
class=
"layui-icon layui-icon-add-1"
></i>
选择图片
</a>
<input
style=
"display: none"
type=
"file"
id=
"upgteimg"
value=
""
accept=
"image/jpg,image/jpeg,image/png,image/bmp"
multiple
/>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
style=
"color: red"
></span>
团购详情
</label>
<div
class=
"layui-input-inline"
id=
"groupDetail"
style=
"width:70%"
>
<script
id=
"editor"
name=
"detailContent"
th:utext=
"${obj.groupDetail}"
type=
"text/plain"
style=
"width:100%;height:500px;"
></script>
</div>
</div>
<button
class=
"layui-btn"
style=
"display: none;"
id=
"saveBtn"
onclick=
"save()"
>
保存
</button>
</form>
</div>
<script
type=
"text/javascript"
th:src=
"@{/js/upload_img/js/updateimg.js}"
></script>
<script>
var
id
=
'[[${id}]]'
;
var
ue
=
UE
.
getEditor
(
'editor'
);
UE
.
Editor
.
prototype
.
_bkGetActionUrl
=
UE
.
Editor
.
prototype
.
getActionUrl
;
UE
.
Editor
.
prototype
.
getActionUrl
=
function
(
action
)
{
if
(
action
==
'uploadimage'
||
action
==
'uploadscrawl'
||
action
==
'uploadimage'
)
{
return
"http://1.15.43.240:8330/product/uploads"
;
// return "https://127.0.0.1/goods/uploads";
}
else
if
(
action
==
'listimage'
)
{
return
this
.
_bkGetActionUrl
.
call
(
this
,
action
);
}
else
{
return
this
.
_bkGetActionUrl
.
call
(
this
,
action
);
}
}
$
(
function
()
{
if
(
id
)
{
// getGoodsInfo(goodsId);
showImg
(
'[[${obj.groupBuyTitle}]]'
);
}
});
function
save
()
{
// if ($("#formId input[name='sname']").val() == '') {
// layer.msg("名称不能为空!");
// return false;
// }
//
// if ($("#formId input[name='sfactory']").val() == '') {
// layer.msg("产地不能为空!");
// return false;
// }
//
// if ($("#formId input[name='spcode']").val() == '') {
// layer.msg("编码不能为空!");
// return false;
// }
//
// if ($("#formId input[name='scondition']").val() == '') {
// layer.msg("条件不能为空!");
// return false;
// }
//
// if ($("#formId input[name='sduction']").val() == '') {
// layer.msg("简介不能为空!");
// return false;
// }
//
// if ($("#formId input[name='specs']").val() == '') {
// layer.msg("规格不能为空!");
// return false;
// }
//
//
// if (!$("#dsaleprice").val()) {
// layer.msg("售价不能为空!");
// return false;
// }
//
// if ($("#dsaleprice").val() == 0) {
// layer.msg("售价不能为0!");
// return false;
// }
//
//
// if (!$("#doldprice").val()) {
// layer.msg("原价不能为空!");
// return false;
// }
//
// if (!$("#catalogid").val()) {
// layer.msg("分类不能为空!");
// return false;
// }
//
//
// var dsaleprice = $("#formId input[name='dsaleprice']").val();
// //var reg = /^(?!0+(?:\.0+)?$)(?:[1-9]\d*|0)(?:\.\d{1,2})?$/;
// var reg = /^[0-9]+([.]{1}[0-9]{1,2})?$/;
// if (dsaleprice == '' || !reg.test(dsaleprice)) {
// layer.msg("售价不合法!", {icon: 5});
// return false;
// }
//
//
// var content = UE.getEditor('editor').getContent();
// if (content == '') {
// layer.msg("商品详情不能为空!", {icon: 5});
// return false;
// }
//
// var form = document.querySelector("#formId");
// var formdata = new FormData(form);
// var catalogid = $("#catalogid").val();
// formdata.append("catalogid", catalogid);
// formdata.append("sdetail", content);
// formdata.append("istatus", 1);
// formdata.append("itype", 10);
// var goodsImgArr = [dataArr.length];
// for (var i = 0; i
<
dataArr
.
length
;
i
++
)
{
// goodsImgArr[i] = dataArr[i].base64;
// }
// formdata.append("goodsImgArr", goodsImgArr);
// formdata.append("id", id);
$
.
ajax
({
url
:
"add"
,
data
:
formdata
,
type
:
"POST"
,
dataType
:
"json"
,
processData
:
false
,
contentType
:
false
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
closeLayer
();
parent
.
layui
.
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
}
function
showImg
(
goodsImgs
)
{
var
arr
=
goodsImgs
.
split
(
","
);
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
var
imgMsg
=
{
name
:
randomString
(
5
),
//获取文件名
base64
:
arr
[
i
],
//reader.readAsDataURL方法执行完后,base64数据储存在reader.result里
}
dataArr
.
push
(
imgMsg
);
currentReViewImgIndex
=
i
;
var
showui
=
document
.
getElementById
(
"showui"
);
result
=
'<div class="showdiv"><img class="left" src="/js/upload_img/img/Arrow_left.svg" /><img class="center" src="/js/upload_img/img/delete.svg" /><img class="right" src="/js/upload_img/img/Arrow_right.svg" /></div><img id="img'
+
currentReViewImgIndex
+
randomString
(
1
)
+
randomString
(
2
)
+
randomString
(
5
)
+
'" class="showimg" src="'
+
arr
[
i
]
+
'" />'
;
var
li
=
document
.
createElement
(
'li'
);
li
.
innerHTML
=
result
;
showui
.
appendChild
(
li
);
}
}
function
uploadImg
()
{
$
(
"#upgteimg"
).
click
();
}
layui
.
use
(
'form'
,
function
()
{
var
form
=
layui
.
form
;
form
.
render
();
});
function
closeLayer
()
{
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
//关闭当前frame
parent
.
layer
.
close
(
index
);
}
function
chioceImage
(
i
)
{
$
(
'#file'
+
i
).
trigger
(
"click"
);
}
</script>
</body>
</html>
\ No newline at end of file
src/main/resources/templates/groupBuy/list.html
View file @
697f0488
...
...
@@ -19,33 +19,42 @@
</style>
</head>
<body>
<div
class=
"layui-fluid"
>
<div
class=
"layui-card"
>
<div
class=
"layui-form layui-card-header layuiadmin-card-header-auto"
>
<div
class=
"layui-form-item"
>
<!-- <div class="layui-inline">
<label class="layui-form-label">一级类型</label>
<div class="layui-input-block">
<select name="goodsClassId" id="goodsClass">
<option value="">全部</option>
</select>
</div>
</div>-->
<!-- <input type="hidden" name="isLease" id="isLease" class="layui-input" th:value="${isLease}">-->
<div
class=
"layui-inline"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"
snam
e"
class=
"layui-input"
placeholder=
"请输入活动编码"
>
<input
type=
"text"
name=
"
groupBuyCod
e"
class=
"layui-input"
placeholder=
"请输入活动编码"
>
</div>
</div>
<div
class=
"layui-inline"
>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"
snam
e"
class=
"layui-input"
placeholder=
"请输入活动标题"
>
<input
type=
"text"
name=
"
groupBuyTitl
e"
class=
"layui-input"
placeholder=
"请输入活动标题"
>
</div>
</div>
<!--<div class="layui-inline">-->
<!--<label class="layui-form-label"><span style="color: red">*</span>分类</label>-->
<!--<div class="layui-input-inline">-->
<!--<select name="goodsClassPid" id="goodsClassPid" lay-filter="goodsClassPid" lay-search>-->
<!--<option value="">全部</option>-->
<!--<option th:each="list:${goodsClassList}" th:value="${list.goodsClassId}"-->
<!--th:text="${list.goodsClassName }"></option>-->
<!--</select>-->
<!--</div>-->
<!--</div>-->
<!-- <div class="layui-inline">-->
<!-- <label class="layui-form-label">状态</label>-->
<!-- <div class="layui-input-block">-->
<!-- <select name="abolishState">-->
<!-- <option value="">全部</option>-->
<!-- <option value="0">在售</option>-->
<!-- <option value="1">已删除</option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<div
class=
"layui-inline"
>
<button
class=
"layui-btn layuiadmin-button-btn"
lay-submit
lay-filter=
"The-search"
>
<i
class=
"layui-icon layui-icon-search layuiadmin-button-btn"
>
...
...
@@ -60,57 +69,57 @@
</button>
</div>
</div>
</div>
</div>
<div
class=
"layui-card-body"
>
<table
class=
"layui-hide"
id=
"tableId"
lay-filter=
"tableId"
></table>
</div>
</div>
</div>
<!--<script type="text/html" id="faultStatus">-->
<!-- {{#if (d.faultStatus == 0) { }}-->
<!-- <span class="layui-bg-green">正常</span>-->
<!-- {{# }else if(d.faultStatus == 1){ }}-->
<!-- <span class="layui-bg-red">故障</span>-->
<!-- {{# } }}-->
<!--</script>-->
<script
type=
"text/html"
id=
"toolbarUtil"
>
<
div
class
=
"layui-btn-container"
>
<
button
class
=
"layui-btn layui-btn"
lay
-
event
=
"add"
>
<
i
class
=
"layui-icon layui-icon-add-1"
><
/i>
新增</
button
>
<
button
class
=
"layui-btn layui-btn"
lay
-
event
=
"add"
>
新增
<
/button
>
<
/div
>
</script>
<script
type=
"text/html"
id=
"table-handle"
>
<
i
class
=
"layui-icon layui-icon-edit"
lay
-
event
=
"edit"
title
=
"编辑"
><
/i
>
<
i
class
=
"layui-icon layui-icon-delete"
lay
-
event
=
"del"
title
=
"删除"
><
/i
>
<!--
{{
#
if
(
d
.
ishot
==
0
)
{
}}
-->
<!--
<
i
class
=
"layui-icon layui-icon-cart"
lay
-
event
=
"setTj"
title
=
"设为推荐"
><
/i>--
>
<!--
{{
#
}
else
if
(
d
.
ishot
==
1
){
}}
-->
<!--
<
i
class
=
"layui-icon layui-icon-form"
lay
-
event
=
"calTj"
title
=
"取消推荐"
><
/i>--
>
<!--
{{
#
}
}}
-->
<!--
{{
#
if
(
d
.
istatus
==
3
)
{
}}
-->
<!--
<
i
class
=
"layui-icon layui-icon-upload-circle"
lay
-
event
=
"setSj"
title
=
"上架"
><
/i>--
>
<!--
{{
#
}
else
if
(
d
.
istatus
==
1
){
}}
-->
<!--
<
i
class
=
"layui-icon layui-icon-download-circle"
lay
-
event
=
"setXj"
title
=
"下架"
><
/i>--
>
<!--
{{
#
}
}}
-->
</script>
<script
type=
"text/html"
id=
"s
icon
"
>
{{
#
if
(
d
.
s
icon
!=
null
&&
d
.
sicon
!=
''
)
{
}}
<
img
src
=
"{{d.s
icon
}}"
>
{{
#
}
else
if
(
d
.
s
icon
==
null
||
d
.
sicon
==
''
){
}}
<script
type=
"text/html"
id=
"s
shortpic
"
>
{{
#
if
(
d
.
s
shortpic
!=
null
&&
d
.
sshortpic
!=
''
)
{
}}
<
img
src
=
"{{d.s
shortpic
}}"
>
{{
#
}
else
if
(
d
.
s
shortpic
==
null
||
d
.
sshortpic
==
''
){
}}
<
span
>
无
<
/span
>
{{
#
}
}}
</script>
<script>
<script
type=
"text/html"
id=
"istatus"
>
{{
#
if
(
d
.
istatus
==
3
)
{
}}
<
span
>
已下架
<
/span
>
{{
#
}
else
if
(
d
.
istatus
==
1
){
}}
<
span
>
在售
<
/span
>
{{
#
}
}}
</script>
$
(
function
()
{
$
.
ajax
({
url
:
'getPlist'
,
dataType
:
'json'
,
type
:
'POST'
,
success
:
function
(
data
)
{
$
.
each
(
data
,
function
(
index
,
item
)
{
$
(
'#goodsClass'
).
append
(
new
Option
(
item
.
goodsClassName
,
item
.
goodsClassId
));
// 下拉菜单里添加元素
});
layui
.
form
.
render
(
"select"
);
}
})
})
<script>
var
field
=
{}
;
var
field
;
layui
.
use
([
'table'
,
'form'
],
function
()
{
var
form
=
layui
.
form
,
table
=
layui
.
table
;
//监听搜索
...
...
@@ -126,8 +135,8 @@
});
table
.
render
({
elem
:
'#tableId'
,
url
:
'find
ByParam
'
,
where
:
field
,
url
:
'find
PageList
'
,
where
:
{}
,
method
:
'post'
,
contentType
:
"application/json"
// 内容编码, json格式
,
height
:
500
...
...
@@ -137,7 +146,11 @@
,
skin
:
'line '
//表格风格 line (行边框风格)row (列边框风格)nob (无边框风格)
,
even
:
true
//隔行换色
,
limit
:
20
//每页默认显示的数量
,
page
:
false
,
page
:
true
,
request
:
{
pageName
:
"curpage"
,
// 页码的参数名称,默认:page
limitName
:
"pagesize"
// 每页数据量的参数名,默认:limit
}
,
response
:
{
statusName
:
"code"
,
// 规定数据状态的字段名称,默认:code
statusCode
:
100
,
// 规定成功的状态码,默认:0
...
...
@@ -149,59 +162,37 @@
,
parseData
:
function
(
res
)
{
// res 即为原始返回的数据
return
{
"code"
:
res
.
code
,
// 解析接口状态
"msg"
:
res
.
desc
,
// 解析提示文本
"count"
:
res
.
data
.
length
,
// 解析数据长度
"data"
:
res
.
data
// 解析数据列表
"msg"
:
res
.
msg
,
// 解析提示文本
"count"
:
res
.
data
.
pageinfo
.
totalRecords
,
// 解析数据长度
"data"
:
res
.
data
.
items
// 解析数据列表
};
}
,
limits
:
[
10
,
20
,
50
,
100
]
//每页条数的选择项,默认:[10,20,30,40,50,60,70,80,90]。
,
cols
:
[
[
//{type: 'checkbox', field: 'goodsId', fixed: "left"}
{
type
:
'checkbox'
,
field
:
'id'
}
,
{
field
:
'sname'
,
title
:
'编码'
}
,
{
field
:
'sname'
,
title
:
'活动标题'
}
,
{
field
:
'sname'
,
title
:
'开团次数'
}
,
{
field
:
'sname'
,
title
:
'成团次数'
}
,
{
field
:
'sname'
,
title
:
'成交金额'
}
,
{
field
:
'sname'
,
title
:
'成交数量'
}
,
{
field
:
'sname'
,
title
:
'活动日期'
}
,
{
field
:
'sname'
,
title
:
'状态'
}
,
{
field
:
'groupBuyCode'
,
title
:
'编码'
}
,
{
field
:
'groupBuyTitle'
,
title
:
'活动标题'
}
,
{
field
:
'startAndEndTime'
,
title
:
'活动日期'
}
,
{
field
:
'groupStatus'
,
title
:
'状态'
}
// , {field: 'sicon', title: '图片', toolbar: '#sicon'}
,
{
field
:
''
,
width
:
100
,
title
:
'操作'
,
toolbar
:
'#table-handle'
,
fixed
:
'right'
}
]
]
,
done
:
function
(
res
,
curr
,
count
)
{
$
(
".layui-table-main tr"
).
each
(
function
(
index
,
val
)
{
$
(
$
(
".layui-table-fixed-l .layui-table-body tbody tr"
)[
index
]).
height
(
$
(
val
).
height
());
$
(
$
(
".layui-table-fixed-r .layui-table-body tbody tr"
)[
index
]).
height
(
$
(
val
).
height
());
});
$
(
".layui-table-main tr"
).
each
(
function
(
index
,
val
)
{
$
(
".layui-table-fixed"
).
each
(
function
()
{
$
(
$
(
this
).
find
(
".layui-table-body tbody tr"
)[
index
]).
height
(
$
(
val
).
height
());
});
});
$
(
".layui-table-main tr"
).
each
(
function
(
index
,
val
)
{
$
(
".layui-table-fixed"
).
each
(
function
()
{
$
(
$
(
this
).
find
(
".layui-table-body tbody th"
)[
index
]).
height
(
$
(
val
).
height
());
});
});
}
});
//头工具栏事件
table
.
on
(
'toolbar(tableId)'
,
function
(
obj
)
{
var
checkStatus
=
table
.
checkStatus
(
obj
.
config
.
id
);
switch
(
obj
.
event
)
{
case
'add'
:
var
w
=
(
$
(
window
).
width
()
*
0.
5
);
var
h
=
(
$
(
window
).
height
()
*
0.
8
);
var
w
=
(
$
(
window
).
width
()
*
0.
9
);
var
h
=
(
$
(
window
).
height
()
*
0.
9
);
layer
.
open
({
type
:
2
,
title
:
'新增
类型
'
,
title
:
'新增'
,
content
:
'addOrEdit'
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
...
...
@@ -214,7 +205,6 @@
var
iframeBtn
=
body
.
find
(
'#saveBtn'
);
//得到iframe页面层的提交按钮
iframeBtn
.
click
();
//模拟iframe页面层的提交按钮点击
}
});
break
;
case
'del'
:
...
...
@@ -222,7 +212,7 @@
var
id
=
''
;
if
(
data
.
length
>
0
)
{
for
(
var
j
=
0
;
j
<
data
.
length
;
j
++
)
{
id
=
id
+
","
+
data
[
j
].
goods
Class
Id
;
id
=
id
+
","
+
data
[
j
].
goodsId
;
}
}
else
{
layer
.
msg
(
"请至少选择一条数据!"
);
...
...
@@ -230,45 +220,23 @@
}
layer
.
confirm
(
'确定要彻底删除选中的数据吗?'
,
function
(
index
)
{
$
.
ajax
({
url
:
"
del
"
,
url
:
"
changeDeleteState
"
,
data
:
{
"id"
:
id
},
type
:
"POST"
,
dataType
:
"json"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
table
.
reload
(
'tableId'
);
layer
.
close
(
index
);
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
table
.
reload
(
'tableId'
);
layer
.
close
(
index
);
}
}
});
});
break
;
case
'rotation'
:
var
w
=
(
$
(
window
).
width
()
*
0.7
);
var
h
=
(
$
(
window
).
height
()
*
0.4
);
layer
.
open
({
type
:
2
,
title
:
'轮播图设置'
,
content
:
'toBanner'
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
,
maxmin
:
true
,
shadeClose
:
true
,
shade
:
0.4
,
btn
:
[
'保存'
,
'关闭'
]
,
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
//得到iframe页面层的BODY
var
iframeBtn
=
body
.
find
(
'#saveBtn'
);
//得到iframe页面层的提交按钮
iframeBtn
.
click
();
//模拟iframe页面层的提交按钮点击
}
});
break
;
}
;
});
...
...
@@ -276,21 +244,17 @@
//监听行工具事件
table
.
on
(
'tool(tableId)'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
//console.log(obj)
if
(
obj
.
event
===
'del'
)
{
layer
.
confirm
(
'确定彻底删除['
+
obj
.
data
.
sname
+
']吗?'
,
function
(
index
)
{
layer
.
confirm
(
'删除后无法撤销,确定继续吗?'
,
function
(
index
)
{
$
.
ajax
({
url
:
"del"
,
data
:
{
"id"
:
obj
.
data
.
id
},
type
:
"POST"
,
url
:
"/product/"
+
obj
.
data
.
id
+
"/deleteById"
,
type
:
"GET"
,
dataType
:
"json"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
table
.
reload
(
'tableId'
);
layer
.
close
(
index
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
...
...
@@ -300,11 +264,11 @@
});
}
else
if
(
obj
.
event
===
'edit'
)
{
var
id
=
obj
.
data
.
id
;
var
w
=
(
$
(
window
).
width
()
*
0.
5
);
var
h
=
(
$
(
window
).
height
()
*
0.
8
);
var
w
=
(
$
(
window
).
width
()
*
0.
9
);
var
h
=
(
$
(
window
).
height
()
*
0.
9
);
layer
.
open
({
type
:
2
,
title
:
'编辑
类型
'
,
title
:
'编辑
产品
'
,
content
:
'addOrEdit?id='
+
id
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
...
...
@@ -318,11 +282,164 @@
iframeBtn
.
click
();
//模拟iframe页面层的提交按钮点击
}
});
}
else
if
(
obj
.
event
===
'spec'
)
{
var
id
=
obj
.
data
.
id
;
var
w
=
(
$
(
window
).
width
()
*
0.9
);
var
h
=
(
$
(
window
).
height
()
*
0.9
);
layer
.
open
({
type
:
2
,
title
:
'添加商品规格'
,
content
:
'toSpec?id='
+
id
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
,
maxmin
:
true
,
shadeClose
:
true
,
shade
:
0.4
,
btn
:
[
'保存'
,
'关闭'
]
,
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
//得到iframe页面层的BODY
var
iframeBtn
=
body
.
find
(
'#saveBtn'
);
//得到iframe页面层的提交按钮
iframeBtn
.
click
();
//模拟iframe页面层的提交按钮点击
}
});
}
else
if
(
obj
.
event
===
'abolish1'
)
{
var
data
=
'abolishState=0&goodsId='
+
obj
.
data
.
goodsId
updateAbolishState
(
data
);
}
else
if
(
obj
.
event
===
'abolish0'
)
{
var
data
=
'abolishState=1&goodsId='
+
obj
.
data
.
goodsId
updateAbolishState
(
data
);
}
else
if
(
obj
.
event
===
'setTj'
)
{
layer
.
confirm
(
'确定设为推荐吗?'
,
function
(
index
)
{
var
param
=
{};
param
.
id
=
obj
.
data
.
id
;
param
.
ishot
=
1
;
$
.
ajax
({
url
:
"update"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
"设置成功"
,
{
icon
:
6
,
time
:
1000
},
function
()
{
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'calTj'
)
{
layer
.
confirm
(
'确定设为推荐吗?'
,
function
(
index
)
{
var
param
=
{};
param
.
id
=
obj
.
data
.
id
;
param
.
ishot
=
0
;
$
.
ajax
({
url
:
"update"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
"设置成功"
,
{
icon
:
6
,
time
:
1000
},
function
()
{
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'setXj'
)
{
layer
.
confirm
(
'确定要下架吗?'
,
function
(
index
)
{
var
param
=
{};
param
.
id
=
obj
.
data
.
id
;
param
.
istatus
=
3
;
$
.
ajax
({
url
:
"update"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
"下架成功"
,
{
icon
:
6
,
time
:
1000
},
function
()
{
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'setSj'
)
{
layer
.
confirm
(
'确定要上架吗?'
,
function
(
index
)
{
var
param
=
{};
param
.
id
=
obj
.
data
.
id
;
param
.
istatus
=
1
;
$
.
ajax
({
url
:
"update"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
"上架成功"
,
{
icon
:
6
,
time
:
1000
},
function
()
{
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
});
});
function
updateAbolishState
(
data
)
{
$
.
ajax
({
url
:
"changeAbolishState"
,
data
:
data
,
type
:
"POST"
,
dataType
:
"json"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
location
.
replace
(
location
.
href
)
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
}
</script>
</body>
...
...
src/main/resources/templates/groupOrder/detail.html
0 → 100644
View file @
697f0488
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
后台管理系统
</title>
<meta
name=
"renderer"
content=
"webkit"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<link
rel=
"shortcut icon"
th:href=
"@{/images/logo.jpg}"
/>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/layui.css}"
>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/admin.css}"
>
<link
rel=
"stylesheet"
th:href=
"@{/js/upload_img/css/index.css}"
>
<script
type=
"text/javascript"
th:src=
"@{/js/jquery-3.3.1.min.js}"
></script>
<script
th:src=
"@{/js/layui/layui.js}"
charset=
"utf-8"
></script>
<link
rel=
"stylesheet"
th:href=
"@{/js/ueditor/themes/default/css/ueditor.css}"
type=
"text/css"
/>
<script
type=
"text/javascript"
th:src=
"@{/js/ueditor/ueditor.config.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/js/ueditor/ueditor.all.js}"
></script>
<script
type=
"text/javascript"
th:src=
"@{/js/ueditor/lang/zh-cn/zh-cn.js}"
></script>
<script
src=
"http://www.jq22.com/jquery/jquery-1.7.1.js"
></script>
<style>
.layui-form-label
{
width
:
100px
;
}
#editor
{
height
:
600px
;
width
:
700px
;
}
</style>
</head>
<body>
<div
class=
"layui-form"
style=
"padding: 20px 0 0 0;"
>
<!-- <div class="tab-container">-->
<!-- <ul class="tabs">-->
<!-- <li><a href="#tab1">详情</a></li>-->
<!-- <li><a href="#tab2">用户信息</a></li>-->
<!-- </ul>-->
<!-- <div class="tab-content">-->
<!-- <div id="tab1">-->
<form
id=
"formId"
onsubmit=
"return false;"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
活动标题
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
class=
"layui-input"
name=
"groupBuyTitle"
id=
"groupBuyTitle"
th:value=
"${obj.groupBuyTitle}"
>
</div>
<label
class=
"layui-form-label"
>
订单号
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
step=
"1"
class=
"layui-input"
name=
"orderCode"
id=
"orderCode"
th:value=
"${obj.orderCode}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
订单实付金额
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"number"
class=
"layui-input"
name=
"sumDactmoney"
id=
"sumDactmoney"
th:value=
"${obj.sumDactmoney}"
>
</div>
<label
class=
"layui-form-label"
>
订单状态
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
class=
"layui-input"
name=
"groupStatus"
id=
"groupStatus"
th:value=
"${obj.groupStatus}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
成团时间
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
class=
"layui-input"
name=
"successTime"
id=
"successTime"
th:value=
"${obj.successTime}"
>
</div>
<label
class=
"layui-form-label"
>
小区名称
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
class=
"layui-input"
name=
"areaName"
id=
"areaName"
th:value=
"${obj.areaName}"
>
</div>
</div>
<button
class=
"layui-btn"
style=
"display: none;"
id=
"saveBtn"
onclick=
"save()"
>
保存
</button>
</form>
<!-- </div>-->
<!-- <div id="tab2"><p>Content for tab 2 goes here.</p></div>-->
<!-- </div>-->
</div>
</div>
<script
type=
"text/javascript"
th:src=
"@{/js/upload_img/js/updateimg.js}"
></script>
<script>
var
id
=
'[[${id}]]'
;
var
ue
=
UE
.
getEditor
(
'editor'
);
UE
.
Editor
.
prototype
.
_bkGetActionUrl
=
UE
.
Editor
.
prototype
.
getActionUrl
;
UE
.
Editor
.
prototype
.
getActionUrl
=
function
(
action
)
{
if
(
action
==
'uploadimage'
||
action
==
'uploadscrawl'
||
action
==
'uploadimage'
)
{
return
"http://1.15.43.240:8330/product/uploads"
;
// return "https://127.0.0.1/goods/uploads";
}
else
if
(
action
==
'listimage'
)
{
return
this
.
_bkGetActionUrl
.
call
(
this
,
action
);
}
else
{
return
this
.
_bkGetActionUrl
.
call
(
this
,
action
);
}
}
$
(
function
()
{
if
(
id
)
{
// getGoodsInfo(goodsId);
showImg
(
'[[${obj.groupBuyTitle}]]'
);
}
});
function
showImg
(
goodsImgs
)
{
var
arr
=
goodsImgs
.
split
(
","
);
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
var
imgMsg
=
{
name
:
randomString
(
5
),
//获取文件名
base64
:
arr
[
i
],
//reader.readAsDataURL方法执行完后,base64数据储存在reader.result里
}
dataArr
.
push
(
imgMsg
);
currentReViewImgIndex
=
i
;
var
showui
=
document
.
getElementById
(
"showui"
);
result
=
'<div class="showdiv"><img class="left" src="/js/upload_img/img/Arrow_left.svg" /><img class="center" src="/js/upload_img/img/delete.svg" /><img class="right" src="/js/upload_img/img/Arrow_right.svg" /></div><img id="img'
+
currentReViewImgIndex
+
randomString
(
1
)
+
randomString
(
2
)
+
randomString
(
5
)
+
'" class="showimg" src="'
+
arr
[
i
]
+
'" />'
;
var
li
=
document
.
createElement
(
'li'
);
li
.
innerHTML
=
result
;
showui
.
appendChild
(
li
);
}
}
function
uploadImg
()
{
$
(
"#upgteimg"
).
click
();
}
layui
.
use
(
'form'
,
function
()
{
var
form
=
layui
.
form
;
form
.
render
();
});
function
closeLayer
()
{
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
//关闭当前frame
parent
.
layer
.
close
(
index
);
}
function
chioceImage
(
i
)
{
$
(
'#file'
+
i
).
trigger
(
"click"
);
}
</script>
</body>
</html>
\ No newline at end of file
src/main/resources/templates/groupOrder/detailList.html
0 → 100644
View file @
697f0488
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
后台管理系统
</title>
<meta
name=
"renderer"
content=
"webkit"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<link
rel=
"shortcut icon"
th:href=
"@{/images/logo.jpg}"
/>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/layui.css}"
>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/admin.css}"
>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/my.css}"
>
<script
type=
"text/javascript"
th:src=
"@{/js/jquery-3.3.1.min.js}"
></script>
<script
th:src=
"@{/js/layui/layui.js}"
charset=
"utf-8"
></script>
<style>img
{
height
:
25px
;
}
</style>
</head>
<body>
<div
class=
"layui-fluid"
>
<div
class=
"layui-card"
>
</div>
<div
class=
"layui-card-body"
>
<table
class=
"layui-hide"
id=
"tableId"
lay-filter=
"tableId"
></table>
</div>
</div>
</div>
<script>
var
id
=
'[[${orderId}]]'
;
var
field
=
{};
field
.
mainid
=
id
;
layui
.
use
([
'table'
,
'laydate'
,
'form'
],
function
()
{
var
form
=
layui
.
form
,
table
=
layui
.
table
;
table
.
render
({
elem
:
'#tableId'
,
url
:
'findSubPageList'
,
where
:
field
,
method
:
'post'
,
contentType
:
"application/json"
// 内容编码, json格式
,
height
:
500
,
toolbar
:
'#toolbarUtil'
//开启头部工具栏,并为其绑定左侧模板
,
defaultToolbar
:
[
'filter'
]
,
cellMinWidth
:
20
//全局定义常规单元格的最小宽度,layui 2.2.1 新增
,
skin
:
'line '
//表格风格 line (行边框风格)row (列边框风格)nob (无边框风格)
,
even
:
true
//隔行换色
,
limit
:
20
//每页默认显示的数量
,
page
:
true
,
request
:
{
pageName
:
"curpage"
,
// 页码的参数名称,默认:page
limitName
:
"pagesize"
// 每页数据量的参数名,默认:limit
}
,
response
:
{
statusName
:
"code"
,
// 规定数据状态的字段名称,默认:code
statusCode
:
0
,
// 规定成功的状态码,默认:0
msgName
:
"msg"
,
// 规定状态信息的字段名称,默认:msg
countName
:
"count"
,
// 规定数据总数的字段名称,默认:count
dataName
:
"data"
// 规定数据列表的字段名称,默认:data
}
,
parseData
:
function
(
res
)
{
// res 即为原始返回的数据
return
{
"code"
:
res
.
code
,
// 解析接口状态
"msg"
:
res
.
desc
,
// 解析提示文本
"count"
:
res
.
data
.
pageinfo
.
totalRecords
,
// 解析数据长度
"data"
:
res
.
data
.
items
// 解析数据列表
};
}
,
limits
:
[
10
,
20
,
50
,
100
]
//每页条数的选择项,默认:[10,20,30,40,50,60,70,80,90]。
,
cols
:
[
[
{
type
:
'checkbox'
,
fixed
:
"left"
}
,
{
field
:
'sproductname'
,
width
:
100
,
title
:
'商品名称'
}
,{
title
:
"商品图片"
,
align
:
"center"
,
templet
:
function
(
d
)
{
return
d
.
spshortpic
?
'<div><img id="zi'
+
d
.
id
+
'" src="'
+
d
.
spshortpic
+
'" onmouseover="bigImg(this)" onmouseout="smallImg()" onclick="tolook(src)" style="height:20px;"></div>'
:
''
;
}
}
,
{
field
:
'ipronum'
,
width
:
100
,
title
:
'购买数量'
}
,
{
field
:
'dprosum'
,
width
:
100
,
title
:
'金额小计'
}
//, {field: '', width: 130, title: '操作', toolbar: '#table-handle', fixed: "right"}
]
]
});
//头工具栏事件
table
.
on
(
'toolbar(tableId)'
,
function
(
obj
)
{
var
checkStatus
=
table
.
checkStatus
(
obj
.
config
.
id
);
switch
(
obj
.
event
)
{
case
'export'
:
var
href
=
"exportOrder?orderState=[[${orderState}]]"
;
if
(
field
.
orderId
)
{
href
=
href
+
"&orderId="
+
field
.
orderId
;
}
location
.
href
=
href
;
break
;
case
'del'
:
var
data
=
checkStatus
.
data
;
var
id
=
''
;
if
(
data
.
length
>
0
)
{
for
(
var
j
=
0
;
j
<
data
.
length
;
j
++
)
{
id
=
id
+
","
+
data
[
j
].
orderId
;
if
(
data
[
j
].
orderState
==
1
)
{
layer
.
msg
(
"不能删除已支付的订单"
);
return
false
;
}
else
if
(
data
[
j
].
orderState
==
2
)
{
layer
.
msg
(
"不能删除已发货的订单"
);
return
false
;
}
}
}
else
{
layer
.
msg
(
"请至少选择一条数据!"
);
return
false
;
}
layer
.
confirm
(
'确定彻底删除选中的数据吗?'
,
function
(
index
)
{
$
.
ajax
({
url
:
"del"
,
data
:
{
"id"
:
id
},
type
:
"POST"
,
dataType
:
"json"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
layer
.
close
(
index
);
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
break
;
// case 'deliver':
// var data = checkStatus.data;
// var id = '';
// if (data.length > 0) {
// for (var j = 0; j
<
data
.
length
;
j
++
)
{
// id = id + "," + data[j].orderId;
// }
// } else {
// layer.msg("请至少选择一条数据!");
// return false;
// }
// layer.confirm('选中的订单确定发货吗?', function (index) {
// $.ajax({
// url: "deliver",
// data: {"id": id},
// type: "POST",
// dataType: "json",
// success: function (result) {
// if (result.code == 10001) {
// layer.msg(result.msg, {icon: 6, time: 1000}, function () {
// layer.close(index);
// table.reload('tableId');
// });
// } else {
// layer.msg(result.msg, {icon: 5});
// }
// }
// });
// });
// break;
}
;
});
//监听行工具事件
table
.
on
(
'tool(tableId)'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
if
(
obj
.
event
===
'deliver'
)
{
var
id
=
obj
.
data
.
id
;
layer
.
confirm
(
'确定接受订单吗?'
,
function
(
index
)
{
var
param
=
{};
param
.
id
=
id
;
param
.
istatus
=
30
;
$
.
ajax
({
url
:
"updateFwStatus"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
0
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
layer
.
close
(
index
);
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'edit'
)
{
var
id
=
obj
.
data
.
orderId
;
var
w
=
(
$
(
window
).
width
()
*
0.95
);
var
h
=
(
$
(
window
).
height
()
*
0.95
);
layer
.
open
({
type
:
2
,
title
:
'修改订单'
,
content
:
'orderDetailEdit?orderId='
+
id
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
,
maxmin
:
true
,
shadeClose
:
true
,
shade
:
0.4
,
btn
:
[
'确认'
,
'取消'
]
,
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
//得到iframe页面层的BODY
var
iframeBtn
=
body
.
find
(
'#saveBtn'
);
//得到iframe页面层的提交按钮
iframeBtn
.
click
();
//模拟iframe页面层的提交按钮点击
}
});
}
else
if
(
obj
.
event
===
'orderDetail'
)
{
var
id
=
obj
.
data
.
orderId
;
var
w
=
(
$
(
window
).
width
()
*
0.95
);
var
h
=
(
$
(
window
).
height
()
*
0.95
);
layer
.
open
({
type
:
2
,
title
:
'订单详情'
,
content
:
'orderDetail?orderId='
+
id
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
,
maxmin
:
true
,
shadeClose
:
true
,
shade
:
0.4
,
btn
:
[
'关闭'
]
// , yes: function (index, layero) {
// var body = layer.getChildFrame('body', index); //得到iframe页面层的BODY
// var iframeBtn = body.find('#saveBtn');//得到iframe页面层的提交按钮
// iframeBtn.click();//模拟iframe页面层的提交按钮点击
// }
});
}
else
if
(
obj
.
event
===
'del'
)
{
var
id
=
obj
.
data
.
orderId
;
layer
.
confirm
(
'确定彻底删除选中的数据吗?'
,
function
(
index
)
{
$
.
ajax
({
url
:
"del"
,
data
:
{
"id"
:
id
},
type
:
"POST"
,
dataType
:
"json"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
layer
.
close
(
index
);
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'receiving'
)
{
var
id
=
obj
.
data
.
id
;
layer
.
confirm
(
'确定完成订单吗?'
,
function
(
index
)
{
var
param
=
{};
param
.
id
=
id
;
param
.
istatus
=
90
;
$
.
ajax
({
url
:
"updateOkStatus"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
0
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
layer
.
close
(
index
);
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'lease'
)
{
var
id
=
obj
.
data
.
orderId
;
layer
.
confirm
(
obj
.
data
.
orderDetails
+
'确定开始租赁?'
,
function
(
index
)
{
$
.
ajax
({
url
:
"receiving"
,
data
:
{
"orderId"
:
id
,
"orderState"
:
3
},
type
:
"POST"
,
dataType
:
"json"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
layer
.
close
(
index
);
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'refund'
)
{
var
id
=
obj
.
data
.
orderId
;
var
w
=
(
$
(
window
).
width
()
*
0.95
);
var
h
=
(
$
(
window
).
height
()
*
0.95
);
layer
.
open
({
type
:
2
,
title
:
'退还押金'
,
content
:
'toRefund?orderId='
+
id
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
,
maxmin
:
true
,
shadeClose
:
true
,
shade
:
0.4
,
btn
:
[
'保存'
,
'关闭'
]
,
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
//得到iframe页面层的BODY
var
iframeBtn
=
body
.
find
(
'#saveBtn'
);
//得到iframe页面层的提交按钮
iframeBtn
.
click
();
//模拟iframe页面层的提交按钮点击
}
});
}
});
}
);
function
tolook
(
e
)
{
window
.
open
(
e
);
}
/**
* 鼠标移入图片时, 提示弹框 (放大的图片)
*/
function
bigImg
(
obj
){
var
imgUrl
=
obj
.
getAttribute
(
"src"
);
var
imgid
=
obj
.
getAttribute
(
"id"
);
layer
.
tips
(
'<img src="'
+
imgUrl
+
'"style="width:120px; height: 120rpx;">'
,
"#"
+
imgid
,
{
tips
:
[
1
,
''
],
tipsMore
:
false
,
area
:
[
'150px'
,
'140px'
],
time
:
20000
});
}
/**
* 鼠标移出图片时, 取消弹框
*/
function
smallImg
(){
layer
.
closeAll
(
"tips"
);
}
</script>
</body>
</html>
\ No newline at end of file
src/main/resources/templates/groupOrder/list.html
0 → 100644
View file @
697f0488
<!DOCTYPE html>
<html
lang=
"en"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
后台管理系统
</title>
<meta
name=
"renderer"
content=
"webkit"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<link
rel=
"shortcut icon"
th:href=
"@{/images/logo.jpg}"
/>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/layui.css}"
>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/admin.css}"
>
<link
rel=
"stylesheet"
th:href=
"@{/js/layui/css/my.css}"
>
<script
type=
"text/javascript"
th:src=
"@{/js/jquery-3.3.1.min.js}"
></script>
<script
th:src=
"@{/js/layui/layui.js}"
charset=
"utf-8"
></script>
<style>img
{
height
:
25px
;
}
</style>
</head>
<body>
<div
class=
"layui-fluid"
>
<div
class=
"layui-card"
>
<div
class=
"layui-form layui-card-header layuiadmin-card-header-auto my-header"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
订单编号
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"orderCode"
class=
"layui-input"
placeholder=
"请输入订单编号"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
活动标题
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"groupBuyTitle"
class=
"layui-input"
placeholder=
"请输入活动标题"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
订单状态
</label>
<div
class=
"layui-input-block"
>
<select
name=
"groupStatus"
lay-filter=
"istatus"
lay-search
>
<option
value=
""
>
请选择
</option>
<option
value=
"0"
>
待成团
</option>
<option
value=
"1"
>
待发货
</option>
<option
value=
"2"
>
待收货
</option>
<option
value=
"3"
>
已完成
</option>
<option
value=
"4"
>
已取消
</option>
</select>
</div>
</div>
<div
class=
"layui-inline"
>
<button
class=
"layui-btn layuiadmin-button-btn"
lay-submit
lay-filter=
"The-search"
id=
"The-search"
>
<i
class=
"layui-icon layui-icon-search layuiadmin-button-btn"
>
</i>
</button>
</div>
<div
class=
"layui-inline"
>
<button
class=
"layui-btn layuiadmin-button-btn"
onclick=
"javascript:location.replace(location.href);"
>
<i
class=
"layui-icon layui-icon-refresh-3 layuiadmin-button-btn"
>
</i>
</button>
</div>
</div>
</div>
</div>
<div
class=
"layui-card-body"
>
<table
class=
"layui-hide"
id=
"tableId"
lay-filter=
"tableId"
></table>
</div>
</div>
</div>
<script
type=
"text/html"
id=
"toolbarUtil"
>
<
div
class
=
"layui-btn-container"
>
<!--
<
button
class
=
"layui-btn layui-btn-danger"
lay
-
event
=
"del"
><
i
class
=
"layui-icon layui-icon-delete"
><
/i>删除--
>
<!--
<
/button>--
>
<!--
<
button
class
=
"layui-btn layui-btn"
lay
-
event
=
"export"
><
i
class
=
"layui-icon layui-icon-release"
><
/i>导出</
button
>-->
<
/div
>
</script>
<script
type=
"text/html"
id=
"table-handle"
>
<
i
class
=
"layui-icon layui-icon-form"
lay
-
event
=
"orderDetail"
title
=
"订单详情"
><
/i
>
{{
#
if
(
d
.
groupStatus
==
0
)
{
}}
{{
#
}
else
if
(
d
.
groupStatus
==
1
){
}}
<
i
class
=
"layui-icon layui-icon-ok-circle"
lay
-
event
=
"deliver"
title
=
"发货"
><
/i
>
{{
#
}
else
if
(
d
.
groupStatus
==
2
){
}}
<
i
class
=
"layui-icon layui-icon-cart"
lay
-
event
=
"receiving"
title
=
"完成"
><
/i
>
{{
#
}
}}
</script>
<script>
var
field
=
{};
layui
.
use
([
'table'
,
'laydate'
,
'form'
],
function
()
{
var
form
=
layui
.
form
,
table
=
layui
.
table
;
//监听搜索
form
.
on
(
'submit(The-search)'
,
function
(
data
)
{
field
=
data
.
field
;
//执行重载
table
.
reload
(
'tableId'
,
{
where
:
field
,
page
:
{
curr
:
1
}
});
});
table
.
render
({
elem
:
'#tableId'
,
url
:
'findPageList'
,
where
:
field
,
method
:
'post'
,
contentType
:
"application/json"
// 内容编码, json格式
,
height
:
500
,
toolbar
:
'#toolbarUtil'
//开启头部工具栏,并为其绑定左侧模板
,
defaultToolbar
:
[
'filter'
]
,
cellMinWidth
:
20
//全局定义常规单元格的最小宽度,layui 2.2.1 新增
,
skin
:
'line '
//表格风格 line (行边框风格)row (列边框风格)nob (无边框风格)
,
even
:
true
//隔行换色
,
limit
:
20
//每页默认显示的数量
,
page
:
true
,
request
:
{
pageName
:
"curpage"
,
// 页码的参数名称,默认:page
limitName
:
"pagesize"
// 每页数据量的参数名,默认:limit
}
,
response
:
{
statusName
:
"code"
,
// 规定数据状态的字段名称,默认:code
statusCode
:
100
,
// 规定成功的状态码,默认:0
msgName
:
"msg"
,
// 规定状态信息的字段名称,默认:msg
countName
:
"count"
,
// 规定数据总数的字段名称,默认:count
dataName
:
"data"
// 规定数据列表的字段名称,默认:data
}
,
parseData
:
function
(
res
)
{
// res 即为原始返回的数据
return
{
"code"
:
res
.
code
,
// 解析接口状态
"msg"
:
res
.
desc
,
// 解析提示文本
"count"
:
res
.
data
.
pageinfo
.
totalRecords
,
// 解析数据长度
"data"
:
res
.
data
.
items
// 解析数据列表
};
}
,
limits
:
[
10
,
20
,
50
,
100
]
//每页条数的选择项,默认:[10,20,30,40,50,60,70,80,90]。
,
cols
:
[
[
{
type
:
'checkbox'
,
fixed
:
"left"
}
,
{
field
:
'groupBuyTitle'
,
title
:
'活动标题'
,
fixed
:
"left"
}
,
{
field
:
'areaName'
,
title
:
'小区名称'
}
,
{
field
:
'orderCode'
,
title
:
'订单编号'
}
,
{
field
:
'sumDactmoney'
,
title
:
'订单实付金额'
}
,
{
field
:
'sumDactmoney'
,
title
:
'订单实付金额'
}
,{
title
:
"订单状态"
,
templet
:
function
(
d
)
{
var
str
=
""
;
str
+=
'<div>'
;
//订单状态
var
status
=
""
;
if
(
d
.
groupStatus
==
0
)
status
=
"<span class='layui-badge layui-bg-orange'>待成团</span>"
;
if
(
d
.
groupStatus
==
1
)
status
=
"<span class='layui-badge layui-bg-orange'>待发货</span>"
;
if
(
d
.
groupStatus
==
2
)
status
=
"<span class='layui-badge layui-bg-orange'>待收货</span>"
;
if
(
d
.
groupStatus
==
3
)
status
=
"<span class='layui-badge layui-bg-green'>已完成</span>"
;
if
(
d
.
groupStatus
==
4
)
status
=
"<span class='layui-badge layui-bg-black'>已取消</span>"
;
str
+=
' <span>'
+
status
+
'</span>'
;
str
+=
'</div>'
;
return
str
?
str
:
""
;
}
}
,
{
field
:
'successTime'
,
title
:
'成团时间'
}
,
{
field
:
''
,
width
:
130
,
title
:
'操作'
,
toolbar
:
'#table-handle'
,
fixed
:
"right"
}
]
]
});
//头工具栏事件
table
.
on
(
'toolbar(tableId)'
,
function
(
obj
)
{
var
checkStatus
=
table
.
checkStatus
(
obj
.
config
.
id
);
switch
(
obj
.
event
)
{
case
'export'
:
var
href
=
"exportOrder?orderState=[[${orderState}]]"
;
if
(
field
.
orderId
)
{
href
=
href
+
"&orderId="
+
field
.
orderId
;
}
location
.
href
=
href
;
break
;
case
'del'
:
var
data
=
checkStatus
.
data
;
var
id
=
''
;
if
(
data
.
length
>
0
)
{
for
(
var
j
=
0
;
j
<
data
.
length
;
j
++
)
{
id
=
id
+
","
+
data
[
j
].
orderId
;
if
(
data
[
j
].
orderState
==
1
)
{
layer
.
msg
(
"不能删除已支付的订单"
);
return
false
;
}
else
if
(
data
[
j
].
orderState
==
2
)
{
layer
.
msg
(
"不能删除已发货的订单"
);
return
false
;
}
}
}
else
{
layer
.
msg
(
"请至少选择一条数据!"
);
return
false
;
}
layer
.
confirm
(
'确定彻底删除选中的数据吗?'
,
function
(
index
)
{
$
.
ajax
({
url
:
"del"
,
data
:
{
"id"
:
id
},
type
:
"POST"
,
dataType
:
"json"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
layer
.
close
(
index
);
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
break
;
// case 'deliver':
// var data = checkStatus.data;
// var id = '';
// if (data.length > 0) {
// for (var j = 0; j
<
data
.
length
;
j
++
)
{
// id = id + "," + data[j].orderId;
// }
// } else {
// layer.msg("请至少选择一条数据!");
// return false;
// }
// layer.confirm('选中的订单确定发货吗?', function (index) {
// $.ajax({
// url: "deliver",
// data: {"id": id},
// type: "POST",
// dataType: "json",
// success: function (result) {
// if (result.code == 10001) {
// layer.msg(result.msg, {icon: 6, time: 1000}, function () {
// layer.close(index);
// table.reload('tableId');
// });
// } else {
// layer.msg(result.msg, {icon: 5});
// }
// }
// });
// });
// break;
}
;
});
//监听行工具事件
table
.
on
(
'tool(tableId)'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
if
(
obj
.
event
===
'deliver'
)
{
var
id
=
obj
.
data
.
id
;
layer
.
confirm
(
'确定接受订单吗?'
,
function
(
index
)
{
var
param
=
{};
param
.
id
=
id
;
param
.
istatus
=
30
;
$
.
ajax
({
url
:
"updateFwStatus"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
layer
.
close
(
index
);
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'edit'
)
{
var
id
=
obj
.
data
.
orderId
;
var
w
=
(
$
(
window
).
width
()
*
0.95
);
var
h
=
(
$
(
window
).
height
()
*
0.95
);
layer
.
open
({
type
:
2
,
title
:
'修改订单'
,
content
:
'orderDetailEdit?orderId='
+
id
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
,
maxmin
:
true
,
shadeClose
:
true
,
shade
:
0.4
,
btn
:
[
'确认'
,
'取消'
]
,
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
//得到iframe页面层的BODY
var
iframeBtn
=
body
.
find
(
'#saveBtn'
);
//得到iframe页面层的提交按钮
iframeBtn
.
click
();
//模拟iframe页面层的提交按钮点击
}
});
}
else
if
(
obj
.
event
===
'orderDetail'
)
{
var
id
=
obj
.
data
.
id
;
var
w
=
(
$
(
window
).
width
()
*
0.95
);
var
h
=
(
$
(
window
).
height
()
*
0.95
);
layer
.
open
({
type
:
2
,
title
:
'订单详情'
,
content
:
'orderDetail?id='
+
id
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
,
maxmin
:
true
,
shadeClose
:
true
,
shade
:
0.4
,
btn
:
[
'关闭'
]
// , yes: function (index, layero) {
// var body = layer.getChildFrame('body', index); //得到iframe页面层的BODY
// var iframeBtn = body.find('#saveBtn');//得到iframe页面层的提交按钮
// iframeBtn.click();//模拟iframe页面层的提交按钮点击
// }
});
}
else
if
(
obj
.
event
===
'del'
)
{
var
id
=
obj
.
data
.
orderId
;
layer
.
confirm
(
'确定彻底删除选中的数据吗?'
,
function
(
index
)
{
$
.
ajax
({
url
:
"del"
,
data
:
{
"id"
:
id
},
type
:
"POST"
,
dataType
:
"json"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
layer
.
close
(
index
);
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'receiving'
)
{
var
id
=
obj
.
data
.
id
;
layer
.
confirm
(
'确定完成订单吗?'
,
function
(
index
)
{
var
param
=
{};
param
.
id
=
id
;
param
.
istatus
=
90
;
$
.
ajax
({
url
:
"updateOkStatus"
,
data
:
JSON
.
stringify
(
param
),
type
:
"POST"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
layer
.
close
(
index
);
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'lease'
)
{
var
id
=
obj
.
data
.
orderId
;
layer
.
confirm
(
obj
.
data
.
orderDetails
+
'确定开始租赁?'
,
function
(
index
)
{
$
.
ajax
({
url
:
"receiving"
,
data
:
{
"orderId"
:
id
,
"orderState"
:
3
},
type
:
"POST"
,
dataType
:
"json"
,
success
:
function
(
result
)
{
if
(
result
.
code
==
100
)
{
layer
.
msg
(
result
.
msg
,
{
icon
:
6
,
time
:
1000
},
function
()
{
layer
.
close
(
index
);
table
.
reload
(
'tableId'
);
});
}
else
{
layer
.
msg
(
result
.
msg
,
{
icon
:
5
});
}
}
});
});
}
else
if
(
obj
.
event
===
'refund'
)
{
var
id
=
obj
.
data
.
orderId
;
var
w
=
(
$
(
window
).
width
()
*
0.95
);
var
h
=
(
$
(
window
).
height
()
*
0.95
);
layer
.
open
({
type
:
2
,
title
:
'退还押金'
,
content
:
'toRefund?orderId='
+
id
,
area
:
[
w
+
'px'
,
h
+
'px'
]
,
fix
:
false
//不固定
,
maxmin
:
true
,
shadeClose
:
true
,
shade
:
0.4
,
btn
:
[
'保存'
,
'关闭'
]
,
yes
:
function
(
index
,
layero
)
{
var
body
=
layer
.
getChildFrame
(
'body'
,
index
);
//得到iframe页面层的BODY
var
iframeBtn
=
body
.
find
(
'#saveBtn'
);
//得到iframe页面层的提交按钮
iframeBtn
.
click
();
//模拟iframe页面层的提交按钮点击
}
});
}
});
}
);
function
tolook
(
e
)
{
window
.
open
(
e
);
}
/**
* 鼠标移入图片时, 提示弹框 (放大的图片)
*/
function
bigImg
(
obj
){
var
imgUrl
=
obj
.
getAttribute
(
"src"
);
var
imgid
=
obj
.
getAttribute
(
"id"
);
layer
.
tips
(
'<img src="'
+
imgUrl
+
'"style="width:120px; height: 120rpx;">'
,
"#"
+
imgid
,
{
tips
:
[
1
,
''
],
tipsMore
:
false
,
area
:
[
'150px'
,
'140px'
],
time
:
20000
});
}
/**
* 鼠标移出图片时, 取消弹框
*/
function
smallImg
(){
layer
.
closeAll
(
"tips"
);
}
</script>
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment