mirror of
https://github.com/kongyuebin1/dongfeng-pay.git
synced 2025-10-30 18:17:31 +08:00
由gopath形式改为module
This commit is contained in:
11
merchant/static/js/deal_excel.js
Normal file
11
merchant/static/js/deal_excel.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for 导出Excel文件
|
||||
** @Time : 19.12.7 16:48
|
||||
** @Author : Joker
|
||||
** @File : deal_excel
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 19.12.7 16:48
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
let excel={download_trade_order_excel:function(){let startTime=$("#startTime").val();let endTime=$("#endTime").val();let payType=$("#payType").val();let uStatus=$("#uStatus").val();$.ajax({type:"GET",url:"/excel/make_order_excel/",data:{start:startTime,end:endTime,pay_type:payType,status:uStatus,},cache:true,success:function(res){if(res.code===9){let $form=$("<form method='get'></form>");$form.attr("action","/excel/download_excel/"+res.msg);$(document.body).append($form);$form.submit()}else{toastr.error(res.msg)}},error:function(XMLHttpRequest){toastr.info('something is wrong, code: '+XMLHttpRequest.status)}})},download_complaint_record_excel:function(){let startTime=$("#startTime").val();let endTime=$("#endTime").val();let payType=$("#payType").val();let uStatus=$("#uStatus").val();$.ajax({type:"GET",url:"/excel/make_complaint_record_excel/",data:{start:startTime,end:endTime,pay_type:payType,status:uStatus,},cache:true,success:function(res){if(res.code===9){let $form=$("<form method='get'></form>");$form.attr("action","/excel/download_excel/"+res.msg);$(document.body).append($form);$form.submit()}else{toastr.error(res.msg)}},error:function(XMLHttpRequest){toastr.info('something is wrong, code: '+XMLHttpRequest.status)}})},download_withdraw_record_excel:function(){let startTime=$("#startTime").val();let endTime=$("#endTime").val();let uStatus=$("#uStatus").val();$.ajax({type:"GET",url:"/excel/make_withdraw_record_excel/",data:{start:startTime,end:endTime,status:uStatus,},cache:true,success:function(res){if(res.code===9){let $form=$("<form method='get'></form>");$form.attr("action","/excel/download_excel/"+res.msg);$(document.body).append($form);$form.submit()}else{toastr.error(res.msg)}},error:function(XMLHttpRequest){toastr.info('something is wrong, code: '+XMLHttpRequest.status)}})},download_recharge_record_excel:function(){let startTime=$("#startTime").val();let endTime=$("#endTime").val();let uStatus=$("#uStatus").val();$.ajax({type:"GET",url:"/excel/make_recharge_record_excel/",data:{start:startTime,end:endTime,status:uStatus,},cache:true,success:function(res){if(res.code===9){let $form=$("<form method='get'></form>");$form.attr("action","/excel/download_excel/"+res.msg);$(document.body).append($form);$form.submit()}else{toastr.error(res.msg)}},error:function(XMLHttpRequest){toastr.info('something is wrong, code: '+XMLHttpRequest.status)}})}};
|
||||
205
merchant/static/js/form_validate.js
Normal file
205
merchant/static/js/form_validate.js
Normal file
@@ -0,0 +1,205 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for 表单验证js
|
||||
** @Time : 19.12.3 11:17
|
||||
** @Author : Joker
|
||||
** @File : form_validate
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 19.12.3 11:17
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
let form_v = {
|
||||
modify_userInfo: function () {
|
||||
let or_pwd = $("#or_pwd").val();
|
||||
let new_pwd = $("#new_pwd").val();
|
||||
let confirm_pwd = $("#confirm_pwd").val();
|
||||
let patrn = /^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){5,19}$/;
|
||||
if (or_pwd === "" || new_pwd === "" || confirm_pwd === "") {
|
||||
toastr.error("密码不能为空!");
|
||||
return
|
||||
}
|
||||
if (!patrn.exec(new_pwd) || !patrn.exec(confirm_pwd)) {
|
||||
toastr.error("密码只能输入6-20个以字母开头、可带数字、“_”、“.”的字串!");
|
||||
return
|
||||
}
|
||||
if (new_pwd !== confirm_pwd) {
|
||||
toastr.error("两次密码不匹配!");
|
||||
return
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user_info/confirm_pwd/",
|
||||
data: {c: or_pwd,},
|
||||
cache: false,
|
||||
success: function (res) {
|
||||
if (res.code === -9) {
|
||||
toastr.error(res.msg)
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user_info/modify_userInfo/",
|
||||
data: $("#modify_userInfo").serialize(),
|
||||
cache: false,
|
||||
success: function (res) {
|
||||
if (res.code === 9) {
|
||||
toastr.success(res.msg);
|
||||
setTimeout(function () {
|
||||
window.location.reload()
|
||||
}, 3000)
|
||||
} else {
|
||||
toastr.error(res.msg)
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest) {
|
||||
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest) {
|
||||
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
|
||||
}
|
||||
})
|
||||
}, confirm_origin_pwd: function () {
|
||||
let or_pwd = $("#or_pwd").val();
|
||||
if (or_pwd === "") {
|
||||
toastr.error("原始密码不能为空!");
|
||||
return
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user_info/confirm_pwd/",
|
||||
data: {c: or_pwd,},
|
||||
cache: false,
|
||||
success: function (res) {
|
||||
if (res.code === -9) {
|
||||
toastr.error(res.msg)
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest) {
|
||||
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
|
||||
}
|
||||
})
|
||||
}, confirm_new_pwd: function () {
|
||||
let new_pwd = $("#new_pwd").val();
|
||||
let confirm_pwd = $("#confirm_pwd").val();
|
||||
let patrn = /^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){5,19}$/;
|
||||
if (new_pwd === "" || confirm_pwd === "") {
|
||||
toastr.error("新密码不能为空!");
|
||||
return
|
||||
}
|
||||
if (!patrn.exec(new_pwd) || !patrn.exec(confirm_pwd)) {
|
||||
toastr.error("密码只能输入6-20个以字母开头、可带数字、“_”、“.”的字串!");
|
||||
return
|
||||
}
|
||||
if (new_pwd !== confirm_pwd) {
|
||||
toastr.error("两次密码不匹配!")
|
||||
}
|
||||
}, launch_single_withdraw: function (adr) {
|
||||
let balance = $("#balance").val();
|
||||
let bankCode = $("#bankCode").val();
|
||||
let accountName = $("#accountName").val();
|
||||
let cardNo = $("#cardNo").val();
|
||||
let bankAccountType = $("#bankAccountType").val();
|
||||
let province = $("#province").val();
|
||||
let city = $("#city").val();
|
||||
let bankAccountAddress = $("#bankAccountAddress").val();
|
||||
let moblieNo = $("#moblieNo").val();
|
||||
let amount = $("#amount").val();
|
||||
let smsVerifyCode = $("#smsVerifyCode").val();
|
||||
let patrn = /^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/;
|
||||
let patrn2 = /^[1]([3-9])[0-9]{9}$/;
|
||||
if (bankCode === "" || accountName === "" || cardNo === "") {
|
||||
toastr.error("银行名、账户名或卡号不能为空!");
|
||||
return
|
||||
}
|
||||
if (amount === "" || moblieNo === "") {
|
||||
toastr.error("手机号或金额不能为空!");
|
||||
return
|
||||
}
|
||||
if (!patrn2.exec(moblieNo)) {
|
||||
toastr.error("请输入正确的手机号!");
|
||||
return
|
||||
}
|
||||
if (!patrn.exec(amount)) {
|
||||
toastr.error("请输入正确的金额!");
|
||||
return
|
||||
}
|
||||
if ("PUBLIC_ACCOUNT" === bankAccountType) {
|
||||
if (province === "" || city === "" || bankAccountAddress === "") {
|
||||
toastr.error("开户行全称、所在省份或所在城市不能为空!");
|
||||
return
|
||||
}
|
||||
}
|
||||
if (parseInt(amount) > parseInt(balance) || parseInt(amount) > 50000) {
|
||||
toastr.error("提现金额超出限制!");
|
||||
return
|
||||
}
|
||||
if (adr === "") {
|
||||
adr = "/withdraw/send_msg/"
|
||||
} else {
|
||||
if (smsVerifyCode === "") {
|
||||
toastr.error("手机号验证码不能为空!");
|
||||
return
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST", url: adr, data: $("#withdraw").serialize(), success: function (resp) {
|
||||
if (resp.code === 9) {
|
||||
swal(resp.msg, {icon: "success", type: "success", closeOnClickOutside: false,}).then((con) => {
|
||||
if (con) {
|
||||
if (resp.url !== "") {
|
||||
window.location.href = resp.url
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
toastr.error(resp.msg)
|
||||
}
|
||||
}, error: function (XMLHttpRequest) {
|
||||
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
|
||||
}
|
||||
})
|
||||
}, launch_multi_withdraw: function (adr) {
|
||||
let file = $("#file").val();
|
||||
let smsVerifyCode = $("#smsVerifyCode").val();
|
||||
let pos = file.lastIndexOf(".");
|
||||
let lastname = file.substring(pos, file.length);
|
||||
if (lastname.toLowerCase() !== ".xls" && lastname.toLowerCase() !== ".xlsx") {
|
||||
toastr.error("仅支持“xls”、“xlsx”格式文件!");
|
||||
return
|
||||
}
|
||||
if (adr === "") {
|
||||
adr = "/multi_withdraw/send_msg_for_multi/"
|
||||
} else {
|
||||
if (smsVerifyCode === "") {
|
||||
toastr.error("手机验证码不能为空!");
|
||||
return
|
||||
}
|
||||
}
|
||||
let multi_withdraw = document.getElementById('multi_withdraw'), formData = new FormData(multi_withdraw);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: adr,
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (res) {
|
||||
if (res.code === 9) {
|
||||
swal(res.msg, {icon: "success", type: "success", closeOnClickOutside: false,}).then((con) => {
|
||||
if (con) {
|
||||
if (res.url !== "") {
|
||||
window.location.href = res.url
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
swal(res.msg, {icon: "warning", closeOnClickOutside: false,})
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest) {
|
||||
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
176
merchant/static/js/front.js
Normal file
176
merchant/static/js/front.js
Normal file
@@ -0,0 +1,176 @@
|
||||
$(document).ready(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
// ------------------------------------------------------- //
|
||||
// Search Box
|
||||
// ------------------------------------------------------ //
|
||||
$('#search').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$('.search-box').fadeIn();
|
||||
});
|
||||
$('.dismiss').on('click', function () {
|
||||
$('.search-box').fadeOut();
|
||||
});
|
||||
|
||||
// ------------------------------------------------------- //
|
||||
// Card Close
|
||||
// ------------------------------------------------------ //
|
||||
$('.card-close a.remove').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).parents('.card').fadeOut();
|
||||
});
|
||||
|
||||
// ------------------------------------------------------- //
|
||||
// Tooltips init
|
||||
// ------------------------------------------------------ //
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
|
||||
|
||||
// ------------------------------------------------------- //
|
||||
// Adding fade effect to dropdowns
|
||||
// ------------------------------------------------------ //
|
||||
$('.dropdown').on('show.bs.dropdown', function () {
|
||||
$(this).find('.dropdown-menu').first().stop(true, true).fadeIn();
|
||||
});
|
||||
$('.dropdown').on('hide.bs.dropdown', function () {
|
||||
$(this).find('.dropdown-menu').first().stop(true, true).fadeOut();
|
||||
});
|
||||
|
||||
|
||||
// ------------------------------------------------------- //
|
||||
// Sidebar Functionality
|
||||
// ------------------------------------------------------ //
|
||||
$('#toggle-btn').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).toggleClass('active');
|
||||
|
||||
$('.side-navbar').toggleClass('shrinked');
|
||||
$('.content-inner').toggleClass('active');
|
||||
$(document).trigger('sidebarChanged');
|
||||
|
||||
if ($(window).outerWidth() > 1183) {
|
||||
if ($('#toggle-btn').hasClass('active')) {
|
||||
$('.navbar-header .brand-small').hide();
|
||||
$('.navbar-header .brand-big').show();
|
||||
} else {
|
||||
$('.navbar-header .brand-small').show();
|
||||
$('.navbar-header .brand-big').hide();
|
||||
}
|
||||
}
|
||||
|
||||
if ($(window).outerWidth() < 1183) {
|
||||
$('.navbar-header .brand-small').show();
|
||||
}
|
||||
});
|
||||
|
||||
// ------------------------------------------------------- //
|
||||
// Universal Form Validation
|
||||
// ------------------------------------------------------ //
|
||||
|
||||
$('.form-validate').each(function() {
|
||||
$(this).validate({
|
||||
errorElement: "div",
|
||||
errorClass: 'is-invalid',
|
||||
validClass: 'is-valid',
|
||||
ignore: ':hidden:not(.summernote, .checkbox-template, .form-control-custom),.note-editable.card-block',
|
||||
errorPlacement: function (error, element) {
|
||||
// Add the `invalid-feedback` class to the error element
|
||||
error.addClass("invalid-feedback");
|
||||
console.log(element);
|
||||
if (element.prop("type") === "checkbox") {
|
||||
error.insertAfter(element.siblings("label"));
|
||||
}
|
||||
else {
|
||||
error.insertAfter(element);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// ------------------------------------------------------- //
|
||||
// Material Inputs
|
||||
// ------------------------------------------------------ //
|
||||
|
||||
var materialInputs = $('input.input-material');
|
||||
|
||||
// activate labels for prefilled values
|
||||
materialInputs.filter(function() { return $(this).val() !== ""; }).siblings('.label-material').addClass('active');
|
||||
|
||||
// move label on focus
|
||||
materialInputs.on('focus', function () {
|
||||
$(this).siblings('.label-material').addClass('active');
|
||||
});
|
||||
|
||||
// remove/keep label on blur
|
||||
materialInputs.on('blur', function () {
|
||||
$(this).siblings('.label-material').removeClass('active');
|
||||
|
||||
if ($(this).val() !== '') {
|
||||
$(this).siblings('.label-material').addClass('active');
|
||||
} else {
|
||||
$(this).siblings('.label-material').removeClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
// ------------------------------------------------------- //
|
||||
// Footer
|
||||
// ------------------------------------------------------ //
|
||||
|
||||
var contentInner = $('.content-inner');
|
||||
|
||||
$(document).on('sidebarChanged', function () {
|
||||
adjustFooter();
|
||||
});
|
||||
|
||||
$(window).on('resize', function () {
|
||||
adjustFooter();
|
||||
})
|
||||
|
||||
function adjustFooter() {
|
||||
var footerBlockHeight = $('.main-footer').outerHeight();
|
||||
contentInner.css('padding-bottom', footerBlockHeight + 'px');
|
||||
}
|
||||
|
||||
// ------------------------------------------------------- //
|
||||
// External links to new window
|
||||
// ------------------------------------------------------ //
|
||||
$('.external').on('click', function (e) {
|
||||
|
||||
e.preventDefault();
|
||||
window.open($(this).attr("href"));
|
||||
});
|
||||
|
||||
// ------------------------------------------------------ //
|
||||
// For demo purposes, can be deleted
|
||||
// ------------------------------------------------------ //
|
||||
|
||||
var stylesheet = $('link#theme-stylesheet');
|
||||
$("<link id='new-stylesheet' rel='stylesheet'>").insertAfter(stylesheet);
|
||||
var alternateColour = $('link#new-stylesheet');
|
||||
|
||||
if ($.cookie("theme_csspath")) {
|
||||
alternateColour.attr("href", $.cookie("theme_csspath"));
|
||||
}
|
||||
|
||||
$("#colour").change(function () {
|
||||
|
||||
if ($(this).val() !== '') {
|
||||
|
||||
var theme_csspath = 'css/style.' + $(this).val() + '.css';
|
||||
|
||||
alternateColour.attr("href", theme_csspath);
|
||||
|
||||
$.cookie("theme_csspath", theme_csspath, {
|
||||
expires: 365,
|
||||
path: document.URL.substr(0, document.URL.lastIndexOf('/'))
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
11
merchant/static/js/index.js
Normal file
11
merchant/static/js/index.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for 首页js
|
||||
** @Time : 19.12.2 14:46
|
||||
** @Author : Joker
|
||||
** @File : index
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 19.12.2 14:46
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
let index={getAccountInfo:function(){$.ajax({type:"GET",url:"/index/loadInfo/",success:function(result){$("#balanceAmt").text(result["balanceAmt"]);$("#settAmount").text(result["settAmount"]);$("#freezeAmt").text(result["freezeAmt"]);$("#amountFrozen").text(result["amountFrozen"])},error:function(XMLHttpRequest){toastr.info('something is wrong, code: '+XMLHttpRequest.status)}})},getOrdersInfo:function(){$.ajax({type:"GET",url:"/index/loadOrders",success:function(result){$("#orders").text(result["orders"]);$("#suc_orders").text(result["suc_orders"]);$("#suc_rate").text((result["suc_rate"]*100).toFixed(2)+"%")},error:function(XMLHttpRequest){toastr.info('something is wrong, code: '+XMLHttpRequest.status)}})},get_account_balance:function(){$.ajax({type:"GET",url:"/withdraw/balance",success:function(resp){$("#balance").val(resp.balance);$("#sett_fee").html(resp.fee)},error:function(XMLHttpRequest){toastr.info('something is wrong, code: '+XMLHttpRequest.status)}})},loadTradeRecord:function(){$.ajax({type:"GET",url:"/index/load_count_order",success:function(res){let con="";$.each(res,function(index,item){if(item.PayWayName===""){return true}con+=`<div class="project"><div class="row bg-white has-shadow"><div class="left-col col-lg-1 d-flex align-items-center justify-content-between"><small>`+(index+1)+`</small></div><div class="left-col col-lg-3 d-flex align-items-center justify-content-between"><small>`+item.PayWayName+`</small></div><div class="left-col col-lg-2 d-flex align-items-center justify-content-between"><small>`+item.OrderCount+`</small></div><div class="left-col col-lg-2 d-flex align-items-center justify-content-between"><small>`+item.SucOrderCount+`</small></div><div class="left-col col-lg-2 d-flex align-items-center justify-content-between"><small>`+(item.SucRate*100).toFixed(2)+`%</small></div></div></div>`});$("#your_showtime").html(con)},error:function(XMLHttpRequest){toastr.info('something is wrong, code: '+XMLHttpRequest.status)}})},loadPayWay:function(){$.ajax({type:"GET",url:"/index/pay_way",success:function(res){let con="";$.each(res,function(index,item){if(item.Name===""){return true}con+=`<div class="project"><div class="row bg-white has-shadow"><div class="left-col col-lg-1 d-flex align-items-center justify-content-between"><small>`+(index+1)+`</small></div><div class="left-col col-lg-3 d-flex align-items-center justify-content-between"><small>`+item.Name+`</small></div><div class="left-col col-lg-2 d-flex align-items-center justify-content-between"><small>`+item.Rate+`%</small></div></div></div>`});$("#your_showtime").html(con)},error:function(XMLHttpRequest){toastr.info('something is wrong, code: '+XMLHttpRequest.status)}})},};
|
||||
11
merchant/static/js/login.js
Normal file
11
merchant/static/js/login.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for 登录js
|
||||
** @Time : 2019.04.01 13:34
|
||||
** @Author : Joker
|
||||
** @File : login.js
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 2019.04.01 13:34
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
let login={changeImg:function(){login.setImgSrc($("#rcCaptcha-img"),"reload="+(new Date()).getDate())},setImgSrc:function(obj,reload){var $src=obj[0].src;var $flag=$src.indexOf("?");if($flag>=0){$src=$src.substr(0,$flag)}obj.attr("src",$src+"?"+reload)},flushCaptcha:function(){$.ajax({type:"GET",url:"flushCaptcha.py",success:function(res){$("#rcCaptcha-img").attr("src","/img.do/"+res.data+".png");$("#captchaId").val(res.data)}})},login_action:function(){let userName=$("#userName").val();let Password=$("#Password").val();let captchaCode=$("#captchaCode").val();if(userName===""||Password===""){toastr.error("用户名或者密码不能为空!");return}if(captchaCode===""){toastr.error("验证码不能为空!");return}$.ajax({type:"POST",url:"/login.py/",data:$("#form-validate").serialize(),success:function(data){if(data.code===-9){toastr.error(data.msg,function(){if(data.url==="-9"){login.flushCaptcha()}})}else{window.location.href=data.url}},error:function(XMLHttpRequest){toastr.info('something is wrong, code: '+XMLHttpRequest.status)}})},loginOut:function(){swal({title:"Are you sure?",text:"您确定要退出登录吗?",icon:"warning",closeOnClickOutside:false,buttons:true,dangerMode:true,}).then((willDelete)=>{if(willDelete){$.ajax({type:"get",url:"/loginOut.py",success:function(res){window.location.href=res.url},error:function(XMLHttpRequest){toastr.info('something is wrong, code: '+XMLHttpRequest.status)}})}})}};
|
||||
1
merchant/static/js/reload.min.js
vendored
Normal file
1
merchant/static/js/reload.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function b(a){var c=new WebSocket(a);c.onclose=function(){setTimeout(function(){b(a)},2E3)};c.onmessage=function(){location.reload()}}try{if(window.WebSocket)try{b("ws://localhost:12450/reload")}catch(a){console.error(a)}else console.log("Your browser does not support WebSockets.")}catch(a){console.error("Exception during connecting to Reload:",a)};
|
||||
239
merchant/static/js/trade_record.js
Normal file
239
merchant/static/js/trade_record.js
Normal file
@@ -0,0 +1,239 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for 交易记录js
|
||||
** @Time : 19.12.3 15:01
|
||||
** @Author : Joker
|
||||
** @File : trade_record
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 19.12.3 15:01
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
let trade = {
|
||||
get_last_month_date: function () {
|
||||
let date = new Date();
|
||||
let daysInMonth = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
||||
let strYear = date.getFullYear();
|
||||
let strDay = date.getDate();
|
||||
let strMonth = date.getMonth() + 1;
|
||||
let hh = date.getHours();
|
||||
let mm = date.getMinutes();
|
||||
let ss = date.getSeconds();
|
||||
if (((strYear % 4) === 0) && ((strYear % 100) !== 0) || ((strYear % 400) === 0)) {
|
||||
daysInMonth[2] = 29
|
||||
}
|
||||
if (strMonth - 1 === 0) {
|
||||
strYear -= 1;
|
||||
strMonth = 12
|
||||
} else {
|
||||
strMonth -= 1
|
||||
}
|
||||
strDay = Math.min(strDay, daysInMonth[strMonth]);
|
||||
if (strMonth < 10) {
|
||||
strMonth = "0" + strMonth
|
||||
}
|
||||
if (strDay < 10) {
|
||||
strDay = "0" + strDay
|
||||
}
|
||||
if (hh < 10) {
|
||||
hh = "0" + hh
|
||||
}
|
||||
if (mm < 10) {
|
||||
mm = "0" + mm
|
||||
}
|
||||
if (ss < 10) {
|
||||
ss = "0" + ss
|
||||
}
|
||||
return strYear + "-" + strMonth + "-" + strDay + " " + hh + ":" + mm + ":" + ss
|
||||
}, get_time: function (d) {
|
||||
let date = new Date(d);
|
||||
let strYear = date.getFullYear();
|
||||
let strDay = date.getDate();
|
||||
let strMonth = date.getMonth() + 1;
|
||||
let hh = date.getHours();
|
||||
let mm = date.getMinutes();
|
||||
let ss = date.getSeconds();
|
||||
if (strMonth < 10) {
|
||||
strMonth = "0" + strMonth
|
||||
}
|
||||
if (strDay < 10) {
|
||||
strDay = "0" + strDay
|
||||
}
|
||||
if (hh < 10) {
|
||||
hh = "0" + hh
|
||||
}
|
||||
if (mm < 10) {
|
||||
mm = "0" + mm
|
||||
}
|
||||
if (ss < 10) {
|
||||
ss = "0" + ss
|
||||
}
|
||||
return strYear + "-" + strMonth + "-" + strDay + " " + hh + ":" + mm + ":" + ss
|
||||
}, trade_do_paging: function () {
|
||||
let merchantNo = $("#merchant_No").val();
|
||||
let startTime = $("#startTime").val();
|
||||
let endTime = $("#endTime").val();
|
||||
let payType = $("#payType").val();
|
||||
let uStatus = $("#uStatus").val();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/trade/list/",
|
||||
data: {
|
||||
page: '1',
|
||||
limit: "15",
|
||||
MerchantNo: merchantNo,
|
||||
start: startTime,
|
||||
end: endTime,
|
||||
pay_type: payType,
|
||||
status: uStatus,
|
||||
},
|
||||
success: function (data) {
|
||||
trade.show_trade_data(data.root);
|
||||
let options = {
|
||||
bootstrapMajorVersion: 3,
|
||||
currentPage: data.page,
|
||||
totalPages: data.totalPage,
|
||||
numberOfPages: data.limit,
|
||||
itemTexts: function (type, page) {
|
||||
switch (type) {
|
||||
case"first":
|
||||
return "首页";
|
||||
case"prev":
|
||||
return "上一页";
|
||||
case"next":
|
||||
return "下一页";
|
||||
case"last":
|
||||
return "末页";
|
||||
case"page":
|
||||
return page
|
||||
}
|
||||
},
|
||||
onPageClicked: function (event, originalEvent, type, page) {
|
||||
$.ajax({
|
||||
url: "/trade/list/",
|
||||
type: "GET",
|
||||
data: {
|
||||
page: page,
|
||||
MerchantNo: merchantNo,
|
||||
start: startTime,
|
||||
end: endTime,
|
||||
pay_type: payType,
|
||||
status: uStatus,
|
||||
},
|
||||
success: function (data) {
|
||||
trade.show_trade_data(data.root)
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
$('#do_paging').bootstrapPaginator(options)
|
||||
},
|
||||
error: function (XMLHttpRequest) {
|
||||
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
|
||||
}
|
||||
})
|
||||
}, show_trade_data: function (list) {
|
||||
let con = "";
|
||||
$.each(list, function (index, item) {
|
||||
let bg_red = "", st = "", t = "";
|
||||
switch (item.Status) {
|
||||
case"failed":
|
||||
st = "交易失败";
|
||||
break;
|
||||
case"wait":
|
||||
st = "等待支付";
|
||||
break;
|
||||
case"success":
|
||||
bg_red = ` style="color: green"`;
|
||||
st = "交易成功";
|
||||
t = item.UpdateTime;
|
||||
break
|
||||
}
|
||||
con += `<tr><th scope="row">` + (index + 1) + `</th><td>` + item.BankOrderId + `</td><td>` + item.MerchantOrderId + `</td><td>` + item.PayProductName + `</td><td>` + item.OrderAmount.toFixed(2) + `</td><td>` + item.UserInAmount.toFixed(2) + `</td><td>` + item.AllProfit.toFixed(2) + `</td><td` + bg_red + `>` + st + `</td><td>` + t + `</td></tr>`
|
||||
});
|
||||
if (con === "") {
|
||||
con += `<tr><td colspan="9">没有检索到数据</td></tr>`
|
||||
}
|
||||
$("#your_show_time").html(con)
|
||||
}, complaint_do_paging: function () {
|
||||
let merchantNo = $("#merchant_No").val();
|
||||
let startTime = $("#startTime").val();
|
||||
let endTime = $("#endTime").val();
|
||||
let payType = $("#payType").val();
|
||||
let uStatus = $("#uStatus").val();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/trade/complaint/",
|
||||
data: {
|
||||
page: '1',
|
||||
limit: "15",
|
||||
MerchantNo: merchantNo,
|
||||
start: startTime,
|
||||
end: endTime,
|
||||
pay_type: payType,
|
||||
status: uStatus,
|
||||
},
|
||||
success: function (data) {
|
||||
trade.show_complaint_data(data.root);
|
||||
let options = {
|
||||
bootstrapMajorVersion: 3,
|
||||
currentPage: data.page,
|
||||
totalPages: data.totalPage,
|
||||
numberOfPages: data.limit,
|
||||
itemTexts: function (type, page) {
|
||||
switch (type) {
|
||||
case"first":
|
||||
return "首页";
|
||||
case"prev":
|
||||
return "上一页";
|
||||
case"next":
|
||||
return "下一页";
|
||||
case"last":
|
||||
return "末页";
|
||||
case"page":
|
||||
return page
|
||||
}
|
||||
},
|
||||
onPageClicked: function (event, originalEvent, type, page) {
|
||||
$.ajax({
|
||||
url: "/trade/complaint/",
|
||||
type: "GET",
|
||||
data: {
|
||||
page: page,
|
||||
MerchantNo: merchantNo,
|
||||
start: startTime,
|
||||
end: endTime,
|
||||
pay_type: payType,
|
||||
status: uStatus,
|
||||
},
|
||||
success: function (data) {
|
||||
trade.show_complaint_data(data.root)
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
$('#do_paging').bootstrapPaginator(options)
|
||||
},
|
||||
error: function (XMLHttpRequest) {
|
||||
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
|
||||
}
|
||||
})
|
||||
}, show_complaint_data: function (list) {
|
||||
let con = "";
|
||||
$.each(list, function (index, item) {
|
||||
let st = "";
|
||||
switch (item.FreezeOrder) {
|
||||
case"yes":
|
||||
st = "已冻结";
|
||||
break;
|
||||
case"no":
|
||||
st = "已退款";
|
||||
break
|
||||
}
|
||||
con += `<tr><th scope="row">` + (index + 1) + `</th><td>` + item.BankOrderId + `</td><td>` + item.MerchantOrderId + `</td><td>` + item.PayProductName + `</td><td>` + item.OrderAmount.toFixed(2) + `</td><td>` + st + `</td><td>` + item.UpdateTime + `</td></tr>`
|
||||
});
|
||||
if (con === "") {
|
||||
con += `<tr><td colspan="9">没有检索到数据</td></tr>`
|
||||
}
|
||||
$("#your_show_time").html(con)
|
||||
},
|
||||
};
|
||||
253
merchant/static/js/withdraw_account_list.js
Normal file
253
merchant/static/js/withdraw_account_list.js
Normal file
@@ -0,0 +1,253 @@
|
||||
/***************************************************
|
||||
** @Desc : This file for ...
|
||||
** @Time : 19.12.6 13:43
|
||||
** @Author : Joker
|
||||
** @File : withdraw_record
|
||||
** @Last Modified by : Joker
|
||||
** @Last Modified time: 19.12.6 13:43
|
||||
** @Software: GoLand
|
||||
****************************************************/
|
||||
|
||||
let pay = {
|
||||
withdraw_do_paging: function () {
|
||||
let bankNo = $("#bankNo").val();
|
||||
let merchantNo = $("#merchant_No").val();
|
||||
let startTime = $("#startTime").val();
|
||||
let endTime = $("#endTime").val();
|
||||
let uStatus = $("#uStatus").val();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/withdraw/list_record/",
|
||||
data: {
|
||||
page: '1',
|
||||
limit: "15",
|
||||
MerchantNo: merchantNo,
|
||||
BankNo: bankNo,
|
||||
start: startTime,
|
||||
end: endTime,
|
||||
status: uStatus,
|
||||
},
|
||||
success: function (data) {
|
||||
pay.show_withdraw_data(data.root);
|
||||
let options = {
|
||||
bootstrapMajorVersion: 3,
|
||||
currentPage: data.page,
|
||||
totalPages: data.totalPage,
|
||||
numberOfPages: data.limit,
|
||||
itemTexts: function (type, page) {
|
||||
switch (type) {
|
||||
case"first":
|
||||
return "首页";
|
||||
case"prev":
|
||||
return "上一页";
|
||||
case"next":
|
||||
return "下一页";
|
||||
case"last":
|
||||
return "末页";
|
||||
case"page":
|
||||
return page
|
||||
}
|
||||
},
|
||||
onPageClicked: function (event, originalEvent, type, page) {
|
||||
$.ajax({
|
||||
url: "/withdraw/list_record/",
|
||||
type: "GET",
|
||||
data: {
|
||||
page: page,
|
||||
MerchantNo: merchantNo,
|
||||
BankNo: bankNo,
|
||||
start: startTime,
|
||||
end: endTime,
|
||||
status: uStatus,
|
||||
},
|
||||
success: function (data) {
|
||||
pay.show_withdraw_data(data.root)
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
$('#do_paging').bootstrapPaginator(options)
|
||||
},
|
||||
error: function (XMLHttpRequest) {
|
||||
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
|
||||
}
|
||||
})
|
||||
}, show_withdraw_data: function (list) {
|
||||
let con = "";
|
||||
$.each(list, function (index, item) {
|
||||
let bg_red = "", st, t = "";
|
||||
switch (item.Status) {
|
||||
case"payfor_confirm":
|
||||
st = "等待审核";
|
||||
break;
|
||||
case"payfor_solving":
|
||||
st = "系统处理中";
|
||||
break;
|
||||
case"payfor_banking":
|
||||
st = "银行处理中";
|
||||
break;
|
||||
case"failed":
|
||||
st = "代付失败";
|
||||
break;
|
||||
case"success":
|
||||
bg_red = ` style="color: green"`;
|
||||
st = "打款成功";
|
||||
t = trade.get_time(item.UpdateTime);
|
||||
break;
|
||||
default:
|
||||
st = ""
|
||||
}
|
||||
con += `<tr><th scope="row">` + (index + 1) + `</th><td>` + item.BankOrderId + `</td><td>` + item.MerchantOrderId + `</td><td>` + item.PayforTotalAmount.toFixed(2) + `</td><td>` + item.PayforFee.toFixed(2) + `</td><td>` + item.BankName + `</td><td>` + item.BankAccountName + `</td><td>` + item.BankAccountNo + `</td><td` + bg_red + `>` + st + `</td><td>` + item.CreateTime + `</td><td>` + t + `</td><td>` + item.Remark + `</td></tr>`
|
||||
});
|
||||
if (con === "") {
|
||||
con += `<tr><td colspan="9">没有检索到数据</td></tr>`
|
||||
}
|
||||
$("#your_show_time").html(con)
|
||||
}, recharge_do_paging: function () {
|
||||
let startTime = $("#startTime").val();
|
||||
let endTime = $("#endTime").val();
|
||||
let uStatus = $("#uStatus").val();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/recharge/list_recharge_record/",
|
||||
data: {page: '1', limit: "15", start: startTime, end: endTime, status: uStatus,},
|
||||
success: function (data) {
|
||||
pay.show_recharge_data(data.root);
|
||||
let options = {
|
||||
bootstrapMajorVersion: 3,
|
||||
currentPage: data.page,
|
||||
totalPages: data.totalPage,
|
||||
numberOfPages: data.limit,
|
||||
itemTexts: function (type, page) {
|
||||
switch (type) {
|
||||
case"first":
|
||||
return "首页";
|
||||
case"prev":
|
||||
return "上一页";
|
||||
case"next":
|
||||
return "下一页";
|
||||
case"last":
|
||||
return "末页";
|
||||
case"page":
|
||||
return page
|
||||
}
|
||||
},
|
||||
onPageClicked: function (event, originalEvent, type, page) {
|
||||
$.ajax({
|
||||
url: "/recharge/list_recharge_record/",
|
||||
type: "GET",
|
||||
data: {page: page, start: startTime, end: endTime, status: uStatus,},
|
||||
success: function (data) {
|
||||
pay.show_recharge_data(data.root)
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
$('#do_paging').bootstrapPaginator(options)
|
||||
},
|
||||
error: function (XMLHttpRequest) {
|
||||
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
|
||||
}
|
||||
})
|
||||
}, show_recharge_data: function (list) {
|
||||
let con = "";
|
||||
$.each(list, function (index, item) {
|
||||
let st;
|
||||
switch (item.OperateType) {
|
||||
case"plus_amount":
|
||||
st = "加款";
|
||||
break;
|
||||
case"sub_amount":
|
||||
st = "减款";
|
||||
break;
|
||||
case"freeze_amount":
|
||||
st = "冻结";
|
||||
break;
|
||||
case"unfreeze_amount":
|
||||
st = "解冻";
|
||||
break;
|
||||
default:
|
||||
st = ""
|
||||
}
|
||||
con += `<tr><th scope="row">` + (index + 1) + `</th><td>` + item.CreateTime + `</td><td>` + item.Amount.toFixed(2) + `</td><td>` + item.Fee.toFixed(2) + `</td><td>` + item.FreezeAmount.toFixed(2) + `</td><td>` + item.Recharge.toFixed(2) + `</td><td>` + st + `</td></tr>`
|
||||
});
|
||||
if (con === "") {
|
||||
con += `<tr><td colspan="9">没有检索到数据</td></tr>`
|
||||
}
|
||||
$("#your_show_time").html(con)
|
||||
}, history_do_paging: function () {
|
||||
let startTime = $("#startTime").val();
|
||||
let endTime = $("#endTime").val();
|
||||
let uStatus = $("#uStatus").val();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/history/list_history_record/",
|
||||
data: {page: '1', limit: "15", start: startTime, end: endTime, status: uStatus,},
|
||||
success: function (data) {
|
||||
pay.show_history_data(data.root);
|
||||
let options = {
|
||||
bootstrapMajorVersion: 3,
|
||||
currentPage: data.page,
|
||||
totalPages: data.totalPage,
|
||||
numberOfPages: data.limit,
|
||||
itemTexts: function (type, page) {
|
||||
switch (type) {
|
||||
case"first":
|
||||
return "首页";
|
||||
case"prev":
|
||||
return "上一页";
|
||||
case"next":
|
||||
return "下一页";
|
||||
case"last":
|
||||
return "末页";
|
||||
case"page":
|
||||
return page
|
||||
}
|
||||
},
|
||||
onPageClicked: function (event, originalEvent, type, page) {
|
||||
$.ajax({
|
||||
url: "/history/list_history_record/",
|
||||
type: "GET",
|
||||
data: {page: page, start: startTime, end: endTime, status: uStatus,},
|
||||
success: function (data) {
|
||||
pay.show_history_data(data.root)
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
$('#do_paging').bootstrapPaginator(options)
|
||||
},
|
||||
error: function (XMLHttpRequest) {
|
||||
toastr.info('something is wrong, code: ' + XMLHttpRequest.status)
|
||||
}
|
||||
})
|
||||
}, show_history_data: function (list) {
|
||||
let con = "";
|
||||
$.each(list, function (index, item) {
|
||||
let st = "";
|
||||
switch (item.Type) {
|
||||
case"plus_amount":
|
||||
st = "加款";
|
||||
break;
|
||||
case"sub_amount":
|
||||
st = "减款";
|
||||
break;
|
||||
case"freeze_amount":
|
||||
st = "冻结";
|
||||
break;
|
||||
case"unfreeze_amount":
|
||||
st = "解冻";
|
||||
break
|
||||
}
|
||||
con += `<tr><th scope="row">` + (index + 1) + `</th>
|
||||
<td>` + item.CreateTime + `</td>
|
||||
<td>` + item.Amount.toFixed(2) + `</td>
|
||||
<td>` + item.Balance.toFixed(2) + `</td>
|
||||
<td>` + st + `</td></tr>`
|
||||
});
|
||||
if (con === "") {
|
||||
con += `<tr><td colspan="9">没有检索到数据</td></tr>`
|
||||
}
|
||||
$("#your_show_time").html(con)
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user