"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 T=Object.create;var E=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var j=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var O=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of L(t))!N.call(e,o)&&o!==i&&E(e,o,{get:()=>t[o],enumerable:!(r=B(t,o))||r.enumerable});return e};var I=(e,t,i)=>(i=e!=null?T(D(e)):{},O(t||!e||!e.__esModule?E(i,"default",{value:e,enumerable:!0}):i,e));var h=(e,t,i)=>new Promise((r,o)=>{var n=g=>{try{u(i.next(g))}catch(f){o(f)}},c=g=>{try{u(i.throw(g))}catch(f){o(f)}},u=g=>g.done?r(g.value):Promise.resolve(g.value).then(n,c);u((i=i.apply(e,t)).next())});var S=j((W,A)=>{A.exports=Vue});var G=I(S());function F(e,t,...i){uni.__log__?uni.__log__(e,t,...i):console[e].apply(console,[...i,t])}var R={tips(e,t=2e3,i="bottom"){plus.nativeUI.toast(e,{type:"text",duration:t,align:"center",verticalAlign:i})},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:i=>{e(i.uuid)},fail:i=>{t(i)}})})})},timeToTimestamp(e){return new Date(e.replace(/-/g,"/"))},friendlyDate(e){let t=this.timeToTimestamp(e);var i={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"},r=Date.now(),o=Math.floor((r-t)/1e3),n=Math.floor(o/60),c=Math.floor(n/60),u=Math.floor(c/24),g=Math.floor(u/30),f=Math.floor(g/12),d="",m=0;return f>0?(d="year",m=f):g>0?(d="month",m=g):u>0?(d="day",m=u):c>0?(d="hour",m=c):n>0?(d="minute",m=n):(d="second",m=o===0?o=1:o),i[d].replace("%n%",m)},base64Encode(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="",r,o,n,c,u,g,f,d=0;for(e=this.utf8Encode(e);d<e.length;)r=e.charCodeAt(d++),o=e.charCodeAt(d++),n=e.charCodeAt(d++),c=r>>2,u=(r&3)<<4|o>>4,g=(o&15)<<2|n>>6,f=n&63,isNaN(o)?g=f=64:isNaN(n)&&(f=64),i=i+t.charAt(c)+t.charAt(u)+t.charAt(g)+t.charAt(f);return i},utf8Encode(e){e=e.replace(/\r\n/g,`
`);for(var t="",i=0;i<e.length;i++){var r=e.charCodeAt(i);r<128?t+=String.fromCharCode(r):r>127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(r&63|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(r&63|128))}return t},utf8Decode(e){var t=[],i=0,r=0,o=0,n=0,c=0;for(e+="";i<e.length;)o=e.charCodeAt(i),o<128?(t[r++]=String.fromCharCode(o),i++):o>191&&o<224?(n=e.charCodeAt(i+1),t[r++]=String.fromCharCode((o&31)<<6|n&63),i+=2):(n=e.charCodeAt(i+1),c=e.charCodeAt(i+2),t[r++]=String.fromCharCode((o&15)<<12|(n&63)<<6|c&63),i+=3);return t.join("")},base64Decode(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i,r,o,n,c,u,g,f,d=0,m=0,_="",x=[];if(!e)return e;for(e+="";d<e.length;)n=t.indexOf(e.charAt(d++)),c=t.indexOf(e.charAt(d++)),u=t.indexOf(e.charAt(d++)),g=t.indexOf(e.charAt(d++)),f=n<<18|c<<12|u<<6|g,i=f>>16&255,r=f>>8&255,o=f&255,u==64?x[m++]=String.fromCharCode(i):g==64?x[m++]=String.fromCharCode(i,r):x[m++]=String.fromCharCode(i,r,o);return _=x.join(""),this.utf8Decode(_)},hasNotchInScreen(){return plus.navigator.hasNotchInScreen()}},v=R,U=!1;function a(e){uni.getNetworkType({success:function(r){if(r.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 i=uni.getStorageSync("USER_TOKEN");return t.Authorization=i,t["Content-Type"]="application/x-www-form-urlencoded",new Promise((r,o)=>{uni.request({url:e.url,method:e.method||"POST",data:e.data||{},header:t,timeout:5e3,success:n=>{U&&F("log","at utils/request.js:48",n),r(n.data)},fail:n=>{U&&F("log","at utils/request.js:52",n),o(n)},complete:n=>{e.loading&&uni.hideLoading()}})})}a.baseURL="https://newapp.cheshi.com";var w="USER_TOKEN",b="USER_INFO",l=a.baseURL+"/v1",M={baseURL:l,STORAGE_USER_KEY:b,isLogin(){return!!(uni.getStorageSync(w)&&uni.getStorageSync(b))},login(){return uni.navigateTo({url:"/pages/login/index"}),!1},bindThird(e){let t={url:l+"/user/bind-app",data:{openid:e.openid,type:e.type,unionid:e.unionid,nickname:e.nickname,avatar:e.avatar}};return a(t)},getUserInfo(e=!1){return h(this,null,function*(){if(!e){let r=uni.getStorageSync(b);if(r)return r}let t={url:l+"/person/user-info"};return(yield a(t)).data})},getCode(e,t,i,r){let o={url:l+"/user/get-code",data:{device_id:e,mobile:t,token:i,type:r}};return a(o)},fastLogin(e,t){let i={url:l+"/user/fast-login",data:{mobile:e,code:t}};return a(i)},logOff(){let e={url:l+"/person/log-off"};return a(e)},oAuthLogin(e,t,i,r,o,n,c){let u={url:l+"/user/oauth-login",data:{openid:e,type:t,unionid:i,nickname:r,user_img:o,mobile:n,code:c}};return a(u)},updateUserInfo(e,t){let i={url:l+"/person/update-user-info",data:{key:e,value:t}};return a(i)},bindMobile(e,t){let i={url:l+"/user/bind-mobile",data:{mobile:e,code:t}};return a(i)},getNewsHistory(e,t="news",i=10){let r={url:l+"/person/my-history",data:{type:t,page:e,limit:i},method:"POST"};return a(r)},getFocus(e,t=10){let i={url:l+"/person/my-focus",data:{page:e,limit:t},method:"POST"};return a(i)},addFocus(e){let t={url:l+"/person/add-focus",data:{to_uid:e},method:"post"};return a(t)},delFocus(e){let t={url:l+"/person/del-focus",data:{to_uid:e},method:"post"};return a(t)},getMyLikes(e){let t={url:l+"/collect/list",data:{type:e.type,page:e.page,limit:e.limit||30},method:"post"};return a(t)},getProvinceList(){let e={url:l+"/user/get-provinces"};return a(e)},getCityList(e){let t={url:l+"/user/get-citys",data:{provinceID:e}};return a(t)},logout(){this.updateUserClientId("del"),uni.removeStorageSync(w),uni.removeStorageSync(b)},getFavoriteList(e){let t={url:l+"/story/collectlist",data:{action:e.type||"all",page:e.page||1,pagesize:e.limit||10}};return a(t)},thirdLogin(e){return h(this,null,function*(){let t={url:l+"/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}},i=yield a(t);if(v.tips(i.message),i.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(i.code!=200)return uni.removeStorageSync(w),uni.removeStorageSync(b),!1;uni.setStorageSync(w,i.data.login_token),uni.setStorageSync(b,i.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,i]=yield uni.showActionSheet({itemList:["\u5206\u4EAB\u7ED9\u670B\u53CB","\u5206\u4EAB\u5230\u670B\u53CB\u5708"]});if(!i)return!1;let r=yield this.getUserInfo(),o=["video","live"].includes(e.imageType)?r.base_share_host+"/app_"+e.imageType+"_"+e.id+"/?s_id="+r.id:r.base_share_host+"/kaizen/article/"+r.id+"/"+e.id+".html",n=e.title_pic1||e.share_logo,c={provider:"weixin",scene:i.tapIndex==0?"WXSceneSession":"WXSenceTimeline",type:0,href:o,title:e.title+" - KAIZEN",summary:e.short_summary,imageUrl:n};uni.setClipboardData({data:e.short_summary}),yield uni.share(c);let u={url:l+"/story/share",data:{favid:e.id,action:e.imageType}};yield a(u)})},updateUserClientId(e){let t=uni.getStorageSync("UNI_PUSH_CLIENT_ID")||"";if(t=="")return!1;let i={url:l+"/user/push-device",data:{action:e,cid:t,from:v.isIOS()?"ios":"android"}};return a(i)},updateAppBadge(){let e=uni.getStorageSync("UNI_PUSH_CLIENT_ID")||"";if(e==""||v.isAndroid())return!1;let t={url:l+"/public/delete-badge",data:{cid:e,badge:0}};return a(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)}},p=M;var s=I(S());var k=(e,t)=>{let i=e.__vccOpts||e;for(let[r,o]of t)i[r]=o;return i};var P={"uni-icon":{"":{fontFamily:"uniicons",fontWeight:"normal",color:"#434343",marginLeft:"22rpx"}},content:{"":{backgroundColor:"#f5f6f9",flex:1}},page:{"":{flex:1}},whiteview:{"":{marginTop:"20rpx",backgroundColor:"#FFFFFF",paddingTop:0,paddingRight:"32rpx",paddingBottom:0,paddingLeft:"32rpx"}},sigbox:{"":{flexDirection:"row",justifyContent:"space-between",height:"105rpx",borderBottomWidth:"1rpx",borderBottomColor:"#d1d1d6",borderBottomStyle:"solid",alignItems:"center"}},sigtext:{"":{fontSize:"32rpx",color:"#333333"}},"sig-right":{"":{flexDirection:"row",alignItems:"center"}},imgbox:{"":{width:"46rpx",height:"46rpx",borderRadius:"23rpx",overflow:"hidden"}},userimg:{"":{width:"46rpx",height:"46rpx",borderRadius:"23rpx"}},noboder:{"":{borderBottomWidth:0}},loginout:{"":{lineHeight:"50rpx",fontSize:"32rpx",fontWeight:"600",color:"#ff0005",marginTop:"60rpx"}},outbox:{"":{flexDirection:"row",alignItems:"center",justifyContent:"center"}}},z=weex.requireModule("dom");z.addRule("fontFace",{fontFamily:"uniicons",src:"url('/static/uni.ttf')"});var K={data(){return{isLogin:!1,userInfo:{user_img:"",realname:"",nickname:"",mobile:"",id:"",is_bind_weixin:!1,level:{name:"\u9A7E\u6821\u5B66\u5458",level:1,pic:""}},unserToken:"",storageSize:0,storageKeys:[],version:"1.0.0"}},onShow(){return h(this,null,function*(){this.isLogin=p.isLogin(),this.isLogin&&(this.userInfo=yield p.getUserInfo(!0)),plus.runtime.getProperty(plus.runtime.appid,e=>{this.version=e.version})})},onLoad(e){return h(this,null,function*(){})},onReady(){this.getStorage()},methods:{getStorage(){let e=this;uni.getStorageInfo({success:function(t){e.storageKeys=t.keys.filter((i,r)=>i!="USER_INFO"&&i!="USER_TOKEN"),e.storageSize=(t.currentSize/1024).toFixed(2),e.storageSize==0&&(e.storageSize=0)}}),this.isLogin&&(this.unserToken=uni.getStorageSync("USER_TOKEN"))},clearStorage(){let e=this;uni.showModal({content:"\u786E\u5B9A\u8981\u6E05\u9664\u6240\u6709\u7F13\u5B58\u4FE1\u606F\u5417\uFF1F",success:function(t){t.confirm&&(e.storageKeys.length>0?e.storageKeys.forEach((i,r)=>{uni.removeStorage({key:i,success(o){r==e.storageKeys.length-1&&uni.showModal({content:"\u6E05\u7406\u5B8C\u6210",showCancel:!1})}})}):uni.showModal({content:"\u6E05\u7406\u5B8C\u6210",showCancel:!1}))}})},setUserImg(){if(!this.isLogin)p.login();else{let e=this;uni.chooseImage({count:1,sizeType:["original","compressed"],crop:{width:400,height:400},success:function(t){let i=t.tempFilePaths;uni.uploadFile({url:a.baseURL+"/v1/upload/add",filePath:i[0],name:"file",success:r=>{let o=JSON.parse(r.data);o.code==200&&e.changeImg(o.data)}})}})}},changeImg(e){return h(this,null,function*(){(yield p.updateUserInfo("user_img",e)).code==200&&(this.userInfo=yield p.getUserInfo(!0))})},changeName(){if(!this.isLogin)p.login();else{let e=this;uni.showModal({title:"\u8BF7\u8F93\u5165\u8981\u4FEE\u6539\u7684\u6635\u79F0",editable:!0,success:function(t){t.confirm&&e.changeNickName(t.content)}})}},changeNickName(e){return h(this,null,function*(){(yield p.updateUserInfo("nickname",e)).code==200&&(this.userInfo=yield p.getUserInfo(!0))})},goShare(){},loginUout(){uni.showModal({content:"\u786E\u5B9A\u9000\u51FA\u767B\u5F55\u5417\uFF1F",success:function(e){e.confirm&&(p.logout(),uni.navigateBack())}})},toAboutUs(){uni.navigateTo({url:"/pages/webview/index?page="+encodeURIComponent("https://newapp.cheshi.com/v1/user/aboutus")+"&pageTitle=\u5173\u4E8E\u6211\u4EEC"})},logOff(){uni.navigateTo({url:"/pages/mycenter/setting/logOff"})},bindapp(){uni.navigateTo({url:"/pages/mycenter/setting/bindApp"})},aboutYs(){uni.navigateTo({url:"/pages/webview/index?page="+encodeURIComponent("https://a.cheshi.com/aboutus/cj_ys.html")})},fadeBack(){this.isLogin?uni.navigateTo({url:"/pages/mycenter/setting/feedback"}):p.login()}}};function q(e,t,i,r,o,n){let c=(0,s.resolveComponent)("switch");return(0,s.openBlock)(),(0,s.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,s.createElementVNode)("view",{class:"content"},[(0,s.createElementVNode)("list",{class:"page"},[(0,s.createElementVNode)("cell",null,[(0,s.createElementVNode)("view",{class:"whiteview"},[(0,s.createElementVNode)("view",{class:"sigbox",onClick:t[0]||(t[0]=(...u)=>n.setUserImg&&n.setUserImg(...u))},[(0,s.createElementVNode)("u-text",{class:"sigtext"},"\u5934\u50CF"),(0,s.createElementVNode)("view",{class:"sig-right"},[(0,s.createElementVNode)("view",{class:"imgbox"},[(0,s.createElementVNode)("u-image",{class:"userimg",src:o.isLogin?o.userInfo.user_img:"https://img2.cheshi-img.com/t_77095/202207/62ced72b272c2.jpg!img.270x178",mode:""},null,8,["src"])]),(0,s.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")])]),(0,s.createElementVNode)("view",{class:(0,s.normalizeClass)(["sigbox",o.isLogin?"":"noboder"]),onClick:t[1]||(t[1]=(...u)=>n.changeName&&n.changeName(...u))},[(0,s.createElementVNode)("u-text",{class:"sigtext"},"\u6635\u79F0"),(0,s.createElementVNode)("view",{class:"sig-right"},[(0,s.createElementVNode)("u-text",{class:"sigtext"},(0,s.toDisplayString)(o.userInfo.nickname),1),(0,s.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")])],2),o.isLogin?((0,s.openBlock)(),(0,s.createElementBlock)("view",{key:0,class:"sigbox noboder",onClick:t[2]||(t[2]=(...u)=>n.bindapp&&n.bindapp(...u))},[(0,s.createElementVNode)("u-text",{class:"sigtext"},"\u8D26\u53F7\u7ED1\u5B9A"),(0,s.createElementVNode)("view",{class:"sig-right"},[(0,s.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")])])):(0,s.createCommentVNode)("",!0)])]),(0,s.createElementVNode)("cell",null,[(0,s.createElementVNode)("view",{class:"whiteview"},[(0,s.createElementVNode)("view",{class:"sigbox noboder",onClick:t[3]||(t[3]=(...u)=>n.fadeBack&&n.fadeBack(...u))},[(0,s.createElementVNode)("u-text",{class:"sigtext"},"\u610F\u89C1\u53CD\u9988"),(0,s.createElementVNode)("view",{class:"sig-right"},[(0,s.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")])])])]),(0,s.createElementVNode)("cell",null,[(0,s.createElementVNode)("view",{class:"whiteview",onClick:t[4]||(t[4]=(...u)=>n.aboutYs&&n.aboutYs(...u))},[(0,s.createElementVNode)("view",{class:"sigbox"},[(0,s.createElementVNode)("u-text",{class:"sigtext"},"\u5141\u8BB8\u4E2A\u6027\u5316\u5B9A\u5411\u63A8\u9001"),(0,s.createElementVNode)("view",{class:"sig-right"},[(0,s.createVNode)(c,{checked:""})])]),(0,s.createElementVNode)("view",{class:"sigbox noboder"},[(0,s.createElementVNode)("u-text",{class:"sigtext"},"\u9690\u79C1\u653F\u7B56"),(0,s.createElementVNode)("view",{class:"sig-right"},[(0,s.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")])])])]),(0,s.createElementVNode)("cell",null,[(0,s.createElementVNode)("view",{class:"whiteview"},[(0,s.createElementVNode)("view",{class:"sigbox",onClick:t[5]||(t[5]=(...u)=>n.clearStorage&&n.clearStorage(...u))},[(0,s.createElementVNode)("u-text",{class:"sigtext"},"\u6E05\u7A7A\u7F13\u5B58"),(0,s.createElementVNode)("view",{class:"sig-right"},[(0,s.createElementVNode)("u-text",{class:"sigtext"},(0,s.toDisplayString)(o.storageSize)+"MB",1),(0,s.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")])]),(0,s.createElementVNode)("view",{class:"sigbox",onClick:t[6]||(t[6]=(...u)=>n.toAboutUs&&n.toAboutUs(...u))},[(0,s.createElementVNode)("u-text",{class:"sigtext"},"\u5173\u4E8E\u6211\u4EEC"),(0,s.createElementVNode)("view",{class:"sig-right"},[(0,s.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")])]),(0,s.createElementVNode)("view",{class:(0,s.normalizeClass)(["sigbox",o.isLogin?"":"noboder"])},[(0,s.createElementVNode)("u-text",{class:"sigtext"},"\u5F53\u524D\u7248\u672C"),(0,s.createElementVNode)("view",{class:"sig-right"},[(0,s.createElementVNode)("u-text",{class:"sigtext"},(0,s.toDisplayString)(o.version),1)])],2),o.isLogin?((0,s.openBlock)(),(0,s.createElementBlock)("view",{key:0,class:"sigbox noboder",onClick:t[7]||(t[7]=(...u)=>n.logOff&&n.logOff(...u))},[(0,s.createElementVNode)("u-text",{class:"sigtext"},"\u6CE8\u9500\u8D26\u53F7"),(0,s.createElementVNode)("view",{class:"sig-right"},[(0,s.createElementVNode)("u-text",{class:"uni-icon"},"\uE470")])])):(0,s.createCommentVNode)("",!0)])]),o.isLogin?((0,s.openBlock)(),(0,s.createElementBlock)("cell",{key:0},[(0,s.createElementVNode)("view",{class:"outbox",onClick:t[8]||(t[8]=(...u)=>n.loginUout&&n.loginUout(...u))},[(0,s.createElementVNode)("u-text",{class:"loginout"},"\u9000\u51FA\u767B\u5F55")])])):(0,s.createCommentVNode)("",!0)])])])}var y=k(K,[["render",q],["styles",[P]]]);var C=plus.webview.currentWebview();if(C){let e=parseInt(C.id),t="pages/mycenter/setting/index",i={};try{i=JSON.parse(C.__query__)}catch(o){}y.mpType="page";let r=Vue.createPageApp(y,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:t,__pageQuery:i});r.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...y.styles||[]])),r.mount("#root")}})();
