Authored by ccbikai

扩展对象优化

... ... @@ -2,7 +2,6 @@
* 拦截跳转, 在这里给将要打开的页面设置一下 header 样式
* @return {[type]}
*/
const $ = require('jquery');
const yoho = require('yoho');
const parse = require('yoho-qs/parse'); // 提供解析函数
... ... @@ -232,7 +231,7 @@ const matchHeader = (path, qs, titleMap) => {
const intercept = (url) => {
if (yoho.isApp) {
let titleMap = $.extend({}, defaultTitleMap);
let titleMap = Object.assign({}, defaultTitleMap);
let [path, qs] = url.split('?');
qs = parse(qs);
... ...
... ... @@ -81,7 +81,7 @@ class Modal {
}
}
$.extend(Modal, {
Object.assign(Modal, {
alert: (text, title)=> {
const modal = new Modal({
text: text,
... ...
... ... @@ -23,11 +23,11 @@ function tip(param) {
};
if (typeof param === 'string') {
$.extend(viewData, {
Object.assign(viewData, {
txt: param
});
} else {
$.extend(viewData, param);
Object.assign(viewData, param);
}
const tipView = `<div class="tip-box"><div class="tip">${viewData.txt}</div></div>`;
... ...
... ... @@ -3,7 +3,7 @@ var $ = require('jquery');
var interceptClick = require('common/intercept-click');
$(() => {
const header = $.extend({}, interceptClick.defaultTitleMap[1]);
const header = Object.assign({}, interceptClick.defaultTitleMap[1]);
header.title.des = '关于';
yoho.updateNavigationBar({
... ...
... ... @@ -41,7 +41,7 @@ $(() => {
});
});
const header = $.extend({}, interceptClick.defaultTitleMap[3]);
const header = Object.assign({}, interceptClick.defaultTitleMap[3]);
header.title.des = '意见反馈';
header.right = {
... ...
const $ = require('jquery');
const yoho = require('yoho');
const interceptClick = require('common/intercept-click');
const Modal = require('common/modal');
... ... @@ -19,7 +18,7 @@ exports.applySuccuss = function(type, applyId) {
let kind = config[type];
let goStatusPage = function() {
let header = $.extend({}, interceptClick.defaultTitleMap[1]);
let header = Object.assign({}, interceptClick.defaultTitleMap[1]);
header.left.action = location.origin + '/me/return';
header.title.des = `${kind.name}状态`;
... ...
... ... @@ -26,7 +26,7 @@ const yoho = {
/**
* storage
*/
storage: window.localStorage,
storage: window.localStorage || {},
/**
* JS 与 APP 共享的对象
... ...
... ... @@ -214,7 +214,7 @@
}
},
updateNavBar() {
const header = $.extend({}, interceptClick.defaultTitleMap[5]);
const header = Object.assign({}, interceptClick.defaultTitleMap[5]);
header.defaultSelectedIndex = '1';
header.right.des = this.editmodel ? '完成' : '编辑';
... ...
... ... @@ -229,7 +229,7 @@
}
},
updateNavBar() {
const header = $.extend({}, interceptClick.defaultTitleMap[5]);
const header = Object.assign({}, interceptClick.defaultTitleMap[5]);
header.defaultSelectedIndex = '0';
header.right.des = this.editmodel ? '完成' : '编辑';
... ...
... ... @@ -99,7 +99,7 @@
},
methods: {
updateNavBar() {
const header = $.extend({}, interceptClick.defaultTitleMap[2]);
const header = Object.assign({}, interceptClick.defaultTitleMap[2]);
header.title.des = '订单详情';
setTimeout(() => {
... ... @@ -272,6 +272,8 @@
yohoAPI.goPay({
orderid: order.orderCode,
amount: order.amount
}, () => {
yohoAPI.storage.orderReload = true;
});
},
applyRefund() {
... ...
... ... @@ -91,7 +91,6 @@
if (!document.hidden) {
if (yohoAPI.storage.orderReload) {
this.reload();
delete yohoAPI.storage.orderReload;
}
}
});
... ... @@ -108,6 +107,8 @@
this.orderList = [];
this.getOrderData();
delete yohoAPI.storage.orderReload;
},
getOrderData() {
this.busy = true;
... ... @@ -254,6 +255,8 @@
yohoAPI.goPay({
orderid: order.orderCode,
amount: order.amount
}, () => {
yohoAPI.storage.orderReload = true;
});
},
dropDown(elementId) {
... ...