chunk-eb773252.7b456bae.js 13 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-eb773252"],{"0b33":function(t,e,i){"use strict";var n=i("a142"),r=i("9884"),o=Object(n["f"])("tab"),s=o[0],a=o[1];e["a"]=s({mixins:[Object(r["a"])("vanTabs")],props:{title:String,disabled:Boolean},data:function(){return{inited:!1}},computed:{selected:function(){return this.index===this.parent.curActive}},watch:{"parent.curActive":function(){this.inited=this.inited||this.selected},title:function(){this.parent.setLine()}},mounted:function(){this.slots("title")&&this.parent.renderTitle(this.$refs.title,this.index)},render:function(t){var e=this.slots,i=this.selected,n=this.inited||!this.parent.lazyRender,r=[n?e():t()];return e("title")&&r.push(t("div",{ref:"title"},[e("title")])),this.parent.animated?t("div",{attrs:{role:"tabpanel","aria-hidden":!i},class:a("pane-wrapper",{inactive:!i})},[t("div",{class:a("pane")},[r])]):t("div",{directives:[{name:"show",value:i}],attrs:{role:"tabpanel"},class:a("pane")},[r])}})},4598:function(t,e,i){"use strict";(function(t){i.d(e,"a",function(){return c});var n=i("a142"),r=Date.now();function o(t){var e=Date.now(),i=Math.max(0,16-(e-r)),n=setTimeout(t,i);return r=e+i,n}var s=n["d"]?t:window,a=s.requestAnimationFrame||o;s.cancelAnimationFrame||s.clearTimeout;function c(t){return a.call(s,t)}}).call(this,i("c8ba"))},"5e46":function(t,e,i){"use strict";function n(){return n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},n.apply(this,arguments)}var r=i("a142"),o=i("4598");function s(t,e,i){var n=0,r=t.scrollLeft,s=0===i?1:Math.round(1e3*i/16);function a(){t.scrollLeft+=(e-r)/s,++n<s&&Object(o["a"])(a)}a()}var a=!1;if(!r["d"])try{var c={};Object.defineProperty(c,"passive",{get:function(){a=!0}}),window.addEventListener("test-passive",null,c)}catch(C){}function l(t,e,i,n){void 0===n&&(n=!1),r["d"]||t.addEventListener(e,i,!!a&&{capture:!1,passive:n})}function u(t,e,i){r["d"]||t.removeEventListener(e,i)}var h=10;function d(t,e){return t>e&&t>h?"horizontal":e>t&&e>h?"vertical":""}var f={data:function(){return{direction:""}},methods:{touchStart:function(t){this.resetTouchStatus(),this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY},touchMove:function(t){var e=t.touches[0];this.deltaX=e.clientX-this.startX,this.deltaY=e.clientY-this.startY,this.offsetX=Math.abs(this.deltaX),this.offsetY=Math.abs(this.deltaY),this.direction=this.direction||d(this.offsetX,this.offsetY)},resetTouchStatus:function(){this.direction="",this.deltaX=0,this.deltaY=0,this.offsetX=0,this.offsetY=0}}},v=i("9884");function p(t){function e(){this.binded||(t.call(this,l,!0),this.binded=!0)}function i(){this.binded&&(t.call(this,u,!1),this.binded=!1)}return{mounted:e,activated:e,deactivated:i,beforeDestroy:i}}function b(t,e){void 0===e&&(e=window);var i=t;while(i&&"HTML"!==i.tagName&&"BODY"!==i.tagName&&1===i.nodeType&&i!==e){var n=window.getComputedStyle(i),r=n.overflowY;if("scroll"===r||"auto"===r)return i;i=i.parentNode}return e}function m(t){return"scrollTop"in t?t.scrollTop:t.pageYOffset}function y(t,e){"scrollTop"in t?t.scrollTop=e:t.scrollTo(t.scrollX,e)}function w(t){return(t===window?0:t.getBoundingClientRect().top)+m(window)}var g=Object(r["f"])("tabs"),A=g[0],S=g[1],T=Object(r["f"])("tab")[1];e["a"]=A({mixins:[f,Object(v["b"])("vanTabs"),p(function(t,e){this.bindScrollEvent(e),t(window,"resize",this.setLine,!0)})],model:{prop:"active"},props:{color:String,sticky:Boolean,animated:Boolean,offsetTop:Number,swipeable:Boolean,background:String,lineWidth:[Number,String],lineHeight:[Number,String],titleActiveColor:String,titleInactiveColor:String,border:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},lazyRender:{type:Boolean,default:!0},active:{type:[Number,String],default:0},type:{type:String,default:"line"},duration:{type:Number,default:.3},swipeThreshold:{type:Number,default:4}},data:function(){return this.scrollEvent=!1,{position:"",curActive:null,lineStyle:{backgroundColor:this.color}}},computed:{scrollable:function(){return this.children.length>this.swipeThreshold||!this.ellipsis},wrapStyle:function(){switch(this.position){case"top":return{top:this.offsetTop+"px",position:"fixed"};case"bottom":return{top:"auto",bottom:0};default:return null}},navStyle:function(){return{borderColor:this.color,background:this.background}},trackStyle:function(){if(this.animated)return{transform:"translate3d("+-1*this.curActive*100+"%, 0, 0)",transitionDuration:this.duration+"s"}}},watch:{active:function(t){t!==this.curActive&&this.correctActive(t)},color:function(){this.setLine()},children:function(){this.correctActive(this.curActive||this.active),this.scrollIntoView(),this.setLine()},curActive:function(){this.scrollIntoView(),this.setLine(),"top"!==this.position&&"bottom"!==this.position||y(window,w(this.$el)-this.offsetTop)},sticky:function(t){this.bindScrollEvent(t)}},mounted:function(){this.onShow()},activated:function(){this.onShow(),this.setLine()},methods:{onShow:function(){var t=this;this.$nextTick(function(){t.inited=!0,t.scrollIntoView(!0)})},bindScrollEvent:function(t){var e=this.sticky&&t;this.scrollEvent!==e&&(this.scrollEvent=e,this.scrollEl=this.scrollEl||b(this.$el),(e?l:u)(this.scrollEl,"scroll",this.onScroll,!0),this.onScroll())},onTouchEnd:function(){var t=this.direction,e=this.deltaX,i=this.curActive,n=50;"horizontal"===t&&this.offsetX>=n&&(e>0&&0!==i?this.setCurActive(i-1):e<0&&i!==this.children.length-1&&this.setCurActive(i+1))},onScroll:function(){var t=m(window)+this.offsetTop,e=w(this.$el),i=e+this.$el.offsetHeight-this.$refs.wrap.offsetHeight;this.position=t>i?"bottom":t>e?"top":"";var n={scrollTop:t,isFixed:"top"===this.position};this.$emit("scroll",n)},setLine:function(){var t=this,e=this.inited;this.$nextTick(function(){var i=t.$refs.tabs;if(i&&i[t.curActive]&&"line"===t.type){var n=i[t.curActive],o=t.lineWidth,s=t.lineHeight,a=Object(r["b"])(o)?o:n.offsetWidth/2,c=n.offsetLeft+n.offsetWidth/2,l={width:Object(r["e"])(a),backgroundColor:t.color,transform:"translateX("+c+"px) translateX(-50%)"};if(e&&(l.transitionDuration=t.duration+"s"),Object(r["b"])(s)){var u=Object(r["e"])(s);l.height=u,l.borderRadius=u}t.lineStyle=l}})},correctActive:function(t){t=+t;var e=this.children.some(function(e){return e.index===t}),i=(this.children[0]||{}).index||0;this.setCurActive(e?t:i)},setCurActive:function(t){t=this.findAvailableTab(t,t<this.curActive),Object(r["b"])(t)&&t!==this.curActive&&(this.$emit("input",t),null!==this.curActive&&this.$emit("change",t,this.children[t].title),this.curActive=t)},findAvailableTab:function(t,e){var i=e?-1:1,n=t;while(n>=0&&n<this.children.length){if(!this.children[n].disabled)return n;n+=i}},onClick:function(t){var e=this.children[t],i=e.title,n=e.disabled;n?this.$emit("disabled",t,i):(this.setCurActive(t),this.$emit("click",t,i))},scrollIntoView:function(t){var e=this.$refs.tabs;if(this.scrollable&&e&&e[this.curActive]){var i=this.$refs.nav,n=e[this.curActive],r=n.offsetLeft-(i.offsetWidth-n.offsetWidth)/2;s(i,r,t?0:this.duration)}},renderTitle:function(t,e){var i=this;this.$nextTick(function(){var n=i.$refs.title[e];n.parentNode.replaceChild(t,n)})},getTabStyle:function(t,e){var i={},n=this.color,r=e===this.curActive,o="card"===this.type;n&&(t.disabled||!o||r||(i.color=n),!t.disabled&&o&&r&&(i.backgroundColor=n),o&&(i.borderColor=n));var s=r?this.titleActiveColor:this.titleInactiveColor;return s&&(i.color=s),this.scrollable&&this.ellipsis&&(i.flexBasis=88/this.swipeThreshold+"%"),i}},render:function(t){var e,i=this,r=this.type,o=this.ellipsis,s=this.animated,a=this.scrollable,c=this.children.map(function(e,n){return t("div",{ref:"tabs",refInFor:!0,attrs:{role:"tab","aria-selected":n===i.curActive},class:T({active:n===i.curActive,disabled:e.disabled,complete:!o}),style:i.getTabStyle(e,n),on:{click:function(){i.onClick(n)}}},[t("span",{ref:"title",refInFor:!0,class:{"van-ellipsis":o}},[e.title])])});return this.swipeable&&(e={touchstart:this.touchStart,touchmove:this.touchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchEnd}),t("div",{class:S([r])},[t("div",{ref:"wrap",style:this.wrapStyle,class:[S("wrap",{scrollable:a}),{"van-hairline--top-bottom":"line"===r&&this.border}]},[t("div",{ref:"nav",attrs:{role:"tablist"},class:S("nav",[r]),style:this.navStyle},[this.slots("nav-left"),"line"===r&&t("div",{class:S("line"),style:this.lineStyle}),c,this.slots("nav-right")])]),t("div",{class:S("content",{animated:s}),on:n({},e)},[s?t("div",{class:S("track"),style:this.trackStyle},[this.slots()]):this.slots()])])}})},"68ef":function(t,e,i){},9884:function(t,e,i){"use strict";function n(t,e){var i,n;void 0===e&&(e={});var r=e.indexKey||"index";return{inject:(i={},i[t]={default:null},i),computed:(n={parent:function(){return this[t]}},n[r]=function(){return this.bindRelation(),this.parent.children.indexOf(this)},n),created:function(){this.bindRelation()},beforeDestroy:function(){var t=this;this.parent&&(this.parent.children=this.parent.children.filter(function(e){return e!==t}))},methods:{bindRelation:function(){if(this.parent){var t=this.parent.children;if(-1===t.indexOf(this)){var e=this.parent.slots().indexOf(this.$vnode);-1===e?t.push(this):t.splice(e,0,this)}}}}}}function r(t){return{provide:function(){var e;return e={},e[t]=this,e},data:function(){return{children:[]}}}}i.d(e,"a",function(){return n}),i.d(e,"b",function(){return r})},a142:function(t,e,i){"use strict";var n=i("2b0e"),r="__",o="--";function s(t,e,i){return e?t+i+e:t}function a(t,e){if("string"===typeof e)return s(t,e,o);if(Array.isArray(e))return e.map(function(e){return a(t,e)});var i={};return e&&Object.keys(e).forEach(function(n){i[t+o+n]=e[n]}),i}function c(t){return function(e,i){return e&&"string"!==typeof e&&(i=e,e=""),e=s(t,e,r),i?[e,a(e,i)]:e}}var l=Object.prototype.hasOwnProperty;function u(t,e,i){var n=e[i];L(n)&&(l.call(t,i)&&X(n)&&"function"!==typeof n?t[i]=h(Object(t[i]),e[i]):t[i]=n)}function h(t,e){return Object.keys(e).forEach(function(i){u(t,e,i)}),t}var d={name:"姓名",tel:"电话",save:"保存",confirm:"确认",cancel:"取消",delete:"删除",complete:"完成",loading:"加载中...",telEmpty:"请填写电话",nameEmpty:"请填写姓名",confirmDelete:"确定要删除么",telInvalid:"请填写正确的电话",vanContactCard:{addText:"添加联系人"},vanContactList:{addText:"新建联系人"},vanPagination:{prev:"上一页",next:"下一页"},vanPullRefresh:{pulling:"下拉即可刷新...",loosing:"释放即可刷新..."},vanSubmitBar:{label:"合计:"},vanCoupon:{valid:"有效期",unlimited:"无使用门槛",discount:function(t){return t+"折"},condition:function(t){return"满"+t+"元可用"}},vanCouponCell:{title:"优惠券",tips:"使用优惠",count:function(t){return t+"张可用"}},vanCouponList:{empty:"暂无优惠券",exchange:"兑换",close:"不使用优惠",enable:"可使用优惠券",disabled:"不可使用优惠券",placeholder:"请输入优惠码"},vanAddressEdit:{area:"地区",postal:"邮政编码",areaEmpty:"请选择地区",addressEmpty:"请填写详细地址",postalEmpty:"邮政编码格式不正确",defaultAddress:"设为默认收货地址",telPlaceholder:"收货人手机号",namePlaceholder:"收货人姓名",areaPlaceholder:"选择省 / 市 / 区"},vanAddressEditDetail:{label:"详细地址",placeholder:"街道门牌、楼层房间号等信息"},vanAddressList:{add:"新增地址"}},f=n["default"].prototype,v=n["default"].util.defineReactive;v(f,"$vantLang","zh-CN"),v(f,"$vantMessages",{"zh-CN":d});var p={messages:function(){return f.$vantMessages[f.$vantLang]},use:function(t,e){var i;f.$vantLang=t,this.add((i={},i[t]=e,i))},add:function(t){void 0===t&&(t={}),h(f.$vantMessages,t)}},b=/-(\w)/g;function m(t){return t.replace(b,function(t,e){return e.toUpperCase()})}var y={methods:{slots:function(t,e){void 0===t&&(t="default");var i=this.$slots,n=this.$scopedSlots;return n[t]?n[t](e):i[t]}}},w={type:Array,default:function(){return[]}},g={type:Number,default:0};function A(t){Object.keys(t).forEach(function(e){t[e]===Array?t[e]=w:t[e]===Number&&(t[e]=g)})}function S(t){var e=this.name;t.component(e,this),t.component(m("-"+e),this)}function T(t){var e=t.scopedSlots||t.data.scopedSlots||{},i=t.slots();return Object.keys(i).forEach(function(t){e[t]||(e[t]=function(){return i[t]})}),e}function C(t){return{functional:!0,props:t.props,model:t.model,render:function(e,i){return t(e,i.props,T(i),i)}}}function $(t){return function(e){return"function"===typeof e&&(e=C(e)),e.functional||(e.mixins=e.mixins||[],e.mixins.push(y)),e.props&&A(e.props),e.name=t,e.install=S,e}}function x(t){var e=m(t)+".";return function(t){for(var i=N(p.messages(),e+t)||N(p.messages(),t),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return"function"===typeof i?i.apply(void 0,r):i}}function E(t){return t="van-"+t,[$(t),c(t),x(t)]}function O(t){return/^\d+(\.\d+)?$/.test(t)}function k(t){if(L(t))return t=String(t),O(t)?t+"px":t}i.d(e,"d",function(){return j}),i.d(e,"b",function(){return L}),i.d(e,"c",function(){return X}),i.d(e,"a",function(){return N}),i.d(e,"f",function(){return E}),i.d(e,"e",function(){return k});var j=n["default"].prototype.$isServer;function L(t){return void 0!==t&&null!==t}function X(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function N(t,e){var i=e.split("."),n=t;return i.forEach(function(t){n=L(n[t])?n[t]:""}),n}},b807:function(t,e,i){},bda7:function(t,e,i){"use strict";i("68ef"),i("b807")},da3c:function(t,e,i){"use strict";i("68ef"),i("f319")},f319:function(t,e,i){}}]);
  2. //# sourceMappingURL=chunk-eb773252.7b456bae.js.map