...
|
...
|
@@ -3,8 +3,9 @@ |
|
|
* @return {[type]}
|
|
|
*/
|
|
|
const yoho = require('yoho');
|
|
|
const parse = require('yoho-qs/parse'); // 提供解析函数
|
|
|
|
|
|
const origin = 'http://m.yohoblk.com';
|
|
|
const origin = location.origin;
|
|
|
|
|
|
/**
|
|
|
* 跳转 App 头部参数
|
...
|
...
|
@@ -104,21 +105,97 @@ const matchHeader = (url) => { |
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/product\/new/.test(url)) {
|
|
|
if (/\/home\/mydetails$/.test(url)) {
|
|
|
header = titleMap[1];
|
|
|
header.title.des = '个人信息';
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
// header.xxx = '111';// 匹配到头类型以后,可修改里边的内容
|
|
|
if (/\/home\/orders/.test(url)) {
|
|
|
var des = '',
|
|
|
u = url.split('?')[1],
|
|
|
u = parse(u);
|
|
|
|
|
|
if (u.type === '1') {
|
|
|
des = '我的订单';
|
|
|
} else if (u.type === '2') {
|
|
|
des = '待付款';
|
|
|
} else if (u.type === '3') {
|
|
|
des = '待发货';
|
|
|
} else if (u.type === '4') {
|
|
|
des = '待收货';
|
|
|
}
|
|
|
header = titleMap[1];
|
|
|
header.title.des = des;
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/refund\/orders/.test(url)) {
|
|
|
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)) {
|
|
|
header = titleMap[1];
|
|
|
header.title.des = '有货币';
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/help$/.test(url)) {
|
|
|
header = titleMap[1];
|
|
|
header.title.des = '帮助中心';
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/chat8.live800.com/.test(url)) {
|
|
|
header = titleMap[1];
|
|
|
header.title.des = 'Yoho!Blk在线客服';
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/feedback/.test(url)) {
|
|
|
header = titleMap[3];
|
|
|
header.title.des = '意见反馈';
|
|
|
header.right = {
|
|
|
des: '提交',
|
|
|
action: 'saveFeedback'
|
|
|
}
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
if (/\/home\/about/.test(url)) {
|
|
|
header = titleMap[1];
|
|
|
header.title.des = '关于';
|
|
|
return header;
|
|
|
}
|
|
|
|
|
|
return header;
|
|
|
};
|
|
|
|
|
|
|
|
|
module.exports = (url) => {
|
|
|
if (yoho.isApp) {
|
|
|
let data = {
|
|
|
header: matchHeader(url),
|
|
|
url: /^(https?:)?\/\//i.test(url) ? url : location.origin + url
|
|
|
url: /^(https?:)?\/\//i.test(url) ? url : origin + url
|
|
|
};
|
|
|
|
|
|
// console.log(data);
|
...
|
...
|
|