Commit 09cd0288 authored by leon's avatar leon

feat: normal title add jump

parent 7bd2aa5c
......@@ -25,6 +25,16 @@
methods: {
onClick(url) {
if (url != '') {
const num = url.indexOf('?')
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)
})
......@@ -32,6 +42,7 @@
}
}
}
}
</script>
<style lang="scss" scoped>
......
......@@ -106,7 +106,6 @@
this.pageSize = option.pageSize
//如果是最后一个元素,需要提前加载后面列表数据
if (this.indexs == this.idList.length-1) {
console.log("xiayiye")
this.getReportIdList()
}
this.getReportCharts()
......
......@@ -98,6 +98,27 @@ const install = (Vue, vm) => {
}
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 = {
converFunction,
......@@ -106,7 +127,8 @@ const install = (Vue, vm) => {
dateFormat,
pxToRpx,
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