Showing
3 changed files
with
23 additions
and
13 deletions
@@ -114,11 +114,29 @@ const getChannel = function() { | @@ -114,11 +114,29 @@ const getChannel = function() { | ||
114 | }); | 114 | }); |
115 | }; | 115 | }; |
116 | 116 | ||
117 | +const miniVersion = function (miniVersion) { | ||
118 | + let appVersion = cookie.get('app_version'); | ||
119 | + let miniVersions = miniVersion.split('.'); | ||
120 | + | ||
121 | + if (appVersion && typeof appVersion === 'string') { | ||
122 | + let versions = appVersion.split('.'); | ||
123 | + | ||
124 | + if (versions.length === 3 && | ||
125 | + (+versions[0] > +miniVersions[0] || | ||
126 | + (+versions[0] === +miniVersions[0] && +versions[1] > +miniVersions[1]) || | ||
127 | + (+versions[0] === +miniVersions[0] && +versions[1] === +miniVersions[1] && +versions[2] >= +miniVersions[2]))) { | ||
128 | + return true; | ||
129 | + } | ||
130 | + } | ||
131 | + return false; | ||
132 | +}; | ||
133 | + | ||
117 | export default { | 134 | export default { |
118 | getImgHost, | 135 | getImgHost, |
119 | getImgUrl, | 136 | getImgUrl, |
120 | applySuccuss, | 137 | applySuccuss, |
121 | visibilitychange, | 138 | visibilitychange, |
122 | getChannel, | 139 | getChannel, |
123 | - replaceHttp | 140 | + replaceHttp, |
141 | + miniVersion | ||
124 | }; | 142 | }; |
@@ -47,7 +47,7 @@ function BrandHrefBinding(el, binding) { | @@ -47,7 +47,7 @@ function BrandHrefBinding(el, binding) { | ||
47 | 47 | ||
48 | if (yoho.isYohoBuy && !shopId) { | 48 | if (yoho.isYohoBuy && !shopId) { |
49 | yoho.ready(function () { | 49 | yoho.ready(function () { |
50 | - if (cookie.get('app_version') >= '6.5.5') { | 50 | + if (util.miniVersion('6.5.5')) { |
51 | let { name } = binding.value; | 51 | let { name } = binding.value; |
52 | 52 | ||
53 | let goParams = { | 53 | let goParams = { |
@@ -44,6 +44,7 @@ import ResourceNewProductList from 'components/resources/resource-new-product-li | @@ -44,6 +44,7 @@ import ResourceNewProductList from 'components/resources/resource-new-product-li | ||
44 | import ResourceTfGoodsList from 'components/resources/resource-tfgoods-list'; | 44 | import ResourceTfGoodsList from 'components/resources/resource-tfgoods-list'; |
45 | import {SearchSlider} from 'components/search'; | 45 | import {SearchSlider} from 'components/search'; |
46 | import {mapState} from 'vuex'; | 46 | import {mapState} from 'vuex'; |
47 | +import util from 'common/util'; | ||
47 | import {HomeSlider} from './components'; | 48 | import {HomeSlider} from './components'; |
48 | import {REPORT_YAS} from 'store/yoho/types'; | 49 | import {REPORT_YAS} from 'store/yoho/types'; |
49 | import ResourceBox from 'components/resources/resource-box'; | 50 | import ResourceBox from 'components/resources/resource-box'; |
@@ -123,17 +124,8 @@ export default { | @@ -123,17 +124,8 @@ export default { | ||
123 | }, | 124 | }, |
124 | mounted() { | 125 | mounted() { |
125 | if (this.$yoho.isAndroid) { | 126 | if (this.$yoho.isAndroid) { |
126 | - let appVersion = this.$cookie.get('app_version'); | ||
127 | - | ||
128 | - if (appVersion && typeof appVersion === 'string') { | ||
129 | - let versions = appVersion.split('.'); | ||
130 | - | ||
131 | - if (versions.length === 3 && | ||
132 | - (+versions[0] > 6 || | ||
133 | - (+versions[0] === 6 && +versions[1] > 5) || | ||
134 | - (+versions[0] === 6 && +versions[1] === 5 && +versions[2] > 1))) { | ||
135 | - this.showBack = true; | ||
136 | - } | 127 | + if (util.miniVersion('6.5.2')) { |
128 | + this.showBack = true; | ||
137 | } | 129 | } |
138 | } else { | 130 | } else { |
139 | this.showBack = true; | 131 | this.showBack = true; |
-
Please register or login to post a comment