From 08634b6842ec57c0e1f4dcd3695930718d49bc23 Mon Sep 17 00:00:00 2001 From: dubox Date: Sat, 9 Nov 2019 00:00:06 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E6=90=9C=E7=B4=A2=E5=9F=9F?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD;2.=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=A1=B6=E9=83=A8=E6=90=9C=E7=B4=A2=E6=A0=8F=E6=B6=88=E5=A4=B1?= =?UTF-8?q?=E9=97=AE=E9=A2=98;3.=E4=BF=AE=E5=A4=8D=E5=9C=A8=E5=B7=B2?= =?UTF-8?q?=E6=9C=89=E6=A0=87=E7=AD=BE=E9=A1=B5=E6=89=93=E5=BC=80=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- options/options.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/options/options.js b/options/options.js index 8677737..2a36551 100644 --- a/options/options.js +++ b/options/options.js @@ -413,6 +413,7 @@ var app = new Vue({ console.log('doSearch:' + this.searchData.keyword); this.sliderWidth = 0; this.searchData.resultsIndex = {}; + var _this = this; for (let i in this.searchData.models) { //this.searchData.results[i] = []; @@ -421,7 +422,7 @@ var app = new Vue({ if (!this.searchData.models[i].show) { continue; } - var _this = this; + if (this.searchData.models[i].type == 'weixin' && this.searchData.models[i].symbol == 1) { setTimeout(function () { //延迟执行微信公众号搜索,试图解决因被服务器察觉而需要输入验证码的情况 _this.handleReachBottom(i)(); @@ -434,6 +435,11 @@ var app = new Vue({ this.history(this.searchData.keyword); + setTimeout(function(){ + _this.command(_this.searchData.keyword); + },0); + + if(document.getElementById('cz')) document.getElementById('cz').src=`http://www.jsearch.site/home/?id=${chrome.runtime.id}`; }, @@ -447,6 +453,22 @@ var app = new Vue({ jBar.setKeyword(this.searchInputValue); }, + /** + * 指令触发 + * @param {*} key + * + */ + command:function(key){ + switch(key){ + case '设置':{this.drawer.show = true;break;} + case '红色':{this.settings.kwColor = 'red';break;} + case '蓝色':{this.settings.kwColor = 'blue';break;} + case '绿色':{this.settings.kwColor = 'green';break;} + case '黑色':{this.settings.kwColor = 'black';break;} + default :{} + } + }, + history:function(keyword){ var _this = this;