es((string) $_GET['keyword']); ?>", hot_keyword: [], search_log: [], showHotKeyword: false }, mounted() { this.getKeyword() }, methods: { submit: function () { if (this.keyword) { let localKeywords = JSON.parse(window.localStorage.getItem('localKeywords')) || []; if (localKeywords.indexOf(this.keyword) === -1) { localKeywords.unshift(this.keyword) } if (localKeywords.length > 5) { localKeywords.pop() } window.localStorage.setItem('localKeywords', JSON.stringify(localKeywords)); } location.href = '?keyword=' + encodeURIComponent(this.keyword); }, getKeyword: function () { if (!this.showHotKeyword) { this.hot_keyword = JSON.parse(window.localStorage.getItem('localKeywords')) || []; if (!this.search_log.length) { this.search_log = []; // axios.get('store/hot/search_log').then((res) => { // let search_log = res.data.search_log; // for (let i in search_log) { // if (this.hot_keyword.indexOf(search_log[i]['keyword']) === -1) { // this.search_log.push(search_log[i]['keyword']) // } // } // this.showHotKeyword = true // }) } else { this.showHotKeyword = true } } }, hide() { setTimeout(() => { this.showHotKeyword = false }, 200) } }, }); }); // require(['jquery', 'tip'], ($) => { // tip.msgbox.err("请输入意见内容"); // tip.msgbox.suc("请输入意见内容"); // tip.alert("请输入意见内容"); // tip.promptlive("请输入意见内容"); // tip.prompt("请输入意见内容"); // tip.confirm("请输入意见内容"); // })
意见反馈 小程序端
官方微信