From 7cd28cc7ce0a40485be042b919bf5e51bd349c99 Mon Sep 17 00:00:00 2001
From: ELF <360197197@qq.com>
Date: Thu, 20 Feb 2020 10:43:59 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/View/PresidentDeposit/form.html | 187 ------------------
1 file changed, 187 deletions(-)
diff --git a/Application/Admin/View/PresidentDeposit/form.html b/Application/Admin/View/PresidentDeposit/form.html
index 04ea3d80a..b97f932d3 100644
--- a/Application/Admin/View/PresidentDeposit/form.html
+++ b/Application/Admin/View/PresidentDeposit/form.html
@@ -186,36 +186,6 @@ $(function(){
});
showTab();
- var promoteGameRatioData = {};
- promoteGameRatioData.ratio = '0.00';
- promoteGameRatioData.begin_time = '';
- promoteGameRatioData.end_time = '';
- promoteGameRatioData.remark = '';
-
- $('#company_id').change(function (e) {
- var companyId = parseInt($(this).val());
- $.ajax({
- type: 'post',
- url: "{:U('getPromotes')}",
- dataType: 'json',
- data: {'company_id': companyId},
- success: function (data) {
- var html = '';
- if (data.length > 0) {
- for (let i = 0;i < data.length;i++) {
- html += '';
- }
- }
- $('#promote_id').html(html);
- $('#promote_id').select2();
- getPromoteGameRatio();
- },
- error: function (result) {
- console.log(result);
- }
- });
- });
-
$('#pay_type').change(function() {
var val = $(this).val()
if (val == 2) {
@@ -228,46 +198,6 @@ $(function(){
$('#pay_way').val('').select2()
}
})
- $('#ratio, #begin_time, #end_time, #remark').change(function () {
- var val = $(this).val();
- var elementIdName = $(this).attr('id');
- promoteGameRatioData[elementIdName] = val;
- });
-
- $('#promote_id, #game_id').change(function () {
- getPromoteGameRatio();
- });
-
- function getPromoteGameRatio()
- {
- var promoteId = parseInt($('#promote_id').val());
- var gameId = parseInt($('#game_id').val());
-
- $.ajax({
- type: 'post',
- url: "{:U('getPromoteGameRatio')}",
- dataType: 'json',
- data: {'promote_id': promoteId, 'game_id': gameId},
- success: function (data) {
- var record = data.record;
- if (data.status == 2) {
- $('#ratio').val(record.ratio);
- $('#last_ratio').text(record.last_ratio);
- $('#begin_time').val(record.begin_time);
- $('#end_time').val(record.end_time);
- $('#remark').val(record.remark);
- $('#id').val(record.id);
- } else {
- // $('#ratio').val(promoteGameRatioData.ratio);
- $('#last_ratio').text(record.last_ratio);
- // $('#begin_time').val(promoteGameRatioData.begin_time);
- // $('#end_time').val(promoteGameRatioData.end_time);
- // $('#remark').val(promoteGameRatioData.remark);
- $('#id').val('');
- }
- }
- });
- }
$('#submit').click(function (e) {
var target = $('form').get(0).action;
@@ -305,123 +235,6 @@ $(function(){
}
});
});
-
- $('.iconfont-btn-add').click(function (e) {
- var delBtn = $('.iconfont-btn-del');
- var html = '';
- html += '
';
- html += '
';
- html += '
';
- html += '
';
- html += '';
- html += '';
- html += '
';
- html += '
';
- html += '
';
- html += '';
- html += '%';
- html += '';
- html += '
';
- html += '
';
-
- $('.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');
- }
- }
- });
});
\ No newline at end of file