Commit 9a136742 authored by 肖健's avatar 肖健

轮播图没有链接不跳转

parent 6883092b
...@@ -252,17 +252,19 @@ ...@@ -252,17 +252,19 @@
goOtherLink(index) { goOtherLink(index) {
let item = this.list5[index] let item = this.list5[index]
let link = item.link; let link = item.link;
var newStr = link.indexOf("http"); if(link) {
var newStr2 = link.indexOf("https"); var newStr = link.indexOf("http");
if (newStr == 0 || newStr2 == 0) { var newStr2 = link.indexOf("https");
if (newStr == 0 || newStr2 == 0) {
uni.navigateTo({
url: '/pages/webview/webview?url=' + link
})
return
}
uni.navigateTo({ uni.navigateTo({
url: '/pages/webview/webview?url=' + link url: link
}) })
return
} }
uni.navigateTo({
url: link
})
}, },
// 获取爱车列表 // 获取爱车列表
getCarList(){ getCarList(){
......
...@@ -249,17 +249,19 @@ ...@@ -249,17 +249,19 @@
goOtherLink(index) { goOtherLink(index) {
let item = this.list5[index] let item = this.list5[index]
let link = item.link; let link = item.link;
var newStr = link.indexOf("http"); if(link) {
var newStr2 = link.indexOf("https"); var newStr = link.indexOf("http");
if (newStr == 0 || newStr2 == 0) { var newStr2 = link.indexOf("https");
if (newStr == 0 || newStr2 == 0) {
uni.navigateTo({
url: '/pages/webview/webview?url=' + link
})
return
}
uni.navigateTo({ uni.navigateTo({
url: '/pages/webview/webview?url=' + link url: link
}) })
return
} }
uni.navigateTo({
url: link
})
}, },
// 获取爱车列表 // 获取爱车列表
getCarList(){ getCarList(){
......
...@@ -249,17 +249,19 @@ export default { ...@@ -249,17 +249,19 @@ export default {
goOtherLink(index){ goOtherLink(index){
let item = this.list3[index] let item = this.list3[index]
let link = item.link; let link = item.link;
var newStr = link.indexOf("http"); if(link) {
var newStr2 = link.indexOf("https"); var newStr = link.indexOf("http");
if (newStr == 0 || newStr2 == 0) { var newStr2 = link.indexOf("https");
if (newStr == 0 || newStr2 == 0) {
uni.navigateTo({
url: '/pages/webview/webview?url=' + link
})
return
}
uni.navigateTo({ uni.navigateTo({
url: '/pages/webview/webview?url=' + link url: link
}) })
return }
}
uni.navigateTo({
url: link
})
} }
}, },
onReady: function () { onReady: function () {
......
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