add 同步支付场景到商户端

master
luoyang 6 years ago
parent 03353f0f3e
commit ebc35d2050

@ -117,6 +117,48 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}
}
};
var resetClientPayDescByTpey = function (type) {
type = parseInt(type);
if (type == 1) {
removeClientPayDesc($scope.partner.client_pay_desc, '10');
}
if (type == 2) {
removeClientPayDesc($scope.partner.client_pay_desc, '20');
}
};
$scope.toggleClientPayType = function (type) {
var $idx = $scope.partner.client_pay_type.indexOf(type);
if ($idx >= 0) {
$scope.partner.client_pay_type.splice($idx, 1);
resetClientPayDescByTpey(type);
} else {
$scope.partner.client_pay_type.push(type);
$scope.partner.client_pay_type.sort(compare);
}
};
var removeClientPayDesc = function (items, key) {
for (var i = 0; i < items.length; i++) {
var item = items[i];
if (item.indexOf(key)>=0) {
items.splice(items.indexOf(item), 1);
i = i - 1;
}
}
};
$scope.toggleClientPayDesc = function (type) {
var $idx = $scope.partner.client_pay_desc.indexOf(type);
if ($idx >= 0) {
if (type == '203') {
removeClientPayDesc($scope.partner.client_pay_desc,'2030')
}
$scope.partner.client_pay_desc.splice($idx, 1);
} else {
$scope.partner.client_pay_desc.push(type);
$scope.partner.client_pay_desc.sort(compare);
}
};
$scope.uploadStorePhoto = function (file) {
if (file != null) {
@ -165,6 +207,34 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}
var content = '';
if ($scope.partner.client_pay_type.length==0) {
alert('请选择商户支付场景')
return;
}
if ($scope.partner.client_pay_desc.length==0) {
alert('请选择商户支付方式')
return;
}
if ($scope.partner.client_pay_type.indexOf('1') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('10') < 0) {
alert("请检查线上支付场景是否已选择支付方式");
return;
}
}
if ( $scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) {
alert("请检查线下支付场景是否已选择支付方式");
return;
}
}
if ($scope.partner.client_pay_desc.join(',').indexOf('203') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('2030') < 0) {
alert("请检查线下支付是否已选择收银系统类型");
return;
}
}
$scope.partner.client_pay_type = $scope.partner.client_pay_type.join(',');
$scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(',');
$http.put('/client/partner_info/update/partnerInfo', $scope.partner).then(function () {
if (content != '') {
commonDialog.alert({
@ -303,6 +373,49 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}
};
var resetClientPayDescByTpey = function (type) {
type = parseInt(type);
if (type == 1) {
removeClientPayDesc($scope.partner.client_pay_desc, '10');
}
if (type == 2) {
removeClientPayDesc($scope.partner.client_pay_desc, '20');
}
};
$scope.toggleClientPayType = function (type) {
var $idx = $scope.partner.client_pay_type.indexOf(type);
if ($idx >= 0) {
$scope.partner.client_pay_type.splice($idx, 1);
resetClientPayDescByTpey(type);
} else {
$scope.partner.client_pay_type.push(type);
$scope.partner.client_pay_type.sort(compare);
}
};
var removeClientPayDesc = function (items, key) {
for (var i = 0; i < items.length; i++) {
var item = items[i];
if (item.indexOf(key)>=0) {
items.splice(items.indexOf(item), 1);
i = i - 1;
}
}
};
$scope.toggleClientPayDesc = function (type) {
var $idx = $scope.partner.client_pay_desc.indexOf(type);
if ($idx >= 0) {
if (type == '203') {
removeClientPayDesc($scope.partner.client_pay_desc,'2030')
}
$scope.partner.client_pay_desc.splice($idx, 1);
} else {
$scope.partner.client_pay_desc.push(type);
$scope.partner.client_pay_desc.sort(compare);
}
};
$scope.updatePartner = function (form) {
if (form.$invalid) {
angular.forEach(form, function (item, key) {
@ -328,6 +441,34 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}
var content = '';
if ($scope.partner.client_pay_type.length==0) {
alert('请选择商户支付场景')
return;
}
if ($scope.partner.client_pay_desc.length==0) {
alert('请选择商户支付方式')
return;
}
if ($scope.partner.client_pay_type.indexOf('1') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('10') < 0) {
alert("请检查线上支付场景是否已选择支付方式");
return;
}
}
if ( $scope.partner.client_pay_type.indexOf('2') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) {
alert("请检查线下支付场景是否已选择支付方式");
return;
}
}
if ($scope.partner.client_pay_desc.join(',').indexOf('203') >= 0) {
if ($scope.partner.client_pay_desc.join(',').indexOf('2030') < 0) {
alert("请检查线下支付是否已选择收银系统类型");
return;
}
}
$scope.partner.client_pay_type = $scope.partner.client_pay_type.join(',');
$scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(',');
$http.put('/client/partner_info/update/partnerInfo', $scope.partner).then(function () {
if (content != '') {
commonDialog.alert({

@ -1,3 +1,13 @@
<style>
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
color: #333;
background-color: #f7bf90;
border-color: #adadad;
}
</style>
<section class="content-header">
<h1 ng-bind="partner.company_name"></h1>
<ol class="breadcrumb">
@ -184,19 +194,115 @@
<label class="control-label col-sm-2">
Merchant Payment Scenario Type</label>
<div class="col-sm-8">
<p class="form-control-static"
ng-bind="partner.client_pay_type">
<button class="btn btn-default"
ng-class="{active:partner.client_pay_type.indexOf('1')>=0}">
<i class="fa fa-mixcloud"></i>
线上</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_type.indexOf('2')>=0}">
<i class="fa fa-shopping-basket"></i>
线下</button>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Merchant Payment Scenario Description</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.client_pay_desc"></p>
<div class="form-group"
ng-if="partner.client_pay_type.indexOf('1')>=0">
<label class="control-label col-sm-2">
Online</label>
<div class="col-sm-8">
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('101')>=0}">
<i class="fa fa-desktop"></i>
PC网站</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('102')>=0}">
<i class="fa fa-mobile-phone"></i>
手机端网站</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('103')>=0}">
<i class="fa fa-mobile-phone"></i>
APP</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('104')>=0}">
<i class="fa fa-wechat"></i>
微信内、支付宝内网站</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('105')>=0}">
<i class="fa fa-wechat"></i>
小程序</button>
</div>
</div>
<div ng-if="partner.client_pay_type.indexOf('2')>=0">
<div class="form-group"
ng-class="{'has-error':partnerForm.client_offline.$invalid && partnerForm.client_offline.$dirty}">
<label class="control-label col-sm-2">Offline</label>
<div class="col-sm-8">
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('201')>=0}">
<i class="fa fa-qrcode"></i>
二维码立牌</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('202')>=0}">
<i class="fa fa-user"></i>
RoyalPay POS</button>
<button class="btn btn-default"
ng-class="{active:(partner.client_pay_desc.join(',').indexOf('203')>=0)}">
<i class="fa fa-laptop"></i>
收银系统</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('204')>=0}">
<i class="fa fa-shopping-cart"></i>
无人售货机</button>
</div>
</div>
</div>
<div ng-if="partner.client_pay_desc.join(',').indexOf('203')>=0">
<div class="form-group"
ng-class="{'has-error':partnerForm.client_offline.$invalid && partnerForm.client_offline.$dirty}">
<label class="control-label col-sm-2">* POS</label>
<div class="col-sm-8">
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20301')>=0}">
<i class="fa fa-laptop"></i>
ipos</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20302')>=0}">
<i class="fa fa-laptop"></i>
pospal</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20304')>=0}">
<i class="fa fa-laptop"></i>
Lotus</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20305')>=0}">
<i class="fa fa-laptop"></i>
AoShangBao</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20306')>=0}">
<i class="fa fa-laptop"></i>
Infinity</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20307')>=0}">
<i class="fa fa-laptop"></i>
EasyCloud</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20303')>=0}">
<i class="fa fa-laptop"></i>
Aus Post</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20308')>=0}">
<i class="fa fa-laptop"></i>
AoMaiKe</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20399')>=0}">
<i class="fa fa-laptop"></i>
其他</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Alipay Information &nbsp; <em class="small"><b>(Optional)</b></em></div>
<div class="panel-body">
@ -526,6 +632,142 @@
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Merchant Payment Scenario</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">*
Merchant Payment Scenario Type</label>
<div class="col-sm-8">
<button class="btn btn-default"
ng-class="{active:partner.client_pay_type.indexOf('1')>=0}"
ng-click="toggleClientPayType('1')">
<i class="fa fa-mixcloud"></i>
线上</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_type.indexOf('2')>=0}"
ng-click="toggleClientPayType('2')">
<i class="fa fa-shopping-basket"></i>
线下</button>
</div>
</div>
<div class="form-group"
ng-if="partner.client_pay_type.indexOf('1')>=0">
<label class="control-label col-sm-2">
*Online Scene Of Merchants</label>
<div class="col-sm-8">
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('101')>=0}"
ng-click="toggleClientPayDesc('101')">
<i class="fa fa-desktop"></i>
PC网站</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('102')>=0}"
ng-click="toggleClientPayDesc('102')">
<i class="fa fa-mobile-phone"></i>
手机端网站</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('103')>=0}"
ng-click="toggleClientPayDesc('103')">
<i class="fa fa-mobile-phone"></i>
APP</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('104')>=0}"
ng-click="toggleClientPayDesc('104')">
<i class="fa fa-wechat"></i>
微信内、支付宝内网站</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('105')>=0}"
ng-click="toggleClientPayDesc('105')">
<i class="fa fa-wechat"></i>
小程序</button>
</div>
</div>
<div ng-if="partner.client_pay_type.indexOf('2')>=0">
<div class="form-group"
ng-class="{'has-error':partnerForm.client_offline.$invalid && partnerForm.client_offline.$dirty}">
<label class="control-label col-sm-2">*Offline Scene Of Merchants</label>
<div class="col-sm-8">
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('201')>=0}"
ng-click="toggleClientPayDesc('201')">
<i class="fa fa-qrcode"></i>
二维码立牌</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('202')>=0}"
ng-click="toggleClientPayDesc('202')">
<i class="fa fa-user"></i>
RoyalPay POS</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.join(',').indexOf('203')>=0}"
ng-click="toggleClientPayDesc('203')">
<i class="fa fa-laptop"></i>
收银系统</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('204')>=0}"
ng-click="toggleClientPayDesc('204')">
<i class="fa fa-shopping-cart"></i>
无人售货机</button>
</div>
</div>
</div>
<div ng-if="partner.client_pay_desc.join(',').indexOf('203')>=0">
<div class="form-group"
ng-class="{'has-error':partnerForm.client_offline.$invalid && partnerForm.client_offline.$dirty}">
<label class="control-label col-sm-2">* POS</label>
<div class="col-sm-8">
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20301')>=0}"
ng-click="toggleClientPayDesc('20301')">
<i class="fa fa-laptop"></i>
ipos</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20302')>=0}"
ng-click="toggleClientPayDesc('20302')">
<i class="fa fa-laptop"></i>
pospal</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20304')>=0}"
ng-click="toggleClientPayDesc('20304')">
<i class="fa fa-laptop"></i>
Lotus</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20305')>=0}"
ng-click="toggleClientPayDesc('20305')">
<i class="fa fa-laptop"></i>
AoShangBao</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20306')>=0}"
ng-click="toggleClientPayDesc('20306')">
<i class="fa fa-laptop"></i>
Infinity</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20307')>=0}"
ng-click="toggleClientPayDesc('20307')">
<i class="fa fa-laptop"></i>
EasyCloud</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20303')>=0}"
ng-click="toggleClientPayDesc('20303')">
<i class="fa fa-laptop"></i>
Aus Post</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20308')>=0}"
ng-click="toggleClientPayDesc('20308')">
<i class="fa fa-laptop"></i>
AoMaiKe</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20399')>=0}"
ng-click="toggleClientPayDesc('20399')">
<i class="fa fa-laptop"></i>
其他</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Store Information &nbsp; <em class="small"><b>(Optional)</b></em></div>
<div class="panel-body">

