Authored by 陈峰

Merge branch 'feature/brand-multi-shops' into 'gray'

Feature/brand multi shops



See merge request !90
{
"name": "yohoblk-wap",
"version": "2.0.40",
"version": "2.0.41",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -24,11 +24,12 @@ function BrandHrefBinding(el, binding) {
return;
}
if (binding.modifiers.shop) {
let href = `/product/shop/${binding.value.domain}`;
let href = `/product/shop/${binding.value.domain || binding.value.name}`;
let shopId = binding.value.shopId;
if (yoho.isYohoBuy && shopId) {
let { shopName, shopTemplateType, isRedShop } = binding.value;
let goParams = {
action: 'go.shop',
params: {
... ... @@ -40,6 +41,30 @@ function BrandHrefBinding(el, binding) {
};
href += `?openby:yohobuy=${JSON.stringify(goParams)}`;
el.href = href;
return;
}
if (yoho.isYohoBuy && !shopId) {
yoho.ready(function () {
yoho.getAppVersion({}, (version) => {
if (version >= '6.5.5') {
let { name } = binding.value;
let goParams = {
action: 'go.searchlist',
params: {
keyword: name
}
};
href += `?openby:yohobuy=${JSON.stringify(goParams)}`;
el.href = href;
} else {
el.href = href;
}
});
});
return;
}
el.href = href;
... ...
... ... @@ -67,7 +67,7 @@ const yoho = {
},
ready(callback) {
if (this.isApp) {
if (this.isApp || this.isYohoBuy) {
document.addEventListener('deviceready', callback);
} else {
return callback();
... ... @@ -118,7 +118,7 @@ const yoho = {
* @param fail
*/
getAppVersion(args, success, fail) {
if (this.isApp && window.yohoInterface) {
if (window.yohoInterface) {
window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
method: 'get.appversion',
arguments: args
... ...