Authored by Aiden Xu

Merge remote-tracking branch 'origin/develop' into develop

... ... @@ -3,6 +3,5 @@
<div class="suggest-sub-form">
<textarea name="" id="suggest-textarea" placeholder="请写下对于BLK的意见和建议,我们将及时根据您的意见作出改进"></textarea>
</div>
<input id="submit-button" type="button" value="提交" />
{{/ suggestSub}}
</div>
... ...
... ... @@ -35,7 +35,7 @@
<span class="num">{{send_cargo_num}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/orders?type=5">
<a class="type-item" href="/home/refund/orders">
<span class="icon icon-refund-exchange"></span>
<br>退换货
{{#if refund_exchange_num}}
... ...
... ... @@ -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);
... ...
... ... @@ -5,11 +5,10 @@
*/
var $ = require('yoho-jquery'),
tip = require('../common/tip');
tip = require('../common/tip'),
yoho = require('yoho');
var submitButton = $('#submit-button');
submitButton.on('click', function() {
yoho.addNativeMethod('saveFeedback', function() {
var suggestText = $('#suggest-textarea').val(),
textReg = /\S+/;
... ...
... ... @@ -32,6 +32,7 @@
<script>
const $ = require('yoho-jquery');
const tip = require('common/tip');
const yoho = require('yoho');
module.exports = {
props: ['brandUrl'],
... ... @@ -73,12 +74,6 @@
tip('网络错误');
});
},
editModel(action) {
this.editmodel = action;
if (!action) {
this.hideDelBth();
}
},
showDelBtn(index) {
this.hideDelBth();
let delBtn = $('#del-' + index);
... ... @@ -116,6 +111,16 @@
tip('网络错误');
});
}
},
created: function() {
let _this = this;
yoho.addNativeMethod('editModel', function(action) {
_this.editmodel = action;
if (!action) {
_this.hideDelBth();
}
});
}
};
</script>
... ...
... ... @@ -79,12 +79,6 @@
tip('网络错误');
});
},
editModel(action) {
this.editmodel = action;
if (!action) {
this.hideDelBth();
}
},
showDelBtn(index) {
this.hideDelBth();
let delBtn = $('#del-' + index);
... ... @@ -122,6 +116,16 @@
tip('网络错误');
});
}
},
created: function() {
let _this = this;
yoho.addNativeMethod('editModel', function(action) {
_this.editmodel = action;
if (!action) {
_this.hideDelBth();
}
});
}
};
</script>
... ...