@ -3,6 +3,13 @@
max-height: 100px;
margin-left: 20px;
}
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
color: #333;
background-color: #f7bf90;
border-color: #adadad;
}
</style>
<section class="content-header">
<h1 ng-bind="partner.short_name"></h1>
@ -185,6 +192,143 @@
</div>
</div>
<!--end 商户基本资料-->
<div class="panel panel-default">
<div class="panel-heading">Merchant Payment Scenario</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">*
Merchant Payment Scenario Type</label>
<div class="col-sm-8">
<button class="btn btn-default"
ng-class="{active:partner.client_pay_type.indexOf('1')>=0}"
ng-click="toggleClientPayType('1')">
<i class="fa fa-mixcloud"></i>
线上</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_type.indexOf('2')>=0}"
ng-click="toggleClientPayType('2')">
<i class="fa fa-shopping-basket"></i>
线下</button>
</div>
</div>
<div class="form-group"
ng-if="partner.client_pay_type.indexOf('1')>=0">
<label class="control-label col-sm-2">
*Online Scene Of Merchants</label>
<div class="col-sm-8">
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('101')>=0}"
ng-click="toggleClientPayDesc('101')">
<i class="fa fa-desktop"></i>
PC网站</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('102')>=0}"
ng-click="toggleClientPayDesc('102')">
<i class="fa fa-mobile-phone"></i>
手机端网站</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('103')>=0}"
ng-click="toggleClientPayDesc('103')">
<i class="fa fa-mobile-phone"></i>
APP</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('104')>=0}"
ng-click="toggleClientPayDesc('104')">
<i class="fa fa-wechat"></i>
微信内、支付宝内网站</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('105')>=0}"
ng-click="toggleClientPayDesc('105')">
<i class="fa fa-wechat"></i>
小程序</button>
</div>
</div>
<div ng-if="partner.client_pay_type.indexOf('2')>=0">
<div class="form-group"
ng-class="{'has-error':partnerForm.client_offline.$invalid && partnerForm.client_offline.$dirty}">
<label class="control-label col-sm-2">*Offline Scene Of Merchants</label>
<div class="col-sm-8">
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('201')>=0}"
ng-click="toggleClientPayDesc('201')">
<i class="fa fa-qrcode"></i>
二维码立牌</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('202')>=0}"
ng-click="toggleClientPayDesc('202')">
<i class="fa fa-user"></i>
RoyalPay POS</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.join(',').indexOf('203')>=0}"
ng-click="toggleClientPayDesc('203')">
<i class="fa fa-laptop"></i>
收银系统</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('204')>=0}"
ng-click="toggleClientPayDesc('204')">
<i class="fa fa-shopping-cart"></i>
无人售货机</button>
</div>
</div>
</div>
<div ng-if="partner.client_pay_desc.join(',').indexOf('203')>=0">
<div class="form-group"
ng-class="{'has-error':partnerForm.client_offline.$invalid && partnerForm.client_offline.$dirty}">
<label class="control-label col-sm-2">* POS</label>
<div class="col-sm-8">
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20301')>=0}"
ng-click="toggleClientPayDesc('20301')">
<i class="fa fa-laptop"></i>
ipos</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20302')>=0}"
ng-click="toggleClientPayDesc('20302')">
<i class="fa fa-laptop"></i>
pospal</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20304')>=0}"
ng-click="toggleClientPayDesc('20304')">
<i class="fa fa-laptop"></i>
Lotus</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20305')>=0}"
ng-click="toggleClientPayDesc('20305')">
<i class="fa fa-laptop"></i>
AoShangBao</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20306')>=0}"
ng-click="toggleClientPayDesc('20306')">
<i class="fa fa-laptop"></i>
Infinity</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20307')>=0}"
ng-click="toggleClientPayDesc('20307')">
<i class="fa fa-laptop"></i>
EasyCloud</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20303')>=0}"
ng-click="toggleClientPayDesc('20303')">
<i class="fa fa-laptop"></i>
Aus Post</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20308')>=0}"
ng-click="toggleClientPayDesc('20308')">
<i class="fa fa-laptop"></i>
AoMaiKe</button>
<button class="btn btn-default"
ng-class="{active:partner.client_pay_desc.indexOf('20399')>=0}"
ng-click="toggleClientPayDesc('20399')">
<i class="fa fa-laptop"></i>
其他</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Alipay Information &nbsp; <em class="small"><b>(Optional)</b></em></div>
<div class="panel-body">

Loading…
Cancel
Save