diff --git a/o2web/source/x_component_Setting/$Main/default/apppack/index.html b/o2web/source/x_component_Setting/$Main/default/apppack/index.html index d9160aec3a87a90fcc1c678e07ef07e01dd7a56c..5a6806b36f53a615d02388e22d1dd23579915098 100644 --- a/o2web/source/x_component_Setting/$Main/default/apppack/index.html +++ b/o2web/source/x_component_Setting/$Main/default/apppack/index.html @@ -81,7 +81,7 @@
- + diff --git a/o2web/source/x_component_Setting/SettingMobile.js b/o2web/source/x_component_Setting/SettingMobile.js index ede293ecd59d55de326674c78b149397ac931bb9..e768a77ee007c8603c3aae0766152377715ed7e8 100644 --- a/o2web/source/x_component_Setting/SettingMobile.js +++ b/o2web/source/x_component_Setting/SettingMobile.js @@ -317,26 +317,28 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({ }, // 直接用原有资料重新打包 reSubmitPack: function() { - this.showLoading(); - o2.Actions.load("x_program_center").AppPackAction.androidPackReStart(this.token, function (json) { - console.log(json) - this.hiddenLoading(); - if (json.data && json.data.value) { - // 提交成功 获取最新打包对象信息 - this.loadAppPackInfo(); - } else { - this.app.notice(json.message, "error", this.contentAreaNode); - } - }.bind(this), function (error) { - this.hiddenLoading(); - console.log(error); - this.app.notice(error, "error", this.contentAreaNode); + this.confirm(this.lp.alert, this.lp.mobile_apppack_message_alert_submit, function() { + this.showLoading(); + o2.Actions.load("x_program_center").AppPackAction.androidPackReStart(this.token, function (json) { + console.log(json) + this.hiddenLoading(); + if (json.data && json.data.value) { + // 提交成功 获取最新打包对象信息 + this.loadAppPackInfo(); + } else { + this.app.notice(json.message, "error", this.contentAreaNode); + } + }.bind(this), function (error) { + this.hiddenLoading(); + console.log(error); + this.app.notice(error, "error", this.contentAreaNode); + }.bind(this)); }.bind(this)); }, // 提交打包 submitPack: function () { + var appName = this.apppackAppNameInputNode.get("value"); - console.log(appName); if (!appName || appName === "") { this.app.notice(this.lp.mobile_apppack_message_appname_not_empty, "error", this.contentAreaNode); return; @@ -348,7 +350,6 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({ var files = this.apppackLogoInputNode.files; if (files.length) { var file = files.item(0); - console.log(file.name); var fileExt = file.name.substring(file.name.lastIndexOf(".")); if (fileExt.toLowerCase() !== ".png") { this.app.notice(this.lp.mobile_apppack_message_app_logo_need_png, "error", this.contentAreaNode); @@ -359,7 +360,6 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({ return; } var protocol = this.apppackProtocolInputNode.get("value"); - console.log(protocol); if (!protocol || protocol === "") { this.app.notice(this.lp.mobile_apppack_message_portocol_not_empty, "error", this.contentAreaNode); return; @@ -369,49 +369,83 @@ MWF.xApplication.Setting.AppPackOnlineDocument = new Class({ return; } var host = this.apppackHostInputNode.get("value"); - console.log(host); if (!host || host === "") { this.app.notice(this.lp.mobile_apppack_message_host_not_empty, "error", this.contentAreaNode); return; } var port = this.apppackPortInputNode.get("value"); - console.log(port); if (!port || port === "") { this.app.notice(this.lp.mobile_apppack_message_port_not_empty, "error", this.contentAreaNode); return; } var context = this.apppackContextInputNode.get("value"); - console.log(context); if (!context || context === "") { this.app.notice(this.lp.mobile_apppack_message_context_not_empty, "error", this.contentAreaNode); return; } - this.showLoading(); - var formData = new FormData(); - formData.append('file', file); - formData.append('fileName', file.name); - formData.append('appName', appName); - formData.append('o2ServerProtocol', protocol); - formData.append('o2ServerHost', host); - formData.append('o2ServerPort', port); - formData.append('o2ServerContext', context); - formData.append('token', this.token); + this.confirm(this.lp.alert, this.lp.mobile_apppack_message_alert_submit, function() { + this.showLoading(); + var formData = new FormData(); + formData.append('file', file); + formData.append('fileName', file.name); + formData.append('appName', appName); + formData.append('o2ServerProtocol', protocol); + formData.append('o2ServerHost', host); + formData.append('o2ServerPort', port); + formData.append('o2ServerContext', context); + formData.append('token', this.token); + + o2.Actions.load("x_program_center").AppPackAction.androidPackStart(formData, "{}",function (json) { + console.log(json) + this.hiddenLoading(); + if (json.data && json.data.value) { + // 提交成功 获取最新打包对象信息 + this.loadAppPackInfo(); + } else { + this.app.notice(json.message, "error", this.contentAreaNode); + } + }.bind(this), function (error) { + this.hiddenLoading(); + console.log(error); + this.app.notice(error, "error", this.contentAreaNode); + }.bind(this)); + }.bind(this)); - o2.Actions.load("x_program_center").AppPackAction.androidPackStart(formData, "{}",function (json) { - console.log(json) - this.hiddenLoading(); - if (json.data && json.data.value) { - // 提交成功 获取最新打包对象信息 - this.loadAppPackInfo(); - } else { - this.app.notice(json.message, "error", this.contentAreaNode); - } - }.bind(this), function (error) { - this.hiddenLoading(); - console.log(error); - this.app.notice(error, "error", this.contentAreaNode); + }, + //确认 + confirm: function (title, text, okCallback) { + var width = 600; + var height = 110; + var size = this.app.content.getSize(); + var x = (size.x - width) / 2; + var y = (size.y - height) / 2; + MWF.require("MWF.xDesktop.Dialog", function () { + var dlg = new MWF.xDesktop.Dialog({ + "title": title, + "style": "settingStyle", + "top": y, + "left": x, + "width": width, + "height": height, + "text": text, + "maskNode": this.app.content, + "container": this.app.content, + "buttonList": [ + { + "text": this.lp.ok, + "action": function () { + if (okCallback) { okCallback(); } + this.close(); + } + }, + { + "text": this.lp.cancel, + "action": function () { this.close(); } + } + ] + }); + dlg.show(); }.bind(this)); - } }); diff --git a/o2web/source/x_component_Setting/lp/en.js b/o2web/source/x_component_Setting/lp/en.js index 047d24f15a801413783900606c76d4780cb363a8..ecd0f5f0c8703ac56f2cf1e609f81e803896f144 100644 --- a/o2web/source/x_component_Setting/lp/en.js +++ b/o2web/source/x_component_Setting/lp/en.js @@ -222,7 +222,7 @@ MWF.xApplication.Setting.LP = { "mobile_apppack_tips1": "⚠️ Currently, the online packaging function of mobile app only supports Android.", - "mobile_apppack_tips2": "⚠️ If you need to package online, you must register and log in to [云服务配置] .", + "mobile_apppack_tips2": "⚠️ If you need to package online, you must register and log in to [Cloud Setting] .", "mobile_apppack_tips3": "⚠️ After submitting the information, the current packing status will be displayed. The packing process takes a long time. You can leave the current page first, wait for the packing to complete, and then download the APK file from this page.", "mobile_apppack_status_label": "current state", "mobile_apppack_form_appName": "App Name", @@ -256,6 +256,8 @@ MWF.xApplication.Setting.LP = { "mobile_apppack_message_port_not_empty": "Central server port number cannot be empty!", "mobile_apppack_message_context_not_empty": "Central server context cannot be empty!", "mobile_apppack_message_portocol_http_https": "HTTP protocol just support http or https !", + "mobile_apppack_refresh_status_btn": "Refresh Status", + "mobile_apppack_message_alert_submit": "Are you sure you want to submit,The current form information will be packaged as a mobile App ?", "imgSize": "size of the picture:", "defaultImg": "Default picture", diff --git a/o2web/source/x_component_Setting/lp/zh-cn.js b/o2web/source/x_component_Setting/lp/zh-cn.js index c0ffeba2f7ac64524ef95aec432184d5706bb4bc..3f1bf7a594579b7b2373651ad8d441c2a6f56f3a 100644 --- a/o2web/source/x_component_Setting/lp/zh-cn.js +++ b/o2web/source/x_component_Setting/lp/zh-cn.js @@ -216,6 +216,8 @@ MWF.xApplication.Setting.LP = { "mobile_mpweixin_menu_save_success": "保存数据成功!", "mobile_mpweixin_menu_delete_alert_msg": "确认要删除这条数据吗,会同时删除它的子菜单?", "mobile_mpweixin_menu_delete_success": "删除数据成功!", + + "save": "保存", "alert": "提示", @@ -255,7 +257,8 @@ MWF.xApplication.Setting.LP = { "mobile_apppack_message_port_not_empty": "中心服务器端口号不能为空!", "mobile_apppack_message_context_not_empty": "中心服务器上下文不能为空!", "mobile_apppack_message_portocol_http_https": "HTTP协议只能是 http 或 https !", - + "mobile_apppack_refresh_status_btn": "刷新状态", + "mobile_apppack_message_alert_submit": "确定要提交吗,当前表单信息将被打包成移动端App ?", "imgSize": "图片尺寸:", "defaultImg": "默认图片",