wszhyWx/pages/web_view_controller/web_view_controller.vue

50 lines
922 B
Vue
Raw Permalink Normal View History

2023-11-24 02:13:41 +00:00
<template>
<web-view v-if='src' :src="src"></web-view>
</template>
<script>
export default {
data() {
return {
token:'',
deviceId:'',
src:'',
userid:'',
url:''
};
},
onLoad(options) {
let that = this
uni.getStorage({
key: 'token',
success: function(res) {
// console.log('res',res);
that.token = res.data;
uni.getStorage({
key:'userid',
success:function(res){
that.userid = res.data
2023-12-28 09:17:50 +00:00
that.src = `https://portal.lihe-control.com/#/${options.url}?token=${that.token}&userid=${that.userid}&deviceId=${options.deviceId}`+ (options.num ? '&id=' + options.num : '')
2023-11-24 02:13:41 +00:00
console.log(that.src);
}
})
},
fail:function(err){
uni.navigateTo({
url:'/pages/controller/controller'
});
uni.showToast({
title: "跳转失败!",
icon: 'fail',
})
}
})
}
}
</script>
<style lang="scss">
</style>