"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 U=Object.create;var A=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var R=(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 i of N(t))!B.call(e,i)&&i!==r&&A(e,i,{get:()=>t[i],enumerable:!(o=j(t,i))||o.enumerable});return e};var D=(e,t,r)=>(r=e!=null?U(O(e)):{},M(t||!e||!e.__esModule?A(r,"default",{value:e,enumerable:!0}):r,e));var m=(e,t,r)=>new Promise((o,i)=>{var n=l=>{try{s(r.next(l))}catch(g){i(g)}},d=l=>{try{s(r.throw(l))}catch(g){i(g)}},s=l=>l.done?o(l.value):Promise.resolve(l.value).then(n,d);s((r=r.apply(e,t)).next())});var w=R((Y,I)=>{I.exports=Vue});var J=D(w());function S(e,t,...r){uni.__log__?uni.__log__(e,t,...r):console[e].apply(console,[...r,t])}var P={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 m(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(),i=Math.floor((o-t)/1e3),n=Math.floor(i/60),d=Math.floor(n/60),s=Math.floor(d/24),l=Math.floor(s/30),g=Math.floor(l/12),p="",h=0;return g>0?(p="year",h=g):l>0?(p="month",h=l):s>0?(p="day",h=s):d>0?(p="hour",h=d):n>0?(p="minute",h=n):(p="second",h=i===0?i=1:i),r[p].replace("%n%",h)},base64Encode(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",o,i,n,d,s,l,g,p=0;for(e=this.utf8Encode(e);p<e.length;)o=e.charCodeAt(p++),i=e.charCodeAt(p++),n=e.charCodeAt(p++),d=o>>2,s=(o&3)<<4|i>>4,l=(i&15)<<2|n>>6,g=n&63,isNaN(i)?l=g=64:isNaN(n)&&(g=64),r=r+t.charAt(d)+t.charAt(s)+t.charAt(l)+t.charAt(g);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,i=0,n=0,d=0;for(e+="";r<e.length;)i=e.charCodeAt(r),i<128?(t[o++]=String.fromCharCode(i),r++):i>191&&i<224?(n=e.charCodeAt(r+1),t[o++]=String.fromCharCode((i&31)<<6|n&63),r+=2):(n=e.charCodeAt(r+1),d=e.charCodeAt(r+2),t[o++]=String.fromCharCode((i&15)<<12|(n&63)<<6|d&63),r+=3);return t.join("")},base64Decode(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,i,n,d,s,l,g,p=0,h=0,T="",b=[];if(!e)return e;for(e+="";p<e.length;)n=t.indexOf(e.charAt(p++)),d=t.indexOf(e.charAt(p++)),s=t.indexOf(e.charAt(p++)),l=t.indexOf(e.charAt(p++)),g=n<<18|d<<12|s<<6|l,r=g>>16&255,o=g>>8&255,i=g&255,s==64?b[h++]=String.fromCharCode(r):l==64?b[h++]=String.fromCharCode(r,o):b[h++]=String.fromCharCode(r,o,i);return T=b.join(""),this.utf8Decode(T)},hasNotchInScreen(){return plus.navigator.hasNotchInScreen()}},y=P,k=!1;function u(e){uni.getNetworkType({success:function(o){if(o.networkType=="none")return y.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,i)=>{uni.request({url:e.url,method:e.method||"POST",data:e.data||{},header:t,timeout:5e3,success:n=>{k&&S("log","at utils/request.js:48",n),o(n.data)},fail:n=>{k&&S("log","at utils/request.js:52",n),i(n)},complete:n=>{e.loading&&uni.hideLoading()}})})}u.baseURL="https://newapp.cheshi.com";var v="USER_TOKEN",_="USER_INFO",c=u.baseURL+"/v1",z={baseURL:c,STORAGE_USER_KEY:_,isLogin(){return!!(uni.getStorageSync(v)&&uni.getStorageSync(_))},login(){return uni.navigateTo({url:"/pages/login/index"}),!1},bindThird(e){let t={url:c+"/user/bind-app",data:{openid:e.openid,type:e.type,unionid:e.unionid,nickname:e.nickname,avatar:e.avatar}};return u(t)},getUserInfo(e=!1){return m(this,null,function*(){if(!e){let o=uni.getStorageSync(_);if(o)return o}let t={url:c+"/person/user-info"};return(yield u(t)).data})},getCode(e,t,r,o){let i={url:c+"/user/get-code",data:{device_id:e,mobile:t,token:r,type:o}};return u(i)},fastLogin(e,t){let r={url:c+"/user/fast-login",data:{mobile:e,code:t}};return u(r)},logOff(){let e={url:c+"/person/log-off"};return u(e)},oAuthLogin(e,t,r,o,i,n,d){let s={url:c+"/user/oauth-login",data:{openid:e,type:t,unionid:r,nickname:o,user_img:i,mobile:n,code:d}};return u(s)},updateUserInfo(e,t){let r={url:c+"/person/update-user-info",data:{key:e,value:t}};return u(r)},bindMobile(e,t){let r={url:c+"/user/bind-mobile",data:{mobile:e,code:t}};return u(r)},getNewsHistory(e,t="news",r=10){let o={url:c+"/person/my-history",data:{type:t,page:e,limit:r},method:"POST"};return u(o)},getFocus(e,t=10){let r={url:c+"/person/my-focus",data:{page:e,limit:t},method:"POST"};return u(r)},addFocus(e){let t={url:c+"/person/add-focus",data:{to_uid:e},method:"post"};return u(t)},delFocus(e){let t={url:c+"/person/del-focus",data:{to_uid:e},method:"post"};return u(t)},getMyLikes(e){let t={url:c+"/collect/list",data:{type:e.type,page:e.page,limit:e.limit||30},method:"post"};return u(t)},getProvinceList(){let e={url:c+"/user/get-provinces"};return u(e)},getCityList(e){let t={url:c+"/user/get-citys",data:{provinceID:e}};return u(t)},logout(){this.updateUserClientId("del"),uni.removeStorageSync(v),uni.removeStorageSync(_)},getFavoriteList(e){let t={url:c+"/story/collectlist",data:{action:e.type||"all",page:e.page||1,pagesize:e.limit||10}};return u(t)},thirdLogin(e){return m(this,null,function*(){let t={url:c+"/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 u(t);if(y.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(v),uni.removeStorageSync(_),!1;uni.setStorageSync(v,r.data.login_token),uni.setStorageSync(_,r.data.user_info),this.updateUserClientId("add"),uni.switchTab({url:"/pages/index/index"})})},share(e){return m(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(),i=["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",n=e.title_pic1||e.share_logo,d={provider:"weixin",scene:r.tapIndex==0?"WXSceneSession":"WXSenceTimeline",type:0,href:i,title:e.title+" - KAIZEN",summary:e.short_summary,imageUrl:n};uni.setClipboardData({data:e.short_summary}),yield uni.share(d);let s={url:c+"/story/share",data:{favid:e.id,action:e.imageType}};yield u(s)})},updateUserClientId(e){let t=uni.getStorageSync("UNI_PUSH_CLIENT_ID")||"";if(t=="")return!1;let r={url:c+"/user/push-device",data:{action:e,cid:t,from:y.isIOS()?"ios":"android"}};return u(r)},updateAppBadge(){let e=uni.getStorageSync("UNI_PUSH_CLIENT_ID")||"";if(e==""||y.isAndroid())return!1;let t={url:c+"/public/delete-badge",data:{cid:e,badge:0}};return u(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=z;var f=D(w());var C=(e,t)=>{let r=e.__vccOpts||e;for(let[o,i]of t)r[o]=i;return r};var W={nodata_template:{"":{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"}},wrap:{".nodata_template ":{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},nodataimg:{".nodata_template .wrap ":{width:"360rpx",marginBottom:"20rpx"}},text:{".nodata_template .wrap .nodatatxt ":{textAlign:"center",fontSize:"24rpx",color:"#8E8E93"}}},q={props:{oWidth:{type:[String],default:"750rpx"},oHeight:{type:[String],default:"600rpx"},oTxt:{type:[String],default:"\u6682\u65E0\u6570\u636E"}},methods:{}};function H(e,t,r,o,i,n){return(0,f.openBlock)(),(0,f.createElementBlock)("view",{class:"nodata_template",style:(0,f.normalizeStyle)({height:r.oHeight,width:r.oWidth}),renderWhole:!0},[(0,f.createElementVNode)("view",{class:"wrap"},[(0,f.createElementVNode)("u-image",{class:"nodataimg",src:"/static/nodata.png",mode:"widthFix"}),(0,f.createElementVNode)("view",{class:"nodatatxt"},[(0,f.createElementVNode)("u-text",{class:"text"},(0,f.toDisplayString)(r.oTxt),1)])])],4)}var F=C(q,[["render",H],["styles",[W]]]);var a=D(w());var V={page:{"":{flex:1,paddingTop:0,paddingRight:"32rpx",paddingBottom:0,paddingLeft:"32rpx",backgroundColor:"#ffffff"}},nodata:{"":{paddingTop:"100rpx",paddingRight:0,paddingBottom:"100rpx",paddingLeft:0,color:"#8E8E93",fontSize:"24rpx",textAlign:"center"}},nrbox:{"":{marginTop:"60rpx",flexDirection:"row",justifyContent:"space-between",alignItems:"center",height:"100rpx"}},leftbox:{"":{width:"514rpx",flexDirection:"row",alignItems:"center"}},imgbox:{"":{width:"100rpx",height:"100rpx",overflow:"hidden",borderRadius:"50rpx",marginRight:"38rpx"}},img:{"":{width:"100rpx",height:"100rpx",borderRadius:"50rpx"}},namebox:{"":{alignItems:"center"}},name:{"":{fontSize:"32rpx",color:"#333333",fontWeight:"600",height:"45rpx",lineHeight:"45rpx",lines:1,textOverflow:"ellipsis",width:"476rpx"}},rightbox:{"":{height:"60rpx",lineHeight:"58rpx",borderWidth:"1rpx",borderColor:"#D1D1D6",backgroundColor:"#ffffff",fontSize:"28rpx",color:"#333333",paddingTop:0,paddingRight:"24rpx",paddingBottom:0,paddingLeft:"24rpx",borderRadius:"30rpx"}},redbg:{"":{backgroundColor:"#ff0005",borderColor:"#ff0005",color:"#ffffff"}},ldbox:{"":{paddingTop:"20rpx",paddingRight:0,paddingBottom:"20rpx",paddingLeft:0,textAlign:"center",flexDirection:"row",justifyContent:"center",alignItems:"flex-start"}}},G={components:{noData:F},data(){return{theList:[],pages:1,isLoading:!1,canLoad:!1,loadingText:"\u52A0\u8F7D\u4E2D...",focusText:["\u5173\u6CE8","\u5173\u6CE8","\u5DF2\u5173\u6CE8","\u4E92\u76F8\u5173\u6CE8"]}},onLoad(e){return m(this,null,function*(){this.getList()})},methods:{getList(){return m(this,null,function*(){if(this.canLoad)return;this.canLoad=!0;let e=yield x.getFocus(this.pages,40);e.code==200?(e.data.length>0?(this.theList=this.theList.concat(e.data),this.canLoad=!1,this.isLoading=!1):this.loadingText="\u6CA1\u6709\u66F4\u591A\u4E86",this.pages+=1):uni.showToast({title:e.message,icon:"none",mask:!0})})},follow(e,t,r){return m(this,null,function*(){let o=[];switch(e){case 0:o=yield x.addFocus(t),o.code==200&&(this.theList[r].focus_status=2,uni.showToast({title:"\u5173\u6CE8\u6210\u529F",icon:"none",mask:!0}));break;case 1:o=yield x.addFocus(t),o.code==200&&(this.theList[r].focus_status=3,uni.showToast({title:"\u5173\u6CE8\u6210\u529F",icon:"none",mask:!0}));break;case 2:o=yield x.delFocus(t),S("log","at pages/mycenter/myfocus.nvue:100",o),o.code==200&&(this.theList[r].focus_status=0,uni.showToast({title:"\u5DF2\u53D6\u6D88\u5173\u6CE8",icon:"none",mask:!0}));break;case 3:o=yield x.delFocus(t),o.code==200&&(this.theList[r].focus_status=1,uni.showToast({title:"\u5DF2\u53D6\u6D88\u5173\u6CE8",icon:"none",mask:!0}));break}})},goDetail(e){uni.navigateTo({url:"/pages/news/index?id="+e+"&type=news"})},onloading(e){this.isLoading=!0,setTimeout(()=>{this.getList()},2e3)}}};function K(e,t,r,o,i,n){let d=(0,a.resolveComponent)("no-data");return(0,a.openBlock)(),(0,a.createElementBlock)("list",{class:"page",bounce:!0,loadmoreoffset:"1"},[i.theList.length<=0?((0,a.openBlock)(),(0,a.createElementBlock)("cell",{key:0},[(0,a.createVNode)(d,{oHeight:"800rpx",oWidth:"686rpx",oTxt:"\u8FD8\u6CA1\u6709\u5173\u6CE8\u4EFB\u4F55\u4F5C\u8005"})])):(0,a.createCommentVNode)("",!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(i.theList,(s,l)=>((0,a.openBlock)(),(0,a.createElementBlock)("cell",{key:l},[(0,a.createElementVNode)("view",{class:"nrbox"},[(0,a.createElementVNode)("view",{class:"leftbox"},[(0,a.createElementVNode)("view",{class:"imgbox"},[(0,a.createElementVNode)("u-image",{class:"img",src:s.user_img,mode:""},null,8,["src"])]),(0,a.createElementVNode)("view",{class:"namebox"},[(0,a.createElementVNode)("u-text",{class:"name"},(0,a.toDisplayString)(s.name),1)])]),(0,a.createElementVNode)("u-text",{class:(0,a.normalizeClass)(["rightbox",s.focus_status<=1?"redbg":""]),onClick:g=>n.follow(s.focus_status,s.uid,l)},(0,a.toDisplayString)(i.focusText[s.focus_status]),11,["onClick"])])]))),128)),i.isLoading?((0,a.openBlock)(),(0,a.createElementBlock)("cell",{key:1},[(0,a.createElementVNode)("view",{class:"ldbox"},[(0,a.createElementVNode)("u-text",null,(0,a.toDisplayString)(i.loadingText),1)])])):(0,a.createCommentVNode)("",!0),i.theList.length>20?((0,a.openBlock)(),(0,a.createElementBlock)("loading",{key:2,class:"loadingbox",onLoading:t[0]||(t[0]=(...s)=>n.onloading&&n.onloading(...s)),display:i.isLoading?"show":"hide"},null,40,["display"])):(0,a.createCommentVNode)("",!0)])}var E=C(G,[["render",K],["styles",[V]]]);var L=plus.webview.currentWebview();if(L){let e=parseInt(L.id),t="pages/mycenter/myfocus",r={};try{r=JSON.parse(L.__query__)}catch(i){}E.mpType="page";let o=Vue.createPageApp(E,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:t,__pageQuery:r});o.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...E.styles||[]])),o.mount("#root")}})();
