forked from github/dataease
fix: 移动端拼写错误
This commit is contained in:
parent
1e5cd254f8
commit
cd1f4f1de1
@ -58,7 +58,7 @@ const util = {
|
|||||||
/**
|
/**
|
||||||
* 关键字颜色变化
|
* 关键字颜色变化
|
||||||
*/
|
*/
|
||||||
serachNmme(val, name) {
|
searchNmme(val, name) {
|
||||||
let namestr = new RegExp(val);
|
let namestr = new RegExp(val);
|
||||||
let nameresult =
|
let nameresult =
|
||||||
`<div style="font-size: 14px;color: #333;line-height: 1.5;">
|
`<div style="font-size: 14px;color: #333;line-height: 1.5;">
|
||||||
@ -94,7 +94,7 @@ const util = {
|
|||||||
dataHandle(item, val) {
|
dataHandle(item, val) {
|
||||||
// 改变字体颜色
|
// 改变字体颜色
|
||||||
if (val) {
|
if (val) {
|
||||||
item.nameNodes = util.serachNmme(val, item.name);
|
item.nameNodes = util.searchNmme(val, item.name);
|
||||||
} else {
|
} else {
|
||||||
item.nameNodes = `<div style="font-size: 14px;color: #333;line-height: 1.5;">${item.name}</div>`;
|
item.nameNodes = `<div style="font-size: 14px;color: #333;line-height: 1.5;">${item.name}</div>`;
|
||||||
|
|
||||||
@ -130,9 +130,9 @@ const util = {
|
|||||||
setHistory(val) {
|
setHistory(val) {
|
||||||
let searchHistory = uni.getStorageSync('search:history');
|
let searchHistory = uni.getStorageSync('search:history');
|
||||||
if (!searchHistory) searchHistory = [];
|
if (!searchHistory) searchHistory = [];
|
||||||
let serachData = {};
|
let searchData = {};
|
||||||
if (typeof(val) === 'string') {
|
if (typeof(val) === 'string') {
|
||||||
serachData = {
|
searchData = {
|
||||||
adcode: [],
|
adcode: [],
|
||||||
address: [],
|
address: [],
|
||||||
city: [],
|
city: [],
|
||||||
@ -143,18 +143,18 @@ const util = {
|
|||||||
typecode: []
|
typecode: []
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
serachData = val
|
searchData = val
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断数组是否存在,如果存在,那么将放到最前面
|
// 判断数组是否存在,如果存在,那么将放到最前面
|
||||||
for (var i = 0; i < searchHistory.length; i++) {
|
for (var i = 0; i < searchHistory.length; i++) {
|
||||||
if (searchHistory[i].name === serachData.name) {
|
if (searchHistory[i].name === searchData.name) {
|
||||||
searchHistory.splice(i, 1);
|
searchHistory.splice(i, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
searchHistory.unshift(util.dataHandle(serachData));
|
searchHistory.unshift(util.dataHandle(searchData));
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
key: 'search:history',
|
key: 'search:history',
|
||||||
data: searchHistory,
|
data: searchHistory,
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=1182
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=1182
|
||||||
* @property {String} href 点击后打开的外部网页url
|
* @property {String} href 点击后打开的外部网页url
|
||||||
* @property {String} text 显示的文字
|
* @property {String} text 显示的文字
|
||||||
* @property {String} downlaod H5平台下载文件名
|
* @property {String} download H5平台下载文件名
|
||||||
* @property {Boolean} showUnderLine 是否显示下划线
|
* @property {Boolean} showUnderLine 是否显示下划线
|
||||||
* @property {String} copyTips 在小程序端复制链接时显示的提示语
|
* @property {String} copyTips 在小程序端复制链接时显示的提示语
|
||||||
* @property {String} color 链接文字颜色
|
* @property {String} color 链接文字颜色
|
||||||
|
@ -116,7 +116,7 @@
|
|||||||
index: 1
|
index: 1
|
||||||
})
|
})
|
||||||
this.loadStarStatus()
|
this.loadStarStatus()
|
||||||
this.caclViewHeight()
|
this.calcViewHeight()
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -194,7 +194,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
caclViewHeight() {
|
calcViewHeight() {
|
||||||
let systemInfo = uni.getSystemInfoSync()
|
let systemInfo = uni.getSystemInfoSync()
|
||||||
const h5Height = systemInfo.windowHeight - systemInfo.statusBarHeight
|
const h5Height = systemInfo.windowHeight - systemInfo.statusBarHeight
|
||||||
if(systemInfo.navigationBarHeight) {
|
if(systemInfo.navigationBarHeight) {
|
||||||
|
@ -113,9 +113,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
requestHome({type: index, lastTime: activeTab.lastTime}).then(res => {
|
requestHome({type: index, lastTime: activeTab.lastTime}).then(res => {
|
||||||
var datas = res.data.listObject
|
var data = res.data.listObject
|
||||||
if(datas.length > 0) {
|
if(data.length > 0) {
|
||||||
datas.forEach(item => {
|
data.forEach(item => {
|
||||||
item.article_type = 1
|
item.article_type = 1
|
||||||
item.image_url = '../../../static/yibiaobans.png'
|
item.image_url = '../../../static/yibiaobans.png'
|
||||||
if(item.nickName) {
|
if(item.nickName) {
|
||||||
@ -124,11 +124,11 @@
|
|||||||
if(item.time)
|
if(item.time)
|
||||||
item.rightText = formatHistoryDate(item.time)
|
item.rightText = formatHistoryDate(item.time)
|
||||||
})
|
})
|
||||||
activeTab.lastTime = datas[datas.length - 1].time
|
activeTab.lastTime = data[data.length - 1].time
|
||||||
if(replace) {
|
if(replace) {
|
||||||
activeTab.data = datas
|
activeTab.data = data
|
||||||
}else {
|
}else {
|
||||||
activeTab.data = activeTab.data.concat(datas)
|
activeTab.data = activeTab.data.concat(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user