Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨建斌
/
dy-wx2
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
befb6c8e
authored
2019-10-16 22:23:13 +0800
by
fuenxin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
update code
1 parent
1ae9192a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
40 deletions
.vscode/settings.json
js/app.js
js/controller/bondController.js
js/controller/bondPayController.js
js/controller/mainController.js
js/service/wechatPaymentService.js
.vscode/settings.json
0 → 100644
View file @
befb6c8
{
"liveServer.settings.port"
:
5501
}
\ No newline at end of file
js/app.js
View file @
befb6c8
...
...
@@ -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
(
globalServic
e
)
{
app
.
run
([
'globalService'
,
'$rootScope'
,
function
(
globalService
,
$rootScop
e
)
{
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
...
...
js/controller/bondController.js
View file @
befb6c8
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
...
...
js/controller/bondPayController.js
View file @
befb6c8
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
...
...
js/controller/mainController.js
View file @
befb6c8
...
...
@@ -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
)
{
...
...
js/service/wechatPaymentService.js
View file @
befb6c8
...
...
@@ -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
(
'支付'
)
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment