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
ecc609ba
authored
2018-08-25 17:04:04 +0800
by
ex
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改支付地址
1 parent
368b7c2c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
12 deletions
html/main.html
js/JSBridge.js
js/controller/mainController.js
js/controller/mapController.js
js/service/wechatPaymentService.js
html/main.html
View file @
ecc609b
<div
ng-controller=
"mainController"
>
<div
id=
"mapContainer"
class=
"mapContainer"
ng-controller=
"mapController"
></div>
<div
id=
"sliderMenu"
class=
"sliderMenu"
style=
"display:
none
;"
<div
id=
"sliderMenu"
class=
"sliderMenu"
style=
"display:
block
;"
ng-class=
"{true: 'menuOpen', false: 'menuClose'}[$root.openMenu]"
>
<img
src=
"images/slideMenuBackground.png"
/>
...
...
js/JSBridge.js
View file @
ecc609b
...
...
@@ -40,10 +40,29 @@ AppClient.prototype.getERCode = function (callbackName, callback, jsonStr) {
this
.
appObj
.
callHandler
(
"getERCode"
,
iOSData
,
callback
);
}
};
window
.
getIOSERCode
=
function
(
_params
)
{
AppClient
.
prototype
.
getGPS
=
function
(
callbackName
,
callback
,
jsonStr
)
{
var
dataParams
=
""
;
if
(
isJson
(
jsonStr
)){
dataParams
=
JSON
.
parse
(
jsonStr
);
}
var
iOSData
=
{
from
:
'H5'
,
params
:
dataParams
};
if
(
this
.
isAndroid
)
{
this
.
appObj
.
getGPS
(
'H5'
,
jsonStr
);
}
else
{
this
.
appObj
.
callHandler
(
"getGPS"
,
iOSData
,
callback
);
}
};
window
.
getERCode
=
function
(
_params
)
{
alert
(
JSON
.
parse
(
_params
))
}
window
.
get
window
.
getGPS
=
function
(
params
)
{
alert
(
JSON
.
parse
(
params
))
}
if
(
window
.
android
)
{
appClient
=
new
AppClient
(
window
.
android
,
true
);
// 此处可以调用一些init的方法
...
...
js/controller/mainController.js
View file @
ecc609b
...
...
@@ -2,7 +2,7 @@ angular.module('myApp')
.
controller
(
'mainController'
,[
'$scope'
,
'$rootScope'
,
'dingdaService'
,
'$state'
,
'globalService'
,
function
(
$scope
,
$rootScope
,
dingdaService
,
$state
,
globalService
){
$rootScope
.
isRendBike
=
false
;
$rootScope
.
isLoadFinish
=
fals
e
;
$rootScope
.
isLoadFinish
=
tru
e
;
$scope
.
unfinishOrder
=
{};
var
init
=
function
()
{
// globalService.init();
...
...
@@ -114,7 +114,7 @@ angular.module('myApp')
// }
$rootScope
.
openScan
=
false
;
console
.
log
(
appClient
)
appClient
.
getERCode
(
'get
IOS
ERCode'
,
function
(
res
)
{
appClient
.
getERCode
(
'getERCode'
,
function
(
res
)
{
alert
(
JSON
.
parse
(
res
))
},
''
)
// wx.scanQRCode({
...
...
js/controller/mapController.js
View file @
ecc609b
...
...
@@ -34,6 +34,8 @@ angular.module('myApp')
var
initMap
=
function
()
{
map
=
new
BMap
.
Map
(
"mapContainer"
);
map
.
centerAndZoom
(
new
BMap
.
Point
(
120.124421
,
30.279879
),
15
);
map
.
addEventListener
(
"click"
,
function
()
{
...
...
@@ -295,8 +297,15 @@ angular.module('myApp')
// onSuccess(res)
// }
// });
appClient
.
getERCode
(
'getGPS'
,
function
(
res
)
{
alert
(
JSON
.
parse
(
res
))
onSuccess
({
latitude
:
30.2741500000
,
longitude
:
120.1551500000
})
onSuccess
({
latitude
:
30.2741500000
,
longitude
:
120.1551500000
})
},
''
)
// onSuccess({latitude:30.2741500000,longitude:120.1551500000})
}
...
...
@@ -578,6 +587,7 @@ angular.module('myApp')
// mui.init();
initCustomOverlay
();
initMap
();
// wx.ready(function() {
initLocation
();
...
...
js/service/wechatPaymentService.js
View file @
ecc609b
...
...
@@ -57,7 +57,7 @@ angular.module('myApp.services')
}
var
wxh5ApiCall
=
function
(
sign
,
q
)
{
console
.
log
(
'sign'
,
sign
);
//
console.log('sign', sign);
window
.
location
.
href
=
sign
.
mwebUrl
;
}
...
...
@@ -97,14 +97,19 @@ angular.module('myApp.services')
* 租车付款
*/
callRentTypePay
:
function
(
orderId
,
amount
,
type
)
{
var
user
=
JSON
.
parse
(
localStorage
.
getItem
(
"ls.user"
))
if
(
user
){
var
token
=
user
.
token
}
switch
(
type
)
{
case
100
:
var
html
=
' <form action="'
+
host
+
'/
bill/alipay/h5/'
+
orderId
var
html
=
' <form action="'
+
host
+
'/
h5/alipay/bill/'
+
orderId
+
'/'
+
token
+
'" method="post">'
+
' <input type="text" name="amount" value="'
+
amount
+
'" />'
+
' <input type="text" name="body" value="租车租金"/>'
+
' <input type="text" name="type" value="100" />'
+
' <input type="text" name="token" value="'
+
token
+
'" />'
+
' <input type="submit" id="ok">'
+
' </input>'
+
' </form>'
...
...
@@ -113,7 +118,7 @@ angular.module('myApp.services')
// form.querySelector('#ok').click()
document
.
body
.
appendChild
(
form
)
document
.
querySelector
(
'#ok'
).
click
()
return
null
case
101
:
var
param
=
Object
.
assign
(
$location
.
search
(),{
amount
:
amount
,
...
...
@@ -142,14 +147,25 @@ angular.module('myApp.services')
* @param amount
*/
callDepositTypePay
:
function
(
amount
,
type
){
var
user
=
JSON
.
parse
(
localStorage
.
getItem
(
"ls.user"
))
if
(
user
){
var
token
=
user
.
token
}
switch
(
type
)
{
case
100
:
var
html
=
' <form action="'
+
host
+
'/balance/alipay/h5'
// $http.post(host + '/bill/alipay/h5',{
// 'amout': amount,
// 'body': '保证金充值',
// 'type': 100,
// }).success(function (res) {
// console.log(res)
// })
var
html
=
' <form action="'
+
host
+
'/h5/alipay/balance/'
+
token
+
'" method="post">'
+
' <input type="text" name="amount" value="'
+
amount
+
'" />'
+
' <input type="text" name="body" value="保证金充值"/>'
+
' <input type="text" name="type" value="100" />'
+
' <input type="submit" id="ok">\n'
+
' 余额充值\n'
+
' </input>\n'
+
...
...
@@ -159,7 +175,7 @@ angular.module('myApp.services')
// form.querySelector('#ok').click()
document
.
body
.
appendChild
(
form
)
document
.
querySelector
(
'#ok'
).
click
()
return
null
case
101
:
var
param
=
Object
.
assign
(
$location
.
search
(),{
amount
:
amount
,
...
...
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