bondPayController.js 1.01 KB
angular.module('myApp')
	.controller('bondPayController',['$scope', '$rootScope', '$state', 'wechatPayment', 'dingdaService', '$stateParams',
        function($scope,$rootScope,$state, wechatPayment, dingdaService, $stateParams){
        $scope.payType = 100
        if(!$rootScope.toPaid){
            $state.go('bond', {longitude: $stateParams.longitude , latitude: $stateParams.latitude });
        }
        // 支付保证金
    	var ispay = false;
        $scope.goPay = function(){
            if(ispay) return;
            ispay = true;
            var IswechatPayment= window.localStorage.getItem("IswechatPayment");
            if (IswechatPayment== undefined || IswechatPayment == "no") {
                wechatPayment.callDepositTypePay($rootScope.toPaid, $scope.payType)
                    .then(function (result) {
                        ispay = false;
                    }, function (errMsg) {
                        ispay = false;
                       
                    })
                }
        }

}])