小程序跳转PC
parent
97ab8e6518
commit
4d0b9210e8
|
@ -49,7 +49,7 @@
|
|||
onLoad(option) {
|
||||
if(option.userid){
|
||||
this.userid = option.userid
|
||||
console.log(this.userid);
|
||||
// console.log(this.userid);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -70,7 +70,7 @@
|
|||
})
|
||||
}
|
||||
if (this.newPassword == this.confirmNewPassword) {
|
||||
console.log(this.userid,this.oldPassword,this.newPassword);
|
||||
// console.log(this.userid,this.oldPassword,this.newPassword);
|
||||
this.$http({
|
||||
url: this.api.user_update_pwd,
|
||||
method: 'put',
|
||||
|
@ -80,7 +80,7 @@
|
|||
"password": this.newPassword
|
||||
}
|
||||
}).then(res=>{
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
if(res.code == 200){
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
|
|
|
@ -142,7 +142,7 @@
|
|||
</view>
|
||||
次施肥
|
||||
</view>
|
||||
<view class="changeMoreBtn" @click="toWebView">
|
||||
<view class="changeMoreBtn" @click="toWebView(indexs)">
|
||||
<image src="../../static/changeMore.png" mode=""></image>
|
||||
<text>修改更多参数</text>
|
||||
</view>
|
||||
|
@ -250,9 +250,10 @@
|
|||
this.getReg();
|
||||
},
|
||||
methods: {
|
||||
toWebView() {
|
||||
toWebView(id) {
|
||||
// console.log(id);
|
||||
uni.navigateTo({
|
||||
url: '/pages/web_view/web_view'
|
||||
url: '/pages/web_view/web_view?id=' + id
|
||||
})
|
||||
},
|
||||
countData10(data) {
|
||||
|
@ -310,7 +311,7 @@
|
|||
url: this.api.readFs_reg,
|
||||
data: data
|
||||
}).then((res) => {
|
||||
console.log(res, 11);
|
||||
// console.log(res, 11);
|
||||
if (res.code == 200) {
|
||||
uni.hideLoading()
|
||||
uni.stopPullDownRefresh();
|
||||
|
@ -318,7 +319,7 @@
|
|||
this.getType00();
|
||||
this.inputData1[10 + (this.indexs - 1) + '01'] = this.countData10(this.inputData1[10 + (
|
||||
this.indexs - 1) + '01'])
|
||||
console.log(this.inputData1[10 + (this.indexs - 1) + '01'], 111);
|
||||
// console.log(this.inputData1[10 + (this.indexs - 1) + '01'], 111);
|
||||
} else {
|
||||
that.$refs.uToast.show({
|
||||
title: res.msg,
|
||||
|
@ -332,7 +333,7 @@
|
|||
},
|
||||
getType00() {
|
||||
var number = this.padString(this.inputData1[10 + (this.indexs - 1) + "00"].toString(2), 3)
|
||||
console.log(number);
|
||||
// console.log(number);
|
||||
if (Number(number[0])) {
|
||||
this.topActive = 1
|
||||
} else if (Number(number[1])) {
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
url: this.api.sel_eqbyid + userid,
|
||||
method: 'GET'
|
||||
}).then(res => {
|
||||
console.log(res, '根据用户id查询对应的设备数据');
|
||||
// console.log(res, '根据用户id查询对应的设备数据');
|
||||
if (res.code == 200) {
|
||||
this.deviceList=res.data
|
||||
}
|
||||
|
|
|
@ -326,7 +326,7 @@
|
|||
url: this.api.getFs_rtdata + "?equipmentId=" + i.deviceId,
|
||||
method: 'post',
|
||||
}).then(res => {
|
||||
console.log(res, '主页查看施肥机实时数据');
|
||||
// console.log(res, '主页查看施肥机实时数据');
|
||||
if(res.code == 200){
|
||||
uni.hideLoading({
|
||||
title: '完成'
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
url: this.api.user_logout,
|
||||
method: 'GET'
|
||||
}).then(res => {
|
||||
console.log(res, '退出');
|
||||
// console.log(res, '退出');
|
||||
if (res.code == 200) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
|
@ -168,7 +168,7 @@
|
|||
uni.getStorage({
|
||||
key: 'userid',
|
||||
success: function(res) {
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
that.$http({
|
||||
url: that.api.sel_user,
|
||||
method: 'GET',
|
||||
|
@ -176,7 +176,7 @@
|
|||
userId: res.data
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
if (res.code == 200) {
|
||||
that.userName = res.data.username;
|
||||
that.admin = that.user_level(res.data.userType);
|
||||
|
|
|
@ -1,13 +1,47 @@
|
|||
<template>
|
||||
<web-view src="https://portal.lihe-control.com/#/realTime"></web-view>
|
||||
<web-view v-if='src' :src="src"></web-view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
token:'',
|
||||
id:'',
|
||||
src:'',
|
||||
userid:''
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
// console.log('options',options);
|
||||
if(options){
|
||||
this.id = options.id
|
||||
}
|
||||
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
|
||||
that.src = `https://portal.lihe-control.com/#/irrigateSet?id=${that.id}&token=${that.token}&userid=${that.userid}`
|
||||
// console.log(that.src);
|
||||
}
|
||||
})
|
||||
},
|
||||
fail:function(err){
|
||||
uni.navigateTo({
|
||||
url:'/pages/fertilizer_machine/fertilizer_machine'
|
||||
});
|
||||
uni.showToast({
|
||||
title: "跳转失败!",
|
||||
icon: 'fail',
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -214,9 +214,10 @@ var _default = {
|
|||
onLoad: function onLoad(option) {
|
||||
if (option.userid) {
|
||||
this.userid = option.userid;
|
||||
console.log(this.userid);
|
||||
// console.log(this.userid);
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 密码提交
|
||||
submit_pwd: function submit_pwd() {
|
||||
|
@ -235,7 +236,7 @@ var _default = {
|
|||
});
|
||||
}
|
||||
if (this.newPassword == this.confirmNewPassword) {
|
||||
console.log(this.userid, this.oldPassword, this.newPassword);
|
||||
// console.log(this.userid,this.oldPassword,this.newPassword);
|
||||
this.$http({
|
||||
url: this.api.user_update_pwd,
|
||||
method: 'put',
|
||||
|
@ -245,7 +246,7 @@ var _default = {
|
|||
"password": this.newPassword
|
||||
}
|
||||
}).then(function (res) {
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
|
|
|
@ -439,9 +439,10 @@ var _default = {
|
|||
this.getReg();
|
||||
},
|
||||
methods: (_methods = {
|
||||
toWebView: function toWebView() {
|
||||
toWebView: function toWebView(id) {
|
||||
// console.log(id);
|
||||
uni.navigateTo({
|
||||
url: '/pages/web_view/web_view'
|
||||
url: '/pages/web_view/web_view?id=' + id
|
||||
});
|
||||
},
|
||||
countData10: function countData10(data) {
|
||||
|
@ -500,14 +501,14 @@ var _default = {
|
|||
url: this.api.readFs_reg,
|
||||
data: data
|
||||
}).then(function (res) {
|
||||
console.log(res, 11);
|
||||
// console.log(res, 11);
|
||||
if (res.code == 200) {
|
||||
uni.hideLoading();
|
||||
uni.stopPullDownRefresh();
|
||||
_this2.inputData1 = res.data;
|
||||
_this2.getType00();
|
||||
_this2.inputData1[10 + (_this2.indexs - 1) + '01'] = _this2.countData10(_this2.inputData1[10 + (_this2.indexs - 1) + '01']);
|
||||
console.log(_this2.inputData1[10 + (_this2.indexs - 1) + '01'], 111);
|
||||
// console.log(this.inputData1[10 + (this.indexs - 1) + '01'], 111);
|
||||
} else {
|
||||
that.$refs.uToast.show({
|
||||
title: res.msg,
|
||||
|
@ -521,7 +522,7 @@ var _default = {
|
|||
},
|
||||
getType00: function getType00() {
|
||||
var number = this.padString(this.inputData1[10 + (this.indexs - 1) + "00"].toString(2), 3);
|
||||
console.log(number);
|
||||
// console.log(number);
|
||||
if (Number(number[0])) {
|
||||
this.topActive = 1;
|
||||
} else if (Number(number[1])) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -224,7 +224,7 @@ var _default = {
|
|||
url: this.api.sel_eqbyid + userid,
|
||||
method: 'GET'
|
||||
}).then(function (res) {
|
||||
console.log(res, '根据用户id查询对应的设备数据');
|
||||
// console.log(res, '根据用户id查询对应的设备数据');
|
||||
if (res.code == 200) {
|
||||
_this.deviceList = res.data;
|
||||
}
|
||||
|
|
|
@ -772,7 +772,7 @@ var _default = {
|
|||
url: _this.api.getFs_rtdata + "?equipmentId=" + i.deviceId,
|
||||
method: 'post'
|
||||
}).then(function (res) {
|
||||
console.log(res, '主页查看施肥机实时数据');
|
||||
// console.log(res, '主页查看施肥机实时数据');
|
||||
if (res.code == 200) {
|
||||
uni.hideLoading({
|
||||
title: '完成'
|
||||
|
|
|
@ -138,7 +138,7 @@ var _default = {
|
|||
url: this.api.user_logout,
|
||||
method: 'GET'
|
||||
}).then(function (res) {
|
||||
console.log(res, '退出');
|
||||
// console.log(res, '退出');
|
||||
if (res.code == 200) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
|
@ -193,7 +193,7 @@ var _default = {
|
|||
uni.getStorage({
|
||||
key: 'userid',
|
||||
success: function success(res) {
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
that.$http({
|
||||
url: that.api.sel_user,
|
||||
method: 'GET',
|
||||
|
@ -201,7 +201,7 @@ var _default = {
|
|||
userId: res.data
|
||||
}
|
||||
}).then(function (res) {
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
if (res.code == 200) {
|
||||
that.userName = res.data.username;
|
||||
that.admin = that.user_level(res.data.userType);
|
||||
|
|
|
@ -133,7 +133,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
/* WEBPACK VAR INJECTION */(function(uni) {
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
|
@ -145,10 +145,48 @@ exports.default = void 0;
|
|||
//
|
||||
var _default = {
|
||||
data: function data() {
|
||||
return {};
|
||||
return {
|
||||
token: '',
|
||||
id: '',
|
||||
src: '',
|
||||
userid: ''
|
||||
};
|
||||
},
|
||||
onLoad: function onLoad(options) {
|
||||
// console.log('options',options);
|
||||
if (options) {
|
||||
this.id = options.id;
|
||||
}
|
||||
var that = this;
|
||||
uni.getStorage({
|
||||
key: 'token',
|
||||
success: function success(res) {
|
||||
// console.log('res',res);
|
||||
that.token = res.data;
|
||||
uni.getStorage({
|
||||
key: 'userid',
|
||||
success: function success(res) {
|
||||
that.userid = res.data;
|
||||
that.src = "https://portal.lihe-control.com/#/irrigateSet?id=".concat(that.id, "&token=").concat(that.token, "&userid=").concat(that.userid);
|
||||
// console.log(that.src);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
fail: function fail(err) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/fertilizer_machine/fertilizer_machine'
|
||||
});
|
||||
uni.showToast({
|
||||
title: "跳转失败!",
|
||||
icon: 'fail'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
||||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
|
||||
|
||||
/***/ })
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
<web-view src="https://portal.lihe-control.com/#/realTime"></web-view>
|
||||
<block wx:if="{{src}}"><web-view src="{{src}}"></web-view></block>
|
Loading…
Reference in New Issue