c4caec3a by unknown

pay update

1 parent 4ebea400
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/h5wx.iml" filepath="$PROJECT_DIR$/.idea/h5wx.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -1017,7 +1017,9 @@ body, button, input, select, textarea {
font-size: 10px;
}
.pay-active{
background: #acacac;
}
......
<div ng-controller="bondPayController" class="payPanel">
<div class="paywayMenu">
<div class="paywayMenuItem">
<div ng-click="payType = 100" class="paywayMenuItem" ng-class="{'pay-active': payType === 100}">
<img src="images/alipay.png" /> 支付宝
</div>
<div ng-click="payType = 101" class="paywayMenuItem" ng-class="{'pay-active': payType === 101}">
<img src="images/wechat.png" /> 微信支付
</div>
</div>
......
<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"/>
......
......@@ -35,7 +35,7 @@
</div>
<div id="alipayform" style="display: none">
<form action="http://lsz1.28ms.com/service/balance/alipay/h5" method="post">
<form action="http://h5api.dy.dingdachuxing.com/service/balance/alipay/h5" method="post">
<input type="hidden" name="type" value="100">
<input type="hidden" name="body" value="钱包充值">
<div class="paywayMenu">
......
......@@ -15,8 +15,8 @@ angular.module('myApp')
// }
$scope.init = function(){
var latitude = $stateParams.latitude;
var longitude = $stateParams.longitude;
var latitude = $stateParams.latitude || '120.15515';
var longitude = $stateParams.longitude || '30.27415';
dingdaService.getBond(longitude,latitude)
.success(function(data){
// alert(JSON.stringify(data))
......
angular.module('myApp')
.controller('bondPayController',['$scope', '$rootScope', '$state', 'wechatPayment',
function($scope,$rootScope,$state, wechatPayment){
.controller('bondPayController',['$scope', '$rootScope', '$state', 'wechatPayment', 'dingdaService',
function($scope,$rootScope,$state, wechatPayment, dingdaService){
$scope.payType = 100
if(!$rootScope.toPaid){
$state.go('bond');
}
......@@ -11,10 +11,9 @@ angular.module('myApp')
if(ispay) return;
ispay = true;
var IswechatPayment= window.localStorage.getItem("IswechatPayment");
if (IswechatPayment== undefined || IswechatPayment == "no") {
wechatPayment.callDepositPay($rootScope.toPaid)
wechatPayment.callDepositTypePay($rootScope.toPaid, $scope.payType)
.then(function (result) {
ispay = false;
//支付成功
......@@ -27,8 +26,20 @@ angular.module('myApp')
//支付失败
})
}
}
// 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
......
......@@ -39,6 +39,7 @@ angular.module('myApp')
console.log(JSON.stringify(data))
})
}
$scope.moduleList = [];
$scope.moduleList.push({
name : "行程记录",
......
......@@ -239,11 +239,13 @@ angular.module('myApp')
menuControl.onclick = function() {
$scope.$apply(function() {
// alert(!globalService.getData("user"))
//alert($rootScope.openMenu);
if(!globalService.getData("user")) {
$state.go('login');
return;
}
$rootScope.openMenu = !$rootScope.openMenu;
//alert($rootScope.openMenu);
})
}
map.getContainer().appendChild(menuControl);
......@@ -289,12 +291,14 @@ angular.module('myApp')
getlocation();
function getlocation() {
wx.getLocation({
type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
success: function (res) {
onSuccess(res)
}
});
// wx.getLocation({
// type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
// success: function (res) {
// onSuccess(res)
// }
// });
onSuccess({latitude:30.2741500000,longitude:120.1551500000})
}
......@@ -307,6 +311,7 @@ angular.module('myApp')
}
var convertor = new BMap.Convertor();
var pointArr = [];
// alert(longitude, latitude);
pointArr.push(new BMap.Point(longitude, latitude));
convertor.translate(pointArr, 3, 5, function(data){
var point = data.points[0];
......@@ -576,8 +581,8 @@ angular.module('myApp')
initCustomOverlay();
initMap();
wx.ready(function() {
// wx.ready(function() {
initLocation();
})
// })
}]);
\ No newline at end of file
......
......@@ -54,7 +54,6 @@ angular.module('myApp.services')
loadCityConfig();
loadPathParams();
initWeixinMenu($http);
}
var loadPersistData = function() {
......
angular.module('myApp.services')
.service('wechatPayment',['$http', '$q', '$rootScope','$location',function($http, $q, $rootScope,$location) {
//var host = 'http://finance.api.dingdachuxing.com/service';
var host = 'http://finance.dy.dingdatech.com/service';
var host = 'http://finance.api.dingdachuxing.com/service';
// var host = 'http://finance.dy.dingdatech.com/service';
var h5wxhost = 'http://lsz1.28ms.com/service/balance/';
var payhost = 'http://lsz1.28ms.com/service'
var h5alipayhost = 'http://lsz1.28ms.com/service/balance/';
var h5wxhost = 'http://h5api.dy.dingdachuxing.com/service/balance/';
var h5alipayhost = 'http://h5api.dy.dingdachuxing.com/service/balance/';
console.log('search:',$location.search());
......@@ -101,6 +103,17 @@ angular.module('myApp.services')
type : 101
});
return callUnifiedOrderApi(host + "/bail/wx", param);
}, /**
* 保证金充值
* @param amount
*/
callDepositTypePay : function(amount, type){
var param = Object.assign($location.search(),{
amount : amount,
body : "保证金充值",
type : type
});
return callUnifiedOrderApi(payhost + "/balance/" + (type === 100?'alipay': 'wx') +"/h5", param);
},
/**
* 钱包充值
......
......@@ -63,7 +63,7 @@ function initWeixinMenu($http){
.success(function(data){
// alert(JSON.stringify(data) + ", with url : " + location.href.split('#')[0])
if(data){
weixinOptionMenuInit(data.appid, data.timestamp, data.noncestr, data.signature);
// weixinOptionMenuInit(data.appid, data.timestamp, data.noncestr, data.signature);
}
})
.error(function(arg1){
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!