123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- define(['template', 'native', 'config', 'user'], function (template, native, config, user) {
- function back(event) {
- event.preventDefault();
- $(document).trigger('spa:navigate', {
- hash: '',
- pushData: {
- dontNeedReload: true
- }
- });
- }
- return {
- title: '壹管家上门服务',
- body: '',
- init: function (pageData, dtd) {
- var $view = this;
- var $doc = $(document);
- var url = 'http://wozhua-others.qiniudn.com/2016-01-04-detail-2.jpg';
- var tpl = template('activities/cat', {
- showNavBar: !config.isWX && !config.isChubao,
- src: url
- });
- var d = new Image();
- d.src = url;
- $doc.trigger('spa:openloader');
- d.onload = function() {
- $doc.trigger('spa:closeloader');
- $('.spa-page-body', $view).html(tpl);
- setTimeout(function () {
- pageData.scroll = new IScroll('#activities-scroll');
- }, 50);
- }
- user.activities['visited_order0122'] = true; // 首页活动弹窗名字
- user.setCache('activities');
- //返回
- $.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();
- }
- }
- })
|