增加APP端js
This commit is contained in:
parent
3651fe9ff2
commit
73939e91d7
@ -0,0 +1,49 @@
|
|||||||
|
(function () {
|
||||||
|
|
||||||
|
var u = navigator.userAgent;
|
||||||
|
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
|
||||||
|
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
||||||
|
|
||||||
|
function AppOaFormUtil() {
|
||||||
|
this.confirmAssignees = null;
|
||||||
|
this.fields = null;
|
||||||
|
this.formButton = null;
|
||||||
|
this.currentUser = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化APP数据
|
||||||
|
* @param dataObj
|
||||||
|
*/
|
||||||
|
this.initAppFormData = function (dataObj) {
|
||||||
|
this.confirmAssignees = dataObj.confirmAssignees;
|
||||||
|
this.fields = dataObj.fields;
|
||||||
|
this.formButton = dataObj.formButton;
|
||||||
|
this.currentUser = dataObj.currentUser;
|
||||||
|
|
||||||
|
if (isAndroid) {
|
||||||
|
window.android.invokeNative('initFormData', JSON.stringify(dataObj))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getConfirmAssignees = function () {
|
||||||
|
alert(JSON.stringify(this.confirmAssignees))
|
||||||
|
return this.confirmAssignees;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getFields = function () {
|
||||||
|
return this.fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getFormButton = function () {
|
||||||
|
return this.formButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getCurrentUser = function () {
|
||||||
|
return this.currentUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
window.appOaFormUtil = new AppOaFormUtil();
|
||||||
|
|
||||||
|
})();
|
Loading…
Reference in New Issue
Block a user