Authored by 沈志敏

fix bug

... ... @@ -157,7 +157,6 @@ const matchHeader = (path, qs, titleMap) => {
if (/\/me\/order\/detail$/.test(path)) {
header = titleMap[2];
header.title.des = '订单详情';
header.title.right.action = origin + '/me/service';
return header;
}
... ...
const yoho = require('yoho');
const getImgHost = function(url) {
let urlArr = url.split('/'),
num = urlArr[urlArr.length - 1].substr(1, 1),
... ... @@ -11,6 +13,16 @@ const getImgHost = function(url) {
}
};
const visibilitychange = function() {
document.addEventListener('visibilitychange', function() {
if (yoho.isApp && !document.hidden) {
yoho.showLoading(false);
}
});
}
module.exports = {
getImgHost: getImgHost
getImgHost,
visibilitychange
};
... ...
... ... @@ -17,6 +17,7 @@
const $ = require('jquery');
const yoho = require('yoho');
const Vue = require('vue');
const util = require('common/util');
const interceptClick = require('common/intercept-click');
// 隐藏 App 默认显示的 loading
... ... @@ -24,6 +25,7 @@ Vue.mixin({
ready() {
if (this === this.$root && location.pathname !== '/sidebar') {
yoho.showLoading(false);
util.visibilitychange();
}
}
});
... ... @@ -33,6 +35,7 @@ $(() => {
if ($body.hasClass('no-local-js')) {
yoho.showLoading(false); // 隐藏 App 默认显示的 loading
util.visibilitychange();
}
$body.on('click', 'a[href]', function() {
// 拦截跳转
... ...
var yoho = require('yoho');
var $ = require('jquery');
const util = require('common/util');
if (!yoho.isLogin) {
$('.auth').addClass('no-intercept');
$('.auth').on('click', function() {
... ... @@ -8,7 +8,7 @@ if (!yoho.isLogin) {
return false;
});
} else {
// 地址管理
// 地址管理
$('#address').on('click', function() {
yoho.goAddress({
type: '2'
... ... @@ -25,4 +25,5 @@ $('#setting').on('click', function() {
$(() => {
yoho.showLoading(false);
util.visibilitychange();
});
... ...
... ... @@ -76,6 +76,11 @@
},
ready() {
this.getOrderData();
yohoAPI.addNativeMethod('goToService', () => {
interceptClick.intercept('/me/service');
return false;
});
},
methods: {
getOrderData() {
... ...