支持跳转插件

This commit is contained in:
wuxw 2024-03-24 16:52:43 +08:00
parent 8735f30ff1
commit 4a7d0e6e19
4 changed files with 54 additions and 75 deletions

View File

@ -209,28 +209,7 @@
},
_navJumpToIot: function () {
//获取用户名
let param = {
params:{
targetUrl: '/',
communityId:vc.getCurrentCommunity().communityId
}
};
//发送get请求
vc.http.apiGet('/iot.getIotToken',
param,
function (json, res) {
let _json = JSON.parse(json);
if (_json.code != 0) {
vc.toast(_json.msg);
return;
}
let _url = _json.data.url;
window.open(_url);
},
function () {
console.log('请求失败处理');
}
);
vc.jumpToIot('/');
},
_emitMsg: function (_param) {
vm._settingActiveCatalog(_param);

View File

@ -136,32 +136,7 @@
vc.jumpToPage('/#/pages/property/parkingAreaText?paId=' + _parkingArea.paId)
},
_openParkingAreaTotalControl: function (_parkingArea) {
//获取用户名
let param = {
params:{
targetUrl: encodeURIComponent('/#/pages/car/parkingAreaTotalControl?paId=' + _parkingArea.paId),
communityId:vc.getCurrentCommunity().communityId
}
};
//发送get请求
vc.http.apiGet('/iot.getIotToken',
param,
function (json, res) {
let _json = JSON.parse(json);
if (_json.code != 0) {
vc.toast(_json.msg);
return;
}
let _url = _json.data.url;
window.open(_url);
},
function () {
console.log('请求失败处理');
}
);
//vc.jumpToPage('/#/pages/property/parkingAreaTotalControl?paId=' + _parkingArea.paId);
vc.jumpToIot('/#/pages/car/parkingAreaTotalControl?paId=' + _parkingArea.paId);
}
}
});

View File

@ -91,32 +91,7 @@
vc.jumpToPage('/#/pages/property/parkingBoxAreaManage?boxId=' + _parkingBox.boxId + "&boxName=" + _parkingBox.boxName);
},
_openParkingAreaControl: function (_parkingBox) {
//vc.jumpToPage('/#/pages/property/parkingAreaControl?boxId=' + _parkingBox.boxId + "&paId=" + _parkingBox.paId);
//获取用户名
let param = {
params:{
targetUrl: encodeURIComponent('/#/pages/car/parkingAreaControl?boxId=' + _parkingBox.boxId + "&paId=" + _parkingBox.paId),
communityId:vc.getCurrentCommunity().communityId
}
};
//发送get请求
vc.http.apiGet('/iot.getIotToken',
param,
function (json, res) {
let _json = JSON.parse(json);
if (_json.code != 0) {
vc.toast(_json.msg);
return;
}
let _url = _json.data.url;
window.open(_url);
},
function () {
console.log('请求失败处理');
}
);
vc.jumpToIot('/#/pages/property/parkingAreaControl?boxId=' + _parkingBox.boxId + "&paId=" + _parkingBox.paId);
}
}
});

View File

@ -1301,7 +1301,6 @@
//绑定跳转函数
vcFramework.jumpToPage = function (url) {
//判断 url 的模板是否 和当前url 模板一个
console.log('jumpToPage', url);
if (url.indexOf('#') < 0) {
window.location.href = url;
return;
@ -1320,6 +1319,57 @@
//vcFramework.reBuilderVcTree();
};
//跳转至物联网
vcFramework.jumpToIot = function (url) {
let param = {
params:{
targetUrl: encodeURIComponent(url),
communityId:vc.getCurrentCommunity().communityId
}
};
//发送get请求
vc.http.apiGet('/iot.getIotToken',
param,
function (json, res) {
let _json = JSON.parse(json);
if (_json.code != 0) {
vc.toast(_json.msg);
return;
}
let _url = _json.data.url;
window.open(_url);
},
function () {
console.log('请求失败处理');
}
);
};
//跳转至物联网
vcFramework.jumpToPlugin = function (url) {
let param = {
params:{
targetUrl: encodeURIComponent(url),
communityId:vc.getCurrentCommunity().communityId
}
};
//发送get请求
vc.http.apiGet('/plugin.getPluginToken',
param,
function (json, res) {
let _json = JSON.parse(json);
if (_json.code != 0) {
vc.toast(_json.msg);
return;
}
let _url = _json.data.url;
window.open(_url);
},
function () {
console.log('请求失败处理');
}
);
};
refreshVcFramework = function () {
$that.$destroy();
let _vmOptions = {