Authored by 李奇

品牌跳转规则修改

@@ -30,9 +30,6 @@ function BrandHrefBinding(el, binding) { @@ -30,9 +30,6 @@ function BrandHrefBinding(el, binding) {
30 if (yoho.isYohoBuy && shopId) { 30 if (yoho.isYohoBuy && shopId) {
31 let { shopName, shopTemplateType, isRedShop } = binding.value; 31 let { shopName, shopTemplateType, isRedShop } = binding.value;
32 32
33 - if (isRedShop === 1) {  
34 - shopTemplateType = '1';  
35 - }  
36 let goParams = { 33 let goParams = {
37 action: 'go.shop', 34 action: 'go.shop',
38 params: { 35 params: {
@@ -45,9 +42,11 @@ function BrandHrefBinding(el, binding) { @@ -45,9 +42,11 @@ function BrandHrefBinding(el, binding) {
45 42
46 href += `?openby:yohobuy=${JSON.stringify(goParams)}`; 43 href += `?openby:yohobuy=${JSON.stringify(goParams)}`;
47 el.href = href; 44 el.href = href;
  45 + return;
48 } 46 }
49 47
50 if (yoho.isYohoBuy && !shopId) { 48 if (yoho.isYohoBuy && !shopId) {
  49 + yoho.ready(function () {
51 yoho.getAppVersion({}, (version) => { 50 yoho.getAppVersion({}, (version) => {
52 if (version >= '6.5.5') { 51 if (version >= '6.5.5') {
53 let { name } = binding.value; 52 let { name } = binding.value;
@@ -64,7 +63,11 @@ function BrandHrefBinding(el, binding) { @@ -64,7 +63,11 @@ function BrandHrefBinding(el, binding) {
64 el.href = href; 63 el.href = href;
65 } 64 }
66 }); 65 });
  66 + });
  67 + return;
67 } 68 }
  69 +
  70 + el.href = href;
68 } else { 71 } else {
69 el.href = `/product/shop/${binding.value}`; 72 el.href = `/product/shop/${binding.value}`;
70 } 73 }
@@ -67,7 +67,7 @@ const yoho = { @@ -67,7 +67,7 @@ const yoho = {
67 }, 67 },
68 68
69 ready(callback) { 69 ready(callback) {
70 - if (this.isApp) { 70 + if (this.isApp || this.isYohoBuy) {
71 document.addEventListener('deviceready', callback); 71 document.addEventListener('deviceready', callback);
72 } else { 72 } else {
73 return callback(); 73 return callback();
@@ -118,7 +118,7 @@ const yoho = { @@ -118,7 +118,7 @@ const yoho = {
118 * @param fail 118 * @param fail
119 */ 119 */
120 getAppVersion(args, success, fail) { 120 getAppVersion(args, success, fail) {
121 - if (this.isApp && window.yohoInterface) { 121 + if (window.yohoInterface) {
122 window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, { 122 window.yohoInterface.triggerEvent(success || nullFun, fail || nullFun, {
123 method: 'get.appversion', 123 method: 'get.appversion',
124 arguments: args 124 arguments: args