"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 d=Object.create;var l=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var S=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var H=(r,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of f(e))!m.call(r,s)&&s!==i&&l(r,s,{get:()=>e[s],enumerable:!(n=x(e,s))||n.enumerable});return r};var w=(r,e,i)=>(i=r!=null?d(y(r)):{},H(e||!r||!r.__esModule?l(i,"default",{value:r,enumerable:!0}):i,r));var g=S((B,h)=>{h.exports=Vue});var t=w(g());var u=(r,e)=>{let i=r.__vccOpts||r;for(let[n,s]of e)i[n]=s;return i};var T={content:{"":{flex:1,backgroundColor:"#f5f6f9"}},topview:{"":{position:"relative",alignItems:"center",backgroundColor:"#FFFFFF",marginBottom:"30rpx"}},header:{"":{paddingTop:0,paddingRight:"32rpx",paddingBottom:"10rpx",paddingLeft:"32rpx",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"750rpx"}},goback:{"":{width:"60rpx",height:"80rpx",justifyContent:"center",textAlign:"left"}},backicon:{"":{fontFamily:"uniicons",fontWeight:"600",fontSize:"40rpx",lineHeight:"80rpx"}},searchbox:{"":{width:"510rpx",height:"68rpx",backgroundColor:"#FFFFFF",boxShadow:"0rpx 0rpx 32rpx 0rpx rgba(0,0,0,0.1)",borderRadius:"34rpx",paddingTop:0,paddingRight:"30rpx",paddingBottom:0,paddingLeft:"30rpx",flexDirection:"row",alignItems:"center"}},"search-icon":{"":{width:"38rpx",height:"38rpx",marginRight:"24rpx"}},searchInput:{"":{fontSize:"26rpx",color:"#333333",fontWeight:"400",height:"68rpx",width:"380rpx"}},"search-btn":{"":{fontSize:"28rpx",lineHeight:"80rpx",color:"#FF0005",paddingTop:0,paddingRight:"20rpx",paddingBottom:0,paddingLeft:"20rpx"}},hisbox:{"":{paddingTop:0,paddingRight:"32rpx",paddingBottom:0,paddingLeft:"32rpx"}},"his-top":{"":{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"40rpx"}},title:{"":{fontSize:"36rpx",color:"#050B25",lineHeight:"50rpx",fontWeight:"600"}},"del-box":{"":{width:"50rpx",height:"50rpx"}},"del-img":{"":{width:"42rpx",height:"42rpx"}},"his-info":{"":{flexDirection:"row",flexWrap:"wrap"}},"his-sig":{"":{fontSize:"28rpx",color:"#050B25",height:"58rpx",lineHeight:"58rpx",paddingTop:0,paddingRight:"20rpx",paddingBottom:0,paddingLeft:"20rpx",backgroundColor:"#ffffff",borderRadius:"29rpx",marginTop:0,marginRight:"20rpx",marginBottom:"20rpx",marginLeft:0}}},b=weex.requireModule("dom");b.addRule("fontFace",{fontFamily:"uniicons",src:"url('/static/uni.ttf')"});var v={data(){return{iStatusBarHeight:0,placeHolder:"\u6377\u9014X90 | \u6377\u8FBEVS7 | \u5965\u8FEAA6L",searchText:"",searchHistory:[]}},mounted(){let r=uni.getSystemInfoSync();this.pageHeight=r.windowHeight,this.iStatusBarHeight=r.statusBarHeight},onShow(){this.searchText="",uni.getStorageSync("SEARCH_HISTORY")&&(this.searchHistory=JSON.parse(uni.getStorageSync("SEARCH_HISTORY")))},methods:{goBack(){uni.navigateBack()},getText(r){this.searchText=r.detail.value},searchFn(){if(this.searchText=this.searchText.replace(/\s+/ig," "),this.searchText==""||this.searchText==" "){uni.showToast({title:"\u5173\u952E\u8BCD\u4E0D\u80FD\u4E3A\u7A7A",icon:"none",mask:!0});return}let r=this;r.searchHistory.length>=20&&r.searchHistory.pop(),r.searchHistory=r.searchHistory.filter(e=>e!=r.searchText),this.searchHistory.unshift(this.searchText),uni.setStorageSync("SEARCH_HISTORY",JSON.stringify(this.searchHistory)),uni.navigateTo({url:"/pages/search/result/index?detail="+encodeURIComponent(JSON.stringify(r.searchText))})},goSearch(r){let e=this;e.searchHistory.length>=20&&e.searchHistory.pop(),e.searchHistory=e.searchHistory.filter(i=>i!=r),this.searchHistory.unshift(r),uni.setStorageSync("SEARCH_HISTORY",JSON.stringify(this.searchHistory)),uni.navigateTo({url:"/pages/search/result/index?detail="+encodeURIComponent(JSON.stringify(r))})},clearHistory(){uni.removeStorageSync("SEARCH_HISTORY"),this.searchHistory=[]}}};function _(r,e,i,n,s,a){return(0,t.openBlock)(),(0,t.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,t.createElementVNode)("view",{class:"content"},[(0,t.createElementVNode)("view",{class:"topview"},[(0,t.createElementVNode)("view",{class:"header",style:(0,t.normalizeStyle)({"padding-top":s.iStatusBarHeight+"px"})},[(0,t.createElementVNode)("view",{class:"goback",onClick:e[0]||(e[0]=o=>a.goBack())},[(0,t.createElementVNode)("u-text",{class:"backicon"},"\uE582")]),(0,t.createElementVNode)("view",{class:"searchbox"},[(0,t.createElementVNode)("u-image",{class:"search-icon",src:"/static/searchicon.png"}),(0,t.createElementVNode)("u-input",{class:"searchInput",type:"text",onInput:e[1]||(e[1]=(...o)=>a.getText&&a.getText(...o)),value:s.searchText,placeholder:s.placeHolder,confirmType:"search",onConfirm:e[2]||(e[2]=(...o)=>a.searchFn&&a.searchFn(...o))},null,40,["value","placeholder"])]),(0,t.createElementVNode)("u-text",{class:"search-btn",onClick:e[3]||(e[3]=(...o)=>a.searchFn&&a.searchFn(...o))},"\u641C\u7D22")],4)]),(0,t.createElementVNode)("view",{class:"hisbox"},[(0,t.createElementVNode)("view",{class:"his-top"},[(0,t.createElementVNode)("u-text",{class:"title"},"\u641C\u7D22\u5386\u53F2"),(0,t.createElementVNode)("view",{class:"del-box",onClick:e[4]||(e[4]=(...o)=>a.clearHistory&&a.clearHistory(...o))},[(0,t.createElementVNode)("u-image",{class:"del-img",src:"/static/select_clear.png"})])]),s.searchHistory.length>0?((0,t.openBlock)(),(0,t.createElementBlock)("view",{key:0,class:"his-info"},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.searchHistory,(o,F)=>((0,t.openBlock)(),(0,t.createElementBlock)("u-text",{class:"his-sig",onClick:C=>a.goSearch(o)},(0,t.toDisplayString)(o),9,["onClick"]))),256))])):(0,t.createCommentVNode)("",!0)])])])}var c=u(v,[["render",_],["styles",[T]]]);var p=plus.webview.currentWebview();if(p){let r=parseInt(p.id),e="pages/search/index",i={};try{i=JSON.parse(p.__query__)}catch(s){}c.mpType="page";let n=Vue.createPageApp(c,{$store:getApp({allowDefault:!0}).$store,__pageId:r,__pagePath:e,__pageQuery:i});n.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...c.styles||[]])),n.mount("#root")}})();
