"use weex:vue";

if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
  Promise.prototype.finally = function(callback) {
    const promise = this.constructor
    return this.then(
      value => promise.resolve(callback()).then(() => value),
      reason => promise.resolve(callback()).then(() => {
        throw reason
      })
    )
  }
};

if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
  const global = uni.requireGlobal()
  ArrayBuffer = global.ArrayBuffer
  Int8Array = global.Int8Array
  Uint8Array = global.Uint8Array
  Uint8ClampedArray = global.Uint8ClampedArray
  Int16Array = global.Int16Array
  Uint16Array = global.Uint16Array
  Int32Array = global.Int32Array
  Uint32Array = global.Uint32Array
  Float32Array = global.Float32Array
  Float64Array = global.Float64Array
  BigInt64Array = global.BigInt64Array
  BigUint64Array = global.BigUint64Array
};


(()=>{var L=Object.create;var w=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var C=(e,i)=>()=>(i||e((i={exports:{}}).exports,i),i.exports);var k=(e,i,s,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of I(i))!S.call(e,r)&&r!==s&&w(e,r,{get:()=>i[r],enumerable:!(n=T(i,r))||n.enumerable});return e};var m=(e,i,s)=>(s=e!=null?L(y(e)):{},k(i||!e||!e.__esModule?w(s,"default",{value:e,enumerable:!0}):s,e));var p=C((P,x)=>{x.exports=Vue});var M=m(p());function u(e,i,...s){uni.__log__?uni.__log__(e,i,...s):console[e].apply(console,[...s,i])}var t=m(p());var g=(e,i)=>{let s=e.__vccOpts||e;for(let[n,r]of i)s[n]=r;return s};var A={"uni-swiper-page":{"":{flex:1,position:"absolute",left:0,top:0,right:0,bottom:0}},list:{"":{flex:1,backgroundColor:"#ebebeb"}},"list-item":{"":{marginLeft:12,marginRight:12,marginTop:12,paddingTop:20,paddingRight:20,paddingBottom:20,paddingLeft:20,backgroundColor:"#ffffff",borderRadius:5}},loading:{"":{height:20}}},z={props:{pid:{type:[Number,String],default:""},parentId:{type:String,default:""}},data(){return{scrollable:!0,dataList:[]}},created(){for(var e=1;e<=32;e++)this.dataList.push({id:e,name:e})},methods:{setScrollRef(e){this.$refs.list.setSpecialEffects&&this.$refs.list.setSpecialEffects({id:this.parentId,headerHeight:e})},onclick(e){u("log","at pages/template/swiper-list-nvue/swiper-page.nvue:50","onclick")},loadData(){},clear(){this.dataList.length=0}}};function D(e,i,s,n,r,a){return(0,t.openBlock)(),(0,t.createElementBlock)("view",{class:"uni-swiper-page",renderWhole:!0},[(0,t.createElementVNode)("list",{ref:"list",class:"list",offsetAccuracy:5,bounce:!0,isSwiperList:"true"},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.dataList,(o,c)=>((0,t.openBlock)(),(0,t.createElementBlock)("cell",{key:o.id,ref_for:!0,ref:"item"+c,onClick:i[0]||(i[0]=(...f)=>a.onclick&&a.onclick(...f))},[(0,t.createElementVNode)("view",{class:"list-item"},[(0,t.createElementVNode)("u-text",null,(0,t.toDisplayString)(o.name),1)])]))),128)),(0,t.createElementVNode)("cell",{class:"loading"})],512)])}var W=g(z,[["render",D],["styles",[A]]]),E={page:{"":{flex:1}},header:{"":{height:160,flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:"#f4f4f4"}},"header-title":{"":{fontSize:30,fontWeight:"bold",color:"#444444"}},"flexible-view":{"":{backgroundColor:"#f823ff"}},"page-head":{"":{height:200,flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"#FF0000"}},tabs:{"":{flexDirection:"column",overflow:"hidden",backgroundColor:"#ffffff"}},"tab-bar":{"":{width:"750rpx",height:"84rpx",flexDirection:"row"}},"scroll-view-indicator":{"":{position:"relative",height:2,backgroundColor:"rgba(0,0,0,0)"}},"scroll-view-underline":{"":{position:"absolute",top:0,bottom:0,width:0,backgroundColor:"#007AFF"}},"scroll-view-animation":{"":{transitionDuration:200,transitionProperty:"left"}},"tab-bar-line":{"":{height:"1rpx",backgroundColor:"#cccccc"}},"tab-view":{"":{flex:1}},"uni-tab-item":{"":{flexWrap:"nowrap",paddingLeft:25,paddingRight:25}},"uni-tab-item-title":{"":{color:"#555555",fontSize:"30rpx",height:"80rpx",lineHeight:"80rpx",flexWrap:"nowrap"}},"uni-tab-item-title-active":{"":{color:"#007AFF"}},"swiper-item":{"":{flex:1,flexDirection:"column"}},"swiper-page":{"":{flex:1,flexDirection:"row",position:"absolute",left:0,top:0,right:0,bottom:0}},"refresh-view":{"":{width:"750rpx",height:80,flexDirection:"row",alignItems:"center",justifyContent:"center"}},"@TRANSITION":{"scroll-view-animation":{duration:200,property:"left"}}},R=weex.requireModule("dom"),F=100,H=3,_=1,N={components:{swiperPage:W},data(){return{tabList:[],tabIndex:0,cacheTab:[],scrollInto:"",indicatorLineLeft:0,indicatorLineWidth:0,isTap:!1,showTitleView:!0,pageHeight:300,pageId:"page",refreshing:!1,refreshText:"",refreshFlag:!1}},onLoad(){for(var e=0;e<6;e++)this.tabList.push({id:"tab"+e,name:"Tab "+(e+1),pageid:e+1})},onReady(){this.pageHeight=uni.getSystemInfoSync().windowHeight,this._lastTabIndex=0,this.swiperWidth=0,this.tabbarWidth=0,this.tabListSize={},this._touchTabIndex=0,this._headHeight=100,this.pageList=this.$refs.page,this.selectorQuery()},methods:{ontap1(e){u("log","at pages/template/swiper-list-nvue/swiper-list-nvue.nvue:99","ontap1",e)},ontabtap(e){let i=e.target.dataset.current||e.currentTarget.dataset.current;this.isTap=!0;var s=this.tabListSize[i];this.updateIndicator(s.left,s.width),this._touchTabIndex=i,this.switchTab(i)},onswiperchange(e){},onswiperscroll(e){if(!this.isTap){var i=e.detail.dx,s=this._lastTabIndex;if(i>_?s++:i<-_&&s--,!(s===this._lastTabIndex||s<0||s>this.pageList.length-1)){this.pageList[s].dataList.length===0&&this.loadTabData(s);var n=Math.abs(this.swiperWidth/i),r=this.tabListSize[this._lastTabIndex],a=this.tabListSize[s],o=r.left+(a.left-r.left)/n,c=r.width+(a.width-r.width)/n;this.updateIndicator(o,c)}}},animationfinish(e){let i=e.detail.current;this._touchTabIndex===i&&(this.isTap=!1),this._lastTabIndex=i,this.switchTab(i),this.updateIndicator(this.tabListSize[i].left,this.tabListSize[i].width)},selectorQuery(){uni.createSelectorQuery().in(this).select("#head").boundingClientRect().exec(s=>{this._headHeight=s[0].height}),uni.createSelectorQuery().in(this).select("#tab-bar").boundingClientRect().exec(s=>{this.tabbarWidth=s[0].width}),uni.createSelectorQuery().in(this).select("#tab-bar-view").boundingClientRect().exec(s=>{this.swiperWidth=s[0].width});for(var e=uni.createSelectorQuery().in(this),i=0;i<this.tabList.length;i++)e.select("#"+this.tabList[i].id).boundingClientRect();e.exec(s=>{s.forEach(n=>{this.tabListSize[n.dataset.id]=n}),this.updateIndicator(this.tabListSize[this.tabIndex].left,this.tabListSize[this.tabIndex].width),this.switchTab(this.tabIndex)})},updateIndicator(e,i){this.indicatorLineLeft=e,this.indicatorLineWidth=i},switchTab(e){if(this.pageList[e].dataList.length===0&&this.loadTabData(e),this.pageList[e].setScrollRef(this._headHeight),this.tabIndex!==e&&(this.pageList[this.tabIndex].dataList.length>F&&this.cacheTab.indexOf(this.tabIndex)<0&&this.cacheTab.push(this.tabIndex),this.tabIndex=e,this.scrollTabTo(e),this.cacheTab.length>H)){let i=this.cacheTab[0];this.clearTabData(i),this.cacheTab.splice(0,1)}},scrollTabTo(e){let i=this.$refs["tabitem"+e][0],s=0;e>0&&(s=this.tabbarWidth/2-this.tabListSize[e].width/2,this.tabListSize[e].right<this.tabbarWidth/2&&(s=this.tabListSize[0].width)),R.scrollToElement(i,{offset:-s})},loadTabData(e){this.pageList[e].loadData()},clearTabData(e){this.pageList[e].clear()},onrefresh(e){this.refreshing=!0,this.refreshText="\u5237\u65B0\u4E2D...",setTimeout(()=>{this.refreshing=!1,this.refreshFlag=!1,this.refreshText="\u5DF2\u5237\u65B0"},2e3)},onpullingdown(e){this.refreshing||(this.pulling=!1,Math.abs(e.pullingDistance)>Math.abs(e.viewHeight)?(this.refreshFlag=!0,this.refreshText="\u91CA\u653E\u7ACB\u5373\u5237\u65B0"):(this.refreshFlag=!1,this.refreshText="\u4E0B\u62C9\u53EF\u4EE5\u5237\u65B0"))}}};function V(e,i,s,n,r,a){let o=(0,t.resolveComponent)("swiper-page"),c=(0,t.resolveComponent)("swiper-item"),f=(0,t.resolveComponent)("swiper");return(0,t.openBlock)(),(0,t.createElementBlock)("list",{id:r.pageId,class:"page",bounce:!0,isSwiperList:"true"},[(0,t.createElementVNode)("refresh",{class:"refresh",onRefresh:i[0]||(i[0]=(...l)=>a.onrefresh&&a.onrefresh(...l)),onPullingdown:i[1]||(i[1]=(...l)=>a.onpullingdown&&a.onpullingdown(...l)),display:r.refreshing?"show":"hide"},[(0,t.createElementVNode)("div",{class:"refresh-view"},[(0,t.createElementVNode)("u-text",{class:"loading-text"},(0,t.toDisplayString)(r.refreshText),1)])],40,["display"]),(0,t.createElementVNode)("cell",null,[(0,t.createElementVNode)("view",{id:"head",class:"header"},[(0,t.createElementVNode)("u-text",{class:"header-title"},"header")])]),(0,t.createElementVNode)("cell",null,[(0,t.createElementVNode)("view",{class:"tabs",style:(0,t.normalizeStyle)("height:"+r.pageHeight+"px")},[(0,t.createElementVNode)("scroll-view",{ref:"tabbar1",id:"tab-bar",class:"tab-bar",scroll:!1,scrollX:!0,showScrollbar:!1,scrollIntoView:r.scrollInto},[(0,t.createElementVNode)("view",{style:{"flex-direction":"column"}},[(0,t.createElementVNode)("view",{style:{"flex-direction":"row"}},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.tabList,(l,h)=>((0,t.openBlock)(),(0,t.createElementBlock)("view",{class:"uni-tab-item",key:l.id,id:l.id,ref_for:!0,ref:"tabitem"+h,"data-id":h,"data-current":h,onClick:i[2]||(i[2]=(...v)=>a.ontabtap&&a.ontabtap(...v))},[(0,t.createElementVNode)("u-text",{class:(0,t.normalizeClass)(["uni-tab-item-title",r.tabIndex==h?"uni-tab-item-title-active":""])},(0,t.toDisplayString)(l.name),3)],8,["id","data-id","data-current"]))),128))]),(0,t.createElementVNode)("view",{class:"scroll-view-indicator"},[(0,t.createElementVNode)("view",{ref:"underline",class:(0,t.normalizeClass)(["scroll-view-underline",r.isTap?"scroll-view-animation":""]),style:(0,t.normalizeStyle)({left:r.indicatorLineLeft+"px",width:r.indicatorLineWidth+"px"})},null,6)])])],8,["scrollIntoView"]),(0,t.createElementVNode)("view",{class:"tab-bar-line"}),(0,t.createVNode)(f,{class:"tab-view",ref:"swiper1",id:"tab-bar-view",current:r.tabIndex,duration:300,onChange:a.onswiperchange,onTransition:a.onswiperscroll,onAnimationfinish:a.animationfinish,onOnAnimationEnd:a.animationfinish},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.tabList,(l,h)=>((0,t.openBlock)(),(0,t.createBlock)(c,{class:"swiper-item",key:h},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(o,{class:"swiper-page",pid:l.pageid,parentId:r.pageId,ref_for:!0,ref:"page"},null,8,["pid","parentId"])]),_:2},1024))),128))]),_:1},8,["current","onChange","onTransition","onAnimationfinish","onOnAnimationEnd"])],4)])],8,["id"])}var d=g(N,[["render",V],["styles",[E]]]);var b=plus.webview.currentWebview();if(b){let e=parseInt(b.id),i="pages/template/swiper-list-nvue/swiper-list-nvue",s={};try{s=JSON.parse(b.__query__)}catch(r){}d.mpType="page";let n=Vue.createPageApp(d,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:i,__pageQuery:s});n.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...d.styles||[]])),n.mount("#root")}})();
