Commit 09cd0288 authored by leon's avatar leon

feat: normal title add jump

parent 7bd2aa5c
...@@ -25,9 +25,20 @@ ...@@ -25,9 +25,20 @@
methods: { methods: {
onClick(url) { onClick(url) {
if (url != '') { if (url != '') {
uni.navigateTo({ const num = url.indexOf('?')
url:'../../pages/webView/webView?url=' + encodeURIComponent(url) const path = url.substr(0, num)
}) const query = this.$u.common.getQueryFromString(url)
// 当url里面的路径包含viewer且query里面有id字段
if(path.indexOf('viewer') != -1 && Object.keys(query).includes('id')) {
const likeUrl = "../../pages/details/details?id=" + query.id + "&idList=" + [query.id] +"&pageSize=" + '1'
uni.navigateTo({
url: likeUrl
})
} else {
uni.navigateTo({
url:'../../pages/webView/webView?url=' + encodeURIComponent(url)
})
}
} }
} }
} }
......
...@@ -106,7 +106,6 @@ ...@@ -106,7 +106,6 @@
this.pageSize = option.pageSize this.pageSize = option.pageSize
//如果是最后一个元素,需要提前加载后面列表数据 //如果是最后一个元素,需要提前加载后面列表数据
if (this.indexs == this.idList.length-1) { if (this.indexs == this.idList.length-1) {
console.log("xiayiye")
this.getReportIdList() this.getReportIdList()
} }
this.getReportCharts() this.getReportCharts()
......
...@@ -98,6 +98,27 @@ const install = (Vue, vm) => { ...@@ -98,6 +98,27 @@ const install = (Vue, vm) => {
} }
return result return result
} }
/**
* 从string中提取参数
*/
const getQueryFromString = (string) => {
const num = string.indexOf("?")
const qs = string.substr(num+1) // 获取url中"?"符后的字串
let args = {} // 保存参数数据的对象
const items = qs.length ? qs.split("&") : [] // 取得每一个参数项,
let item = null
const len = items.length;
for(var i = 0; i < len; i++) {
item = items[i].split("=");
var name = decodeURIComponent(item[0]),
value = decodeURIComponent(item[1]);
if(name) {
args[name] = value;
}
}
return args;
}
vm.$u.common = { vm.$u.common = {
converFunction, converFunction,
...@@ -106,7 +127,8 @@ const install = (Vue, vm) => { ...@@ -106,7 +127,8 @@ const install = (Vue, vm) => {
dateFormat, dateFormat,
pxToRpx, pxToRpx,
rpxToPx, rpxToPx,
chunk chunk,
getQueryFromString
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment