2023-10-07 01:49:48 +00:00
|
|
|
<template>
|
2023-10-08 07:37:17 +00:00
|
|
|
<web-view v-if='src' :src="src"></web-view>
|
2023-10-07 01:49:48 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
2023-10-08 07:37:17 +00:00
|
|
|
token:'',
|
|
|
|
id:'',
|
|
|
|
src:'',
|
2024-03-12 07:17:57 +00:00
|
|
|
userid:'',
|
|
|
|
deviceId:''
|
2023-10-07 01:49:48 +00:00
|
|
|
};
|
2023-10-08 07:37:17 +00:00
|
|
|
},
|
|
|
|
onLoad(options) {
|
|
|
|
// console.log('options',options);
|
|
|
|
if(options){
|
2024-03-12 07:17:57 +00:00
|
|
|
this.id = options.id;
|
|
|
|
this.deviceId = options.deviceId
|
2023-10-08 07:37:17 +00:00
|
|
|
}
|
|
|
|
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
|
2024-03-12 07:17:57 +00:00
|
|
|
that.src = `https://portal.lihe-control.com/#/irrigateSet?id=${that.id}&token=${that.token}&userid=${that.userid}&deviceId=${that.deviceId}`
|
2023-10-08 07:37:17 +00:00
|
|
|
// console.log(that.src);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
fail:function(err){
|
|
|
|
uni.navigateTo({
|
|
|
|
url:'/pages/fertilizer_machine/fertilizer_machine'
|
|
|
|
});
|
|
|
|
uni.showToast({
|
|
|
|
title: "跳转失败!",
|
|
|
|
icon: 'fail',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2023-10-07 01:49:48 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
|
|
</style>
|