Authored by 李奇

fixed:版本比较

... ... @@ -114,11 +114,29 @@ const getChannel = function() {
});
};
const miniVersion = function (miniVersion) {
let appVersion = cookie.get('app_version');
let miniVersions = miniVersion.split('.');
if (appVersion && typeof appVersion === 'string') {
let versions = appVersion.split('.');
if (versions.length === 3 &&
(+versions[0] > +miniVersions[0] ||
(+versions[0] === +miniVersions[0] && +versions[1] > +miniVersions[1]) ||
(+versions[0] === +miniVersions[0] && +versions[1] === +miniVersions[1] && +versions[2] >= +miniVersions[2]))) {
return true;
}
}
return false;
};
export default {
getImgHost,
getImgUrl,
applySuccuss,
visibilitychange,
getChannel,
replaceHttp
replaceHttp,
miniVersion
};
... ...
... ... @@ -47,7 +47,7 @@ function BrandHrefBinding(el, binding) {
if (yoho.isYohoBuy && !shopId) {
yoho.ready(function () {
if (cookie.get('app_version') >= '6.5.5') {
if (util.miniVersion('6.5.5')) {
let { name } = binding.value;
let goParams = {
... ...
... ... @@ -44,6 +44,7 @@ import ResourceNewProductList from 'components/resources/resource-new-product-li
import ResourceTfGoodsList from 'components/resources/resource-tfgoods-list';
import {SearchSlider} from 'components/search';
import {mapState} from 'vuex';
import util from 'common/util';
import {HomeSlider} from './components';
import {REPORT_YAS} from 'store/yoho/types';
import ResourceBox from 'components/resources/resource-box';
... ... @@ -123,17 +124,8 @@ export default {
},
mounted() {
if (this.$yoho.isAndroid) {
let appVersion = this.$cookie.get('app_version');
if (appVersion && typeof appVersion === 'string') {
let versions = appVersion.split('.');
if (versions.length === 3 &&
(+versions[0] > 6 ||
(+versions[0] === 6 && +versions[1] > 5) ||
(+versions[0] === 6 && +versions[1] === 5 && +versions[2] > 1))) {
this.showBack = true;
}
if (util.miniVersion('6.5.2')) {
this.showBack = true;
}
} else {
this.showBack = true;
... ...