define(['$', 'template', 'product', 'order', 'cart', 'native', 'helper', 'user', 'api', 'config', 'address', 'IScroll'], function ($, template, product, order, cart ,native, helper, user, api, config, address, IScroll) { function back(event) { event.preventDefault(); $(document).trigger('spa:navigate', { hash: '', pushData: { dontNeedReload: true } }); } return { title: '壹管家上门服务', body: '', init: function (pageData, dtd) { var productType = pageData.pushData.productType; var $view = this; var $doc = $(document); //返回 $.newTouch('.back-button', function (event) { back.call(this, event); }, $view); $view.on('tapBackButton', function (event) { back.call(this, event); }); $view.on('swipeRight', function (event) { back.call(this, event); }); dtd.resolve(); }, beforeopen: function (pageData, dtd) { var $view = this; var pushData = pageData.pushData; var $doc = $(document); pushData.needReset = false; var productType = pushData.productType; var tmpData = { showNavBar: !config.isWX && !config.isChubao, prodcutTitle: product.getProductTitle(productType) }; var tpl = template('coming/index', tmpData); $view.find('.spa-page-body').html(tpl); dtd.resolve(); if (config.isWX) { wx.ready(function(){ wx.onMenuShareTimeline({ title: '家政服务,首选壹管家', link: 'http://www.yiguanjia.me/o2o/web/index', imgUrl: 'http://wozhua-others.qiniudn.com/icon-o2o-home.jpg' }); wx.onMenuShareAppMessage({ title: '家政服务,首选壹管家', desc: '全程管家,精心每一个细节!', link: 'http://www.yiguanjia.me/o2o/web/index', imgUrl: 'http://wozhua-others.qiniudn.com/icon-o2o-home.jpg' }); }); } } } })