@ -3,6 +3,7 @@
< block name = "body" >
< link rel = "stylesheet" href = "__CSS__/select2.min.css" type = "text/css" / >
< link rel = "stylesheet" type = "text/css" href = "__CSS__/admin_table.css" media = "all" >
< link href = "__STATIC__/icons_alibaba/iconfont.css" rel = "stylesheet" >
< script type = "text/javascript" src = "__STATIC__/uploadify/jquery.uploadify.min.js" > < / script >
< script type = "text/javascript" src = "__STATIC__/provincecityarea/AreaData_min.js" > < / script >
< script src = "__STATIC__/layer/layer.js" > < / script >
@ -22,6 +23,48 @@
.tabcon1711 .mustmark {
margin-left:-7px;
}
.list-ratio {
display: table;
}
.list-ratio .li-ratio {
display: flex;
margin-bottom: 20px;
align-items: center;
}
.list-ratio .li-ratio .turnover, .list-ratio .li-ratio .turnover-ratio {
position: relative;
}
.list-ratio .li-ratio .turnover span, .list-ratio .li-ratio .turnover-ratio .error-message {
color: red;
position: absolute;
left: 0;
top: 30px;
white-space: nowrap;
display: none;
}
.iconfont-btn {
cursor: pointer;
}
.iconfont-style {
font-size: 18px;
color: #fff;
border-radius: 4px;
border: 0;
padding: 5px;
margin-left: 10px;
}
.iconfont-selected {
background-color: #0A9AF2;
}
.iconfont-selected:hover {
background-color: #03a9f4;
}
.iconfont-unselected {
background-color: #999;
}
.iconfont-unselected:hover {
background-color: #ababab;
}
< / style >
< div class = "cf main-place top_nav_list navtab_list" >
< h3 class = "page_title" > {$meta_title}< / h3 >
@ -83,11 +126,62 @@
< tr >
< td class = "l" > 现分成比例:< / td >
< td class = "r table_radio" >
< input type = "text" class = "txt" name = "ratio" id = "ratio" value = "{$record.ratio|default='0.00'}" placeholder = "" onKeyUp = "value=value.replace(/[^\w\.\/]/ig,'')" >
< label > 默认分成比例:< / label >
< input type = "text" class = "txt ratio" name = "ratio" id = "ratio" value = "{$record.ratio|default='0.00'}" placeholder = "" onKeyUp = "value=value.replace(/[^\w\.\/]/ig,'')" style = "width: 60px;" >
< span class = "form_unit" > %< / span >
< span class = "notice-text" > 当前需要修改成的分成比例< / span >
< / td >
< / tr >
< tr > < td style = "height: 10px;" > < / td > < / tr >
< tr >
< td class = "l" > < / td >
< td class = "r table_radio" >
< div class = "list-ratio" >
< empty name = "record['turnover_ratio']" >
< div class = "li-ratio" >
< label > 月流水大于等于:< / label >
< div class = "turnover" >
< input type = "text" class = "txt" name = "turnover[]" value = "" placeholder = "" onKeyUp = "value=value.replace(/[^\w\.\/]/ig,'')" style = "width: 100px;margin-right: 10px;" >
< span > < / span >
< / div >
< label > 分成比例:< / label >
< div class = "turnover-ratio" >
< input type = "text" class = "txt" name = "turnover_ratio[]" value = "" placeholder = "" onKeyUp = "value=value.replace(/[^\w\.\/]/ig,'')" style = "width: 60px;" >
< span class = "form_unit" style = "margin-right: 10px;" > %< / span >
< span class = "error-message" > sadasdas< / span >
< / div >
< span class = "iconfont-btn iconfont-btn-add" title = "添加流水比例" > < i class = "iconfont-style iconfont-selected iconfont iconjiahao1" > < / i > < / span >
< span class = "iconfont-btn iconfont-btn-del" title = "删除流水比例" > < i class = "iconfont-style iconfont-unselected iconfont iconjianhao" > < / i > < / span >
< / div >
< else / >
< volist name = "record['turnover_ratio']" key = "key" id = "vo" >
< div class = "li-ratio" >
< label > 月流水大于等于:< / label >
< div class = "turnover" >
< input type = "text" class = "txt" name = "turnover[]" value = "{$vo['turnover']|default=''}" placeholder = "" onKeyUp = "value=value.replace(/[^\w\.\/]/ig,'')" style = "width: 100px;margin-right: 10px;" >
< span > < / span >
< / div >
< label > 分成比例:< / label >
< div class = "turnover-ratio" >
< input type = "text" class = "txt" name = "turnover_ratio[]" value = "{$vo['ratio']|default=''}" placeholder = "" onKeyUp = "value=value.replace(/[^\w\.\/]/ig,'')" style = "width: 60px;" >
< span class = "form_unit" style = "margin-right: 10px;" > %< / span >
< span class = "error-message" > < / span >
< / div >
< if condition = "$key eq 1" >
< span class = "iconfont-btn iconfont-btn-add" title = "添加流水比例" > < i class = "iconfont-style iconfont-selected iconfont iconjiahao1" > < / i > < / span >
< if condition = "1 eq count($record['turnover_ratio'])" >
< span class = "iconfont-btn iconfont-btn-del" title = "删除流水比例" > < i class = "iconfont-style iconfont-unselected iconfont iconjianhao" > < / i > < / span >
< else / >
< span class = "iconfont-btn iconfont-btn-del" title = "删除流水比例" > < i class = "iconfont-style iconfont-selected iconfont iconjianhao" > < / i > < / span >
< / if >
< / if >
< / div >
< / volist >
< / empty >
< / div >
< span class = "notice-text" style = "width: auto;" > < / span >
< / td >
< / tr >
< tr >
< td class = "l" > < i class = "mustmark" > *< / i > 开始时间:< / td >
< td class = "r table_radio" >
@ -147,13 +241,15 @@ $(".select_gallery").select2();
$(function(){
$('.time').datetimepicker({
format: 'yyyy-mm-dd ',
format: 'yyyy-mm',
language: "zh-CN",
minView: 2,
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: false,
startView: 'year',
minView:'year',
maxView:'year',
});
showTab();
@ -239,6 +335,119 @@ $(function(){
}
});
});
$('.iconfont-btn-add').click(function (e) {
var delBtn = $('.iconfont-btn-del');
var html = '';
html += '< div class = "li-ratio" > ';
html += '< label > 月流水大于等于:< / label > ';
html += '< div class = "turnover" > ';
html += '< input type = "text" class = "txt" name = "turnover[]" value = "" placeholder = "" onKeyUp = "value=value.replace(/[^\\w\\.\\/]/ig, \'\')" style = "width: 100px;margin-right: 10px;" > ';
html += '< span > < / span > ';
html += '< / div > ';
html += '< label > 分成比例:< / label > ';
html += '< div class = "turnover-ratio" > ';
html += '< input type = "text" class = "txt" name = "turnover_ratio[]" value = "" placeholder = "" onKeyUp = "value=value.replace(/[^\\w\\.\\/]/ig, \'\')" style = "width: 60px;" > ';
html += '< span class = "form_unit" style = "margin-right: 10px;" > %< / span > ';
html += '< span class = "error-message" > < / span > ';
html += '< / div > ';
html += '< / div > ';
$('.list-ratio').append(html);
if ($('.list-ratio').children().length > 1 & & delBtn.children('i').hasClass('iconfont-unselected')) {
delBtn.children('i').removeClass('iconfont-unselected');
delBtn.children('i').addClass('iconfont-selected');
}
$('.list-ratio').children(':last-child').children('.turnover').children('input').change(function (e) {
turnoverChangeHandle();
});
$('.list-ratio').children(':last-child').children('.turnover-ratio').children('input').change(function (e) {
turnoverRatioChangeHandle();
});
});
$('.list-ratio').children('.li-ratio').children('.turnover').children('input').change(function (e) {
turnoverChangeHandle();
});
$('.list-ratio').children('.li-ratio').children('.turnover-ratio').children('input').change(function (e) {
turnoverRatioChangeHandle();
});
function turnoverChangeHandle()
{
$('.list-ratio').children('.li-ratio').children('.turnover').children('input').each(function () {
var that = $(this);
var thatLiRatio = that.parent().parent();
var thatLiRatioIndex = thatLiRatio.index();
var prevTurnover = 0;
var prev = thatLiRatio.prev().children().children('input');
var thatTurnover = parseFloat(that.val());
if (thatLiRatioIndex > 0) {
prevTurnover = parseFloat(prev.val());
prevTurnoverHandle(thatTurnover, prevTurnover, that);
}
});
}
function turnoverRatioChangeHandle() {
var ratio = parseFloat($('#ratio').val());
$('.list-ratio').children('.li-ratio').children('.turnover-ratio').children('input').each(function () {
var that = $(this);
var thatLiRatio = that.parent().parent();
var thatLiRatioIndex = thatLiRatio.index();
var thatTurnoverRatio = parseFloat(that.val());
if (thatLiRatioIndex === 0) {
console.log(111)
prevTurnoverRatio = ratio;
prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that, true);
} else {
var prev = thatLiRatio.prev().children('.turnover-ratio').children('input');
var prevTurnoverRatio = parseFloat(prev.val());
prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that);
}
});
}
function prevTurnoverHandle(thatTurnover, prevTurnover, that)
{
if (thatTurnover < = prevTurnover) {
that.parent().children('span').text('月流水必须大于上一个月流水');
that.parent().children('span').show();
} else {
that.parent().children('span').hide();
}
return true;
}
function prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that, isDefault = false)
{
if (thatTurnoverRatio < = prevTurnoverRatio) {
var msg = isDefault ? '月流水分成比例必须大于默认分成比例' : '月流水分成比例必须大于上一个月流水分成比例';
that.parent().children('.error-message').text(msg);
that.parent().children('.error-message').show();
} else {
that.parent().children('.error-message').hide();
}
return true;
}
$('.iconfont-btn-del').click(function (e) {
var that = $(this);
if ($('.list-ratio').children().length > 1) {
$('.list-ratio').children(':last-child').remove();
if ($('.list-ratio').children().length === 1) {
that.children('i').removeClass('iconfont-selected');
that.children('i').addClass('iconfont-unselected');
}
}
});
});
< / script >
< / block >