|
@ -12,6 +12,7 @@ var docInfo = window.localStorage.getItem("docInfo");
|
|
|
docInfo = JSON.parse(docInfo);
|
|
|
|
|
|
var fromTabIdx = request.fromTabIdx; // 记录前一个Tab索引,用于返回按钮
|
|
|
var reqLinkList = []; //记录切换tab时访问的路径集合,方便返回操作时,不修改之前请求路径的参数
|
|
|
|
|
|
//初始tab的链接
|
|
|
var links = [{
|
|
@ -27,7 +28,7 @@ var links = [{
|
|
|
name: '订单跟踪',
|
|
|
class: '',
|
|
|
},{
|
|
|
url: 'body-record.html?patiCode='+patiCode,
|
|
|
url: 'body-record.html?from=tab&patiCode='+patiCode,
|
|
|
name: '体征记录',
|
|
|
class: ''
|
|
|
},{
|
|
@ -95,7 +96,8 @@ function initPage(){
|
|
|
var html = template('tab_tmp', {list: links});
|
|
|
$("#tabs").append(html);
|
|
|
parent.document.getElementById('main').src = links[tab].url;
|
|
|
|
|
|
reqLinkList.push(links[tab].url);
|
|
|
|
|
|
$("#tabs").on('click', 'a', function(){
|
|
|
var $this = $(this),
|
|
|
$li = $this.parent();
|
|
@ -103,16 +105,26 @@ function initPage(){
|
|
|
$li.siblings().removeClass("active");
|
|
|
$li.addClass("active");
|
|
|
tab = $this.data('index');
|
|
|
parent.document.getElementById('main').src = links[tab].url+'&from=tab';
|
|
|
reqLinkList.push(links[tab].url+'&from=tab&fromTabIdx='+fromTabIdx);
|
|
|
var url = links[tab].url+'&from=tab&fromTabIdx='+fromTabIdx;
|
|
|
// parent.document.getElementById('main').src = url;
|
|
|
})
|
|
|
}
|
|
|
|
|
|
function toPrePrescriptionTab() {
|
|
|
if(fromTabIdx!=null && fromTabIdx != undefined) {
|
|
|
$("#tabs li").eq(fromTabIdx).find('a').trigger('click')
|
|
|
}else{
|
|
|
history.go(-1);
|
|
|
//页面返回的操作不做trigger操作
|
|
|
var oldUrl = reqLinkList.pop();
|
|
|
var fromTabIdx = oldUrl.split("fromTabIdx=")[1];
|
|
|
var length = reqLinkList.length;
|
|
|
if(length>0){
|
|
|
//应跳转去的页面是
|
|
|
// var url = reqLinkList[reqLinkList.length -1];
|
|
|
if(fromTabIdx){
|
|
|
$("#tabs li").removeClass("active");
|
|
|
$("#tabs li").eq(fromTabIdx).addClass("active");
|
|
|
}
|
|
|
}
|
|
|
history.go(-1);
|
|
|
}
|
|
|
|
|
|
top.toPrePrescriptionTab = toPrePrescriptionTab
|
|
@ -176,7 +188,7 @@ function updateLinkInfo(){
|
|
|
name: '订单跟踪',
|
|
|
class: '',
|
|
|
},{
|
|
|
url: 'body-record.html?patiCode='+patiCode,
|
|
|
url: 'body-record.html?from=tab&patiCode='+patiCode,
|
|
|
name: '体征记录',
|
|
|
class: ''
|
|
|
},{
|
|
@ -192,5 +204,4 @@ function updateLinkInfo(){
|
|
|
name: '历史续方',
|
|
|
class: ''
|
|
|
}];
|
|
|
console.log(links);
|
|
|
}
|