...
|
...
|
@@ -42,12 +42,12 @@ const titleMap = { |
|
|
action: ''
|
|
|
},
|
|
|
title: {
|
|
|
des: '标题3',
|
|
|
des: 'BLK',
|
|
|
action: ''
|
|
|
},
|
|
|
right: {
|
|
|
des: '提交',
|
|
|
action: ''
|
|
|
action: 'submitForm'
|
|
|
}
|
|
|
},
|
|
|
4: {
|
...
|
...
|
@@ -67,16 +67,16 @@ const titleMap = { |
|
|
action: ''
|
|
|
},
|
|
|
ltitle: {
|
|
|
des: '商品5',
|
|
|
action: ''
|
|
|
des: '商品',
|
|
|
action: origin + '/favorite'
|
|
|
},
|
|
|
rtitle: {
|
|
|
des: '品牌5',
|
|
|
action: ''
|
|
|
des: '品牌',
|
|
|
action: origin + '/favorite?tab=brand'
|
|
|
},
|
|
|
right: {
|
|
|
des: '编辑5',
|
|
|
action: ''
|
|
|
des: '编辑',
|
|
|
action: 'editModel'
|
|
|
}
|
|
|
},
|
|
|
6: {
|
...
|
...
|
@@ -92,20 +92,15 @@ const matchHeader = (url) => { |
|
|
let header = {
|
|
|
headerid: '-1' // 默认不显示头部
|
|
|
};
|
|
|
let path = url.split('?')[0];
|
|
|
|
|
|
if (/\/brands/.test(url) || /\/cate/.test(url)) {
|
|
|
header = titleMap[2];
|
|
|
alert(JSON.stringify(header));
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/mydetails/.test(url)) {
|
|
|
if (/\/home\/mydetails$/.test(path)) {
|
|
|
header = titleMap[1];
|
|
|
header.title.des = '个人信息';
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/orders/.test(url)) {
|
|
|
if (/\/home\/orders$/.test(path)) {
|
|
|
let des = '';
|
|
|
let u = url.split('?')[1];
|
|
|
|
...
|
...
|
@@ -124,55 +119,38 @@ const matchHeader = (url) => { |
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/order-detail/.test(url)) {
|
|
|
if (/\/home\/order-detail$/.test(path)) {
|
|
|
header = titleMap[2];
|
|
|
header.title.des = '订单详情';
|
|
|
header.title.right.action = origin + '/home/service';
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/refund\/orders/.test(url)) {
|
|
|
if (/\/home\/refund\/orders$/.test(path)) {
|
|
|
header = titleMap[1];
|
|
|
header.title.des = '退/换货';
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/favorite/.test(url)) {
|
|
|
header = titleMap[5];
|
|
|
header.ltitle = {
|
|
|
des: '商品',
|
|
|
action: origin + '/home/favorite'
|
|
|
};
|
|
|
header.rtitle = {
|
|
|
des: '品牌',
|
|
|
action: origin + '/home/favorite?tab=brand'
|
|
|
};
|
|
|
header.right = {
|
|
|
des: '编辑',
|
|
|
action: 'editModel'
|
|
|
};
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/mycurrency/.test(url)) {
|
|
|
if (/\/home\/mycurrency$/.test(path)) {
|
|
|
header = titleMap[1];
|
|
|
header.title.des = '有货币';
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/help$/.test(url)) {
|
|
|
if (/\/home\/help$/.test(path)) {
|
|
|
header = titleMap[1];
|
|
|
header.title.des = '帮助中心';
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/service$/.test(url)) {
|
|
|
if (/\/home\/service$/.test(path)) {
|
|
|
header = titleMap[1];
|
|
|
header.title.des = 'Yoho!Blk在线客服';
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/feedback/.test(url)) {
|
|
|
if (/\/home\/feedback$/.test(path)) {
|
|
|
header = titleMap[3];
|
|
|
header.title.des = '意见反馈';
|
|
|
header.right = {
|
...
|
...
|
@@ -182,7 +160,7 @@ const matchHeader = (url) => { |
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/about/.test(url)) {
|
|
|
if (/\/home\/about$/.test(path)) {
|
|
|
header = titleMap[1];
|
|
|
header.title.des = '关于';
|
|
|
return header;
|
...
|
...
|
@@ -194,16 +172,30 @@ const matchHeader = (url) => { |
|
|
|
|
|
module.exports = (url) => {
|
|
|
if (yoho.isApp) {
|
|
|
// 品牌 品类
|
|
|
// if (/\/brands/.test(url) || /\/cate/.test(url)) {
|
|
|
// return yoho.goTab({index: 1});
|
|
|
// }
|
|
|
let path = url.split('?')[0];
|
|
|
|
|
|
// 个人中心收藏
|
|
|
if (/\/home\/favorite$/.test(path)) {
|
|
|
return yoho.goPageView({
|
|
|
header: titleMap[5]
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 个人中心首页
|
|
|
if (/\/home$/.test(url)) {
|
|
|
if (/\/home$/.test(path)) {
|
|
|
return yoho.goTab({index: 4});
|
|
|
}
|
|
|
|
|
|
// 资讯
|
|
|
if (/\/news$/.test(path)) {
|
|
|
return yoho.goTab({index: 3});
|
|
|
}
|
|
|
|
|
|
// 品牌 品类
|
|
|
if (/\/brands$/.test(path) || /\/cate$/.test(path)) {
|
|
|
return yoho.goTab({index: 1});
|
|
|
}
|
|
|
|
|
|
yoho.goNewPage({
|
|
|
header: matchHeader(url),
|
|
|
url: /^(https?:)?\/\//i.test(url) ? url : origin + url
|
...
|
...
|
|