tn-nav-bar.js 5.8 KB

1234567891011
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["tuniao-ui/components/tn-nav-bar/tn-nav-bar"],{204:function(t,e,n){"use strict";n.r(e);var a=n(205),r=n(207);for(var i in r)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(i);n(210);var u,o=n(36),s=Object(o["default"])(r["default"],a["render"],a["staticRenderFns"],!1,null,"1748c37c",null,!1,a["components"],u);s.options.__file="tuniao-ui/components/tn-nav-bar/tn-nav-bar.vue",e["default"]=s.exports},205:function(t,e,n){"use strict";n.r(e);var a=n(206);n.d(e,"render",(function(){return a["render"]})),n.d(e,"staticRenderFns",(function(){return a["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return a["recyclableRender"]})),n.d(e,"components",(function(){return a["components"]}))},206:function(t,e,n){"use strict";var a;n.r(e),n.d(e,"render",(function(){return r})),n.d(e,"staticRenderFns",(function(){return u})),n.d(e,"recyclableRender",(function(){return i})),n.d(e,"components",(function(){return a}));var r=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__get_style([t.navBarStyle])),a=t.__get_style([t.barStyle]),r=t.__get_style([t.contentStyle]);t.$mp.data=Object.assign({},{$root:{s0:n,s1:a,s2:r}})},i=!1,u=[];r._withStripped=!0},207:function(t,e,n){"use strict";n.r(e);var a=n(208),r=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e["default"]=r.a},208:function(t,e,n){"use strict";(function(t,a){var r=n(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(58)),u=r(n(60)),o=r(n(209)),s={name:"tn-nav-bar",mixins:[o.default],props:{zIndex:{type:Number,default:0},height:{type:Number,default:0},unit:{type:String,default:"px"},isBack:{type:Boolean,default:!0},backIcon:{type:String,default:"left"},backTitle:{type:String,default:"返回"},alpha:{type:Boolean,default:!1},fixed:{type:Boolean,default:!0},bottomShadow:{type:Boolean,default:!0},customBack:{type:Boolean,default:!1},beforeBack:{type:Function,default:null}},computed:{navBarStyle:function(){var t={};return t.height=0===this.height?this.customBarHeight+this.unit:this.height+this.unit,this.fixed&&(t.position="fixed"),t.zIndex=this.elZIndex,t},barClass:function(){var t="";return this.backgroundColorClass&&(t+=" ".concat(this.backgroundColorClass)),this.fontColorClass&&(t+="".concat(this.fontColorClass)),this.fixed&&(t+=" tn-custom-nav-bar__bar--fixed"),this.alpha&&(t+=" tn-custom-nav-bar__bar--alpha"),this.bottomShadow&&(t+=" tn-custom-nav-bar__bar--bottom-shadow"),t},barStyle:function(){var t={};return t.height=0===this.height?this.customBarHeight+this.unit:this.height+this.unit,this.fixed&&(t.paddingTop=this.statusBarHeight+"px"),this.backgroundColorClass||(t.backgroundColor=""!==this.backgroundColor?this.backgroundColor:"#FFFFFF"),!this.fontColorClass&&this.fontColor&&(t.color=this.fontColor),t.zIndex=this.elZIndex,t},contentStyle:function(){var t={};if(t.top=this.fixed?this.statusBarHeight+"px":"0px",t.height=0===this.height?this.customBarHeight-this.statusBarHeight+this.unit:this.height+this.unit,t.lineHeight=t.height,this.isBack)if(this.customBack){var e=2*(this.customBackStyleInfo.width+this.customBackStyleInfo.left);t.width="calc(100% - ".concat(e,"px)")}else t.width="calc(100% - 340rpx)";else t.width="100%";return t},elZIndex:function(){return this.zIndex?this.zIndex:this.$t.zIndex.navbar}},data:function(){return{statusBarHeight:0,customBarHeight:0,customBackStyleInfo:{width:86,height:32,left:15}}},mounted:function(){this.updateNavBarInfo()},created:function(){var e=t.getMenuButtonBoundingClientRect();this.customBackStyleInfo.width=e.width,this.customBackStyleInfo.height=e.height,this.customBackStyleInfo.left=a.upx2px(750)-e.right},methods:{updateNavBarInfo:function(){var t=this;return(0,u.default)(i.default.mark((function e(){var n,a,r;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.vuex_custom_bar_height,a=t.vuex_status_bar_height,n){e.next=15;break}return e.prev=3,e.next=6,t.$t.updateCustomBar();case 6:r=e.sent,n=r.customBarHeight,a=r.statusBarHeight,e.next=15;break;case 11:return e.prev=11,e.t0=e["catch"](3),setTimeout((function(){t.updateNavBarInfo()}),10),e.abrupt("return");case 15:t&&t.$t.vuex("vuex_status_bar_height",a),t&&t.$t.vuex("vuex_custom_bar_height",n),t.customBarHeight=n,t.statusBarHeight=a;case 19:case"end":return e.stop()}}),e,null,[[3,11]])})))()},handlerBack:function(){var t=this;return(0,u.default)(i.default.mark((function e(){var n;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.beforeBack||"function"!==typeof t.beforeBack){e.next=10;break}if(n=t.beforeBack.bind(t.$t.$parent.call(t))(),!n||"function"!==typeof n.then){e.next=7;break}return e.next=5,n.then((function(e){t.navBack()})).catch((function(t){}));case 5:e.next=8;break;case 7:!0===n&&t.navBack();case 8:e.next=11;break;case 10:t.navBack();case 11:case"end":return e.stop()}}),e)})))()},navBack:function(){var t=getCurrentPages();if(t&&t.length>0){var e=t[0];1!=t.length||e.route&&"pages/index/index"==e.route?a.navigateBack({delta:1}):a.reLaunch({url:"/pages/index/index"})}else a.reLaunch({url:"/pages/index/index"})}}};e.default=s}).call(this,n(1)["default"],n(2)["default"])},210:function(t,e,n){"use strict";n.r(e);var a=n(211),r=n.n(a);for(var i in a)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(i);e["default"]=r.a},211:function(t,e,n){}}]);
  2. //# sourceMappingURL=../../../../.sourcemap/mp-weixin/tuniao-ui/components/tn-nav-bar/tn-nav-bar.js.map
  3. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  4. 'tuniao-ui/components/tn-nav-bar/tn-nav-bar-create-component',
  5. {
  6. 'tuniao-ui/components/tn-nav-bar/tn-nav-bar-create-component':(function(module, exports, __webpack_require__){
  7. __webpack_require__('2')['createComponent'](__webpack_require__(204))
  8. })
  9. },
  10. [['tuniao-ui/components/tn-nav-bar/tn-nav-bar-create-component']]
  11. ]);