commit
833a10e101
@ -0,0 +1,5 @@
|
||||
app.lakala_pay.host=https://intl.lakala.com:7777
|
||||
app.lakala_pay.publicKey=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPg0O4rPQJL1O+jqJ4rBjFVNRAuDmBSoii9pYfPQBaescCVY0irkWWoLyfTT65TjvnPpOx+IfNzBTlB13qCEFm7algREoeUHjFgFNHiXJ2LK/R0+VWgXe5+EDFfbrFCPnmLKG3OcKDGQszP0VOf6VVTM1t56CpgaRMm1/+Tzd2TQIDAQAB
|
||||
app.lakala_pay.merchants.COPAUS000003.accountId=COPAUS000003
|
||||
app.lakala_pay.merchants.COPAUS000003.currency=AUD
|
||||
app.lakala_pay.merchants.COPAUS000003.privateKey=MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAIDjX164cAJrlsikv2aCtGendMxOi97lCU/7sLp5qpMGIIYjpN71LpYR2SBm2vzQNGP0UE6kFtOUfsPLf8CZxPHXVd2Qnz3YC+2uUGkWmafEWVkw1LnDenI9SD5vvGZYeEH5H7Ct6yYv5/JTSevRgCVllWqcPXDs8spQmbcr8/oVAgMBAAECgYAF9v/d6Vk9s276AC3fd6MTvPs5zVTJzv28VuCZ8LGFNl5g9ttVejFavp620ivGUXhrO85PpWZtCk1HkG5sInGr0pVnBb8dtsfyEzTHnguv7mNSQ6tYEsINcyYbhOnPMsECaNrdwCC7q0i82MQGTHss50F0mjxRCVz4ndiBseRXYQJBANJ9lTuyuKUmUdxsQNLy+ajFSWvVcC0IRLBT2E1EqgPBRJuTc2wlULJVAKz/+eSEjDsmJ0yD9fnISjdY1csyS20CQQCcwTBZIejjwP011sB2A91z2DSnveU4vvgFWnj0hhM4a/ChuUKoylMVYlDQ1vrqErFag96keU9BUwQ1LlmfC1hJAkANDKoW1GKsIm8Kyk9OhK/Drc96dvYIZK3VfK05RRuBNhcpyf9q4flZxPlQwGHer/T9qcTf8oJqZOds/P3sJgcVAkB/C6Sf2Pfj/3o5tH/wJlnJliW2/hVV1JE35Ye6xx+0zucMbBY2ryR/ZFuTp2ldZSEQ92fvbdJqY1o5sAM6//rhAkAMhwWEtGZ8tboADbWBnxD/maMGYlI/oGsQHWTT9/Jt2LmlR+dgpl1DVwizPbVJ0hVJZWkF/BC5bdZ9XEIZsv/K
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.8 KiB |
File diff suppressed because one or more lines are too long
@ -0,0 +1,65 @@
|
||||
<div class="content">
|
||||
<form novalidate name="subForm">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Add Yeepay Sub Merchant Id</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.business_content.$invalid && subForm.business_content.$dirty}">
|
||||
<label class="control-label col-sm-3" for="business_content">* Business Content</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="business_content"
|
||||
ng-model="business_content"
|
||||
id="business_content" required
|
||||
ng-options="business_content.value as business_content.label for business_content in yeepay_business_contents">
|
||||
<option value="">Please Choose</option>
|
||||
</select>
|
||||
<div ng-messages="subForm.business_content.$error" ng-if="subForm.business_content.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.industry.$invalid && subForm.industry.$dirty}">
|
||||
<label class="control-label col-sm-3" for="industry">* Business Category</label>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="industry"
|
||||
ng-model="industry"
|
||||
id="industry" required
|
||||
ng-options="industry.value as industry.label for industry in yeepay_industries">
|
||||
<option value="">Please Choose</option>
|
||||
</select>
|
||||
<div ng-messages="subForm.industry.$error" ng-if="subForm.industry.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group"
|
||||
ng-class="{'has-error':subForm.sub_merchant_id.$invalid && subForm.sub_merchant_id.$dirty}">
|
||||
<label class="control-label col-sm-3" for="sub_merchant_id_input">* Yeepay Sub Merchant ID</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" ng-model="sub_merchant_id"
|
||||
type="text" name="sub_merchant_id" id="sub_merchant_id_input" required maxlength="50">
|
||||
<div ng-messages="subForm.sub_merchant_id.$error" ng-if="subForm.sub_merchant_id.$dirty">
|
||||
<p class="small text-danger" ng-message="required">Required Field</p>
|
||||
<p class="small text-danger" ng-message="maxlength">More Than 50</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-group margin-bottom margin-top">
|
||||
<button class="btn btn-success" type="button"
|
||||
ng-click="saveYeepayAdd(subForm)">Submit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
@ -0,0 +1,197 @@
|
||||
.gateway-background {
|
||||
width:100%;
|
||||
height:100%;
|
||||
/*position: fixed;*/
|
||||
background: url("../img/gateway_bg.png");
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
overflow-y: auto;
|
||||
background-size:100% 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.head-bar{
|
||||
display: inline;
|
||||
text-align: center;
|
||||
}
|
||||
.head-bar img{
|
||||
width: 396px;
|
||||
height: 116px;
|
||||
top: 60px;
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.order-box{
|
||||
height: 550px;
|
||||
width: 800px;
|
||||
margin: 2% auto;
|
||||
/*box-shadow: 0px 0px 25px 0px rgba(0,0,0,0.21);*/
|
||||
}
|
||||
|
||||
.order-box:after{
|
||||
content:'';
|
||||
display:block;
|
||||
clear:both;
|
||||
}
|
||||
.order-box .left{
|
||||
display: inline;
|
||||
opacity: 0.84;
|
||||
background: #f06010;
|
||||
width:40%;
|
||||
float: left;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
/*.order-box .left .m-logo{*/
|
||||
/*background: #FFFFFF;*/
|
||||
/*border-radius: 100px;*/
|
||||
/*width: 120px;*/
|
||||
/*height: 120px;*/
|
||||
/*margin-top: 15%;*/
|
||||
/*display: inline-block;*/
|
||||
/*}*/
|
||||
.m-logo{
|
||||
line-height: 100px;
|
||||
}
|
||||
.m-logo img{
|
||||
width: 100px;
|
||||
padding: 10px;
|
||||
}
|
||||
.short-name{
|
||||
margin-top: 40px;
|
||||
font-family: MicrosoftYaHei;
|
||||
font-size: 18px;
|
||||
}
|
||||
.intro{
|
||||
margin: 100px 0 50px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.order-box .right{
|
||||
display: inline;
|
||||
background: #FFFFFF;
|
||||
width:60%;
|
||||
float: right;
|
||||
height: 80%;
|
||||
padding: 20px 40px;
|
||||
}
|
||||
.order-box .brand{
|
||||
display: inline;
|
||||
background: #f06010 ;
|
||||
width:60%;
|
||||
float: right;
|
||||
height: 20%;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.order-box .brand img{
|
||||
width: 246px;
|
||||
height: 51px;
|
||||
margin-top: 7%
|
||||
}
|
||||
|
||||
.order-box .right .title {
|
||||
font-family: PingFang-SC-Medium;
|
||||
font-size: 20px;
|
||||
color: #434343;
|
||||
letter-spacing: 0px;
|
||||
padding-bottom: 10px;
|
||||
padding-top: 20px;
|
||||
}
|
||||
.order-box .right input {
|
||||
background-color: #EEEEEE;
|
||||
border: none;
|
||||
outline: none;
|
||||
height: 45px;
|
||||
}
|
||||
.order-box .right .form_margin {
|
||||
|
||||
}
|
||||
.order-box .right .form_input {
|
||||
height: 45px;
|
||||
}
|
||||
.footer-bottom{
|
||||
font-family: PingFangSC-Regular;
|
||||
color: #FFFFFF;
|
||||
letter-spacing: 0px;
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.footer-bottom-success{
|
||||
margin-top: 60px;
|
||||
color: #444444;
|
||||
}
|
||||
|
||||
.warning{
|
||||
font-size: x-small;
|
||||
color: #f06010;
|
||||
}
|
||||
.submit{
|
||||
color: #fff;
|
||||
background-color: #f06010;
|
||||
border-color: #f06010;
|
||||
}
|
||||
/*成功页*/
|
||||
.order-box .success-logo{
|
||||
text-align: center;
|
||||
height: 150px;
|
||||
background: #F0F3FA;
|
||||
line-height: 150px;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 22px;
|
||||
color: #444444;
|
||||
letter-spacing: 0px;
|
||||
|
||||
}
|
||||
|
||||
.order-info{
|
||||
padding: 50px 100px;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-size: 17px;
|
||||
color: #444444;
|
||||
letter-spacing: 0px;
|
||||
}
|
||||
|
||||
@media(max-width:800px){
|
||||
.order-box{
|
||||
width:100%;
|
||||
}
|
||||
.order-info{
|
||||
padding:50px 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.gateway-background .modal {
|
||||
background-color: rgba(0,0,0,.8);
|
||||
}
|
||||
|
||||
.gateway-background .modal-dialog {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
}
|
||||
.surcharge{
|
||||
font-size: 0.8em;
|
||||
color: #909090;
|
||||
}
|
||||
.exchange{
|
||||
font-size: 0.8em;
|
||||
color: #909090;
|
||||
}
|
||||
.div-inline {
|
||||
display: inline;
|
||||
width: 50%;
|
||||
}
|
||||
.div-inline-select {
|
||||
text-align: center;
|
||||
text-align-last: center;
|
||||
}
|
@ -0,0 +1,267 @@
|
||||
body {
|
||||
color: #333333;
|
||||
font-family: PingFang-SC-Regular;
|
||||
font-size: 14px;
|
||||
letter-spacing: 0px;
|
||||
}
|
||||
|
||||
ul, li {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
input::-webkit-input-placeholder {
|
||||
color: #C0C0C0;
|
||||
}
|
||||
|
||||
input::-moz-placeholder { /* Mozilla Firefox 19+ */
|
||||
color: #C0C0C0;
|
||||
}
|
||||
|
||||
input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
|
||||
color: #C0C0C0;
|
||||
}
|
||||
|
||||
input:-ms-input-placeholder { /* Internet Explorer 10-11 */
|
||||
color: #C0C0C0;
|
||||
}
|
||||
|
||||
.my-input {
|
||||
border-top: 0;
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid #EBEBEB;
|
||||
border-left: 0;
|
||||
padding: 10px 0;
|
||||
width: 100%;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
width: 100px;
|
||||
background: #fff;
|
||||
padding: 10px 0px;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #EBEBEB;
|
||||
margin-right: -4px;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.change-color {
|
||||
color: #f06010;
|
||||
border-bottom: 1px solid #f06010;
|
||||
}
|
||||
|
||||
.s1 {
|
||||
position: absolute;
|
||||
bottom: -1px;
|
||||
left: 45px;
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
border-top: 5px solid transparent;
|
||||
border-left: 5px solid transparent;
|
||||
border-right: 5px solid transparent;
|
||||
border-bottom: 5px solid #EBEBEB;
|
||||
}
|
||||
|
||||
.s1-change-color {
|
||||
border-bottom: 5px solid #f06010;
|
||||
}
|
||||
|
||||
.s2 {
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
left: 45px;
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
border-top: 5px solid transparent;
|
||||
border-left: 5px solid transparent;
|
||||
border-right: 5px solid transparent;
|
||||
border-bottom: 5px solid #fff;
|
||||
}
|
||||
|
||||
.main {
|
||||
width: 700px;
|
||||
padding: 40px 0 0 70px;
|
||||
background-color: #FFFFFF;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.main-logo {
|
||||
width: 770px;
|
||||
height: 47px;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.main-left {
|
||||
width: 300px;
|
||||
display: inline-block;
|
||||
margin-right: 50px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.input-item {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.commit-button {
|
||||
background-color: #f06010;
|
||||
color: #FFFFFF;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 10px 0;
|
||||
font-size: 17px;
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
margin: 20px 0;
|
||||
box-shadow: 0 2px 11px 0;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.main-middle {
|
||||
width: 2px;
|
||||
height: 400px;
|
||||
border: 1px dashed #EBEBEB;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
vertical-align: top;
|
||||
margin: 10px 40px 0 0;
|
||||
}
|
||||
|
||||
.main-right {
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
padding-top: 72px;
|
||||
}
|
||||
|
||||
.main-right-top {
|
||||
background: #FFFFFF;
|
||||
border: 1px solid #EBEBEB;
|
||||
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.30);
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 120px;
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
line-height: 120px;
|
||||
}
|
||||
|
||||
.main-right-top img {
|
||||
width: 35px;
|
||||
height: 40px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.royalpay {
|
||||
font-size: 16px;
|
||||
letter-spacing: 0px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.description {
|
||||
margin-top: 162px;
|
||||
letter-spacing: 0px;
|
||||
}
|
||||
|
||||
.my-modal {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: black;
|
||||
opacity: 0.80;
|
||||
z-index: 111;
|
||||
}
|
||||
|
||||
.qrcode {
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.all {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.all img {
|
||||
width: 100%;
|
||||
height: 354px;
|
||||
}
|
||||
|
||||
.all .all-logo {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
margin: auto;
|
||||
top: 47px;
|
||||
width: 82px;
|
||||
height: 82px;
|
||||
text-align: center;
|
||||
line-height: 75px;
|
||||
border-radius: 82px;
|
||||
background: #FFFFFF;
|
||||
border: 1px solid #EBEBEB;
|
||||
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.30);
|
||||
}
|
||||
|
||||
.all .all-logo img {
|
||||
width: 35px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.all .all-royalpay {
|
||||
position: absolute;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
top: 136px;
|
||||
color: #FFFFFF;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.all .all-royalpay-pic {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 195px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.all .all-royalpay-pic img {
|
||||
width: 100px;
|
||||
height: 37px;
|
||||
}
|
||||
|
||||
.all .all-form {
|
||||
position: absolute;
|
||||
width: 90%;
|
||||
top: 249px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
background: #FFFFFF;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.all .form-input {
|
||||
box-shadow: 0px 2px 11px 0px rgba(0, 0, 0, 0.20);
|
||||
padding: 30px 24px 20px 24px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.weui-cells-design {
|
||||
background-color: #FFFFFF;
|
||||
border-bottom: 1px solid #EBEBEB;
|
||||
line-height: 1.47058824;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 881 KiB |
After Width: | Height: | Size: 4.9 KiB |
@ -0,0 +1,115 @@
|
||||
var num = function(obj){
|
||||
obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
|
||||
obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
|
||||
obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
|
||||
obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
|
||||
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
|
||||
|
||||
var surchargeData = calculateSurcharge(obj.value-0);
|
||||
var surchargeAmount = Decimal.add(surchargeData.surcharge,surchargeData.tax);
|
||||
$('#surchargeAmount').html(surchargeAmount+'');
|
||||
$('#totalAmount').html(surchargeData.newPrice+'');
|
||||
if(surchargeAmount+0===0 || !window.c4surcharge){
|
||||
$('.surcharge').hide();
|
||||
}else {
|
||||
$('.surcharge').show();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
$('.surcharge').hide();
|
||||
var payUrl = window.location.href;
|
||||
$.cookie("payURL",payUrl,{ expires: 1,path:'/' });
|
||||
|
||||
var customer_id = ""||$.cookie("CustomerID");
|
||||
if (customer_id==null||customer_id === ""){
|
||||
getQrcode();
|
||||
}
|
||||
function getQrcode(){
|
||||
$.ajax({
|
||||
url: '/global/userstatus/customer_wechat_qrcode',
|
||||
method: 'get',
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
$('#qrmodal').find('img#qrimg').attr('src', data.code_img);
|
||||
$('#qrmodal').show();
|
||||
setTimeout(function () {
|
||||
checkQRStatus(data.code_id)
|
||||
}, 2000);
|
||||
},
|
||||
error: function (jqXHR) {
|
||||
alert(jqXHR.responseJSON.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
function checkQRStatus(codeId) {
|
||||
$.ajax({
|
||||
url: '/global/userstatus/customer_wechat_qrcode/' + codeId + '/check',
|
||||
method: 'get',
|
||||
success: function (data) {
|
||||
$('#qrmodal').hide();
|
||||
customer_id = $.cookie("CustomerID");
|
||||
},
|
||||
error: function () {
|
||||
setTimeout(function () {
|
||||
checkQRStatus(codeId)
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
}
|
||||
$('input').keypress(function (evt) {
|
||||
if (evt.keyCode === 13) {
|
||||
$('#login-btn').click();
|
||||
}
|
||||
});
|
||||
$('#commit-btn').click(function () {
|
||||
|
||||
var price = $('#price').val();
|
||||
if (price == null || price.length === 0) {
|
||||
alert('请填写订单金额');
|
||||
return;
|
||||
}
|
||||
var product = $('#product').val();
|
||||
if (product == null || product.length === 0) {
|
||||
alert('请填写真实的商品名称');
|
||||
return;
|
||||
}
|
||||
var select_currency = $('#select_currency').val();
|
||||
var remark = $('#remark').val();
|
||||
var buyForexKind = $('#buyForexKind').val();
|
||||
var jsonData = {user_id: customer_id, price: price, product_name: product,gateway_type: 9,description: remark,buy_forex_kind: buyForexKind,currency: select_currency};
|
||||
var commit = confirm("是否确认提交支付");
|
||||
if (commit) {
|
||||
$('#commit-btn').addClass('hidden');
|
||||
$('#commit-btn-loading').removeClass('hidden');
|
||||
$.ajax({
|
||||
url: '/api/v1.0/lakala_pay/partners/'+window.client_moniker+'/submit',
|
||||
method: 'put',
|
||||
data: JSON.stringify(jsonData),
|
||||
contentType: 'application/json',
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if('SUCCESS' !== res.return_code){
|
||||
alert(res.message);
|
||||
$('#commit-btn').removeClass('hidden');
|
||||
$('#commit-btn-loading').addClass('hidden');
|
||||
}else {
|
||||
const $form = $(res.formString);
|
||||
$('body').append($form);
|
||||
$form.submit();
|
||||
$('body').removeChildren($form);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR) {
|
||||
alert(JSON.parse(jqXHR.responseText).message);
|
||||
$('#commit-btn').removeClass('hidden');
|
||||
$('#commit-btn-loading').addClass('hidden');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
$('#commit-btn').removeClass('hidden');
|
||||
$('#commit-btn-loading').addClass('hidden');
|
||||
}
|
||||
});
|
||||
})
|
@ -0,0 +1,80 @@
|
||||
var num = function (obj) {
|
||||
obj.value = obj.value.replace(/[^\d.]/g, "");
|
||||
obj.value = obj.value.replace(/^\./g, "");
|
||||
obj.value = obj.value.replace(/\.{2,}/g, ".");
|
||||
obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
|
||||
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
|
||||
if(obj.value.indexOf(".")< 0 && obj.value !==""){
|
||||
obj.value= parseFloat(obj.value);
|
||||
}
|
||||
|
||||
var surchargeData = calculateSurcharge(obj.value - 0);
|
||||
var surchargeAmount = Decimal.add(surchargeData.surcharge, surchargeData.tax);
|
||||
$('#surchargeAmount').html(surchargeAmount + '');
|
||||
$('#totalAmount').html(surchargeData.newPrice + '');
|
||||
if (surchargeAmount - 0 === 0 || !window.c4surcharge) {
|
||||
$('.surcharge').hide();
|
||||
} else {
|
||||
$('.surcharge').show();
|
||||
}
|
||||
|
||||
};
|
||||
function onChange(str,num) {
|
||||
return str.length === num;
|
||||
|
||||
}
|
||||
$(document).ready(function () {
|
||||
$('.surcharge').hide();
|
||||
$('#commit-btn').click(function () {
|
||||
var currency = $('#select_currency option:selected').val();
|
||||
var buy_forex_kind = $('#buy_forex_kind option:selected').val();
|
||||
var price = $('#price').val();
|
||||
var remark = $('#product_name option:selected').val() + '-' + $('#remark').val();
|
||||
if (price == null || onChange(price, 0)) {
|
||||
alert('请填写订单金额');
|
||||
return;
|
||||
}
|
||||
if (price - 0 === 0) {
|
||||
alert('金额不能为0');
|
||||
return;
|
||||
}
|
||||
|
||||
$('#commit-btn').addClass('hidden');
|
||||
$('#commit-btn-loading').removeClass('hidden');
|
||||
|
||||
var jsonData = {
|
||||
customer_id: window.customer_id,
|
||||
price: price,
|
||||
currency: currency,
|
||||
buy_forex_kind: buy_forex_kind,
|
||||
gateway_type: 8,
|
||||
description:remark
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: '/api/v1.0/lakala_pay/partners/' + window.client_moniker + '/submit',
|
||||
method: 'put',
|
||||
data: JSON.stringify(jsonData),
|
||||
contentType: 'application/json',
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if(res.return_code !== 'SUCCESS'){
|
||||
alert(res.message);
|
||||
$('#commit-btn').removeClass('hidden');
|
||||
$('#commit-btn-loading').addClass('hidden');
|
||||
}else {
|
||||
const $form = $(res.formString);
|
||||
$('body').append($form);
|
||||
$form.submit();
|
||||
$('body').removeChildren($form);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR) {
|
||||
alert(JSON.parse(jqXHR.responseText).message);
|
||||
$('#commit-btn').removeClass('hidden');
|
||||
$('#commit-btn-loading').addClass('hidden');
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
});
|
@ -0,0 +1,111 @@
|
||||
var num = function(obj){
|
||||
obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
|
||||
obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
|
||||
obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
|
||||
obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
|
||||
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
|
||||
|
||||
var surchargeData = calculateSurcharge(obj.value-0);
|
||||
var surchargeAmount = Decimal.add(surchargeData.surcharge,surchargeData.tax);
|
||||
$('#surchargeAmount').html(surchargeAmount+'');
|
||||
$('#totalAmount').html(surchargeData.newPrice+'');
|
||||
if(surchargeAmount+0==0 || !window.c4surcharge){
|
||||
$('.surcharge').hide();
|
||||
}else {
|
||||
$('.surcharge').show();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
$('.surcharge').hide();
|
||||
var payUrl = window.location.href;
|
||||
$.cookie("payURL",payUrl,{ expires: 1,path:'/' });
|
||||
|
||||
var customer_id = ""||$.cookie("CustomerID");
|
||||
if (customer_id==null||customer_id == ""){
|
||||
getQrcode();
|
||||
}
|
||||
function getQrcode(){
|
||||
$.ajax({
|
||||
url: '/global/userstatus/customer_wechat_qrcode',
|
||||
method: 'get',
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
$('#qrmodal').find('img#qrimg').attr('src', data.code_img);
|
||||
$('#qrmodal').show();
|
||||
setTimeout(function () {
|
||||
checkQRStatus(data.code_id)
|
||||
}, 2000);
|
||||
},
|
||||
error: function (jqXHR) {
|
||||
alert(jqXHR.responseJSON.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
function checkQRStatus(codeId) {
|
||||
$.ajax({
|
||||
url: '/global/userstatus/customer_wechat_qrcode/' + codeId + '/check',
|
||||
method: 'get',
|
||||
success: function (data) {
|
||||
$('#qrmodal').hide();
|
||||
customer_id = $.cookie("CustomerID");
|
||||
},
|
||||
error: function () {
|
||||
setTimeout(function () {
|
||||
checkQRStatus(codeId)
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
}
|
||||
$('input').keypress(function (evt) {
|
||||
if (evt.keyCode == 13) {
|
||||
$('#login-btn').click();
|
||||
}
|
||||
});
|
||||
$('#commit-btn').click(function () {
|
||||
|
||||
var price = $('#price').val();
|
||||
if (price == null || price.length == 0) {
|
||||
alert('请填写订单金额');
|
||||
return;
|
||||
}
|
||||
var product = $('#product').val();
|
||||
if (product == null || product.length == 0) {
|
||||
alert('请填写真实的商品名称');
|
||||
return;
|
||||
}
|
||||
var select_currency = $('#select_currency').val();
|
||||
var remark = $('#remark').val();
|
||||
var jsonData = {user_id:customer_id,price:price,product_name:product,description:remark,currency: select_currency};
|
||||
var commit = confirm("是否确认提交支付");
|
||||
if (commit){
|
||||
$('#commit-btn').addClass('hidden');
|
||||
$('#commit-btn-loading').removeClass('hidden');
|
||||
$.ajax({
|
||||
url: '/api/v1.0/yeepay/partners/'+window.client_moniker+'/share',
|
||||
method: 'put',
|
||||
data: JSON.stringify(jsonData),
|
||||
contentType: 'application/json',
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if(res.return_code != 'SUCCESS'){
|
||||
alert(res.message);
|
||||
$('#commit-btn').removeClass('hidden');
|
||||
$('#commit-btn-loading').addClass('hidden');
|
||||
}else {
|
||||
location.href = res.pay_url+'?'+res.sign_url;
|
||||
}
|
||||
},
|
||||
error: function (jqXHR) {
|
||||
alert(JSON.parse(jqXHR.responseText).message);
|
||||
$('#commit-btn').removeClass('hidden');
|
||||
$('#commit-btn-loading').addClass('hidden');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
$('#commit-btn').removeClass('hidden');
|
||||
$('#commit-btn-loading').addClass('hidden');
|
||||
}
|
||||
});
|
||||
})
|
@ -0,0 +1,78 @@
|
||||
var num = function (obj) {
|
||||
obj.value = obj.value.replace(/[^\d.]/g, "");
|
||||
obj.value = obj.value.replace(/^\./g, "");
|
||||
obj.value = obj.value.replace(/\.{2,}/g, ".");
|
||||
obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
|
||||
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
|
||||
if(obj.value.indexOf(".")< 0 && obj.value !=""){
|
||||
obj.value= parseFloat(obj.value);
|
||||
}
|
||||
|
||||
var surchargeData = calculateSurcharge(obj.value - 0);
|
||||
var surchargeAmount = Decimal.add(surchargeData.surcharge, surchargeData.tax);
|
||||
$('#surchargeAmount').html(surchargeAmount + '');
|
||||
$('#totalAmount').html(surchargeData.newPrice + '');
|
||||
if (surchargeAmount - 0 == 0 || !window.c4surcharge) {
|
||||
$('.surcharge').hide();
|
||||
} else {
|
||||
$('.surcharge').show();
|
||||
}
|
||||
|
||||
};
|
||||
function onChange(str,num) {
|
||||
if (str.length == num) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
$(document).ready(function () {
|
||||
$('.surcharge').hide();
|
||||
$('#commit-btn').click(function () {
|
||||
var product = $('#product').val();
|
||||
var price = $('#price').val();
|
||||
var remark = $('#remark').val();
|
||||
var currency = $('#select_currency option:selected').val();
|
||||
if (price == null || onChange(price,0)) {
|
||||
alert('请填写订单金额');
|
||||
return;
|
||||
}
|
||||
if (price-0 ==0) {
|
||||
alert('金额不能为0');
|
||||
return;
|
||||
}
|
||||
|
||||
$('#commit-btn').addClass('hidden');
|
||||
$('#commit-btn-loading').removeClass('hidden');
|
||||
|
||||
var jsonData = {
|
||||
user_id: window.customer_id,
|
||||
price: price,
|
||||
currency: currency,
|
||||
product_name:product,
|
||||
description:remark
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: '/api/v1.0/yeepay/partners/' + window.client_moniker + '/share',
|
||||
method: 'put',
|
||||
data: JSON.stringify(jsonData),
|
||||
contentType: 'application/json',
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if(res.return_code != 'SUCCESS'){
|
||||
alert(res.message);
|
||||
$('#commit-btn').removeClass('hidden');
|
||||
$('#commit-btn-loading').addClass('hidden');
|
||||
}else {
|
||||
location.href = res.pay_url+'?'+res.sign_url;
|
||||
}
|
||||
},
|
||||
error: function (jqXHR) {
|
||||
alert(JSON.parse(jqXHR.responseText).message);
|
||||
$('#commit-btn').removeClass('hidden');
|
||||
$('#commit-btn-loading').addClass('hidden');
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
});
|
Loading…
Reference in new issue