beautician.js 1.5 KB

1
  1. define(["$","template","user","config","order","IScroll"],function(e,t,n,r,i,s){function o(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"placeOrder"})}var u={};return{title:"壹管家上门服务",body:"",init:function(t,n){var r=this,s=e(document);e.newTouch(".back-button",function(e){o.call(this,e)},r),r.on("tapBackButton",function(e){o.call(this,e)}),r.on("swipeRight",function(e){o.call(this,e)}),e.newTouch(".btn-check",function(t){if(e(this).parent().hasClass("disabled"))return;var n=e(this).parent().attr("data-id"),r=e(this).parent().attr("data-name");i.beautician.name=r,i.beautician.id=n,s.trigger("spa:navigate",{hash:"placeOrder"})},r),e.newTouch(".btn-recommend",function(e){i.beautician.name="系统推荐",i.beautician.id="",s.trigger("spa:navigate",{hash:"placeOrder"})},r),e.newTouch(".select-item",function(t){var n=e(this).attr("data-recommend"),r=e(this).attr("data-id"),i=e(this).attr("data-name"),o=e(this).attr("data-desc"),a=e(this).attr("data-favor"),f=e(this).attr("data-avatar");s.trigger("spa:navigate",{hash:"beautician-detail",pushData:{id:r,name:i,desc:o,favor:a,avatar:f,recommend:n,extraService:u.extraService}})},r),n.resolve()},beforeopen:function(i,o){var a=this,f=i.pushData,l=e(document);u.extraService=f.extraService;var c={showNavBar:!r.isWX&&!r.isChubao,can:n.selectTech.can,match:n.selectTech.match},h=t("beautician/index",c);a.find(".spa-page-body").html(h),setTimeout(function(){i.scroll=new s("#beauticianScroll")},500),o.resolve()},afteropen:function(e,t){i.extraService=u.extraService,t.resolve()}}});