From 7c8c0c56c922d9e75210a88af79612c0427735dd Mon Sep 17 00:00:00 2001 From: yuan <1551130722@qq.com> Date: Fri, 25 May 2018 11:20:56 +0800 Subject: [PATCH] fix~ --- src/db/modify.sql | 3 +- .../merchant_application.js | 115 ++++-------------- 2 files changed, 28 insertions(+), 90 deletions(-) diff --git a/src/db/modify.sql b/src/db/modify.sql index b98a58b8e..7b217acd5 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -510,8 +510,7 @@ CREATE TABLE `sys_mail_send` ( alter table sys_clients add column mail_confirm tinyint(1) default '0' COMMENT '0: 未验证,1已验证'; CREATE TABLE `sys_client_pre_apply` ( - `client_pre_apply_id` int(11) NOT NULL, - `username` varchar(50) DEFAULT NULL, + `client_pre_apply_id` int(11) NOT NULL AUTO_INCREMENT, `password` varchar(20) DEFAULT '', `contact_person` varchar(50) DEFAULT NULL, `contact_phone` varchar(20) DEFAULT '', diff --git a/src/main/ui/static/merchantapplication/merchant_application.js b/src/main/ui/static/merchantapplication/merchant_application.js index 9326ecf79..a5e5abcdd 100644 --- a/src/main/ui/static/merchantapplication/merchant_application.js +++ b/src/main/ui/static/merchantapplication/merchant_application.js @@ -40,62 +40,7 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', "value": "WA" } ]; - var industryMap = [ - { - "label": "综合商城 Integrated Store", - "value": 336 - }, - { - "label": "食品 Food", - "value": 335 - }, - { - "label": "化妆品 Cosmetics", - "value": 334 - }, - { - "label": "鞋包服饰 Clothes", - "value": 327 - }, - { - "label": "酒店行业 Hospitality industry", - "value": 328 - }, - { - "label": "数码电器 Electric appliances", - "value": 332 - }, - { - "label": "母婴 Baby and maternal products", - "value": 333 - }, - { - "label": "文具/办公用品 Office supplies", - "value": 337 - }, - { - "label": "机票行业 Airline tickets industry", - "value": 339 - }, - { - "label": "国际物流 International logistics", - "value": 330 - }, - { - "label": "教育行业 Education section", - "value": 329 - }, - { - "label": "其它服务行业 Other services industry", - "value": 331 - }, - { - "label": "其它货物贸易行业 Other goods trade industry", - "value": 338 - } - ]; $scope.name_exist = false; - $scope.industries = angular.copy(industryMap); $scope.states = angular.copy(stateMap); $scope.countries = angular.copy(countryMap); $scope.seconds = 6; @@ -105,6 +50,14 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', $scope.bankaccount = {}; $scope.rate = {}; + $scope.loadRoyalpayindustry = function () { + $http.get('/static/data/royalpayindustry.json').then(function (resp) { + $scope.royalpayindustry = resp.data; + }) + }; + $scope.loadRoyalpayindustry(); + + $scope.checkUserName = function (username) { if(username != null && username != ''){ $http.get('/register/account/' + $scope.partner.username+'/check').then(function (resp) { @@ -154,9 +107,9 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', } },1000) }; - $scope.sendVerificationCode = function (phone_number) { + $scope.sendVerificationCode = function () { $scope.sendPhoneCodeTime(); - $http.post('/register/get/code/{number}').then(function (resp) { + $http.post('/register/info/phone/'+ $scope.partner.contact_phone +'/verify').then(function (resp) { }, function (resp) { $scope.resError = resp.data.message; }); @@ -207,7 +160,8 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', } } }; - $scope.saveApplyInfo = function (form,index) { + + $scope.saveStep1 = function (form,index) { if (form.$invalid) { angular.forEach(form, function (item, key) { if (key.indexOf('$') < 0) { @@ -216,31 +170,14 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', }); return; } - if(index == 1){ - $scope.partner.codeKey = Math.random().toString(16).substring(2); - } - $http.post('/register/info/update/' + $scope.partner.username, $scope.partner).then(function (resp) { - if (index == 3) { - $scope.getRateConfig(); - } - if (index == 4) { - $scope.goToLogin(); - } + $scope.partner.codeKey = Math.random().toString(16).substring(2); + $http.post('/register/info/update/' + $scope.partner.username +'/step1', $scope.partner).then(function (resp) { $scope.changeChoose(index); }, function (resp) { $scope.resError = resp.data.message; }); }; - - - - - - /* $scope.captchaImage = '/partners/application/captcha-image'; - $scope.changeCaptchaImage = function () { - $scope.captchaImage = '/partners/application/captcha-image?' + Math.floor(Math.random() * 100); - }; - $scope.save = function (form) { + $scope.saveApplyInfo = function (form,index) { if (form.$invalid) { angular.forEach(form, function (item, key) { if (key.indexOf('$') < 0) { @@ -249,17 +186,19 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', }); return; } - $scope.partner.company_name = $scope.partner.short_name; - $('#login-btn').attr('disabled', true); - $http.post('partners/application', $scope.partner).then(function (resp) { - alert("Registered merchant application has been submitted successfully"); - location.href = 'partner_register_success.html'; - //commonDialog.alert({title: 'Success', content: 'Registered merchant application has been submitted successfully', type: 'success'}); + if(index == 1){ + $scope.partner.codeKey = Math.random().toString(16).substring(2); + } + $http.post('/register/info/update/' + $scope.partner.username, $scope.partner).then(function (resp) { + if (index == 3) { + $scope.getRateConfig(); + } + if (index == 4) { + $scope.goToLogin(); + } + $scope.changeChoose(index); }, function (resp) { - alert(resp.data.message); $scope.resError = resp.data.message; - $scope.changeCaptchaImage(); - $('#login-btn').attr('disabled', false); }); - };*/ + }; }]); \ No newline at end of file