@@ -284,8 +284,8 @@
- Alipay+(Online) :
- none
+ Alipay+(Online) :
+ none
diff --git a/src/main/ui/static/payment/validation/order-validation.js b/src/main/ui/static/payment/validation/order-validation.js
index 683d30057..3df8e518f 100644
--- a/src/main/ui/static/payment/validation/order-validation.js
+++ b/src/main/ui/static/payment/validation/order-validation.js
@@ -2,316 +2,327 @@
* Created by davep on 2016-09-01.
*/
define(['angular', 'uiRouter'], function () {
- 'use strict'
- var app = angular.module('orderValidApp', ['ui.router'])
- app.config([
- '$stateProvider',
- function ($stateProvider) {
- $stateProvider
- .state('order_valid', {
- url: '/order_validation',
- templateUrl: '/static/payment/validation/templates/valid-calendar.html',
- controller: 'orderValidCalendarCtrl',
- })
- .state('order_valid.report', {
- url: '/{date}',
- templateUrl: '/static/payment/validation/templates/valid.html',
- controller: 'orderValidationCtrl',
- })
- .state('order_valid.report_new', {
- url: '/new/{date}',
- templateUrl: '/static/payment/validation/templates/valid_new.html',
- controller: 'orderValidationNewCtrl',
- })
- },
- ])
- app.controller('orderValidCalendarCtrl', [
- '$scope',
- '$http',
- '$filter',
- '$state',
- 'commonDialog',
- function ($scope, $http, $filter, $state, commonDialog) {
- $scope.today = new Date()
- $scope.loadValidatedDates = function (month) {
- let monthStr = $filter('date')(month, 'yyyyMM')
- $http.get('/sys/financial/validated_dates/' + monthStr).then(function (resp) {
- $scope.validatedDates = resp.data
- })
- }
- $scope.findReport = function (dateStr) {
- if ($scope.validatedDates == null) {
- return null
- }
- let filtered = $scope.validatedDates.filter(rp => rp.date === dateStr)
- return filtered.length ? filtered[0] : null
- }
- $scope.checkDetail = function (date) {
- const filterItem = $scope.validatedDates.filter(rp => rp.date === date)
- const dateStr = date.replace(/\//g, '')
- if (filterItem.length) {
- if (filterItem[0].isOld) {
- $state.go('order_valid.report', { date: dateStr })
- } else {
- sessionStorage.setItem('warningLevel', filterItem[0].warning_level)
- $state.go('order_valid.report_new', { date: dateStr })
- }
- } else {
- commonDialog
- .confirm({
- title: 'Confirm',
- content: '是否确认重新执行对账?',
- })
- .then(function () {
- $http
- .get('/sys/financial/order_validations/' + dateStr, {
- params: {
- use_cache: false,
- },
- timeout: 300000,
+ 'use strict'
+ var app = angular.module('orderValidApp', ['ui.router'])
+ app.config([
+ '$stateProvider',
+ function ($stateProvider) {
+ $stateProvider
+ .state('order_valid', {
+ url: '/order_validation',
+ templateUrl: '/static/payment/validation/templates/valid-calendar.html',
+ controller: 'orderValidCalendarCtrl',
})
- .then(
- function () {
- $state.reload()
- },
- function (resp) {
- $state.reload()
- }
- )
- })
- }
- }
- },
- ])
- // old
- app.controller('orderValidationCtrl', [
- '$scope',
- '$http',
- '$filter',
- '$stateParams',
- 'commonDialog',
- function ($scope, $http, $filter, $stateParams, commonDialog) {
- $scope.date = $stateParams.date
- $scope.startValid = function (forceRebuild) {
- $scope.report = { loading: true }
- $http
- .get('/sys/financial/order_validations/' + $scope.date, {
- params: {
- use_cache: !forceRebuild,
- },
- timeout: 300000,
- })
- .then(
- function (resp) {
- $scope.report = resp.data
- $scope.notExistsKeys = []
- $scope.notEqualsKeys = []
- angular.forEach($scope.report.not_exists, function (item) {
- angular.forEach(item, function (val, key) {
- if ($scope.notExistsKeys.indexOf(key) < 0) {
- $scope.notExistsKeys.push(key)
- }
+ .state('order_valid.report', {
+ url: '/{date}',
+ templateUrl: '/static/payment/validation/templates/valid.html',
+ controller: 'orderValidationCtrl',
+ })
+ .state('order_valid.report_new', {
+ url: '/new/{date}',
+ templateUrl: '/static/payment/validation/templates/valid_new.html',
+ controller: 'orderValidationNewCtrl',
})
- })
- angular.forEach($scope.report.not_equals, function (item) {
- angular.forEach(item, function (val, key) {
- if ($scope.notExistsKeys.indexOf(key) < 0) {
- $scope.notExistsKeys.push(key)
- }
+ },
+ ])
+ app.controller('orderValidCalendarCtrl', [
+ '$scope',
+ '$http',
+ '$filter',
+ '$state',
+ 'commonDialog',
+ function ($scope, $http, $filter, $state, commonDialog) {
+ $scope.today = new Date()
+ $scope.loadValidatedDates = function (month) {
+ let monthStr = $filter('date')(month, 'yyyyMM')
+ $http.get('/sys/financial/validated_dates/' + monthStr).then(function (resp) {
+ $scope.validatedDates = resp.data
})
- })
- },
- function (resp) {
- commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
- $scope.report = null
}
- )
- }
- $scope.startValid(false)
+ $scope.findReport = function (dateStr) {
+ if ($scope.validatedDates == null) {
+ return null
+ }
+ let filtered = $scope.validatedDates.filter(rp => rp.date === dateStr)
+ return filtered.length ? filtered[0] : null
+ }
+ $scope.checkDetail = function (date) {
+ const filterItem = $scope.validatedDates.filter(rp => rp.date === date)
+ const dateStr = date.replace(/\//g, '')
+ if (filterItem.length) {
+ if (filterItem[0].isOld) {
+ $state.go('order_valid.report', {date: dateStr})
+ } else {
+ sessionStorage.setItem('warningLevel', filterItem[0].warning_level)
+ $state.go('order_valid.report_new', {date: dateStr})
+ }
+ } else {
+ commonDialog
+ .confirm({
+ title: 'Confirm',
+ content: '是否确认重新执行对账?',
+ })
+ .then(function () {
+ $http
+ .get('/sys/financial/order_validations/' + dateStr, {
+ params: {
+ use_cache: false,
+ },
+ timeout: 300000,
+ })
+ .then(
+ function () {
+ $state.reload()
+ },
+ function (resp) {
+ $state.reload()
+ }
+ )
+ })
+ }
+ }
+ },
+ ])
+ // old
+ app.controller('orderValidationCtrl', [
+ '$scope',
+ '$http',
+ '$filter',
+ '$stateParams',
+ 'commonDialog',
+ function ($scope, $http, $filter, $stateParams, commonDialog) {
+ $scope.date = $stateParams.date
+ $scope.startValid = function (forceRebuild) {
+ $scope.report = {loading: true}
+ $http
+ .get('/sys/financial/order_validations/' + $scope.date, {
+ params: {
+ use_cache: !forceRebuild,
+ },
+ timeout: 300000,
+ })
+ .then(
+ function (resp) {
+ $scope.report = resp.data
+ $scope.notExistsKeys = []
+ $scope.notEqualsKeys = []
+ angular.forEach($scope.report.not_exists, function (item) {
+ angular.forEach(item, function (val, key) {
+ if ($scope.notExistsKeys.indexOf(key) < 0) {
+ $scope.notExistsKeys.push(key)
+ }
+ })
+ })
+ angular.forEach($scope.report.not_equals, function (item) {
+ angular.forEach(item, function (val, key) {
+ if ($scope.notExistsKeys.indexOf(key) < 0) {
+ $scope.notExistsKeys.push(key)
+ }
+ })
+ })
+ },
+ function (resp) {
+ commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
+ $scope.report = null
+ }
+ )
+ }
+ $scope.startValid(false)
- $scope.fixReport = function () {
- var datePattern = $filter('date')($scope.valid.date, 'yyyyMMdd')
- $http
- .get('/sys/financial/order_validations', {
- params: {
- date: datePattern,
- fix: true,
- },
- })
- .then(
- function (resp) {
- commonDialog.alert({ title: 'Success', content: '修复完毕', type: 'success' })
- },
- function (resp) {
- commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
+ $scope.fixReport = function () {
+ var datePattern = $filter('date')($scope.valid.date, 'yyyyMMdd')
+ $http
+ .get('/sys/financial/order_validations', {
+ params: {
+ date: datePattern,
+ fix: true,
+ },
+ })
+ .then(
+ function (resp) {
+ commonDialog.alert({title: 'Success', content: '修复完毕', type: 'success'})
+ },
+ function (resp) {
+ commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
+ }
+ )
}
- )
- }
- },
- ])
- // new
- app.controller('orderValidationNewCtrl', [
- '$scope',
- '$http',
- '$stateParams',
- 'commonDialog',
- '$uibModal',
- function ($scope, $http, $stateParams, commonDialog, $uibModal) {
- // 清除sessionStorage
- $scope.$on('$destroy', function () {
- sessionStorage.clear()
- })
- $scope.date = angular.copy($stateParams.date)
- $scope.date = $scope.date.substr(0, 4) + '-' + $scope.date.substr(4, 2) + '-' + $scope.date.substr(6)
- $scope.warningLevel = JSON.parse(sessionStorage.getItem('warningLevel'))
- $scope.validItAgain = function () {
- commonDialog
- .confirm({
- title: 'Confirm reconciliations',
- contentHtml: $sce.trustAsHtml('
Agree to send push message'),
- })
- .then(function () {
- var isSendMessage = document.getElementById('isSendMessage').checked
- $http
- .get('/sys/financial/order_validations/' + $stateParams.date, {
- params: {
- use_cache: false,
- is_send_message: isSendMessage,
- },
- timeout: 300000,
- })
- .then($scope.startValid())
+ },
+ ])
+ // new
+ app.controller('orderValidationNewCtrl', [
+ '$scope',
+ '$http',
+ '$sce',
+ '$stateParams',
+ 'commonDialog',
+ '$uibModal',
+ function ($scope, $http, $sce, $stateParams, commonDialog, $uibModal) {
+ // 清除sessionStorage
+ $scope.$on('$destroy', function () {
+ sessionStorage.clear()
})
- }
- // 加载渠道信息
- $scope.startValid = function () {
- $http
- .get('/sys/financial/order_validation_new/' + $stateParams.date, {
- timeout: 300000,
- })
- .then(
- function (resp) {
- $scope.channelList = []
- for (let key in resp.data) {
- const obj = {}
- obj.key = key
- obj.channel = resp.data[key]
- obj.selected = false
- $scope.channelList.push(obj)
- }
- $scope.channelList.map(item => {
- const arr = item.channel.filter(f => {
- return f.success === false
- })
- item.status = arr.length ? 'FAILED' : 'SUCCESS'
- item.success = arr.length ? false : true
- })
- if (sessionStorage.getItem('channel')) {
- const channel = JSON.parse(sessionStorage.getItem('channel'))
- channel.map(item => {
- $scope.channelList.filter(f => f.key === item.key)[0].selected = item.selected
- })
- } else {
- $scope.channelList[0].selected = true
- }
- console.log($scope.channelList)
- },
- function (resp) {
- commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
+ $scope.date = angular.copy($stateParams.date)
+ $scope.date = $scope.date.substr(0, 4) + '-' + $scope.date.substr(4, 2) + '-' + $scope.date.substr(6)
+ $scope.warningLevel = JSON.parse(sessionStorage.getItem('warningLevel'))
+ $scope.validItAgain = function () {
+ commonDialog
+ .confirm({
+ title: 'Confirm reconciliations',
+ contentHtml: $sce.trustAsHtml('
Agree to send push message'),
+ })
+ .then(function () {
+ var isSendMessage = document.getElementById('isSendMessage').checked
+ $http
+ .get('/sys/financial/order_validations/' + $stateParams.date, {
+ params: {
+ use_cache: false,
+ is_send_message: isSendMessage,
+ },
+ timeout: 300000,
+ })
+ .then($scope.startValid())
+ })
+ }
+ // 加载渠道信息
+ $scope.startValid = function () {
+ $http
+ .get('/sys/financial/order_validation_new/' + $stateParams.date, {
+ timeout: 300000,
+ })
+ .then(
+ function (resp) {
+ $scope.channelList = []
+ for (let key in resp.data) {
+ const obj = {}
+ obj.key = key
+ obj.channel = resp.data[key]
+ obj.selected = false
+ $scope.channelList.push(obj)
+ }
+ $scope.channelList.map(item => {
+ const arr = item.channel.filter(f => {
+ return f.success === false
+ })
+ item.status = arr.length ? 'FAILED' : 'SUCCESS'
+ item.success = arr.length ? false : true
+ })
+ if (sessionStorage.getItem('channel')) {
+ const channel = JSON.parse(sessionStorage.getItem('channel'))
+ channel.map(item => {
+ $scope.channelList.filter(f => f.key === item.key)[0].selected = item.selected
+ })
+ } else {
+ $scope.channelList[0].selected = true
+ }
+ console.log($scope.channelList)
+ },
+ function (resp) {
+ commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
+ }
+ )
}
- )
- }
- $scope.startValid()
- // 受否折叠
- $scope.fold = function (index) {
- $scope.channelList[index].selected = !$scope.channelList[index].selected
- }
- // 是否清除缓存
- $scope.clear = function (channelName, flag) {
- $http.post('/sys/financial/redo_channel_validation/' + $stateParams.date, { channel: channelName, cache: flag }).then(
- function () {
$scope.startValid()
- },
- function (resp) {
- commonDialog.alert({ title: 'failed', content: resp.data.message, type: 'error' })
- }
- )
- }
- // 处理
- $scope.handle = function (merchant) {
- sessionStorage.setItem('channel', JSON.stringify($scope.channelList))
- $uibModal
- .open({
- templateUrl: '/static/payment/validation/templates/handle_desc.html',
- controller: [
- '$scope',
- '$http',
- 'commonDialog',
- 'merchantInfo',
- function ($scope, $http, commonDialog, merchantInfo) {
- if (merchantInfo.resolve_msg) {
- $scope.message = merchantInfo.resolve_msg
- }
- $scope.confirm = function () {
- $http.post('/sys/financial/mark/resolve/message', { log_id: merchantInfo.log_id, message: $scope.message }).then(
+ // 受否折叠
+ $scope.fold = function (index) {
+ $scope.channelList[index].selected = !$scope.channelList[index].selected
+ }
+ // 是否清除缓存
+ $scope.clear = function (channelName, flag) {
+ $http.post('/sys/financial/redo_channel_validation/' + $stateParams.date, {
+ channel: channelName,
+ cache: flag
+ }).then(
function () {
- $scope.$close()
+ $scope.startValid()
},
function (resp) {
- commonDialog.alert({ title: 'failed', content: resp.data.message, type: 'error' })
+ commonDialog.alert({title: 'failed', content: resp.data.message, type: 'error'})
}
- )
+ )
+ }
+ // 处理
+ $scope.handle = function (merchant) {
+ sessionStorage.setItem('channel', JSON.stringify($scope.channelList))
+ $uibModal
+ .open({
+ templateUrl: '/static/payment/validation/templates/handle_desc.html',
+ controller: [
+ '$scope',
+ '$http',
+ 'commonDialog',
+ 'merchantInfo',
+ function ($scope, $http, commonDialog, merchantInfo) {
+ if (merchantInfo.resolve_msg) {
+ $scope.message = merchantInfo.resolve_msg
+ }
+ $scope.confirm = function () {
+ $http.post('/sys/financial/mark/resolve/message', {
+ log_id: merchantInfo.log_id,
+ message: $scope.message
+ }).then(
+ function () {
+ $scope.$close()
+ },
+ function (resp) {
+ commonDialog.alert({
+ title: 'failed',
+ content: resp.data.message,
+ type: 'error'
+ })
+ }
+ )
+ }
+ },
+ ],
+ resolve: {
+ merchantInfo: [
+ '$stateParams',
+ function () {
+ return merchant
+ },
+ ],
+ },
+ })
+ .result.then(function () {
+ $scope.startValid()
+ })
+ }
+ // 下载
+ $scope.download = function (merchant, keyName) {
+ if (merchant != null) {
+ const params = {}
+ params.channel = keyName
+ params.pid = merchant.pid
+ params.billDate = merchant.bill_date
+ params.noCache = false
+ params.billType = ''
+ window.open(
+ '/sys/financial/downloadChannelReconciliationFile?billDate=' +
+ params.billDate +
+ '&channel=' +
+ params.channel +
+ '&noCache=' +
+ params.noCache +
+ '&pid=' +
+ params.pid +
+ '&billType=' +
+ params.billType
+ )
}
- },
- ],
- resolve: {
- merchantInfo: [
- '$stateParams',
- function () {
- return merchant
- },
- ],
- },
- })
- .result.then(function () {
- $scope.startValid()
- })
- }
- // 下载
- $scope.download = function (merchant, keyName) {
- if (merchant != null) {
- const params = {}
- params.channel = keyName
- params.pid = merchant.pid
- params.billDate = merchant.bill_date
- params.noCache = false
- params.billType = ''
- window.open(
- '/sys/financial/downloadChannelReconciliationFile?billDate=' +
- params.billDate +
- '&channel=' +
- params.channel +
- '&noCache=' +
- params.noCache +
- '&pid=' +
- params.pid +
- '&billType=' +
- params.billType
- )
- }
- }
- // 查看what
- $scope.checkStatus = function (transactionId) {
- $http.get('/sys/financial/get/transaction/status/' + transactionId, {}).then(
- function (resp) {
- commonDialog.alert({ title: resp.data.statusInfo, content: '', type: 'success' })
- },
- function (resp) {
- commonDialog.alert({ title: 'failed', content: resp.data.message, type: 'error' })
- }
- )
- }
- },
- ])
- return app
+ }
+ // 查看what
+ $scope.checkStatus = function (transactionId) {
+ $http.get('/sys/financial/get/transaction/status/' + transactionId, {}).then(
+ function (resp) {
+ commonDialog.alert({title: resp.data.statusInfo, content: '', type: 'success'})
+ },
+ function (resp) {
+ commonDialog.alert({title: 'failed', content: resp.data.message, type: 'error'})
+ }
+ )
+ }
+ },
+ ])
+ return app
})
diff --git a/src/main/ui/static/rservicesapply/templates/r-services-apply.html b/src/main/ui/static/rservicesapply/templates/r-services-apply.html
index 0e7538f23..0788ac2a1 100644
--- a/src/main/ui/static/rservicesapply/templates/r-services-apply.html
+++ b/src/main/ui/static/rservicesapply/templates/r-services-apply.html
@@ -110,7 +110,7 @@
|
|
-
+ |
PASS
|
diff --git a/src/main/ui/static/templates/billCode/js/mobile_payment.js b/src/main/ui/static/templates/billCode/js/mobile_payment.js
index 8c63fdec4..ca4e81309 100644
--- a/src/main/ui/static/templates/billCode/js/mobile_payment.js
+++ b/src/main/ui/static/templates/billCode/js/mobile_payment.js
@@ -158,14 +158,12 @@ $(document).ready(function () {
if(window.openmobilefun == 'alipay'){
paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay/mobile';
}else{
- paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=Alipay';
+ paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=AlipayOnline';
}
}
if(paymentFun == 'AlipayAps'){
- if(window.openmobilefun == 'alipayaps'|| window.openmobilefun == 'alipayaps_cn'){
+ if(window.openmobilefun == 'alipayaps'){
paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay_aps/mobile';
- }else{
- paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay_aps/mobile/redirectApp?priorityChannel=AlipayAps';
}
}
if(paymentFun == 'Bank'){
@@ -184,16 +182,13 @@ $(document).ready(function () {
if(window.openmobilefun == 'alipay'){
paymentLink = '/api/v1.0/share_code/bills/payment/orders/'+window.billInfo.bill_code_id+'/alipay/share_link'
}else{
- paymentLink = '/api/v1.0/share_code/bills/payment/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=Alipay';
+ paymentLink = '/api/v1.0/share_code/bills/payment/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=AlipayOnline';
}
}
if(paymentFun == 'AlipayAps'){
- if(window.openmobilefun == 'alipayaps'|| window.openmobilefun == 'alipayaps_cn'){
+ if(window.openmobilefun == 'alipayaps'){
paymentLink = '/api/v1.0/share_code/bills/payment/orders/'+window.billInfo.bill_code_id+'/alipay_aps/share_link'
- }else{
- paymentLink = '/api/v1.0/share_code/bills/payment/'+window.billInfo.bill_code_id+'/alipay_aps/mobile/redirectApp?priorityChannel=AlipayAps';
-
}
}
if(paymentFun == 'Bank'){
diff --git a/src/main/ui/static/templates/skip_wxbrowser.js b/src/main/ui/static/templates/skip_wxbrowser.js
index bdd95f702..c71b8618c 100644
--- a/src/main/ui/static/templates/skip_wxbrowser.js
+++ b/src/main/ui/static/templates/skip_wxbrowser.js
@@ -1,4 +1,4 @@
-window = {};
+window = window || {};
$(function () {
'use strict';
var winHeight = $(window).height();
@@ -6,7 +6,11 @@ $(function () {
if (ua.indexOf('micromessenger') >= 0) {
$(".weixin-tip").show().css("height", winHeight);
} else {
- location.href = window.target_href;
+ if (!window.retry_flag) {
+ location.href = window.target_href;
+ } else {
+ checkOrderStd(window.client_moniker, window.partner_order_id, true)
+ }
}
decode();
@@ -17,21 +21,59 @@ $(function () {
$('#complete').bind('touchstart', function () {
checkOrderStd(window.client_moniker, window.partner_order_id, false);
});
+ $('#refresh').bind('touchstart', function () {
+ if (window.refresh_cooldown > 0) {
+ return;
+ }
+ window.refresh_cooldown = 10;
+
+ function replaceTxt() {
+ window.refresh_cooldown = window.refresh_cooldown - 1
+ if (window.refresh_cooldown > 0) {
+ $('#refresh').find('a').text('正在查询订单,请' + window.refresh_cooldown + '秒后重试')
+ setTimeout(replaceTxt, 1000)
+ } else {
+ $('#refresh').find('a').text('已完成付款')
+ }
+ }
+
+ setTimeout(replaceTxt, 1000)
+ replaceTxt()
+
+ checkOrderStd(window.client_moniker, window.partner_order_id, false);
+ });
+ $('#retry_btn').bind('touchstart', function () {
+ location.href = window.target_href;
+ })
$('#continue_use_browser').bind('touchstart', function () {
location.href = window.target_href;
});
+ $('#copy_link').bind('touchstart', function () {
+ var current_href = location.href;
+ $("#copy_link_btn").attr("data-clipboard-text", current_href);
+ var btn = document.getElementById('copy_link_btn');
+ var clipboard = new ClipboardJS(btn);
+ clipboard.on('success', function (e) {
+ alert("复制成功!");
+ e.clearSelection();
+ });
+ clipboard.on('error', function (e) {
+ alert("复制失败!");
+ });
+ });
function decode() {
var redirect = window.redirect;
while (redirect.indexOf('://') < 0) {
redirect = decodeURIComponent(redirect);
- if (redirect == window.redirect) {
+ if (redirect === window.redirect) {
break;
}
window.redirect = redirect;
}
}
+
function checkOrderStd(clientMoniker, merchantOrderId, needLoop) {
if (!clientMoniker || !merchantOrderId) {
return;
diff --git a/src/main/ui/static/templates/skip_wxbrowser_aps.js b/src/main/ui/static/templates/skip_wxbrowser_aps.js
new file mode 100644
index 000000000..ecb015c58
--- /dev/null
+++ b/src/main/ui/static/templates/skip_wxbrowser_aps.js
@@ -0,0 +1,69 @@
+window = {};
+$(function () {
+ 'use strict';
+ var winHeight = $(window).height();
+ var ua = navigator.userAgent.toLowerCase();
+ if (ua.indexOf('micromessenger') >= 0) {
+ $(".weixin-tip").show().css("height", winHeight);
+ } else {
+ callAlipayAps();
+ }
+ decode();
+
+ $('.close-weixin-tip').bind('touchstart', function () {
+ $(".weixin-tip").hide();
+ checkOrderStd(window.client_moniker, window.partner_order_id, true);
+ });
+ $('#complete').bind('touchstart', function () {
+ checkOrderStd(window.client_moniker, window.partner_order_id, false);
+ });
+ $('#refresh').bind('touchstart', function () {
+ checkOrderStd(window.client_moniker, window.partner_order_id, false);
+ });
+ $('#continue_use_browser').bind('touchstart', function () {
+ callAlipayAps();
+ });
+ $('#continue_use_browser').bind('touchstart', function () {
+ callAlipayAps();
+ });
+
+ function decode() {
+ var redirect = window.redirect;
+ while (redirect.indexOf('://') < 0) {
+ redirect = decodeURIComponent(redirect);
+ if (redirect == window.redirect) {
+ break;
+ }
+ window.redirect = redirect;
+ }
+ }
+
+ function checkOrderStd(clientMoniker, merchantOrderId, needLoop) {
+ if (!clientMoniker || !merchantOrderId) {
+ return;
+ }
+ $.ajax({
+ url: '/api/v1.0/payment/clients/' + clientMoniker + '/orders/' + merchantOrderId + '/status',
+ method: 'GET',
+ dataType: 'json',
+ success: function (res) {
+ if (res.paid) {
+ location.href = window.redirect + (window.redirect.indexOf('?') < 0 ? '?' : '&') + 'success=true&time=' + res.time + '&nonce_str=' + res.nonce_str + '&sign=' + res.sign;
+ } else {
+ if (needLoop) {
+ setTimeout(checkOrderStd(clientMoniker, merchantOrderId, needLoop), 3000);
+ }
+ if (!needLoop && !res.paid) {
+ alert("订单未支付,请稍后再试");
+ }
+ }
+ },
+ error: function (res) {
+ if (needLoop && res.message) {
+ alert(res.message);
+ }
+ }
+ })
+ }
+})
+;
|