"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 j=Object.create;var k=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var H=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var M=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of N(t))!O.call(e,n)&&n!==r&&k(e,n,{get:()=>t[n],enumerable:!(o=F(t,n))||o.enumerable});return e};var I=(e,t,r)=>(r=e!=null?j(R(e)):{},M(t||!e||!e.__esModule?k(r,"default",{value:e,enumerable:!0}):r,e));var h=(e,t,r)=>new Promise((o,n)=>{var s=p=>{try{a(r.next(p))}catch(m){n(m)}},l=p=>{try{a(r.throw(p))}catch(m){n(m)}},a=p=>p.done?o(p.value):Promise.resolve(p.value).then(s,l);a((r=r.apply(e,t)).next())});var w=H((Q,D)=>{D.exports=Vue});var u=I(w());var S=(e,t)=>{let r=e.__vccOpts||e;for(let[o,n]of t)r[o]=n;return r};var P={tabbar_wrap:{"":{position:"fixed",bottom:0,left:0,width:"750rpx",height:"184rpx",backgroundColor:"rgba(0,0,0,0)",display:"flex",justifyContent:"center",alignItems:"center"}},tabbar:{"":{width:"686rpx",height:"120rpx",flexDirection:"row",paddingLeft:"86rpx",paddingRight:"86rpx",alignItems:"center",justifyContent:"space-between",backgroundColor:"#ffffff",borderRadius:"32rpx",boxShadow:"0rpx 0rpx 32rpx 0rpx rgba(0,0,0,0.1)"}},tab:{"":{alignItems:"center",justifyContent:"center"}},tabimg:{"":{width:"48rpx",height:"48rpx",marginBottom:"3rpx"}},"tab-text":{"":{fontSize:"24rpx",lineHeight:"33rpx",textAlign:"center",fontWeight:"400",color:"#8E8E93"}},"bar-cur":{"":{color:"#333333",fontWeight:"600"}}},z={props:{currentPage:{type:Number,default:0}},data(){return{currentItem:0,tabs:[{id:0,path:"/pages/index/index",text:"\u9996\u9875",icon:"/static/home.png",selectIcon:"/static/home1.png"},{id:1,path:"/pages/select/index",text:"\u9009\u8F66\u4E2D\u5FC3",icon:"/static/select.png",selectIcon:"/static/select1.png"},{id:2,path:"/pages/mycenter/index",text:"\u6211\u7684",icon:"/static/center.png",selectIcon:"/static/center1.png"}]}},mounted(){this.currentItem=this.currentPage,uni.hideTabBar()},methods:{changeItem(e){uni.switchTab({url:e.path})},stopClick(){return!1}}};function W(e,t,r,o,n,s){return(0,u.openBlock)(),(0,u.createElementBlock)("view",{class:"tabbar_wrap",onClick:t[0]||(t[0]=(0,u.withModifiers)((...l)=>s.stopClick&&s.stopClick(...l),["stop"])),renderWhole:!0},[(0,u.createElementVNode)("view",{class:"tabbar"},[((0,u.openBlock)(!0),(0,u.createElementBlock)(u.Fragment,null,(0,u.renderList)(n.tabs,(l,a)=>((0,u.openBlock)(),(0,u.createElementBlock)("view",{class:"tab",onClick:(0,u.withModifiers)(p=>s.changeItem(l),["stop"])},[(0,u.createElementVNode)("u-image",{class:"tabimg",src:n.currentItem==l.id?l.selectIcon:l.icon,mode:""},null,8,["src"]),(0,u.createElementVNode)("u-text",{class:(0,u.normalizeClass)(n.currentItem==l.id?"tab-text bar-cur":"tab-text")},(0,u.toDisplayString)(l.text),3)],8,["onClick"]))),256))])])}var L=S(z,[["render",W],["styles",[P]]]);var i=I(w());var re=I(w()),q=e=>typeof e=="string";function A(e,t,...r){uni.__log__?uni.__log__(e,t,...r):console[e].apply(console,[...r,t])}function U(e,t){return q(e)?t:e}var V={tips(e,t=2e3,r="bottom"){plus.nativeUI.toast(e,{type:"text",duration:t,align:"center",verticalAlign:r})},isIOS(){return uni.getSystemInfoSync().platform==="ios"},isAndroid(){return uni.getSystemInfoSync().platform==="android"},getUUID(){return h(this,null,function*(){return new Promise((e,t)=>{plus.device.getInfo({success:r=>{e(r.uuid)},fail:r=>{t(r)}})})})},timeToTimestamp(e){return new Date(e.replace(/-/g,"/"))},friendlyDate(e){let t=this.timeToTimestamp(e);var r={year:"%n% \u5E74\u524D",month:"%n% \u6708\u524D",day:"%n% \u5929\u524D",hour:"%n% \u5C0F\u65F6\u524D",minute:"%n% \u5206\u949F\u524D",second:"%n% \u79D2\u524D"},o=Date.now(),n=Math.floor((o-t)/1e3),s=Math.floor(n/60),l=Math.floor(s/60),a=Math.floor(l/24),p=Math.floor(a/30),m=Math.floor(p/12),d="",f=0;return m>0?(d="year",f=m):p>0?(d="month",f=p):a>0?(d="day",f=a):l>0?(d="hour",f=l):s>0?(d="minute",f=s):(d="second",f=n===0?n=1:n),r[d].replace("%n%",f)},base64Encode(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",o,n,s,l,a,p,m,d=0;for(e=this.utf8Encode(e);d<e.length;)o=e.charCodeAt(d++),n=e.charCodeAt(d++),s=e.charCodeAt(d++),l=o>>2,a=(o&3)<<4|n>>4,p=(n&15)<<2|s>>6,m=s&63,isNaN(n)?p=m=64:isNaN(s)&&(m=64),r=r+t.charAt(l)+t.charAt(a)+t.charAt(p)+t.charAt(m);return r},utf8Encode(e){e=e.replace(/\r\n/g,`
`);for(var t="",r=0;r<e.length;r++){var o=e.charCodeAt(r);o<128?t+=String.fromCharCode(o):o>127&&o<2048?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(o&63|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(o&63|128))}return t},utf8Decode(e){var t=[],r=0,o=0,n=0,s=0,l=0;for(e+="";r<e.length;)n=e.charCodeAt(r),n<128?(t[o++]=String.fromCharCode(n),r++):n>191&&n<224?(s=e.charCodeAt(r+1),t[o++]=String.fromCharCode((n&31)<<6|s&63),r+=2):(s=e.charCodeAt(r+1),l=e.charCodeAt(r+2),t[o++]=String.fromCharCode((n&15)<<12|(s&63)<<6|l&63),r+=3);return t.join("")},base64Decode(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,n,s,l,a,p,m,d=0,f=0,T="",y=[];if(!e)return e;for(e+="";d<e.length;)s=t.indexOf(e.charAt(d++)),l=t.indexOf(e.charAt(d++)),a=t.indexOf(e.charAt(d++)),p=t.indexOf(e.charAt(d++)),m=s<<18|l<<12|a<<6|p,r=m>>16&255,o=m>>8&255,n=m&255,a==64?y[f++]=String.fromCharCode(r):p==64?y[f++]=String.fromCharCode(r,o):y[f++]=String.fromCharCode(r,o,n);return T=y.join(""),this.utf8Decode(T)},hasNotchInScreen(){return plus.navigator.hasNotchInScreen()}},v=V,B=!1;function c(e){uni.getNetworkType({success:function(o){if(o.networkType=="none")return v.tips("\u8BF7\u68C0\u6D4B\u7F51\u7EDC\u8FDE\u63A5"),!1}}),e.loading&&uni.showLoading({title:"\u52A0\u8F7D\u4E2D...",mask:!0,icon:"none"});let t={};var r=uni.getStorageSync("USER_TOKEN");return t.Authorization=r,t["Content-Type"]="application/x-www-form-urlencoded",new Promise((o,n)=>{uni.request({url:e.url,method:e.method||"POST",data:e.data||{},header:t,timeout:5e3,success:s=>{B&&A("log","at utils/request.js:48",s),o(s.data)},fail:s=>{B&&A("log","at utils/request.js:52",s),n(s)},complete:s=>{e.loading&&uni.hideLoading()}})})}c.baseURL="https://newapp.cheshi.com";var C="USER_TOKEN",b="USER_INFO",g=c.baseURL+"/v1",G={baseURL:g,STORAGE_USER_KEY:b,isLogin(){return!!(uni.getStorageSync(C)&&uni.getStorageSync(b))},login(){return uni.navigateTo({url:"/pages/login/index"}),!1},bindThird(e){let t={url:g+"/user/bind-app",data:{openid:e.openid,type:e.type,unionid:e.unionid,nickname:e.nickname,avatar:e.avatar}};return c(t)},getUserInfo(e=!1){return h(this,null,function*(){if(!e){let o=uni.getStorageSync(b);if(o)return o}let t={url:g+"/person/user-info"};return(yield c(t)).data})},getCode(e,t,r,o){let n={url:g+"/user/get-code",data:{device_id:e,mobile:t,token:r,type:o}};return c(n)},fastLogin(e,t){let r={url:g+"/user/fast-login",data:{mobile:e,code:t}};return c(r)},logOff(){let e={url:g+"/person/log-off"};return c(e)},oAuthLogin(e,t,r,o,n,s,l){let a={url:g+"/user/oauth-login",data:{openid:e,type:t,unionid:r,nickname:o,user_img:n,mobile:s,code:l}};return c(a)},updateUserInfo(e,t){let r={url:g+"/person/update-user-info",data:{key:e,value:t}};return c(r)},bindMobile(e,t){let r={url:g+"/user/bind-mobile",data:{mobile:e,code:t}};return c(r)},getNewsHistory(e,t="news",r=10){let o={url:g+"/person/my-history",data:{type:t,page:e,limit:r},method:"POST"};return c(o)},getFocus(e,t=10){let r={url:g+"/person/my-focus",data:{page:e,limit:t},method:"POST"};return c(r)},addFocus(e){let t={url:g+"/person/add-focus",data:{to_uid:e},method:"post"};return c(t)},delFocus(e){let t={url:g+"/person/del-focus",data:{to_uid:e},method:"post"};return c(t)},getMyLikes(e){let t={url:g+"/collect/list",data:{type:e.type,page:e.page,limit:e.limit||30},method:"post"};return c(t)},getProvinceList(){let e={url:g+"/user/get-provinces"};return c(e)},getCityList(e){let t={url:g+"/user/get-citys",data:{provinceID:e}};return c(t)},logout(){this.updateUserClientId("del"),uni.removeStorageSync(C),uni.removeStorageSync(b)},getFavoriteList(e){let t={url:g+"/story/collectlist",data:{action:e.type||"all",page:e.page||1,pagesize:e.limit||10}};return c(t)},thirdLogin(e){return h(this,null,function*(){let t={url:g+"/user/oauth-login",data:{openid:e.openid,type:e.type,unionid:e.unionid,nickname:e.nickname,avatar:e.avatar,mobile:e.mobile,code:e.code}},r=yield c(t);if(v.tips(r.message),r.code==204&&e.mobile==0&&e.code==0)return uni.setStorageSync("LOGIN_BIND_INFO",t.data),uni.redirectTo({url:"/pages/user/bind-mobile/index"}),!1;if(r.code!=200)return uni.removeStorageSync(C),uni.removeStorageSync(b),!1;uni.setStorageSync(C,r.data.login_token),uni.setStorageSync(b,r.data.user_info),this.updateUserClientId("add"),uni.switchTab({url:"/pages/index/index"})})},share(e){return h(this,null,function*(){if(!this.isAppExists("wechat"))return!1;let[t,r]=yield uni.showActionSheet({itemList:["\u5206\u4EAB\u7ED9\u670B\u53CB","\u5206\u4EAB\u5230\u670B\u53CB\u5708"]});if(!r)return!1;let o=yield this.getUserInfo(),n=["video","live"].includes(e.imageType)?o.base_share_host+"/app_"+e.imageType+"_"+e.id+"/?s_id="+o.id:o.base_share_host+"/kaizen/article/"+o.id+"/"+e.id+".html",s=e.title_pic1||e.share_logo,l={provider:"weixin",scene:r.tapIndex==0?"WXSceneSession":"WXSenceTimeline",type:0,href:n,title:e.title+" - KAIZEN",summary:e.short_summary,imageUrl:s};uni.setClipboardData({data:e.short_summary}),yield uni.share(l);let a={url:g+"/story/share",data:{favid:e.id,action:e.imageType}};yield c(a)})},updateUserClientId(e){let t=uni.getStorageSync("UNI_PUSH_CLIENT_ID")||"";if(t=="")return!1;let r={url:g+"/user/push-device",data:{action:e,cid:t,from:v.isIOS()?"ios":"android"}};return c(r)},updateAppBadge(){let e=uni.getStorageSync("UNI_PUSH_CLIENT_ID")||"";if(e==""||v.isAndroid())return!1;let t={url:g+"/public/delete-badge",data:{cid:e,badge:0}};return c(t)},isAppExists(e){let t={};switch(e){case"wechat":t.pname="com.tencent.mm",t.action="weixin://";break;default:t.pname="",t.action=""}return plus.runtime.isApplicationExist(t)}},x=G;var K=weex.requireModule("dom");K.addRule("fontFace",{fontFamily:"uniicons",src:"url('/static/uni.ttf')"});var $={data(){return{iStatusBarHeight:0,isLogin:!1,userInfo:{user_img:"",realname:"",nickname:"",mobile:"",id:"",is_bind_weixin:!1,level:{name:"\u9A7E\u6821\u5B66\u5458",level:1,pic:""}}}},mounted(){return h(this,null,function*(){let e=uni.getSystemInfoSync();this.pageHeight=e.windowHeight,this.iStatusBarHeight=e.statusBarHeight,uni.$once("login",t=>{this.userInfo=t})})},onShow(){return h(this,null,function*(){this.isLogin=x.isLogin(),this.isLogin&&(this.userInfo=yield x.getUserInfo(!0))})},methods:{goLogin(){uni.navigateTo({url:"/pages/login/index"})},login(){},goHistory(){this.isLogin?uni.navigateTo({url:"/pages/mycenter/history"}):x.login()},goFocus(){this.isLogin?uni.navigateTo({url:"/pages/mycenter/myfocus"}):x.login()},goCollect(){this.isLogin?uni.navigateTo({url:"/pages/mycenter/collect"}):x.login()},goSetting(){uni.navigateTo({url:"/pages/mycenter/setting/index"})},goMessage(){this.isLogin?uni.navigateTo({url:"/pages/mycenter/message"}):x.login()}}},Y={content:{"":{backgroundColor:"#f5f6f9",flex:1}},"uni-icon":{"":{fontFamily:"uniicons",fontWeight:"normal"}},topview:{"":{position:"relative",alignItems:"center",paddingBottom:"20rpx"}},bgimg:{"":{width:"750rpx",height:"450rpx",position:"absolute",left:0,top:0}},"user-box":{"":{flexDirection:"row",alignItems:"center",justifyContent:"space-between",height:"160rpx",paddingTop:0,paddingRight:"32rpx",paddingBottom:0,paddingLeft:"32rpx",marginBottom:"60rpx"}},"user-left":{"":{width:"500rpx",overflow:"hidden",flexDirection:"column"}},"name-box":{"":{height:"78rpx",width:"500rpx",overflow:"hidden",position:"relative",marginBottom:"16rpx"}},line:{"":{width:"118rpx",height:"20rpx",backgroundImage:"linear-gradient(to right, #ff0005, #ff9656)",position:"absolute",left:0,bottom:0}},"user-name":{"":{fontSize:"56rpx",color:"#333333",fontWeight:"600",lineHeight:"78rpx"}},"level-box":{"":{height:"33rpx",flexDirection:"row"}},"level-icon":{"":{width:"24rpx",height:"24rpx",marginRight:"16rpx"}},level:{"":{fontSize:"24rpx",lineHeight:"33rpx"}},"user-img":{"":{width:"160rpx",height:"160rpx",paddingTop:"10rpx",paddingRight:"10rpx",paddingBottom:"10rpx",paddingLeft:"10rpx",borderRadius:"80rpx",boxShadow:"0rpx 0rpx 32rpx 0rpx rgba(0, 0, 0, 0.1)",overflow:"hidden",alignItems:"center",backgroundColor:"#ffffff"}},"user-icon":{"":{width:"140rpx",height:"140rpx",borderRadius:"70rpx"}},"tool-box":{"":{paddingTop:0,paddingRight:"32rpx",paddingBottom:0,paddingLeft:"32rpx"}},"tool-inner":{"":{backgroundColor:"#ffffff",borderRadius:"16rpx",paddingTop:"20rpx",paddingRight:"30rpx",paddingBottom:"20rpx",paddingLeft:"30rpx"}},"tool-sig":{"":{flexDirection:"row",justifyContent:"space-between",height:"85rpx",marginTop:"20rpx",marginRight:0,marginBottom:"20rpx",marginLeft:0,alignItems:"center"}},"sig-left":{"":{flexDirection:"row",alignItems:"center"}},"tool-icon":{"":{width:"40rpx",height:"40rpx",marginRight:"30rpx"}},"tool-text":{"":{fontSize:"32rpx",lineHeight:"45rpx",color:"#333333",fontWeight:"600"}},login:{"":{fontSize:"40rpx",fontWeight:"bold"}}};function X(e,t,r,o,n,s){let l=U((0,i.resolveDynamicComponent)("TabBars"),L);return(0,i.openBlock)(),(0,i.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,i.createElementVNode)("view",{class:"content"},[(0,i.createElementVNode)("u-image",{class:"bgimg",src:"/static/topbg.png"}),(0,i.createElementVNode)("view",{class:"topview",style:{height:"128rpx"}},[(0,i.createElementVNode)("view",{style:(0,i.normalizeStyle)({height:e.iStatusBarHeight+"px"})},null,4)]),(0,i.createElementVNode)("view",{class:"user-box"},[e.isLogin?((0,i.openBlock)(),(0,i.createElementBlock)("view",{key:0,class:"user-left"},[(0,i.createElementVNode)("view",{class:"name-box"},[(0,i.createElementVNode)("view",{class:"line"}),(0,i.createElementVNode)("u-text",{class:"user-name"},(0,i.toDisplayString)(e.userInfo.nickname),1)]),(0,i.createElementVNode)("view",{class:"level-box"},[(0,i.createElementVNode)("u-image",{class:"level-icon",src:"/static/level.png",mode:""}),(0,i.createElementVNode)("u-text",{class:"level"},(0,i.toDisplayString)(e.userInfo.level.name),1)])])):((0,i.openBlock)(),(0,i.createElementBlock)("view",{key:1,class:"login-box",onClick:t[0]||(t[0]=(...a)=>e.goLogin&&e.goLogin(...a))},[(0,i.createElementVNode)("u-text",{class:"login"},"\u767B\u5F55/\u6CE8\u518C")])),(0,i.createElementVNode)("view",{class:"user-img"},[(0,i.createElementVNode)("u-image",{class:"user-icon",src:e.isLogin?e.userInfo.user_img:"/static/user.png",mode:""},null,8,["src"])])]),(0,i.createElementVNode)("view",{class:"tool-box"},[(0,i.createElementVNode)("view",{class:"tool-inner"},[(0,i.createElementVNode)("view",{class:"tool-sig",onClick:t[1]||(t[1]=(...a)=>e.goFocus&&e.goFocus(...a))},[(0,i.createElementVNode)("view",{class:"sig-left"},[(0,i.createElementVNode)("u-image",{class:"tool-icon",src:"/static/heart-outlined.png",mode:""}),(0,i.createElementVNode)("u-text",{class:"tool-text"},"\u5173\u6CE8")]),(0,i.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")]),(0,i.createElementVNode)("view",{class:"tool-sig",onClick:t[2]||(t[2]=(...a)=>e.goCollect&&e.goCollect(...a))},[(0,i.createElementVNode)("view",{class:"sig-left"},[(0,i.createElementVNode)("u-image",{class:"tool-icon",src:"/static/star-outlined.png",mode:""}),(0,i.createElementVNode)("u-text",{class:"tool-text"},"\u6536\u85CF")]),(0,i.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")]),(0,i.createElementVNode)("view",{class:"tool-sig",onClick:t[3]||(t[3]=(...a)=>e.goHistory&&e.goHistory(...a))},[(0,i.createElementVNode)("view",{class:"sig-left"},[(0,i.createElementVNode)("u-image",{class:"tool-icon",src:"/static/index-outlined.png",mode:""}),(0,i.createElementVNode)("u-text",{class:"tool-text"},"\u8DB3\u8FF9")]),(0,i.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")]),(0,i.createElementVNode)("view",{class:"tool-sig",onClick:t[4]||(t[4]=(...a)=>e.goMessage&&e.goMessage(...a))},[(0,i.createElementVNode)("view",{class:"sig-left"},[(0,i.createElementVNode)("u-image",{class:"tool-icon",src:"/static/message-outlined.png",mode:""}),(0,i.createElementVNode)("u-text",{class:"tool-text"},"\u6D88\u606F")]),(0,i.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")]),(0,i.createElementVNode)("view",{class:"tool-sig",onClick:t[5]||(t[5]=(...a)=>e.goSetting&&e.goSetting(...a))},[(0,i.createElementVNode)("view",{class:"sig-left"},[(0,i.createElementVNode)("u-image",{class:"tool-icon",src:"/static/setting-outlined.png",mode:""}),(0,i.createElementVNode)("u-text",{class:"tool-text"},"\u8BBE\u7F6E")]),(0,i.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")])])])]),(0,i.createVNode)(l,{"current-page":2})])}var _=S($,[["render",X],["styles",[Y]]]);var E=plus.webview.currentWebview();if(E){let e=parseInt(E.id),t="pages/mycenter/index",r={};try{r=JSON.parse(E.__query__)}catch(n){}_.mpType="page";let o=Vue.createPageApp(_,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:t,__pageQuery:r});o.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,..._.styles||[]])),o.mount("#root")}})();
