增加用户拓展信息
This commit is contained in:
parent
416721d5f4
commit
02ce38038d
@ -0,0 +1,38 @@
|
|||||||
|
package cn.com.tenlion.operator.controller.api.user.expand;
|
||||||
|
|
||||||
|
import cn.com.tenlion.operator.pojo.dtos.user.expand.UserExpandDTO;
|
||||||
|
import cn.com.tenlion.operator.pojo.vos.user.expand.UserExpandVO;
|
||||||
|
import cn.com.tenlion.operator.service.user.expand.UserExpandServiceImpl;
|
||||||
|
import ink.wgink.annotation.CheckRequestBodyAnnotation;
|
||||||
|
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||||
|
import ink.wgink.pojo.result.SuccessResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName: UserExpandController
|
||||||
|
* @Description:
|
||||||
|
* @Author: wanggeng
|
||||||
|
* @Date: 2024/6/11 上午11:18
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(ISystemConstant.API_PREFIX + "/user/expand")
|
||||||
|
public class UserExpandController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserExpandServiceImpl userExpandService;
|
||||||
|
|
||||||
|
@PostMapping("save-or-update/{userId}")
|
||||||
|
@CheckRequestBodyAnnotation
|
||||||
|
public synchronized SuccessResult saveOrUpdate(@PathVariable("userId") String userId, @RequestBody UserExpandVO userExpandVO) {
|
||||||
|
userExpandService.saveOrUpdate(userId, userExpandVO);
|
||||||
|
return new SuccessResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("get/{userId}")
|
||||||
|
public UserExpandDTO get(@PathVariable("userId") String userId) {
|
||||||
|
return userExpandService.get(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package cn.com.tenlion.operator.controller.route.user.expand;
|
||||||
|
|
||||||
|
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName: UserExpandRouteController
|
||||||
|
* @Description:
|
||||||
|
* @Author: wanggeng
|
||||||
|
* @Date: 2024/6/11 上午11:04
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/user/expand")
|
||||||
|
public class UserExpandRouteController {
|
||||||
|
|
||||||
|
@GetMapping("save-or-update")
|
||||||
|
public ModelAndView update() {
|
||||||
|
ModelAndView modelAndView = new ModelAndView("user/expand/save-or-update");
|
||||||
|
return modelAndView;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package cn.com.tenlion.operator.dao.user.expand;
|
||||||
|
|
||||||
|
import cn.com.tenlion.operator.pojo.dtos.user.expand.UserExpandDTO;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName: IUserExpandDao
|
||||||
|
* @Description:
|
||||||
|
* @Author: wanggeng
|
||||||
|
* @Date: 2024/6/11 上午11:07
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface IUserExpandDao {
|
||||||
|
|
||||||
|
void save(Map<String, Object> params);
|
||||||
|
|
||||||
|
void update(Map<String, Object> params);
|
||||||
|
|
||||||
|
UserExpandDTO get(Map<String, Object> params);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package cn.com.tenlion.operator.pojo.dtos.user.expand;
|
||||||
|
|
||||||
|
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName: UserExpandDTO
|
||||||
|
* @Description:
|
||||||
|
* @Author: wanggeng
|
||||||
|
* @Date: 2024/6/11 上午10:39
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
public class UserExpandDTO extends UserDTO {
|
||||||
|
|
||||||
|
private Long priceAdditionalPkg;
|
||||||
|
private Long priceAdditionalVideoDemo;
|
||||||
|
private Long priceAll;
|
||||||
|
private Long priceMaterial;
|
||||||
|
private Long priceMaterialAgent;
|
||||||
|
private Long priceMaterialAgentUrgent;
|
||||||
|
|
||||||
|
public Long getPriceAdditionalPkg() {
|
||||||
|
return priceAdditionalPkg == null ? 0 : priceAdditionalPkg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriceAdditionalPkg(Long priceAdditionalPkg) {
|
||||||
|
this.priceAdditionalPkg = priceAdditionalPkg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPriceAdditionalVideoDemo() {
|
||||||
|
return priceAdditionalVideoDemo == null ? 0 : priceAdditionalVideoDemo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriceAdditionalVideoDemo(Long priceAdditionalVideoDemo) {
|
||||||
|
this.priceAdditionalVideoDemo = priceAdditionalVideoDemo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPriceAll() {
|
||||||
|
return priceAll == null ? 0 : priceAll;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriceAll(Long priceAll) {
|
||||||
|
this.priceAll = priceAll;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPriceMaterial() {
|
||||||
|
return priceMaterial == null ? 0 : priceMaterial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriceMaterial(Long priceMaterial) {
|
||||||
|
this.priceMaterial = priceMaterial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPriceMaterialAgent() {
|
||||||
|
return priceMaterialAgent == null ? 0 : priceMaterialAgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriceMaterialAgent(Long priceMaterialAgent) {
|
||||||
|
this.priceMaterialAgent = priceMaterialAgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPriceMaterialAgentUrgent() {
|
||||||
|
return priceMaterialAgentUrgent == null ? 0 : priceMaterialAgentUrgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriceMaterialAgentUrgent(Long priceMaterialAgentUrgent) {
|
||||||
|
this.priceMaterialAgentUrgent = priceMaterialAgentUrgent;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
package cn.com.tenlion.operator.pojo.vos.user.expand;
|
||||||
|
|
||||||
|
import ink.wgink.annotation.CheckNumberAnnotation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName: UserExpandVO
|
||||||
|
* @Description:
|
||||||
|
* @Author: wanggeng
|
||||||
|
* @Date: 2024/6/11 上午10:39
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
public class UserExpandVO {
|
||||||
|
|
||||||
|
@CheckNumberAnnotation(name = "拓展安装包价格", min = 0)
|
||||||
|
private Double priceAdditionalPkg;
|
||||||
|
@CheckNumberAnnotation(name = "视频教程价格", min = 0)
|
||||||
|
private Double priceAdditionalVideoDemo;
|
||||||
|
@CheckNumberAnnotation(name = "全托管价格", min = 0)
|
||||||
|
private Double priceAll;
|
||||||
|
@CheckNumberAnnotation(name = "写材料价格", min = 0)
|
||||||
|
private Double priceMaterial;
|
||||||
|
@CheckNumberAnnotation(name = "写材料+代理价格", min = 0)
|
||||||
|
private Double priceMaterialAgent;
|
||||||
|
@CheckNumberAnnotation(name = "写材料+代理(加急)价格", min = 0)
|
||||||
|
private Double priceMaterialAgentUrgent;
|
||||||
|
|
||||||
|
public Double getPriceAdditionalPkg() {
|
||||||
|
return priceAdditionalPkg == null ? 0 : priceAdditionalPkg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriceAdditionalPkg(Double priceAdditionalPkg) {
|
||||||
|
this.priceAdditionalPkg = priceAdditionalPkg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getPriceAdditionalVideoDemo() {
|
||||||
|
return priceAdditionalVideoDemo == null ? 0 : priceAdditionalVideoDemo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriceAdditionalVideoDemo(Double priceAdditionalVideoDemo) {
|
||||||
|
this.priceAdditionalVideoDemo = priceAdditionalVideoDemo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getPriceAll() {
|
||||||
|
return priceAll == null ? 0 : priceAll;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriceAll(Double priceAll) {
|
||||||
|
this.priceAll = priceAll;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getPriceMaterial() {
|
||||||
|
return priceMaterial == null ? 0 : priceMaterial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriceMaterial(Double priceMaterial) {
|
||||||
|
this.priceMaterial = priceMaterial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getPriceMaterialAgent() {
|
||||||
|
return priceMaterialAgent == null ? 0 : priceMaterialAgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriceMaterialAgent(Double priceMaterialAgent) {
|
||||||
|
this.priceMaterialAgent = priceMaterialAgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getPriceMaterialAgentUrgent() {
|
||||||
|
return priceMaterialAgentUrgent == null ? 0 : priceMaterialAgentUrgent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriceMaterialAgentUrgent(Double priceMaterialAgentUrgent) {
|
||||||
|
this.priceMaterialAgentUrgent = priceMaterialAgentUrgent;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,131 @@
|
|||||||
|
package cn.com.tenlion.operator.service.user.expand;
|
||||||
|
|
||||||
|
import cn.com.tenlion.operator.dao.user.expand.IUserExpandDao;
|
||||||
|
import cn.com.tenlion.operator.pojo.dtos.user.expand.UserExpandDTO;
|
||||||
|
import cn.com.tenlion.operator.pojo.vos.user.expand.UserExpandVO;
|
||||||
|
import ink.wgink.common.base.DefaultBaseService;
|
||||||
|
import ink.wgink.exceptions.SearchException;
|
||||||
|
import ink.wgink.interfaces.user.IUserExpandBaseService;
|
||||||
|
import ink.wgink.pojo.ListPage;
|
||||||
|
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||||
|
import ink.wgink.pojo.result.SuccessResultList;
|
||||||
|
import ink.wgink.service.user.service.IUserService;
|
||||||
|
import ink.wgink.util.map.HashMapUtil;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName: UserExpandServiceImpl
|
||||||
|
* @Description:
|
||||||
|
* @Author: wanggeng
|
||||||
|
* @Date: 2024/6/11 上午10:39
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class UserExpandServiceImpl extends DefaultBaseService implements IUserExpandBaseService<UserExpandDTO> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IUserExpandDao userExpandDao;
|
||||||
|
@Autowired
|
||||||
|
private IUserService userService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRoute() {
|
||||||
|
return "route/user/expand/save-or-update";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserExpandDTO get(String userId) {
|
||||||
|
UserDTO userDTO = userService.get(userId);
|
||||||
|
return get(userDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserExpandDTO getByUsername(String username) {
|
||||||
|
UserDTO userDTO = userService.getByUsername(username);
|
||||||
|
return get(userDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
private UserExpandDTO get(UserDTO userDTO) {
|
||||||
|
if (userDTO == null) {
|
||||||
|
throw new SearchException("用户不存在");
|
||||||
|
}
|
||||||
|
Map<String, Object> params = getHashMap(2);
|
||||||
|
params.put("userId", userDTO.getUserId());
|
||||||
|
UserExpandDTO userExpandDTO = userExpandDao.get(params);
|
||||||
|
if (userExpandDTO == null) {
|
||||||
|
userExpandDTO = new UserExpandDTO();
|
||||||
|
}
|
||||||
|
BeanUtils.copyProperties(userDTO, userExpandDTO);
|
||||||
|
return userExpandDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserExpandDTO> listByUserIds(List<String> userIds) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserExpandDTO> listByUsernames(List<String> usernames) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserExpandDTO> list(Map<String, Object> map) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SuccessResultList<List<UserExpandDTO>> listPage(ListPage listPage) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SuccessResultList<List<UserExpandDTO>> listPageByIds(List<String> list, ListPage listPage) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SuccessResultList<List<UserExpandDTO>> listPageByExcludeIds(List<String> list, ListPage listPage) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int countDateRange(String s, String s1) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserExpandDTO> listByKeywords(String s) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void saveOrUpdate(String userId, UserExpandVO userExpandVO) {
|
||||||
|
Map<String, Object> params = getHashMap(2);
|
||||||
|
params.put("userId", userId);
|
||||||
|
UserExpandDTO userExpandDTO = userExpandDao.get(params);
|
||||||
|
userExpandVO.setPriceAdditionalPkg(userExpandVO.getPriceAdditionalPkg() * 100);
|
||||||
|
userExpandVO.setPriceAdditionalVideoDemo(userExpandVO.getPriceAdditionalVideoDemo() * 100);
|
||||||
|
userExpandVO.setPriceAll(userExpandVO.getPriceAll() * 100);
|
||||||
|
userExpandVO.setPriceMaterial(userExpandVO.getPriceMaterial() * 100);
|
||||||
|
userExpandVO.setPriceMaterialAgent(userExpandVO.getPriceMaterialAgent() * 100);
|
||||||
|
userExpandVO.setPriceMaterialAgentUrgent(userExpandVO.getPriceMaterialAgentUrgent() * 100);
|
||||||
|
params = HashMapUtil.beanToMap(userExpandVO);
|
||||||
|
params.put("userId", userId);
|
||||||
|
if (userExpandDTO == null) {
|
||||||
|
userExpandDao.save(params);
|
||||||
|
} else {
|
||||||
|
userExpandDao.update(params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
<?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="cn.com.tenlion.operator.dao.user.expand.IUserExpandDao">
|
||||||
|
|
||||||
|
<resultMap id="userExpandDTO" type="cn.com.tenlion.operator.pojo.dtos.user.expand.UserExpandDTO">
|
||||||
|
<result column="price_additional_pkg" property="priceAdditionalPkg"/>
|
||||||
|
<result column="price_additional_video_demo" property="priceAdditionalVideoDemo"/>
|
||||||
|
<result column="price_all" property="priceAll"/>
|
||||||
|
<result column="price_material" property="priceMaterial"/>
|
||||||
|
<result column="price_material_agent" property="priceMaterialAgent"/>
|
||||||
|
<result column="price_material_agent_urgent" property="priceMaterialAgentUrgent"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="map">
|
||||||
|
INSERT INTO sys_user_expand (
|
||||||
|
user_id,
|
||||||
|
price_additional_pkg,
|
||||||
|
price_additional_video_demo,
|
||||||
|
price_all,
|
||||||
|
price_material,
|
||||||
|
price_material_agent,
|
||||||
|
price_material_agent_urgent
|
||||||
|
) VALUES (
|
||||||
|
#{userId},
|
||||||
|
#{priceAdditionalPkg},
|
||||||
|
#{priceAdditionalVideoDemo},
|
||||||
|
#{priceAll},
|
||||||
|
#{priceMaterial},
|
||||||
|
#{priceMaterialAgent},
|
||||||
|
#{priceMaterialAgentUrgent}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="map">
|
||||||
|
UPDATE
|
||||||
|
sys_user_expand
|
||||||
|
SET
|
||||||
|
price_additional_pkg = #{priceAdditionalPkg},
|
||||||
|
price_additional_video_demo = #{priceAdditionalVideoDemo},
|
||||||
|
price_all = #{priceAll},
|
||||||
|
price_material = #{priceMaterial},
|
||||||
|
price_material_agent = #{priceMaterialAgent},
|
||||||
|
price_material_agent_urgent = #{priceMaterialAgentUrgent}
|
||||||
|
WHERE
|
||||||
|
user_id = #{userId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="get" parameterType="map" resultMap="userExpandDTO">
|
||||||
|
SELECT
|
||||||
|
price_additional_pkg,
|
||||||
|
price_additional_video_demo,
|
||||||
|
price_all,
|
||||||
|
price_material,
|
||||||
|
price_material_agent,
|
||||||
|
price_material_agent_urgent
|
||||||
|
FROM
|
||||||
|
sys_user_expand
|
||||||
|
WHERE
|
||||||
|
<if test="userId != null and userId != ''">
|
||||||
|
user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
168
src/main/resources/templates/user/expand/save-or-update.html
Normal file
168
src/main/resources/templates/user/expand/save-or-update.html
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<base th:href="${#request.getContextPath() + '/'}">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="renderer" content="webkit">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||||
|
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||||
|
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||||
|
<style>
|
||||||
|
.layui-form-item {margin-bottom: 0;}
|
||||||
|
.layui-form-label-new {width: 180px !important;}
|
||||||
|
.layui-input-block-new {margin-left: 180px !important;}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="layui-anim layui-anim-fadein">
|
||||||
|
<div class="layui-card">
|
||||||
|
<div class="layui-card-body" style="padding: 15px;">
|
||||||
|
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||||
|
<blockquote class="layui-elem-quote">价格设置¥,保留两位小数,使用系统默认金额,设置为0即可</blockquote>
|
||||||
|
<div class=" layui-row layui-col-space15">
|
||||||
|
<div class="layui-col-xs4">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label layui-form-label-new">全托管</label>
|
||||||
|
<div class="layui-input-block layui-input-block-new">
|
||||||
|
<input type="number" id="priceAll" name="priceAll" class="layui-input" value="" placeholder="全托管价格" maxlength="50">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-col-xs4">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label layui-form-label-new">写材料</label>
|
||||||
|
<div class="layui-input-block layui-input-block-new">
|
||||||
|
<input type="number" id="priceMaterial" name="priceMaterial" class="layui-input" value="" placeholder="全托管价格" maxlength="50">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-col-xs4">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label layui-form-label-new">写材料+代理</label>
|
||||||
|
<div class="layui-input-block layui-input-block-new">
|
||||||
|
<input type="number" id="priceMaterialAgent" name="priceMaterialAgent" class="layui-input" value="" placeholder="写材料+代理价格" maxlength="50">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class=" layui-row layui-col-space15">
|
||||||
|
<div class="layui-col-xs4">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label layui-form-label-new">写材料+代理(加急)</label>
|
||||||
|
<div class="layui-input-block layui-input-block-new">
|
||||||
|
<input type="number" id="priceMaterialAgentUrgent" name="priceMaterialAgentUrgent" class="layui-input" value="" placeholder="写材料+代理(加急)价格" maxlength="50">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-col-xs4">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label layui-form-label-new">拓展安装包</label>
|
||||||
|
<div class="layui-input-block layui-input-block-new">
|
||||||
|
<input type="number" id="priceAdditionalPkg" name="priceAdditionalPkg" class="layui-input" value="" placeholder="拓展安装包价格" maxlength="50">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-col-xs4">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label layui-form-label-new">视频教程</label>
|
||||||
|
<div class="layui-input-block layui-input-block-new">
|
||||||
|
<input type="number" id="priceAdditionalVideoDemo" name="priceAdditionalVideoDemo" class="layui-input" value="" placeholder="视频教程价格" maxlength="50">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layui-form-item layui-layout-admin">
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<div class="layui-footer" style="left: 0;">
|
||||||
|
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交编辑</button>
|
||||||
|
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||||
|
<script>
|
||||||
|
layui.config({
|
||||||
|
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||||
|
}).extend({
|
||||||
|
index: 'lib/index' //主入口模块
|
||||||
|
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
|
||||||
|
var $ = layui.$;
|
||||||
|
var form = layui.form;
|
||||||
|
var userId = top.restAjax.params(window.location.href).userId;
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
var loadLayerIndex;
|
||||||
|
top.restAjax.get(`api/user/expand/get/${userId}`, {}, null, function(code, data) {
|
||||||
|
data.priceAll = (data.priceAll / 100).toFixed(2)
|
||||||
|
data.priceMaterial = (data.priceMaterial / 100).toFixed(2)
|
||||||
|
data.priceMaterialAgent = (data.priceMaterialAgent / 100).toFixed(2)
|
||||||
|
data.priceMaterialAgentUrgent = (data.priceMaterialAgentUrgent / 100).toFixed(2)
|
||||||
|
data.priceAdditionalPkg = (data.priceAdditionalPkg / 100).toFixed(2)
|
||||||
|
data.priceAdditionalVideoDemo = (data.priceAdditionalVideoDemo / 100).toFixed(2)
|
||||||
|
var dataFormData = {};
|
||||||
|
for(var i in data) {
|
||||||
|
dataFormData[i] = data[i] +'';
|
||||||
|
}
|
||||||
|
form.val('dataForm', dataFormData);
|
||||||
|
form.render(null, 'dataForm');
|
||||||
|
}, function(code, data) {
|
||||||
|
top.dialog.msg(data.msg);
|
||||||
|
}, function() {
|
||||||
|
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
|
||||||
|
}, function() {
|
||||||
|
top.dialog.close(loadLayerIndex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交表单
|
||||||
|
form.on('submit(submitForm)', function(formData) {
|
||||||
|
top.dialog.confirm(top.dataMessage.commit, function(index) {
|
||||||
|
top.dialog.close(index);
|
||||||
|
var loadLayerIndex;
|
||||||
|
top.restAjax.post(`api/user/expand/save-or-update/${userId}`, formData.field, null, function(code, data) {
|
||||||
|
var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
|
||||||
|
time: 0,
|
||||||
|
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||||
|
shade: 0.3,
|
||||||
|
yes: function(index) {
|
||||||
|
top.dialog.close(index);
|
||||||
|
window.location.reload();
|
||||||
|
},
|
||||||
|
btn2: function() {
|
||||||
|
closeBox();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function(code, data) {
|
||||||
|
top.dialog.msg(data.msg);
|
||||||
|
}, function() {
|
||||||
|
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
|
||||||
|
}, function() {
|
||||||
|
top.dialog.close(loadLayerIndex);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
init();
|
||||||
|
|
||||||
|
function closeBox() {
|
||||||
|
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.close').on('click', function() {
|
||||||
|
closeBox();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 校验
|
||||||
|
form.verify({
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user