MyService.js 1.4 KB

1
  1. define(["$","template","user","config","api"],function(e,t,n,r,i){function s(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}function o(e){e.scroll&&(e.scroll.destroy(),e.scroll=null)}return{title:"壹管家上门服务",body:"",init:function(t,n){var r=this,i=e(document);r.on("swipeRight",function(e){s.call(this,e)}),e.newTouch(".back-button",function(e){s.call(this,e)},r),r.on("tapBackButton",function(e){s.call(this,e)}),n.resolve()},beforeopen:function(s,o){var u=this,a=e(document);a.trigger("spa:openloader"),i.geteservation({user_id:n.id},function(n){a.trigger("spa:closeloader");if(n.success){var i=[];n.data.length==0?showListBar=!1:showListBar=!0;var o={showNavBar:!r.isWX&&!r.isChubao,list:n.data,timeArrea:i,showListBar:showListBar},f=t("MyService/index",o);e(".spa-page-body",u).html(f),setTimeout(function(){s.scroll=new IScroll("#myServiceScroll")},500)}else a.trigger("spa:openpanel",["simpleAlert",{message:n.message}])}),o.resolve(),r.isWX&&wx.ready(function(){wx.onMenuShareTimeline({title:"家政服务,首选壹管家",link:"http://www.yiguanjia.club/o2o/web/index",imgUrl:"http://wozhua-others.qiniudn.com/icon-o2o-home.jpg"}),wx.onMenuShareAppMessage({title:"家政服务,首选壹管家",desc:"全程管家,精心每一个细节!",link:"http://www.yiguanjia.club/o2o/web/index",imgUrl:"http://wozhua-others.qiniudn.com/icon-o2o-home.jpg"})})}}});