場(chǎng)景:點(diǎn)擊“積分列表”中的“積分兌換”,需要跳轉(zhuǎn)到三方的“積分商城”鏈接進(jìn)行兌換,兌換完成后,跳回小程序“積分列表”。
結(jié)論:無(wú)法離開小程序,跳轉(zhuǎn)到其他地址。只能通過(guò)web-view內(nèi)嵌的形式,將三方鏈接內(nèi)嵌進(jìn)小程序。文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-516578.html
參數(shù)傳遞方式:拼接到src上 ,<web-view src='https://aaa.com/index?參數(shù)a=XXXXX&參數(shù)b=XXXXX' / >文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-516578.html
積分列表頁(yè)面
<template>
<!-- 積分列表 -->
<view class="bg_wrap fs_28">
<text class="cor_9 fs_24">累計(jì)積分:{{info.total}}</text>
<text class="cor_9 fs_24">剩余積分:{{info.surplus}}</text>
<view class="green_btn_small" @click="go_thirdPart">去兌換</view>
</view>
</template>
<script>
export default {
data() {
return {
info: {
total: 12,
surplus: 1
}
}
},
methods: {
// 去兌換
go_thirdPart() {
uni.navigateTo({
url: `/subpkg/bonus/bonus_exchange?openid=${uni.getStorageSync('openid')}&surplus=${this.info.surplus}`
})
}?
}
}
</script>
積分兌換頁(yè)面
<template>
<!-- 積分兌換頁(yè)面 -->
<view class="bg_wrap fs_28">
<web-view
:src="`https://cy.jingxiniao.com/index/inlet.html?openid=${options.openid}&surplus=${options.surplus}`" />
</view>
</template>
<script>
export default {
data() {
return {
options: {}
}
},
onLoad(options) {
this.options = options
},
}
</script>
到了這里,關(guān)于uniapp 小程序 跳轉(zhuǎn)到外部鏈接的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!