Authored by 郭成尧

for-mars

const Vue = require('vue');
const lazyload = require('vue-lazyload');
const exchange = require('home/exchange/exchange.vue');
const bus = require('plugin/vue-bus');
const yohoApp = require('yoho-app');
require('plugin/vue-filter')(Vue);
Vue.use(lazyload, { preLoad: 3 });
/**
* 发射提交表单事件
*/
function subExchangeForm() {
bus.$emit('subExchangeForm');
}
if (yohoApp && yohoApp.isMarsApp) {
yohoApp.ready(function() {
yohoApp.addNativeMethod('subExchangeForm', subExchangeForm);
yohoApp.invokeMethod('set.topRightButton', {
name: '提交',
callback: 'subExchangeForm()'
});
});
}
new Vue({
el: '#exchange',
components: {
exchange
}
});
$('.yoho-header').find('.nav-btn').on('click', subExchangeForm);
... ...
const Vue = require('vue');
const lazyload = require('vue-lazyload');
const bus = require('plugin/vue-bus');
const refund = require('home/refund/refund.vue');
const vueFilter = require('plugin/vue-filter');
const yohoApp = require('yoho-app');
/**
* 发射提交表单事件
*/
function subRefundForm() {
bus.$emit('subRefundForm');
}
if (yohoApp && yohoApp.isMarsApp) {
yohoApp.ready(function() {
yohoApp.addNativeMethod('subRefundForm', subRefundForm);
yohoApp.invokeMethod('set.topRightButton', {
name: '提交',
callback: 'subRefundForm()'
});
});
}
Vue.use(vueFilter);
Vue.use(lazyload, { preLoad: 3 });
... ... @@ -16,6 +32,4 @@ new Vue({
}
});
$('.yoho-header').find('.nav-btn').on('click', function() {
bus.$emit('subRefundForm');
});
$('.yoho-header').find('.nav-btn').on('click', subRefundForm);
... ...
const Modal = require('plugin/modal2');
const yohoApp = require('yoho-app');
const getImgHost = function(url, bucket = 'goodsimg') {
let urlArr = url.split('/'),
... ... @@ -27,6 +28,13 @@ const getImgUrl = function(src, width = 300, height = 300, mode = 2) {
// 退换货 申请 成功, 打开 modal
const applySuccuss = function(type, applyId) {
// 取消 Mars APP 头部的提交按钮
if (yohoApp && yohoApp.isMarsApp) {
yohoApp.ready(function() {
yohoApp.invokeMethod('set.removeTopRightButton');
});
}
const config = {
exchange: {
name: '换货',
... ...
... ... @@ -69,10 +69,10 @@
}
},
created() {
// 提交按钮dom
this.$submitBtn = $('#yoho-header .nav-btn');
this.$submitBtn.on('click', this.submit);
// 提交表单
bus.$on('subExchangeForm', () => {
this.submit();
});
bus.$on('open.featureSelector', msg => {
this.queryProductFeature(msg.pid, msg.sku, msg.rid);
... ...