...
|
...
|
@@ -19,7 +19,7 @@ const titleMap = { |
|
|
action: ''
|
|
|
},
|
|
|
title: {
|
|
|
des: '标题1',
|
|
|
des: 'BLK',
|
|
|
action: ''
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -29,11 +29,11 @@ const titleMap = { |
|
|
action: ''
|
|
|
},
|
|
|
title: {
|
|
|
des: '标题2',
|
|
|
des: 'BLK',
|
|
|
action: ''
|
|
|
},
|
|
|
right: {
|
|
|
action: ''
|
|
|
action: origin + '/home'
|
|
|
}
|
|
|
},
|
|
|
3: {
|
...
|
...
|
@@ -93,28 +93,23 @@ const matchHeader = (url) => { |
|
|
headerid: '-1' // 默认不显示头部
|
|
|
};
|
|
|
|
|
|
if (/\/product\/new/.test(url)) {
|
|
|
header = titleMap[1];
|
|
|
|
|
|
// header.xxx = '111';// 匹配到头类型以后,可修改里边的内容
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/brands/.test(url) || /\/cate/.test(url)) {
|
|
|
header = titleMap[4];
|
|
|
header = titleMap[2];
|
|
|
alert(JSON.stringify(header));
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/mydetails$/.test(url)) {
|
|
|
if (/\/home\/mydetails/.test(url)) {
|
|
|
header = titleMap[1];
|
|
|
header.title.des = '个人信息';
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/orders/.test(url)) {
|
|
|
var des = '',
|
|
|
u = url.split('?')[1],
|
|
|
u = parse(u);
|
|
|
let des = '';
|
|
|
let u = url.split('?')[1];
|
|
|
|
|
|
u = parse(u);
|
|
|
|
|
|
if (u.type === '1') {
|
|
|
des = '我的订单';
|
...
|
...
|
@@ -141,15 +136,15 @@ const matchHeader = (url) => { |
|
|
header.ltitle = {
|
|
|
des: '商品',
|
|
|
action: origin + '/home/favorite'
|
|
|
}
|
|
|
};
|
|
|
header.rtitle = {
|
|
|
des: '品牌',
|
|
|
action: origin + '/home/favorite?tab=brand'
|
|
|
}
|
|
|
};
|
|
|
header.right = {
|
|
|
des: '编辑',
|
|
|
action: 'editModel'
|
|
|
}
|
|
|
};
|
|
|
return header;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -177,7 +172,7 @@ const matchHeader = (url) => { |
|
|
header.right = {
|
|
|
des: '提交',
|
|
|
action: 'saveFeedback'
|
|
|
}
|
|
|
};
|
|
|
return header;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -193,13 +188,20 @@ const matchHeader = (url) => { |
|
|
|
|
|
module.exports = (url) => {
|
|
|
if (yoho.isApp) {
|
|
|
let data = {
|
|
|
// 品牌 品类
|
|
|
// if (/\/brands/.test(url) || /\/cate/.test(url)) {
|
|
|
// return yoho.goTab({index: 1});
|
|
|
// }
|
|
|
|
|
|
// 个人中心首页
|
|
|
if (/\/home$/.test(url)) {
|
|
|
return yoho.goTab({index: 4});
|
|
|
}
|
|
|
|
|
|
yoho.goNewPage({
|
|
|
header: matchHeader(url),
|
|
|
url: /^(https?:)?\/\//i.test(url) ? url : origin + url
|
|
|
};
|
|
|
|
|
|
// console.log(data);
|
|
|
yoho.goNewPage(data);
|
|
|
});
|
|
|
} else {
|
|
|
location.href = url;
|
|
|
}
|
...
|
...
|
|