diff --git a/module/common/lang/de.php b/module/common/lang/de.php index 3a4ff109c2..4af869ec57 100644 --- a/module/common/lang/de.php +++ b/module/common/lang/de.php @@ -588,6 +588,9 @@ $lang->noticePasteImg = "Paste images here"; $lang->pasteImgFail = "Failed to paste images. Try again later."; $lang->pasteImgUploading = "Uploading..."; +$lang->visionTips = "You can switch vision here"; +$lang->IKnow = "I know"; + /* Time formats settings. */ if(!defined('DT_DATETIME1')) define('DT_DATETIME1', 'Y-m-d H:i:s'); if(!defined('DT_DATETIME2')) define('DT_DATETIME2', 'y-m-d H:i'); diff --git a/module/common/lang/en.php b/module/common/lang/en.php index a3f41ced68..feec14d951 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -588,6 +588,9 @@ $lang->noticePasteImg = "You can paste images into the editor."; $lang->pasteImgFail = "Failed to paste images. Try again later."; $lang->pasteImgUploading = "Uploading..."; +$lang->visionTips = "You can switch vision here"; +$lang->IKnow = "I know"; + /* Time formats settings. */ if(!defined('DT_DATETIME1')) define('DT_DATETIME1', 'Y-m-d H:i:s'); if(!defined('DT_DATETIME2')) define('DT_DATETIME2', 'y-m-d H:i'); diff --git a/module/common/lang/fr.php b/module/common/lang/fr.php index 6c23835d55..b7ebf5bb98 100644 --- a/module/common/lang/fr.php +++ b/module/common/lang/fr.php @@ -588,6 +588,9 @@ $lang->noticePasteImg = "Vous pouvez déposer des images dans l'éditeur."; $lang->pasteImgFail = "Echec lors de la dépose des images. Essayez plus tard."; $lang->pasteImgUploading = "Chargement..."; +$lang->visionTips = "You can switch vision here"; +$lang->IKnow = "I know"; + /* Time formats settings. */ if(!defined('DT_DATETIME1')) define('DT_DATETIME1', 'Y-m-d H:i:s'); if(!defined('DT_DATETIME2')) define('DT_DATETIME2', 'y-m-d H:i'); diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 286b7f8d75..589b9b8a8f 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -588,6 +588,9 @@ $lang->noticePasteImg = "可以在编辑器直接贴图。"; $lang->pasteImgFail = "贴图失败,请稍后重试。"; $lang->pasteImgUploading = "正在上传图片,请稍后..."; +$lang->visionTips = "您可以在这里切换界面"; +$lang->IKnow = "我知道了"; + /* 时间格式设置。*/ if(!defined('DT_DATETIME1')) define('DT_DATETIME1', 'Y-m-d H:i:s'); if(!defined('DT_DATETIME2')) define('DT_DATETIME2', 'y-m-d H:i'); diff --git a/module/index/css/index.ui.css b/module/index/css/index.ui.css index c0268cd453..2f51382a0d 100644 --- a/module/index/css/index.ui.css +++ b/module/index/css/index.ui.css @@ -61,3 +61,9 @@ } [lang^='en'] {--zt-menu-width: 106px;} + + #visionTips {width: 280px; height: 0; position: absolute; bottom: 120px; left: 0; z-index: 200; color: #ffffff;} + #visionTips .inner {width: 270px; height: 58px; position: relative; bottom: 0; left: 0; border-radius: 8px; display: flex; justify-content: space-around; align-items: center;} + #visionTips .line {width: 2px; height: 31px; position: absolute; bottom: -31px; left: 64px;} + #visionTips .circle {width: 10px; height: 10px; border-radius: 50%; border-width: 3px; border-style: solid; position: relative; left: -4px; top: 31px; background-color: white;color: #fff; border-color: #2e7fff;} + #visionTips .inner > button {border-color: white; background: #2e7fff;} diff --git a/module/index/js/index.ui.js b/module/index/js/index.ui.js index 04fbdeea23..05bf9a3095 100644 --- a/module/index/js/index.ui.js +++ b/module/index/js/index.ui.js @@ -930,3 +930,10 @@ window.startCron = function(restart) turnon ? browserNotify() : ping(); if(runnable) startCron(); if(scoreNotice) zui.Messager.show({ content: {html: scoreNotice}, placement: 'bottom-right', time: 0, icon: 'diamond', className: 'text-primary bg-primary-100 bg-opacity-90' }); + +function hideVisionTips() +{ + $('#visionTips').remove(); + var link = $.createLink('my', 'ajaxSaveVisionTips'); + $.post(link, {fields: 1}); +} diff --git a/module/index/ui/index.html.php b/module/index/ui/index.html.php index 2648a90b03..58eec51e00 100644 --- a/module/index/ui/index.html.php +++ b/module/index/ui/index.html.php @@ -92,7 +92,23 @@ div(setID('apps')); div ( setID('appsBar'), - div(setID('visionSwitcher'), visionSwitcher()), + div( + setID('visionSwitcher'), + visionSwitcher(), + (count(explode(',', $this->app->user->visions)) > 1 && empty($config->global->hideVisionTips)) ? + div( + setID('visionTips'), + div( + setClass('inner bg-primary'), + span($lang->visionTips), + button(setClass('btn btn-primary'), on::click('hideVisionTips'), $lang->IKnow), + div( + setClass('line bg-primary pannel-primary'), + div(setClass('circle alert-primary-inverse')) + ) + ), + ) : null, + ), ul ( setID('appTabs'), diff --git a/module/my/control.php b/module/my/control.php index bf39cdc048..ebe0d225e0 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -1453,6 +1453,7 @@ class my extends control { $_SESSION['vision'] = $vision; $this->loadModel('setting')->setItem("{$this->app->user->account}.common.global.vision", $vision); + if(empty($this->config->hideVisionTips)) $this->setting->setItem("{$this->app->user->account}.common.global.hideVisionTips", 1); $this->config->vision = $vision; $_SESSION['user']->rights = $this->user->authorize($this->app->user->account); @@ -1461,4 +1462,18 @@ class my extends control return $this->send(array('result' => 'success', 'load' => helper::createLink('index', 'index'))); } + + /** + * Ajax: 保存界面切换引导. + * Save hideVisionTips by ajax. + * + * @param string $vision + * @access public + * @return void + */ + public function ajaxSaveVisionTips() + { + $this->loadModel('setting')->setItem("{$this->app->user->account}.common.global.hideVisionTips", 1); + return $this->send(array('result' => 'success', 'load' => helper::createLink('index', 'index'))); + } }