1 小程序调用h5
<template>
<view>
<web-view :src="webViewUrl"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
webViewUrl: ''
}
},
onLoad(options) {
this.webViewUrl =
`http://localhost:8080/#/diaoyong&sex=${options.sex}&id=${uni.getStorageSync('id')}`;
}
}
</script>
2 h5 调用 uni小程序(diaoyong.vue)
created() {
this.sex = this.$route.query.sex;
this.id= this.$route.query.id;
},
methods:{
diaoyong(){
// 返回上一页面
uni.navigateBack({
delate: 1 返回的页面数
});
}
}