Procházet zdrojové kódy

#IQRV #comment [JS] 安装请求实现

gifur před 4 roky
rodič
revize
d97cb5f26f

+ 25 - 6
addin/res/ManagerDesktop/css/emui-style.css

@@ -1208,16 +1208,35 @@ width: 24px;
 height: 24px;
 cursor: pointer;
 background-repeat: no-repeat;
-background-image: url('../images/emui-icon.png?r=0.1517399082388049&_=2311627385677326');
-background-position: left -1777px;
+background-image: url('../images/ic_warning.png');
+background-position: left 0px;
+padding-right:5px;
 }
 .ic_warning_small {
 width: 16px;
 height: 16px;
 cursor: pointer;
 background-repeat: no-repeat;
-background-image: url('../images/emui-icon.png?r=0.1517399082388049&_=2311627385677326');
-background-position: left -1801px;
+background-image: url('../images/ic_warning_small.png');
+background-position: left 0px;
+
+}
+.ic_succeed {
+    width: 24px;
+    height: 24px;
+    cursor: pointer;
+    background-repeat: no-repeat;
+    background-image: url('../images/ic_succeed.png');
+    background-position: left 0px;
+    padding-right:5px;
+    }
+.ic_succeed_small {
+width: 16px;
+height: 16px;
+cursor: pointer;
+background-repeat: no-repeat;
+background-image: url('../images/ic_succeed_small.png');
+background-position: left 0px;
 }
 .ic_upgrade_failed {
 width: 20px;
@@ -1225,8 +1244,8 @@ height: 20px;
 float: left;
 margin-right: 8px;
 background-repeat: no-repeat;
-background-image: url('../images/emui-icon.png?r=0.1517399082388049&_=2311627385677326');
-background-position: left -1817px;
+background-image: url('../images/ic_warning.png');
+background-position: left 0px;
 }
 .ic_upgrade_no_new_version {
 width: 21px;

+ 79 - 4
addin/res/ManagerDesktop/guide.html

@@ -109,6 +109,85 @@
                 </div>
             </div>
             <div class="clearboth"></div>
+            <div id="guide_font_confirm_page" style="margin: 0px auto; width: 1000px; padding-top: 133px; display: none;">
+                <div id="guide_font_confirm_content" style="margin:0 auto;position:absolute;">
+                    <div class="guide_table_top">&nbsp;</div>
+                    <div class="margin_bottom_box2 color_background_white" style="min-height:556px;">
+                        <div style="padding-top:20px;height:48px;" class="border_bottom" align="center">
+                            <div style="font-size:18px;">字体安装</div>
+                        </div>
+                        <div align="center" id="guide_font_confirmed_div"
+                         style="padding-top:30px;width:570px;padding-left:0px; ">
+                            <div class="pull-left text-left" id="guide_font_confirmed_content"
+                             style="font-family:'HYQiHei 55S','HYQiHei-55S',sans-serif;width:540px;padding-top:2px;font-size:60px;border:1px solid #00F;padding: 25px 0px 25px 30px;">
+                                我是,;测试字体!
+                            </div>
+                        </div>
+                        <div style="padding-top:100px;" align="center">
+                            <div style="padding-top:50px;padding-bottom: 30px;" id="font_confirm_info">
+                                请<strong>比较上方文字与下方图片</strong>内容字体是否一致,如果确认一致请点击跳过进入下一步,否则请点击安装</div>
+                            <div><img  style="border:1px solid #f37253;" src="./images/HYQiHei_55S_Sample.png"></div>
+                        </div>
+                        <div align="center" id="guide_font_confirm_noinstall_div" class=" hide" style="padding-top:100px;width:570px;padding-left:185px;">
+                            <div class="pull-left ic_warning clearboth"></div>
+                            <div class="pull-left text-left" style="width:540px;padding-top:2px;">
+                                未检测到有安装指定的字体,请点击下方按钮进行安装!
+                            </div>
+                        </div>
+                        <div align="center" id="guide_font_confirm_finished_div"  class=" hide" style="padding-top:100px;width:570px;padding-left:240px;">
+                            <div class="pull-left ic_succeed clearboth"></div>
+                            <div class="pull-left text-left" id="guide_font_confirm_finished_content" style="width:540px;padding-top:2px;">
+                            </div>
+                        </div>
+                        <div class="clearboth" style="padding-top:50px">
+                            <div class="controls_short" style="margin-left:240px;"><button class="btn_normal_short"
+                                    id="guide_font_confirm_install">安装</button></div>
+                                <div class="controls_short"><button class="btn_normal_short"
+                                    id="guide_font_confirm_next">跳过</button></div>
+                        </div>
+                    </div>
+                    <div class="guide_table_bottom">&nbsp;</div>
+                </div>
+            </div>
+            <div class="clearboth"></div>
+            <div id="guide_sogou_install_page" style="margin: 0px auto; width: 1000px; padding-top: 133px; display: none;">
+                <div id="guide_sogou_install_content" style="margin:0 auto;position:absolute;">
+                    <div class="guide_table_top">&nbsp;</div>
+                    <div class="margin_bottom_box2 color_background_white" style="min-height:456px;">
+                        <div style="padding-top:20px;height:48px;" class="border_bottom" align="center">
+                            <div style="font-size:18px;">输入法安装</div>
+                        </div>
+                        <div align="center" id="guide_sogou_noinstall_div" class=" hide" style="padding-top:100px;width:570px;padding-left:185px;">
+                            <div class="pull-left ic_warning clearboth"></div>
+                            <div class="pull-left text-left" style="width:540px;padding-top:2px;">
+                                未检测到当前有安装输入法,请点击下方按钮进行安装!
+                            </div>
+                        </div>
+                        <div align="center" id="guide_sogou_installed_div"  class=" hide" style="padding-top:100px;width:570px;padding-left:240px;">
+                            <div class="pull-left ic_succeed clearboth"></div>
+                            <div class="pull-left text-left" id="guide_sogou_installed_content" style="width:540px;padding-top:2px;">
+                                已检测到输入法!
+                            </div>
+                        </div>
+                        <div align="center" id="guide_sogou_install_finished_div"  class=" hide" style="padding-top:100px;width:570px;padding-left:240px;">
+                            <div class="pull-left ic_succeed clearboth"></div>
+                            <div class="pull-left text-left" id="guide_sogou_install_finished_content" style="width:540px;padding-top:2px;">
+                                安装成功!
+                            </div>
+                        </div>
+                        <div class="clearboth" align="center" style="padding-top:80px;">
+                            <div id="guide_sogou_install_next" style="position: relative;"
+                                class="btn_normal_long hide" onclick="">下一步
+                            </div>
+                            <div id="guide_sogou_install_start" style="position: relative;"
+                                class="btn_normal_long hide" onclick="">安装
+                            </div>
+                        </div>
+                    </div>
+                    <div class="guide_table_bottom">&nbsp;</div>
+                </div>
+            </div>
+            <div class="clearboth"></div>
             <div id="guide_init_param_page" style="margin: 0px auto; width: 1000px; padding-top: 133px; display: none;">
                 <div id="guide_init_param_content" style="margin:0 auto;position:absolute;">
                     <div class="guide_table_top">&nbsp;</div>
@@ -429,10 +508,6 @@
                                     <div style="margin-top:8px;">仅关注(root.ini)已配置内容</div>
                                 </div>
                                 <div class="pull-left">
-                                    <!-- <div id="gui_adapter_config_root_interest_switch" style="margin-top:8px;"
-                                        class="check_off margin_right_10"
-                                        onclick="EMUI.GuideController.captiveModifyPasswordSwitch(this)">
-                                    </div> -->
                                     <div id="gui_adapter_config_root_interest_switch" style="margin-top:5px;"
                                         class="switch_on margin_right_10"
                                         onclick="Switch(this, InterestRootSwitch)">

binární
addin/res/ManagerDesktop/images/HYQiHei_55S_Sample.png


binární
addin/res/ManagerDesktop/images/ic_succeed.png


binární
addin/res/ManagerDesktop/images/ic_succeed_small.png


binární
addin/res/ManagerDesktop/images/ic_warning.png


binární
addin/res/ManagerDesktop/images/ic_warning_small.png


+ 182 - 3
addin/res/ManagerDesktop/js/guide.js

@@ -5,7 +5,9 @@ var CONST = {
     DeployStep_AccessAuthorize : 3,
     DeployStep_MediaConfig : 4,
     DeployStep_Finished : 5,
-    DeployStep_AdapterConfig : 6
+    DeployStep_AdapterConfig : 6,
+    DeployStep_3rdParty_SogouInstall : 7,
+    DeployStep_3rdParty_FontInstall : 8
 };
 
 var SETCTION = {
@@ -723,6 +725,146 @@ $(function () {
         RVC.HealthmanagerEntityCtrl.ControlTerminalLifeNo(1);
     }
 
+    function SogouInstallStateSwitch(installState)
+    {
+        if(installState === 0) {
+            $('#guide_sogou_installed_div').hide();
+            $('#guide_sogou_noinstall_div').show();
+            $('#guide_sogou_install_next').hide();
+            $('#guide_sogou_install_start').show();
+        } else if(installState === 1) {
+            $('#guide_sogou_noinstall_div').hide();
+            $('#guide_sogou_installed_div').show();
+            $('#guide_sogou_install_start').hide();
+            $('#guide_sogou_install_next').show();
+        } else if(installState === 2) {
+            $('#guide_sogou_noinstall_div').hide();
+            $('#guide_sogou_installed_div').hide();
+            $('#guide_sogou_install_start').hide();
+            $('#guide_sogou_install_next').show();
+            $('#guide_sogou_install_finished_div').show();
+        }
+    }
+
+    function InstallSpecifiesFont()
+    {
+        let req = new Request();
+        req.preStep = CONST.DeployStep_3rdParty_SogouInstall;
+        req.currStep = CONST.DeployStep_3rdParty_SogouInstall;
+        req.nextStep = CONST.DeployStep_3rdParty_SogouInstall;
+        req.param1 = 0;
+        req.param2 = 0;
+        req.param3 = '';
+        req.param4 = '';
+        req.param5 = '';
+        req.array1 = [0];
+        req.array2 = [''];
+        req.options = 3; //安装字体
+        req.additional = 0;
+        req.restartApp = false;
+        req.restartPC = false;
+
+        utilStartSubmitDialog();
+        RVC.HealthmanagerEntityCtrl.DeployTerminal(req, function(ret) {
+            utilStopSubmitDialog();
+            if(ret.errorCode === 0) {
+                let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
+                if(result.result == 0) {
+                    $('#guide_font_confirm_next').text('下一步');
+                    var tip = '安装成功!请点击下一步继续';
+                    utilStartAlertDialog(tip);
+                } else {
+                    utilStartAlertDialog("安装失败:[" + result.result + "] " + result.additionalMsg);
+                }
+            } else {
+                RVC.HealthmanagerEntityCtrl.commErrorCallback(ret);
+            }
+        });
+    }
+
+    function InstallSogouInput()
+    {
+        let req = new Request();
+        req.preStep = CONST.DeployStep_3rdParty_SogouInstall;
+        req.currStep = CONST.DeployStep_3rdParty_SogouInstall;
+        req.nextStep = CONST.DeployStep_3rdParty_SogouInstall;
+        req.param1 = 0;
+        req.param2 = 0;
+        req.param3 = '';
+        req.param4 = '';
+        req.param5 = '';
+        req.array1 = [0];
+        req.array2 = [''];
+        req.options = 2; //安装搜狗输入法
+        req.additional = 0;
+        req.restartApp = false;
+        req.restartPC = false;
+
+        utilStartSubmitDialog();
+        RVC.HealthmanagerEntityCtrl.DeployTerminal(req, function(ret) {
+            utilStopSubmitDialog();
+            if(ret.errorCode === 0) {
+                let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
+                if(result.result == 0) {
+                    SogouInstallStateSwitch(2);
+                    var tip = '安装成功!';
+                    if(result.array2.length === 3) {
+                        tip += '<br><br>版本:<strong>' + result.array2[0] + '</strong>';
+                        tip += '<br>安装时间:<strong>' + result.array2[2] + '</strong>';
+                    }
+                    $('#guide_sogou_installed_content').html(tip);
+                } else {
+                    utilStartAlertDialog("安装失败:[" + result.result + "] " + result.additionalMsg);
+                }
+            } else {
+                RVC.HealthmanagerEntityCtrl.commErrorCallback(ret);
+            }
+        });
+    }
+
+    function DisplaySogouInstallState()
+    {
+        let req = new Request();
+        req.preStep = CONST.DeployStep_3rdParty_SogouInstall;
+        req.currStep = CONST.DeployStep_3rdParty_SogouInstall;
+        req.nextStep = CONST.DeployStep_3rdParty_SogouInstall;
+        req.param1 = 0;
+        req.param2 = 0;
+        req.param3 = '';
+        req.param4 = '';
+        req.param5 = '';
+        req.array1 = [0];
+        req.array2 = [''];
+        req.options = 1; //检测输入法的安装状态
+        req.additional = 0;
+        req.restartApp = false;
+        req.restartPC = false;
+
+        RVC.HealthmanagerEntityCtrl.DeployTerminal(req, function(ret) {
+            if(ret.errorCode === 0) {
+                let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
+                if(result.result == 0) {
+                    if(result.param1 !== 1) {
+                        SogouInstallStateSwitch(1);
+                        var tip = '已检测到输入法!';
+                        if(result.array2.length === 3) {
+                            tip += '<br><br>版本:<strong>' + result.array2[0] + '</strong>';
+                            tip += '<br>安装时间:<strong>' + result.array2[2] + '</strong>';
+                        }
+                        $('#guide_sogou_installed_content').html(tip);
+                        console.log(tip);
+                    } else {
+                        SogouInstallStateSwitch(0);
+                    }
+                } else {
+                    utilStartAlertDialog("查询失败:[" + result.result + "] " + result.additionalMsg);
+                }
+            } else {
+                RVC.HealthmanagerEntityCtrl.commErrorCallback(ret);
+            }
+        });
+    }
+
     RVC.GuideController = RVC.Object.extend({
         hideAllPage: function () {
             $('#guide_start_page').hide();
@@ -796,7 +938,14 @@ $(function () {
                 break;
                 case CONST.DeployStep_Finished  :
                     select_page = 'guide_finish_page';
+                break
+                case CONST.DeployStep_3rdParty_SogouInstall:
+                    select_page = 'guide_sogou_install_page';
+                break; 
+                case CONST.DeployStep_3rdParty_FontInstall:
+                    select_page = 'guide_font_confirm_page';
                 break; 
+                
                 default:
                 break;
             }
@@ -819,6 +968,9 @@ $(function () {
                 case CONST.DeployStep_AdapterConfig:
                     InterestRootSwitch(true);
                     break;
+                case CONST.DeployStep_3rdParty_SogouInstall:
+                    DisplaySogouInstallState();
+                    break;
                 default:
                     break;
             }
@@ -954,6 +1106,22 @@ $(function () {
     $(document).on('click', '#guide_media_config_next', function() {
         SaveMediaDeviceConfig();
     });
+
+    $(document).on('click', '#guide_sogou_install_next', function() {
+        utilStartAlertDialog("暂未实现");
+    });
+
+    $(document).on('click', '#guide_sogou_install_start', function() {
+        InstallSogouInput();
+    });
+
+    $(document).on('click', '#guide_font_confirm_install', function() {
+        InstallSpecifiesFont();
+    });
+
+    $(document).on('click', '#guide_font_confirm_next', function() {
+        $('#guide_font_confirm_next').text('下一步');
+    });
     
     $(document).on('click', '#guide_finish_restart_btn', function() {
         FinshedDeploy();
@@ -998,8 +1166,19 @@ $(function () {
                 });
             }
         } else {
-            RVC.GuideController.gotoPage(CONST.DeployStep_Begin);
-            //RVC.GuideController.gotoPage(CONST.DeployStep_AdapterConfig);
+            /**
+             *     DeployStep_Begin : 0,
+                    DeployStep_GetTerminalInfo : 1,
+                    DeployStep_FetchCenterSettings : 2,
+                    DeployStep_AccessAuthorize : 3,
+                    DeployStep_MediaConfig : 4,
+                    DeployStep_Finished : 5,
+                    DeployStep_AdapterConfig : 6,
+                    DeployStep_3rdParty_SogouInstall : 7,
+                    DeployStep_3rdParty_FontInstall
+             * 
+             */
+            RVC.GuideController.gotoPage(CONST.DeployStep_3rdParty_FontInstall);
         }
     }