| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- const app = getApp();
- Page({
- data: {
- },
- onLoad: function () {
- wx.hideShareMenu();
- var that = this;
-
- that.setData({
- Containnerheight: main.getWindowHeight(),
- });
- },
- onShow:function(){
- var that = this;
- var arr = wx.getStorageSync("SearchWord");
- if (!arr)
- arr = [];
- that.setData({
- SelectList: arr,
- });
- },
- onSearch: function (e) {
- wx.navigateTo({
- url: './searchWeb1',
- })
- },
- onSearchHistory: function (e) {
- var search = e.currentTarget.dataset.search;
- var arr = wx.getStorageSync("SearchWord");
- if (!arr)
- arr = [];
- var obj = {};
- obj.Key = search;
- for (var i = 0; i < arr.length; i++) {
- if (arr[i].Key == search) {
- obj.Key = arr[i].Key;
- obj.Value = arr[i].Value;
- arr.splice(i, 1);
- break;
- }
- }
- arr.unshift(obj);
- wx.setStorageSync("SearchWord", arr);
- wx.navigateTo({
- url: './searchWeb2?back=2&search=' + search+'&type=1',
- });
- },
- deleteItem:function(e){
- var that=this;
- wx.showModal({
- title: '提醒',
- content: '删除这条搜索记录?',
- success(res) {
- if (res.confirm) {
- var index = e.currentTarget.dataset.id;
- that.data.SelectList.splice(index, 1);
- that.setData({
- SelectList: that.data.SelectList,
- });
- wx.setStorageSync("SearchWord", that.data.SelectList);
- }
- }
- });
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
- imageUrl: app.globalData.ShareImage,
- }
- },
- })
|