fix: 移动端拼写错误

This commit is contained in:
fit2cloud-chenyw 2022-10-24 14:59:32 +08:00
parent 1e5cd254f8
commit cd1f4f1de1
4 changed files with 16 additions and 16 deletions

View File

@ -58,7 +58,7 @@ const util = {
/**
* 关键字颜色变化
*/
serachNmme(val, name) {
searchNmme(val, name) {
let namestr = new RegExp(val);
let nameresult =
`<div style="font-size: 14px;color: #333;line-height: 1.5;">
@ -94,7 +94,7 @@ const util = {
dataHandle(item, val) {
// 改变字体颜色
if (val) {
item.nameNodes = util.serachNmme(val, item.name);
item.nameNodes = util.searchNmme(val, item.name);
} else {
item.nameNodes = `<div style="font-size: 14px;color: #333;line-height: 1.5;">${item.name}</div>`;
@ -130,9 +130,9 @@ const util = {
setHistory(val) {
let searchHistory = uni.getStorageSync('search:history');
if (!searchHistory) searchHistory = [];
let serachData = {};
let searchData = {};
if (typeof(val) === 'string') {
serachData = {
searchData = {
adcode: [],
address: [],
city: [],
@ -143,18 +143,18 @@ const util = {
typecode: []
};
} else {
serachData = val
searchData = val
}
// 判断数组是否存在,如果存在,那么将放到最前面
for (var i = 0; i < searchHistory.length; i++) {
if (searchHistory[i].name === serachData.name) {
if (searchHistory[i].name === searchData.name) {
searchHistory.splice(i, 1);
break;
}
}
searchHistory.unshift(util.dataHandle(serachData));
searchHistory.unshift(util.dataHandle(searchData));
uni.setStorage({
key: 'search:history',
data: searchHistory,

View File

@ -25,7 +25,7 @@
* @tutorial https://ext.dcloud.net.cn/plugin?id=1182
* @property {String} href 点击后打开的外部网页url
* @property {String} text 显示的文字
* @property {String} downlaod H5平台下载文件名
* @property {String} download H5平台下载文件名
* @property {Boolean} showUnderLine 是否显示下划线
* @property {String} copyTips 在小程序端复制链接时显示的提示语
* @property {String} color 链接文字颜色

View File

@ -116,7 +116,7 @@
index: 1
})
this.loadStarStatus()
this.caclViewHeight()
this.calcViewHeight()
},
@ -194,7 +194,7 @@
})
},
caclViewHeight() {
calcViewHeight() {
let systemInfo = uni.getSystemInfoSync()
const h5Height = systemInfo.windowHeight - systemInfo.statusBarHeight
if(systemInfo.navigationBarHeight) {

View File

@ -113,9 +113,9 @@
}
requestHome({type: index, lastTime: activeTab.lastTime}).then(res => {
var datas = res.data.listObject
if(datas.length > 0) {
datas.forEach(item => {
var data = res.data.listObject
if(data.length > 0) {
data.forEach(item => {
item.article_type = 1
item.image_url = '../../../static/yibiaobans.png'
if(item.nickName) {
@ -124,11 +124,11 @@
if(item.time)
item.rightText = formatHistoryDate(item.time)
})
activeTab.lastTime = datas[datas.length - 1].time
activeTab.lastTime = data[data.length - 1].time
if(replace) {
activeTab.data = datas
activeTab.data = data
}else {
activeTab.data = activeTab.data.concat(datas)
activeTab.data = activeTab.data.concat(data)
}
}