befb6c8e by fuenxin

update code

1 parent 1ae9192a
{
"liveServer.settings.port": 5501
}
\ No newline at end of file
......@@ -48,7 +48,7 @@ var app = angular.module('myApp', [ "ui.router",'myApp.services', 'myApp.direct
templateUrl: "html/pay.html"
})
.state('bondPay',{
url: "/bondPay",
url: "/bondPay/?longitude&latitude",
templateUrl: "html/bondPay.html"
})
.state('bondSuccess',{
......@@ -76,11 +76,8 @@ var app = angular.module('myApp', [ "ui.router",'myApp.services', 'myApp.direct
}])
app.run(['globalService', function(globalService) {
app.run(['globalService', '$rootScope', function(globalService, $rootScope) {
globalService.init();
var loading = document.getElementById("appLoadingIndicator");
loading.style.display = "none";
loading.style.display = "none";
}])
//$(window).bind("load resize",function(){
// $("body").css({zoom:$(window).width()/320,visibility:"visible"});
//});
\ No newline at end of file
......
angular.module('myApp')
.controller('bondController',['$scope' , '$rootScope', '$state' , 'dingdaService' , '$stateParams' ,
function($scope,$rootScope,$state,dingdaService,$stateParams){
function($scope,$rootScope,$state,dingdaService, $stateParams){
$scope.goPay = function(){
$state.go('bondPay');
if($rootScope.toPaid){
$state.go('bondPay', {longitude: $stateParams.longitude , latitude: $stateParams.latitude });
}
}
// function getUrl(name){
......@@ -19,15 +21,17 @@ angular.module('myApp')
var longitude = $stateParams.longitude || '30.27415';
dingdaService.getBond(longitude,latitude)
.success(function(data){
// alert(JSON.stringify(data))
$scope.bondInfo = data.data;
$rootScope.toPaid = data.data.toPaid;
}).error(function(data){
// alert(JSON.stringify(data))
layer.open({
content: '获取保证金失败,请刷新页面',
time:2
});
layer.open({
content: '获取保证金失败,请刷新页面',
time:2
});
// layer.open({
// content: JSON.stringify(data),
// time:2
// });
})
}
......@@ -68,7 +72,9 @@ angular.module('myApp')
}
});
}
})
}).error(function(msg) {
})
}
}])
\ No newline at end of file
......
angular.module('myApp')
.controller('bondPayController',['$scope', '$rootScope', '$state', 'wechatPayment', 'dingdaService',
function($scope,$rootScope,$state, wechatPayment, dingdaService){
.controller('bondPayController',['$scope', '$rootScope', '$state', 'wechatPayment', 'dingdaService', '$stateParams',
function($scope,$rootScope,$state, wechatPayment, dingdaService, $stateParams){
$scope.payType = 100
if(!$rootScope.toPaid){
$state.go('bond');
$state.go('bond', {longitude: $stateParams.longitude , latitude: $stateParams.latitude });
}
// 支付保证金
var ispay = false;
......@@ -15,30 +15,11 @@ angular.module('myApp')
wechatPayment.callDepositTypePay($rootScope.toPaid, $scope.payType)
.then(function (result) {
ispay = false;
//支付成功
// alert(window.localStorage.getItem("IswechatPayment"));
// window.localStorage.setItem("IswechatPayment", "yes")
// $state.go('bondSuccess');
}, function (errMsg) {
ispay = false;
// window.localStorage.setItem("IswechatPayment", "no")
//支付失败
})
}
// wechatPayment.callDepositPay($rootScope.toPaid, $scope.payType)
// .then(function (result) {
// ispay = false;
// //支付成功
// // alert(window.localStorage.getItem("IswechatPayment"));
// window.localStorage.setItem("IswechatPayment", "yes")
// $state.go('bondSuccess');
// }, function (errMsg) {
// ispay = false;
// window.localStorage.setItem("IswechatPayment", "no")
// //支付失败
// })
// }
}
}])
\ No newline at end of file
......
......@@ -12,10 +12,12 @@ angular.module('myApp')
if(r!=null)return unescape(r[2]); return null;
}
$scope.userinfo = globalService.getData("user");
if(!$scope.userinfo) {
var code = getUrl('code')
var loginCode = globalService.getData("loginCode");
var code = getUrl('code')
if(!$scope.userinfo || (code && (loginCode !== code))) {
if(code){
dingdaService.verifyThirdCode(code).success(function (res) {
globalService.saveData('loginCode', code)
if(res.meta.code == 200) {
dingdaService.verifyPhoneCode(res.data.mobile, res.data.code).success(function (data) {
if (data.meta.code == 200) {
......
......@@ -126,6 +126,7 @@ angular.module('myApp.services')
' </form>'
var form = document.createElement('div')
form.innerHTML = html
form.style.display = 'none'
// form.querySelector('#ok').click()
document.body.appendChild(form)
document.querySelector('#ok').click()
......@@ -184,6 +185,7 @@ angular.module('myApp.services')
var form = document.createElement('div')
form.innerHTML = html
// form.querySelector('#ok').click()
form.style.display = 'none'
document.body.appendChild(form)
document.querySelector('#ok').click()
return callUnifiedOrderApiAliPay('支付')
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!