New file |
| | |
| | | package com.xcong.excoin.modules.fish.controller; |
| | | |
| | | import com.xcong.excoin.common.annotation.ControllerEndpoint; |
| | | import com.xcong.excoin.common.controller.BaseController; |
| | | import com.xcong.excoin.common.entity.FebsResponse; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.documentary.dto.FollowTraderInfoDto; |
| | | import com.xcong.excoin.modules.fish.entity.CannonAccountMoneyChange; |
| | | import com.xcong.excoin.modules.fish.entity.CannonExchangeRatio; |
| | | import com.xcong.excoin.modules.fish.entity.CannonSetting; |
| | | import com.xcong.excoin.modules.fish.service.FishService; |
| | | import com.xcong.excoin.modules.systemSetting.entity.PlatformBannerEntity; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping(value = "/fish") |
| | | public class FishController extends BaseController { |
| | | |
| | | private final FishService fishService; |
| | | |
| | | /** |
| | | * 操作记录---列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("accountList") |
| | | public FebsResponse accountList(CannonAccountMoneyChange cannonAccountMoneyChange, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(fishService.accountList(cannonAccountMoneyChange, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 兑换比例设置---列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("exchangeRatio") |
| | | public FebsResponse exchangeRatio(CannonExchangeRatio cannonExchangeRatio, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(fishService.exchangeRatio(cannonExchangeRatio, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 兑换比例设置---更新 |
| | | * @return |
| | | */ |
| | | @PostMapping("exchangeRatioUpdate") |
| | | @ControllerEndpoint(operation = "兑换比例设置---更新", exceptionMessage = "操作失败") |
| | | public FebsResponse exchangeRatioUpdate(@Valid CannonExchangeRatio cannonExchangeRatio) { |
| | | return fishService.exchangeRatioUpdate(cannonExchangeRatio); |
| | | } |
| | | |
| | | /** |
| | | * 炮台设置---列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("cannonList") |
| | | public FebsResponse cannonList(CannonSetting cannonSetting, QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(fishService.cannonList(cannonSetting, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 炮台设置---新增 |
| | | */ |
| | | @PostMapping("cannonAdd") |
| | | @ControllerEndpoint(operation = "炮台设置---新增", exceptionMessage = "新增失败") |
| | | public FebsResponse cannonAdd(@Valid CannonSetting cannonSetting) { |
| | | fishService.cannonAdd(cannonSetting); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | /** |
| | | * 炮台设置---更新 |
| | | * @return |
| | | */ |
| | | @PostMapping("cannonUpdate") |
| | | @ControllerEndpoint(operation = "炮台设置---更新", exceptionMessage = "操作失败") |
| | | public FebsResponse cannonUpdate(@Valid CannonSetting cannonSetting) { |
| | | return fishService.cannonUpdate(cannonSetting); |
| | | } |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.fish.controller; |
| | | |
| | | import com.xcong.excoin.common.controller.BaseController; |
| | | import com.xcong.excoin.common.entity.FebsConstant; |
| | | import com.xcong.excoin.common.utils.FebsUtil; |
| | | import com.xcong.excoin.modules.fish.entity.CannonExchangeRatio; |
| | | import com.xcong.excoin.modules.fish.entity.CannonSetting; |
| | | import com.xcong.excoin.modules.fish.service.FishService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | @Controller("fishView") |
| | | @RequestMapping(FebsConstant.VIEW_PREFIX + "modules/fish") |
| | | @RequiredArgsConstructor |
| | | public class ViewController extends BaseController { |
| | | |
| | | private final FishService fishService; |
| | | |
| | | /** |
| | | * 兑换比例设置---列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("exchangeRatio") |
| | | @RequiresPermissions("exchangeRatio:view") |
| | | public String traderUpdate() { |
| | | return FebsUtil.view("modules/fish/exchangeRatio"); |
| | | } |
| | | |
| | | /** |
| | | * 兑换比例设置---详情 |
| | | */ |
| | | @GetMapping("exchangeRatioUpdate/{id}") |
| | | @RequiresPermissions("exchangeRatioUpdate:update") |
| | | public String exchangeRatioUpdate(@PathVariable long id, Model model) { |
| | | CannonExchangeRatio data = fishService.getExchangeRatioInfoById(id); |
| | | model.addAttribute("exchangeRatio", data); |
| | | return FebsUtil.view("modules/fish/exchangeRatioUpdate"); |
| | | } |
| | | |
| | | /** |
| | | * 炮台设置---列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("cannonList") |
| | | @RequiresPermissions("cannonList:view") |
| | | public String cannonList() { |
| | | return FebsUtil.view("modules/fish/cannonList"); |
| | | } |
| | | |
| | | /** |
| | | * 炮台设置---新增 |
| | | */ |
| | | @GetMapping("cannonAdd") |
| | | @RequiresPermissions("cannonAdd:add") |
| | | public String platformBannerAdd() { |
| | | return FebsUtil.view("modules/fish/cannonAdd"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 炮台设置---详情 |
| | | */ |
| | | @GetMapping("cannonUpdate/{id}") |
| | | @RequiresPermissions("cannonUpdate:update") |
| | | public String cannonUpdate(@PathVariable long id, Model model) { |
| | | CannonSetting data = fishService.getCannonInfoById(id); |
| | | model.addAttribute("cannonsetting", data); |
| | | return FebsUtil.view("modules/fish/cannonUpdate"); |
| | | } |
| | | |
| | | /** |
| | | * 操作记录---列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("accountList") |
| | | @RequiresPermissions("accountList:view") |
| | | public String accountList() { |
| | | return FebsUtil.view("modules/fish/accountList"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.fish.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.xcong.excoin.common.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 兑换比例设置 |
| | | */ |
| | | @Data |
| | | @TableName("cannon_account_money_change") |
| | | public class CannonAccountMoneyChange extends BaseEntity { |
| | | |
| | | private Long member_id; |
| | | //金额 |
| | | private BigDecimal amount; |
| | | //变更金额 |
| | | private BigDecimal change_balance; |
| | | //变更前 |
| | | private BigDecimal change_before; |
| | | //变更后 |
| | | private BigDecimal change_after; |
| | | //1:USDT购买炮台 2:金币兑换1代币 3:1代币兑换金币 |
| | | private Integer type; |
| | | //内容 |
| | | private String content; |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.fish.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | |
| | | /** |
| | | * 兑换比例设置 |
| | | */ |
| | | @Data |
| | | @TableName("cannon_exchange_ratio") |
| | | public class CannonExchangeRatio { |
| | | private Long id; |
| | | //金币兑换代币比例 |
| | | private BigDecimal goldRatio; |
| | | //代币兑换金币比例 |
| | | private BigDecimal coinRatio; |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.fish.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 炮台设置表 |
| | | */ |
| | | @Data |
| | | @TableName("cannon_setting") |
| | | public class CannonSetting { |
| | | |
| | | private Long id; |
| | | //炮台图片 |
| | | private String cannonImg; |
| | | //炮弹图片 |
| | | private String bulletImg; |
| | | //炮台名称 |
| | | private String name; |
| | | //炮台编码 |
| | | private String code; |
| | | //兑换价格 |
| | | private BigDecimal exchangePrice; |
| | | //消耗金币 |
| | | private BigDecimal goldConsume; |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.fish.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xcong.excoin.modules.fish.entity.CannonAccountMoneyChange; |
| | | import com.xcong.excoin.modules.fish.entity.CannonExchangeRatio; |
| | | import com.xcong.excoin.modules.fish.entity.CannonSetting; |
| | | import com.xcong.excoin.modules.fish.vo.CannonAccountMoneyChangeVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface CannonExchangeRatioMapper extends BaseMapper<CannonExchangeRatio> { |
| | | |
| | | IPage<CannonExchangeRatio> findExchangeRatioInPage(Page<CannonExchangeRatio> page, @Param("record") CannonExchangeRatio cannonExchangeRatio); |
| | | |
| | | IPage<CannonSetting> findCannonSettingInPage(Page<CannonSetting> page, @Param("record")CannonSetting cannonSetting); |
| | | |
| | | IPage<CannonAccountMoneyChangeVo> findCannonAccountMoneyChangeInPage(Page<CannonAccountMoneyChangeVo> page, @Param("record")CannonAccountMoneyChange cannonAccountMoneyChange); |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.fish.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xcong.excoin.modules.fish.entity.CannonSetting; |
| | | |
| | | public interface CannonSettingMapper extends BaseMapper<CannonSetting> { |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.fish.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xcong.excoin.common.entity.FebsResponse; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.fish.entity.CannonAccountMoneyChange; |
| | | import com.xcong.excoin.modules.fish.entity.CannonExchangeRatio; |
| | | import com.xcong.excoin.modules.fish.entity.CannonSetting; |
| | | import com.xcong.excoin.modules.fish.vo.CannonAccountMoneyChangeVo; |
| | | |
| | | public interface FishService extends IService<CannonExchangeRatio> { |
| | | |
| | | IPage<CannonExchangeRatio> exchangeRatio(CannonExchangeRatio cannonExchangeRatio, QueryRequest request); |
| | | |
| | | CannonExchangeRatio getExchangeRatioInfoById(long id); |
| | | |
| | | IPage<CannonSetting> cannonList(CannonSetting cannonSetting, QueryRequest request); |
| | | |
| | | void cannonAdd(CannonSetting cannonSetting); |
| | | |
| | | CannonSetting getCannonInfoById(long id); |
| | | |
| | | FebsResponse cannonUpdate(CannonSetting cannonSetting); |
| | | |
| | | FebsResponse exchangeRatioUpdate(CannonExchangeRatio cannonExchangeRatio); |
| | | |
| | | IPage<CannonAccountMoneyChangeVo> accountList(CannonAccountMoneyChange cannonAccountMoneyChange, QueryRequest request); |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.fish.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xcong.excoin.common.entity.FebsResponse; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.fish.entity.CannonAccountMoneyChange; |
| | | import com.xcong.excoin.modules.fish.entity.CannonExchangeRatio; |
| | | import com.xcong.excoin.modules.fish.entity.CannonSetting; |
| | | import com.xcong.excoin.modules.fish.mapper.CannonExchangeRatioMapper; |
| | | import com.xcong.excoin.modules.fish.mapper.CannonSettingMapper; |
| | | import com.xcong.excoin.modules.fish.service.FishService; |
| | | import com.xcong.excoin.modules.fish.vo.CannonAccountMoneyChangeVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class FishServiceImpl extends ServiceImpl<CannonExchangeRatioMapper, CannonExchangeRatio> implements FishService { |
| | | |
| | | private final CannonExchangeRatioMapper cannonExchangeRatioMapper; |
| | | private final CannonSettingMapper cannonSettingMapper; |
| | | |
| | | @Override |
| | | public IPage<CannonExchangeRatio> exchangeRatio(CannonExchangeRatio cannonExchangeRatio, QueryRequest request) { |
| | | Page<CannonExchangeRatio> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<CannonExchangeRatio> cannonExchangeRatioIPage = cannonExchangeRatioMapper.findExchangeRatioInPage(page, cannonExchangeRatio); |
| | | return cannonExchangeRatioIPage; |
| | | } |
| | | |
| | | @Override |
| | | public CannonExchangeRatio getExchangeRatioInfoById(long id) { |
| | | CannonExchangeRatio cannonExchangeRatio = cannonExchangeRatioMapper.selectById(id); |
| | | return cannonExchangeRatio; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<CannonSetting> cannonList(CannonSetting cannonSetting, QueryRequest request) { |
| | | Page<CannonSetting> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<CannonSetting> cannonSettingIPage = cannonExchangeRatioMapper.findCannonSettingInPage(page, cannonSetting); |
| | | return cannonSettingIPage; |
| | | } |
| | | |
| | | @Override |
| | | public void cannonAdd(CannonSetting cannonSetting) { |
| | | CannonSetting cannonSettingNew = new CannonSetting(); |
| | | cannonSettingNew.setName(cannonSetting.getName()); |
| | | cannonSettingNew.setCode(cannonSetting.getCode()); |
| | | cannonSettingNew.setExchangePrice(cannonSetting.getExchangePrice()); |
| | | cannonSettingNew.setGoldConsume(cannonSetting.getGoldConsume()); |
| | | cannonSettingNew.setCannonImg(cannonSetting.getCannonImg()); |
| | | cannonSettingNew.setBulletImg(cannonSettingNew.getBulletImg()); |
| | | cannonSettingMapper.insert(cannonSettingNew); |
| | | } |
| | | |
| | | @Override |
| | | public CannonSetting getCannonInfoById(long id) { |
| | | return cannonSettingMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse cannonUpdate(CannonSetting cannonSetting) { |
| | | cannonSettingMapper.updateById(cannonSetting); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse exchangeRatioUpdate(CannonExchangeRatio cannonExchangeRatio) { |
| | | Long id = cannonExchangeRatio.getId(); |
| | | CannonExchangeRatio cannonExchangeRatioOld = cannonExchangeRatioMapper.selectById(id); |
| | | cannonExchangeRatioOld.setCoinRatio(cannonExchangeRatio.getCoinRatio()); |
| | | cannonExchangeRatioMapper.updateById(cannonExchangeRatioOld); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<CannonAccountMoneyChangeVo> accountList(CannonAccountMoneyChange cannonAccountMoneyChange, QueryRequest request) { |
| | | |
| | | Page<CannonAccountMoneyChangeVo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<CannonAccountMoneyChangeVo> cannonAccountMoneyChangeVoIPage = |
| | | cannonExchangeRatioMapper.findCannonAccountMoneyChangeInPage(page, cannonAccountMoneyChange); |
| | | return cannonAccountMoneyChangeVoIPage; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.fish.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class CannonAccountMoneyChangeVo { |
| | | |
| | | private Long id; |
| | | private Long member_id; |
| | | //金额 |
| | | private BigDecimal amount; |
| | | //变更金额 |
| | | private BigDecimal changeBalance; |
| | | //变更前 |
| | | private BigDecimal changeBefore; |
| | | //变更后 |
| | | private BigDecimal changeAfter; |
| | | //1:USDT购买炮台 2:金币兑换1代币 3:1代币兑换金币 |
| | | private Integer type; |
| | | //内容 |
| | | private String content; |
| | | |
| | | private String email; |
| | | } |
New file |
| | |
| | | <?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.xcong.excoin.modules.fish.mapper.CannonExchangeRatioMapper"> |
| | | |
| | | <select id="findExchangeRatioInPage" resultType="com.xcong.excoin.modules.fish.entity.CannonExchangeRatio"> |
| | | select s.* from cannon_exchange_ratio s order by s.id asc |
| | | </select> |
| | | |
| | | <select id="findCannonSettingInPage" resultType="com.xcong.excoin.modules.fish.entity.CannonSetting"> |
| | | select s.* from cannon_setting s order by s.id asc |
| | | </select> |
| | | |
| | | <select id="findCannonAccountMoneyChangeInPage" resultType="com.xcong.excoin.modules.fish.vo.CannonAccountMoneyChangeVo"> |
| | | SELECT |
| | | a.*, b.email |
| | | FROM |
| | | cannon_account_money_change a |
| | | LEFT JOIN member b ON a.member_id = b.id |
| | | ORDER BY |
| | | a.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-account" lay-title="账户操作记录"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body febs-table-full"> |
| | | <form class="layui-form layui-table-form" lay-filter="user-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | | <!-- <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="add">--> |
| | | <!-- 新增--> |
| | | <!-- </div>--> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table lay-filter="accountTable" lay-data="{id: 'accountTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格操作栏 start --> |
| | | <script type="text/html" id="user-option"> |
| | | <span shiro:lacksPermission="user:view,user:update,user:delete"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <a lay-event="edit" shiro:hasPermission="user:update">编辑 |
| | | <i class="layui-icon febs-edit-area febs-blue"></i> |
| | | </a> |
| | | <a lay-event="delete" shiro:hasPermission="user:update">删除 |
| | | <i class="layui-icon febs-edit-area febs-blue"></i> |
| | | </a> |
| | | </script> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use(['jquery', 'form', 'table', 'febs'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#febs-account'), |
| | | // $add = $view.find('#add'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | tableIns |
| | | ; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('tool(accountTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | |
| | | if (layEvent === 'update') { |
| | | febs.modal.open('编辑', 'modules/fish/exchangeRatioUpdate/' + data.id, { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#exchangeratio-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 刷新按钮 |
| | | $reset.on('click', function () { |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}}); |
| | | }); |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return {}; |
| | | } |
| | | |
| | | // $add.on('click', function () { |
| | | // febs.modal.open('新增', 'modules/helpCenter/helpCenterAdd/', { |
| | | // btn: ['提交', '取消'], |
| | | // yes: function (index, layero) { |
| | | // $('#user-add').find('#submit').trigger('click'); |
| | | // }, |
| | | // btn2: function () { |
| | | // layer.closeAll(); |
| | | // } |
| | | // }); |
| | | // }); |
| | | |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'accountTable', |
| | | url: ctx + 'fish/accountList', |
| | | cols: [[ |
| | | {field: 'id', title: '', minWidth: 100,align:'left'}, |
| | | // {field: 'goldRatio', title: '1USDT兑换金币比例', minWidth: 300,align:'left'}, |
| | | {field: 'email', title: '用户', minWidth: 200,align:'left'}, |
| | | {field: 'amount', title: '金额', minWidth: 200,align:'left'}, |
| | | {field: 'type', title: '类型', |
| | | templet: function (d) { |
| | | if (d.type === 1) { |
| | | return '<span>购买炮台</span>' |
| | | } else if (d.type === 2) { |
| | | return '<span>金币兑换</span>' |
| | | } else if (d.type === 3) { |
| | | return '<span>兑换金币</span>' |
| | | } else{ |
| | | return '' |
| | | } |
| | | },minWidth: 200,align:'center'}, |
| | | {field: 'changeBalance', title: '变更金额', minWidth: 200,align:'left'}, |
| | | {field: 'changeBefore', title: '变更前', minWidth: 200,align:'left'}, |
| | | {field: 'changeAfter', title: '变更后', minWidth: 200,align:'left'}, |
| | | {field: 'content', title: '内容', minWidth: 100,align:'left'}, |
| | | // {title: '操作', |
| | | // templet: function (d) { |
| | | // return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="update" shiro:hasPermission="user:update">编辑</button>' |
| | | // },minWidth: 200,align:'center'} |
| | | ]] |
| | | }); |
| | | } |
| | | }) |
| | | </script> |
New file |
| | |
| | | <style> |
| | | #cannon-add { |
| | | padding: 20px 25px 25px 0; |
| | | } |
| | | |
| | | #cannon-add .layui-treeSelect .ztree li a, .ztree li span { |
| | | margin: 0 0 2px 3px !important; |
| | | } |
| | | #cannon-add #data-permission-tree-block { |
| | | border: 1px solid #eee; |
| | | border-radius: 2px; |
| | | padding: 3px 0; |
| | | } |
| | | #cannon-add .layui-treeSelect .ztree li span.button.switch { |
| | | top: 1px; |
| | | left: 3px; |
| | | } |
| | | |
| | | </style> |
| | | <div class="layui-fluid" id="cannon-add"> |
| | | <form class="layui-form" action="" lay-filter="cannon-add-form"> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label febs-form-item-require">id:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="id"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">名称:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="name" lay-verify="required" |
| | | autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">编码:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="code" lay-verify="required" |
| | | autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">兑换价格:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" name="exchangePrice" lay-verify="required" |
| | | autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">消耗金币:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" name="goldConsume" lay-verify="required" |
| | | autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">炮塔图片:</label> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn" id="cannonImgUpload">上传图片</button> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-upload-list"> |
| | | <img class="layui-upload-img" id="cannonImgUrls" width="100%" > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">图片链接:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" id="cannonImg" name="cannonImg" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">炮弹图片:</label>--> |
| | | <!-- <div class="layui-upload">--> |
| | | <!-- <button type="button" class="layui-btn" id="bulletImgUpload">上传图片</button>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <div class="layui-upload-list">--> |
| | | <!-- <img class="layui-upload-img" id="bulletImgUrls" width="100%" >--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">图片链接:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input type="text" id="bulletImg" name="bulletImg" class="layui-input" readonly>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="cannon-add-form-submit" id="submit"></button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree','upload'], function () { |
| | | var $ = layui.$, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | | formSelects = layui.formSelects, |
| | | treeSelect = layui.treeSelect, |
| | | form = layui.form, |
| | | eleTree = layui.eleTree, |
| | | member = [[${member}]], |
| | | $view = $('#cannon-add'), |
| | | validate = layui.validate, |
| | | upload = layui.upload, |
| | | _deptTree; |
| | | |
| | | // //普通图片上传 |
| | | // var uploadInst = upload.render({ |
| | | // elem: '#bulletImgUpload' |
| | | // ,url: ctx + 'helpCenter/uploadFileBase64' //改成您自己的上传接口 |
| | | // ,before: function(obj){ |
| | | // //预读本地文件示例,不支持ie8 |
| | | // obj.preview(function(index, file, result){ |
| | | // $('#bulletImgUrls').attr('src', result); //图片链接(base64) |
| | | // }); |
| | | // } |
| | | // ,done: function(res){ |
| | | // febs.alert.success(res.data.src); |
| | | // $("#bulletImg").val(res.data.src); |
| | | // } |
| | | // }); |
| | | |
| | | //普通图片上传 |
| | | var uploadInst = upload.render({ |
| | | elem: '#cannonImgUpload' |
| | | ,url: ctx + 'helpCenter/uploadFileBase64' //改成您自己的上传接口 |
| | | ,before: function(obj){ |
| | | //预读本地文件示例,不支持ie8 |
| | | obj.preview(function(index, file, result){ |
| | | $('#cannonImgUrls').attr('src', result); //图片链接(base64) |
| | | }); |
| | | } |
| | | ,done: function(res){ |
| | | febs.alert.success(res.data.src); |
| | | $("#cannonImg").val(res.data.src); |
| | | } |
| | | }); |
| | | |
| | | form.render(); |
| | | |
| | | formSelects.render(); |
| | | |
| | | form.on('submit(cannon-add-form-submit)', function (data) { |
| | | febs.post(ctx + 'fish/cannonAdd', data.field, function () { |
| | | layer.closeAll(); |
| | | febs.alert.success('新增成功'); |
| | | $('#febs-cannonsetting').find('#reset').click(); |
| | | }); |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-cannonsetting" lay-title="炮台设置"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body febs-table-full"> |
| | | <form class="layui-form layui-table-form" lay-filter="user-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="add"> |
| | | 新增 |
| | | </div> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table lay-filter="cannonTable" lay-data="{id: 'cannonTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格操作栏 start --> |
| | | <script type="text/html" id="user-option"> |
| | | <span shiro:lacksPermission="user:view,user:update,user:delete"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <a lay-event="edit" shiro:hasPermission="user:update">编辑 |
| | | <i class="layui-icon febs-edit-area febs-blue"></i> |
| | | </a> |
| | | <a lay-event="delete" shiro:hasPermission="user:update">删除 |
| | | <i class="layui-icon febs-edit-area febs-blue"></i> |
| | | </a> |
| | | </script> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use(['jquery', 'form', 'table', 'febs'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#febs-cannonsetting'), |
| | | $add = $view.find('#add'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | tableIns |
| | | ; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('tool(cannonTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | |
| | | if (layEvent === 'cannonUpdate') { |
| | | febs.modal.open('编辑', 'modules/fish/cannonUpdate/' + data.id, { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#cannon-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | if (layEvent === 'seeImgCannon') { |
| | | var t = $view.find('#seeImgCannon'+data.id+''); |
| | | //页面层 |
| | | layer.open({ |
| | | type: 1, |
| | | title: "炮台图片", |
| | | skin: 'layui-layer-rim', //加上边框 |
| | | area: ['80%', '80%'], //宽高 |
| | | shadeClose: true, //开启遮罩关闭 |
| | | end: function (index, layero) { |
| | | return false; |
| | | }, |
| | | content: '<div style="text-align:center"><img src="' + $(t).attr('src') + '" /></div>' |
| | | }); |
| | | } |
| | | |
| | | // if (layEvent === 'seeImgBullet') { |
| | | // var t = $view.find('#seeImgBullet'+data.id+''); |
| | | // //页面层 |
| | | // layer.open({ |
| | | // type: 1, |
| | | // title: "炮弹图片", |
| | | // skin: 'layui-layer-rim', //加上边框 |
| | | // area: ['80%', '80%'], //宽高 |
| | | // shadeClose: true, //开启遮罩关闭 |
| | | // end: function (index, layero) { |
| | | // return false; |
| | | // }, |
| | | // content: '<div style="text-align:center"><img src="' + $(t).attr('src') + '" /></div>' |
| | | // }); |
| | | // } |
| | | }); |
| | | |
| | | // 刷新按钮 |
| | | $reset.on('click', function () { |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}}); |
| | | }); |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return {}; |
| | | } |
| | | |
| | | $add.on('click', function () { |
| | | febs.modal.open('新增', 'modules/fish/cannonAdd/', { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#cannon-add').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'cannonTable', |
| | | url: ctx + 'fish/cannonList', |
| | | cols: [[ |
| | | {field: 'id', title: '', minWidth: 100,align:'left'}, |
| | | {field: 'name', title: '名称', minWidth: 200,align:'left'}, |
| | | {field: 'code', title: '编码', minWidth: 200,align:'left'}, |
| | | {field: 'exchangePrice', title: '兑换价格', minWidth: 200,align:'left'}, |
| | | {field: 'goldConsume', title: '每发炮弹消耗', minWidth: 200,align:'left'}, |
| | | {field: 'cannonImg', title: '炮台图片', |
| | | templet: function (d) { |
| | | return '<a lay-event="seeImgCannon"><img id="seeImgCannon'+d.id+'" src="'+d.cannonImg+'" alt=""></a>'; |
| | | }, minWidth: 100,align:'center'}, |
| | | // {field: 'bulletImg', title: '炮弹图片', |
| | | // templet: function (d) { |
| | | // return '<a lay-event="seeImgBullet"><img id="seeImgBullet'+d.id+'" src="'+d.bulletImg+'" alt=""></a>'; |
| | | // }, minWidth: 100,align:'center'}, |
| | | {title: '操作', |
| | | templet: function (d) { |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="cannonUpdate" shiro:hasPermission="user:update">编辑</button>' |
| | | },minWidth: 200,align:'center'} |
| | | ]] |
| | | }); |
| | | } |
| | | }) |
| | | </script> |
New file |
| | |
| | | <style> |
| | | #cannon-update { |
| | | padding: 20px 25px 25px 0; |
| | | } |
| | | |
| | | #cannon-update .layui-treeSelect .ztree li a, .ztree li span { |
| | | margin: 0 0 2px 3px !important; |
| | | } |
| | | #cannon-update #data-permission-tree-block { |
| | | border: 1px solid #eee; |
| | | border-radius: 2px; |
| | | padding: 3px 0; |
| | | } |
| | | #cannon-update .layui-treeSelect .ztree li span.button.switch { |
| | | top: 1px; |
| | | left: 3px; |
| | | } |
| | | #cannon-update img{ |
| | | max-width:100px |
| | | } |
| | | |
| | | </style> |
| | | <div class="layui-fluid" id="cannon-update"> |
| | | <form class="layui-form" action="" lay-filter="cannon-update-form"> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label febs-form-item-require">id:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="id" data-th-value="${cannonsetting.id}"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">名称</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="name" data-th-value="${cannonsetting.name}" |
| | | lay-verify="required" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">编码</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="code" data-th-value="${cannonsetting.code}" |
| | | lay-verify="required" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">兑换价格</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="exchangePrice" data-th-value="${cannonsetting.exchangePrice}" |
| | | lay-verify="required" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">每发炮弹消耗</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="goldConsume" data-th-value="${cannonsetting.goldConsume}" |
| | | lay-verify="required" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">炮塔图片:</label> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn" id="cannonImgUpload">上传图片</button> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-upload-list"> |
| | | <img class="layui-upload-img" id="cannonImgUrls" width="100%" > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">图片链接:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" id="cannonImg" name="cannonImg" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="cannon-update-form-submit" id="submit"></button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree', 'laydate','upload'], function () { |
| | | var $ = layui.$, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | | formSelects = layui.formSelects, |
| | | treeSelect = layui.treeSelect, |
| | | form = layui.form, |
| | | laydate = layui.laydate, |
| | | eleTree = layui.eleTree, |
| | | cannonsetting = [[${cannonsetting}]], |
| | | $view = $('#cannon-update'), |
| | | upload = layui.upload, |
| | | validate = layui.validate; |
| | | |
| | | form.render(); |
| | | laydate.render({ |
| | | elem: '#febs-form-group-date' |
| | | }); |
| | | |
| | | formSelects.render(); |
| | | |
| | | //普通图片上传 |
| | | var uploadInst = upload.render({ |
| | | elem: '#cannonImgUpload' |
| | | ,url: ctx + 'helpCenter/uploadFileBase64' //改成您自己的上传接口 |
| | | ,before: function(obj){ |
| | | //预读本地文件示例,不支持ie8 |
| | | obj.preview(function(index, file, result){ |
| | | $('#cannonImgUrls').attr('src', result); //图片链接(base64) |
| | | }); |
| | | } |
| | | ,done: function(res){ |
| | | febs.alert.success(res.data.src); |
| | | $("#cannonImg").val(res.data.src); |
| | | } |
| | | }); |
| | | |
| | | initUserValue(); |
| | | |
| | | function initUserValue() { |
| | | //缩略图图片回显 |
| | | if(cannonsetting.cannonImg != null || cannonsetting.cannonImg != ''){ |
| | | $('#cannonImgUrls').append('<img src="'+ cannonsetting.cannonImg +'" class="layui-upload-img" style="width: 100px">') |
| | | $("#cannonImg").val(cannonsetting.cannonImg); |
| | | } |
| | | form.val("cannon-update-form", { |
| | | "name": cannonsetting.name, |
| | | "code": cannonsetting.code, |
| | | "exchangePrice": cannonsetting.exchangePrice, |
| | | "goldConsume": cannonsetting.goldConsume, |
| | | "cannonImg": cannonsetting.cannonImg |
| | | // "bulletImg": cannonsetting.bulletImg |
| | | }); |
| | | } |
| | | |
| | | form.on('submit(cannon-update-form-submit)', function (data) { |
| | | febs.post(ctx + 'fish/cannonUpdate', data.field, function () { |
| | | layer.closeAll(); |
| | | febs.alert.success('操作成功'); |
| | | $('#febs-cannonsetting').find('#reset').click(); |
| | | }); |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-ratio" lay-title="兑换比例"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body febs-table-full"> |
| | | <form class="layui-form layui-table-form" lay-filter="user-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | | <!-- <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="add">--> |
| | | <!-- 新增--> |
| | | <!-- </div>--> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table lay-filter="ratioTable" lay-data="{id: 'ratioTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格操作栏 start --> |
| | | <script type="text/html" id="user-option"> |
| | | <span shiro:lacksPermission="user:view,user:update,user:delete"> |
| | | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 |
| | | </span> |
| | | <a lay-event="edit" shiro:hasPermission="user:update">编辑 |
| | | <i class="layui-icon febs-edit-area febs-blue"></i> |
| | | </a> |
| | | <a lay-event="delete" shiro:hasPermission="user:update">删除 |
| | | <i class="layui-icon febs-edit-area febs-blue"></i> |
| | | </a> |
| | | </script> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use(['jquery', 'form', 'table', 'febs'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#febs-ratio'), |
| | | // $add = $view.find('#add'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | tableIns |
| | | ; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('tool(ratioTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | |
| | | if (layEvent === 'update') { |
| | | febs.modal.open('编辑', 'modules/fish/exchangeRatioUpdate/' + data.id, { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#exchangeratio-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 刷新按钮 |
| | | $reset.on('click', function () { |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}}); |
| | | }); |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return {}; |
| | | } |
| | | |
| | | // $add.on('click', function () { |
| | | // febs.modal.open('新增', 'modules/helpCenter/helpCenterAdd/', { |
| | | // btn: ['提交', '取消'], |
| | | // yes: function (index, layero) { |
| | | // $('#user-add').find('#submit').trigger('click'); |
| | | // }, |
| | | // btn2: function () { |
| | | // layer.closeAll(); |
| | | // } |
| | | // }); |
| | | // }); |
| | | |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'ratioTable', |
| | | url: ctx + 'fish/exchangeRatio', |
| | | cols: [[ |
| | | {field: 'id', title: '', minWidth: 100,align:'left'}, |
| | | // {field: 'goldRatio', title: '1USDT兑换金币比例', minWidth: 300,align:'left'}, |
| | | {field: 'coinRatio', title: '1代币兑换金币比例', minWidth: 300,align:'left'}, |
| | | {title: '操作', |
| | | templet: function (d) { |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="update" shiro:hasPermission="user:update">编辑</button>' |
| | | },minWidth: 200,align:'center'} |
| | | ]] |
| | | }); |
| | | } |
| | | }) |
| | | </script> |
New file |
| | |
| | | <style> |
| | | #exchangeratio-update { |
| | | padding: 20px 25px 25px 0; |
| | | } |
| | | |
| | | #exchangeratio-update .layui-treeSelect .ztree li a, .ztree li span { |
| | | margin: 0 0 2px 3px !important; |
| | | } |
| | | #exchangeratio-update #data-permission-tree-block { |
| | | border: 1px solid #eee; |
| | | border-radius: 2px; |
| | | padding: 3px 0; |
| | | } |
| | | #exchangeratio-update .layui-treeSelect .ztree li span.button.switch { |
| | | top: 1px; |
| | | left: 3px; |
| | | } |
| | | #exchangeratio-update img{ |
| | | max-width:100px |
| | | } |
| | | |
| | | </style> |
| | | <div class="layui-fluid" id="exchangeratio-update"> |
| | | <form class="layui-form" action="" lay-filter="exchangeratio-update-form"> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label febs-form-item-require">id:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="id" data-th-value="${exchangeRatio.id}"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">兑换金币</label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" name="coinRatio" data-th-value="${exchangeRatio.coinRatio}" |
| | | lay-verify="required" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="exchangeratio-update-form-submit" id="submit"></button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree', 'laydate'], function () { |
| | | var $ = layui.$, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | | formSelects = layui.formSelects, |
| | | treeSelect = layui.treeSelect, |
| | | form = layui.form, |
| | | laydate = layui.laydate, |
| | | eleTree = layui.eleTree, |
| | | exchangeRatio = [[${exchangeRatio}]], |
| | | $view = $('#exchangeratio-update'), |
| | | validate = layui.validate; |
| | | |
| | | form.render(); |
| | | laydate.render({ |
| | | elem: '#febs-form-group-date' |
| | | }); |
| | | |
| | | formSelects.render(); |
| | | |
| | | |
| | | initUserValue(); |
| | | |
| | | function initUserValue() { |
| | | form.val("exchangeratio-update-form", { |
| | | "id": exchangeRatio.id, |
| | | "coinRatio": exchangeRatio.coinRatio |
| | | }); |
| | | } |
| | | |
| | | form.on('submit(exchangeratio-update-form-submit)', function (data) { |
| | | febs.post(ctx + 'fish/exchangeRatioUpdate', data.field, function () { |
| | | layer.closeAll(); |
| | | febs.alert.success('操作成功'); |
| | | $('#febs-ratio').find('#reset').click(); |
| | | }); |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |