Authored by TaoHuang

fix

... ... @@ -22,10 +22,8 @@ export default {
this.$yoho.auth();
}
this.$yoho.setWebview({
bounces: false,
clearCacheWhenDestroy: false
});
// this.$xianyu.setXianyuWebview();
this.$xianyu.setXianyuNav();
// queryString中携带bind_code,则弹出绑定弹框
if (this.$route.query.bind_code) {
... ...
/**
* Xianyu-SDK
*
* 与原生 APP 交互的代码
*
*/
const xianyu = {
/**
* 判断是否是 APP
*/
isAliApp: /AliApp/i.test(navigator.userAgent || ''),
isiOS: /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(navigator.userAgent || ''),
isAndroid: /Android/i.test(navigator.userAgent || ''),
setXianyuWebview() {
if (this.isAliApp && window.WindVane) {
window.WindVane.call('WVIdleFishApi', 'setNavigationBarVisible', { visible: false }, () => {
console.log('set ok');
}, () => {
});
}
},
finishXianyuPage() {
if (this.isAliApp && window.WindVane) {
window.WindVane.call('WVIdleFishApi', 'finish', {}, () => {
console.log('set ok');
}, () => {
});
}
},
backXianyuPage() {
if (this.isAliApp && window.WindVane) {
window.WindVane.call('WVIdleFishApi', 'nativeBack', {}, () => {
console.log('set ok');
}, () => {
});
}
},
setXianyuTitle(args) {
if (this.isAliApp && window.WindVane) {
window.WindVane.call('WVIdleFishApi', 'setTitle', args, () => {
console.log('set ok');
}, () => {
});
}
},
setXianyuNav() {
if (this.isAliApp && window.WindVane) {
window.WindVane.call('WVIdleFishApi', 'setHideNavigatorRightItem', {}, () => {
console.log('set ok');
}, () => {
});
}
},
goXianyuNewPage(args) {
if (!args.url) {
return;
}
if (this.isAliApp && window.WindVane) {
window.WindVane.call('Base', 'openWindow', args, () => {
console.log('open new window success');
}, () => {
window.open(args.url, '_blank');
});
} else {
if (args.url) {
window.open(args.url, '_blank');
}
}
},
};
export default xianyu;
... ...
... ... @@ -201,24 +201,6 @@ const yoho = {
}
},
goXianyuNewPage(args) {
if (!args.url) {
return;
}
if (this.isAliApp && window.WindVane) {
window.WindVane.call('Base', 'openWindow', args, () => {
console.log('open new window success');
}, () => {
window.open(args.url, '_blank');
});
} else {
if (args.url) {
window.open(args.url, '_blank');
}
}
},
/**
* 跳转至新页面(页面内容为html)
* @param args 传递给 APP 的参数 {"url":""}
... ...
... ... @@ -7,6 +7,7 @@ import { get } from 'lodash';
import Lazy from 'vue-lazyload';
import cookie from 'yoho-cookie';
import yoho from 'common/yoho';
import xianyu from 'common/xianyu';
import OrderPayType from 'components/order-pay-type';
import OrderCouponList from 'components/order-coupon-list';
import OrderPromotionList from 'components/order-promotion-list';
... ... @@ -33,6 +34,7 @@ if (window.__INITIAL_STATE__) {
window._router = get(store, 'state.yoho.context.route');
Vue.prop('yoho', yoho);
Vue.prop('xianyu', xianyu);
Vue.prop('sdk', sdk);
Vue.use(Toast);
Vue.use(DatePicker);
... ...
... ... @@ -53,7 +53,7 @@ export default {
openPay() {
const url = config.alipayUrl + '?' + this.payParams;
this.$yoho.goXianyuNewPage({
this.$xianyu.goXianyuNewPage({
url
});
},
... ...
... ... @@ -205,6 +205,7 @@ export default {
.btn-wrapper {
margin-bottom: 40px;
padding: 0 40px;
background-color: white;
}
.agree-wrapper {
... ...