|
@@ -1149,6 +1149,37 @@ var dever = {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ //拉起支付
|
|
|
+ pay : function(result, location, error) {
|
|
|
+ var self = this;
|
|
|
+ if (!error) {
|
|
|
+ if (location.indexOf('?') == -1) {
|
|
|
+ var fix = '?';
|
|
|
+ } else {
|
|
|
+ var fix = '&';
|
|
|
+ }
|
|
|
+ location = location + fix + 'order_id=' + result.order_id;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (result.type == 'test') {
|
|
|
+ self.location(location, 'to');
|
|
|
+ } else if (self.source == 'h5') {
|
|
|
+ uni.hideLoading();
|
|
|
+ uni.showLoading({title: '跳转中', mask: true});
|
|
|
+ self.html(result.order);
|
|
|
+ } else if (self.source == 'app') {
|
|
|
+ self.appPayment(result.type, result.order, function() {
|
|
|
+ self.location(location, 'to');
|
|
|
+ }, function() {
|
|
|
+ if (!error) {
|
|
|
+ self.location(location + '&error=1', 'to');
|
|
|
+ } else {
|
|
|
+ self.alert(error);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
//app支付
|
|
|
appPayment : function(type, order, callback, errorCallback) {
|
|
|
uni.requestPayment({
|