"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 A=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var k=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var L=(e,t,r,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of j(t))!N.call(e,o)&&o!==r&&A(e,o,{get:()=>t[o],enumerable:!(u=U(t,o))||u.enumerable});return e};var x=(e,t,r)=>(r=e!=null?T(O(e)):{},L(t||!e||!e.__esModule?A(r,"default",{value:e,enumerable:!0}):r,e));var h=(e,t,r)=>new Promise((u,o)=>{var i=l=>{try{c(r.next(l))}catch(f){o(f)}},s=l=>{try{c(r.throw(l))}catch(f){o(f)}},c=l=>l.done?u(l.value):Promise.resolve(l.value).then(i,s);c((r=r.apply(e,t)).next())});var b=k((H,F)=>{F.exports=Vue});var K=x(b());function w(e,t,...r){uni.__log__?uni.__log__(e,t,...r):console[e].apply(console,[...r,t])}var R={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"},u=Date.now(),o=Math.floor((u-t)/1e3),i=Math.floor(o/60),s=Math.floor(i/60),c=Math.floor(s/24),l=Math.floor(c/30),f=Math.floor(l/12),d="",g=0;return f>0?(d="year",g=f):l>0?(d="month",g=l):c>0?(d="day",g=c):s>0?(d="hour",g=s):i>0?(d="minute",g=i):(d="second",g=o===0?o=1:o),r[d].replace("%n%",g)},base64Encode(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",u,o,i,s,c,l,f,d=0;for(e=this.utf8Encode(e);d<e.length;)u=e.charCodeAt(d++),o=e.charCodeAt(d++),i=e.charCodeAt(d++),s=u>>2,c=(u&3)<<4|o>>4,l=(o&15)<<2|i>>6,f=i&63,isNaN(o)?l=f=64:isNaN(i)&&(f=64),r=r+t.charAt(s)+t.charAt(c)+t.charAt(l)+t.charAt(f);return r},utf8Encode(e){e=e.replace(/\r\n/g,`
`);for(var t="",r=0;r<e.length;r++){var u=e.charCodeAt(r);u<128?t+=String.fromCharCode(u):u>127&&u<2048?(t+=String.fromCharCode(u>>6|192),t+=String.fromCharCode(u&63|128)):(t+=String.fromCharCode(u>>12|224),t+=String.fromCharCode(u>>6&63|128),t+=String.fromCharCode(u&63|128))}return t},utf8Decode(e){var t=[],r=0,u=0,o=0,i=0,s=0;for(e+="";r<e.length;)o=e.charCodeAt(r),o<128?(t[u++]=String.fromCharCode(o),r++):o>191&&o<224?(i=e.charCodeAt(r+1),t[u++]=String.fromCharCode((o&31)<<6|i&63),r+=2):(i=e.charCodeAt(r+1),s=e.charCodeAt(r+2),t[u++]=String.fromCharCode((o&15)<<12|(i&63)<<6|s&63),r+=3);return t.join("")},base64Decode(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,u,o,i,s,c,l,f,d=0,g=0,E="",y=[];if(!e)return e;for(e+="";d<e.length;)i=t.indexOf(e.charAt(d++)),s=t.indexOf(e.charAt(d++)),c=t.indexOf(e.charAt(d++)),l=t.indexOf(e.charAt(d++)),f=i<<18|s<<12|c<<6|l,r=f>>16&255,u=f>>8&255,o=f&255,c==64?y[g++]=String.fromCharCode(r):l==64?y[g++]=String.fromCharCode(r,u):y[g++]=String.fromCharCode(r,u,o);return E=y.join(""),this.utf8Decode(E)},hasNotchInScreen(){return plus.navigator.hasNotchInScreen()}},_=R,D=!1;function n(e){uni.getNetworkType({success:function(u){if(u.networkType=="none")return _.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((u,o)=>{uni.request({url:e.url,method:e.method||"POST",data:e.data||{},header:t,timeout:5e3,success:i=>{D&&w("log","at utils/request.js:48",i),u(i.data)},fail:i=>{D&&w("log","at utils/request.js:52",i),o(i)},complete:i=>{e.loading&&uni.hideLoading()}})})}n.baseURL="https://newapp.cheshi.com";var C="USER_TOKEN",m="USER_INFO",a=n.baseURL+"/v1",M={baseURL:a,STORAGE_USER_KEY:m,isLogin(){return!!(uni.getStorageSync(C)&&uni.getStorageSync(m))},login(){return uni.navigateTo({url:"/pages/login/index"}),!1},bindThird(e){let t={url:a+"/user/bind-app",data:{openid:e.openid,type:e.type,unionid:e.unionid,nickname:e.nickname,avatar:e.avatar}};return n(t)},getUserInfo(e=!1){return h(this,null,function*(){if(!e){let u=uni.getStorageSync(m);if(u)return u}let t={url:a+"/person/user-info"};return(yield n(t)).data})},getCode(e,t,r,u){let o={url:a+"/user/get-code",data:{device_id:e,mobile:t,token:r,type:u}};return n(o)},fastLogin(e,t){let r={url:a+"/user/fast-login",data:{mobile:e,code:t}};return n(r)},logOff(){let e={url:a+"/person/log-off"};return n(e)},oAuthLogin(e,t,r,u,o,i,s){let c={url:a+"/user/oauth-login",data:{openid:e,type:t,unionid:r,nickname:u,user_img:o,mobile:i,code:s}};return n(c)},updateUserInfo(e,t){let r={url:a+"/person/update-user-info",data:{key:e,value:t}};return n(r)},bindMobile(e,t){let r={url:a+"/user/bind-mobile",data:{mobile:e,code:t}};return n(r)},getNewsHistory(e,t="news",r=10){let u={url:a+"/person/my-history",data:{type:t,page:e,limit:r},method:"POST"};return n(u)},getFocus(e,t=10){let r={url:a+"/person/my-focus",data:{page:e,limit:t},method:"POST"};return n(r)},addFocus(e){let t={url:a+"/person/add-focus",data:{to_uid:e},method:"post"};return n(t)},delFocus(e){let t={url:a+"/person/del-focus",data:{to_uid:e},method:"post"};return n(t)},getMyLikes(e){let t={url:a+"/collect/list",data:{type:e.type,page:e.page,limit:e.limit||30},method:"post"};return n(t)},getProvinceList(){let e={url:a+"/user/get-provinces"};return n(e)},getCityList(e){let t={url:a+"/user/get-citys",data:{provinceID:e}};return n(t)},logout(){this.updateUserClientId("del"),uni.removeStorageSync(C),uni.removeStorageSync(m)},getFavoriteList(e){let t={url:a+"/story/collectlist",data:{action:e.type||"all",page:e.page||1,pagesize:e.limit||10}};return n(t)},thirdLogin(e){return h(this,null,function*(){let t={url:a+"/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 n(t);if(_.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(m),!1;uni.setStorageSync(C,r.data.login_token),uni.setStorageSync(m,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 u=yield this.getUserInfo(),o=["video","live"].includes(e.imageType)?u.base_share_host+"/app_"+e.imageType+"_"+e.id+"/?s_id="+u.id:u.base_share_host+"/kaizen/article/"+u.id+"/"+e.id+".html",i=e.title_pic1||e.share_logo,s={provider:"weixin",scene:r.tapIndex==0?"WXSceneSession":"WXSenceTimeline",type:0,href:o,title:e.title+" - KAIZEN",summary:e.short_summary,imageUrl:i};uni.setClipboardData({data:e.short_summary}),yield uni.share(s);let c={url:a+"/story/share",data:{favid:e.id,action:e.imageType}};yield n(c)})},updateUserClientId(e){let t=uni.getStorageSync("UNI_PUSH_CLIENT_ID")||"";if(t=="")return!1;let r={url:a+"/user/push-device",data:{action:e,cid:t,from:_.isIOS()?"ios":"android"}};return n(r)},updateAppBadge(){let e=uni.getStorageSync("UNI_PUSH_CLIENT_ID")||"";if(e==""||_.isAndroid())return!1;let t={url:a+"/public/delete-badge",data:{cid:e,badge:0}};return n(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)}},B=M;var p=x(b());var I=(e,t)=>{let r=e.__vccOpts||e;for(let[u,o]of t)r[u]=o;return r};var P={content:{"":{flex:1,justifyContent:"space-between",paddingTop:"40rpx",paddingRight:"32rpx",paddingBottom:"40rpx",paddingLeft:"32rpx",backgroundColor:"#ffffff"}},tips:{"":{fontWeight:"600",fontSize:"28rpx",lineHeight:"44rpx"}},"p-list":{"":{fontSize:"28rpx",lineHeight:"44rpx"}},"off-btn":{"":{textAlign:"center",fontSize:"30rpx",color:"#ffffff",height:"88rpx",lineHeight:"88rpx",backgroundColor:"#ff0005",borderRadius:"16rpx"}}},q={data(){return{}},methods:{logoff(){return h(this,null,function*(){(yield B.logOff()).code==200&&(uni.showToast({title:"\u63D0\u4EA4\u6210\u529F",icon:"none"}),setTimeout(()=>{uni.clearStorageSync(),uni.navigateBack()},1500))})}}};function z(e,t,r,u,o,i){return(0,p.openBlock)(),(0,p.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,p.createElementVNode)("view",{class:"content"},[(0,p.createElementVNode)("view",{class:"con-top"},[(0,p.createElementVNode)("u-text",{class:"tips"},"\u5728\u63D0\u4EA4\u6CE8\u9500\u7533\u8BF7\u524D\uFF0C\u8BF7\u8BA4\u771F\u9605\u8BFB\u4EE5\u4E0B\u987B\u77E5"),(0,p.createElementVNode)("u-text",{class:"p-list"},"1.\u8D26\u53F7\u6CE8\u9500\u540E\uFF0C\u8D26\u53F7\u5185\u5982\u6709\u79EF\u5206\u5C06\u505A\u6E05\u96F6\u4F5C\u5E9F\u5904\u7406\uFF1B"),(0,p.createElementVNode)("u-text",{class:"p-list"},"2.\u8D26\u53F7\u6CE8\u9500\u540E\uFF0C\u8D26\u53F7\u5185\u7684\u5404\u7C7B\u4F18\u60E0\u5238\u7B49\u865A\u62DF\u8D22\u4EA7\u5C06\u505A\u6E05\u96F6\u4F5C\u5E9F\u5904\u7406\uFF1B"),(0,p.createElementVNode)("u-text",{class:"p-list"},"3.\u8D26\u53F7\u6D89\u53CA\u7EA0\u7EB7\u65F6\uFF0C\u5305\u62EC\u6295\u8BC9\u3001\u4E3E\u62A5\u6216\u88AB\u6295\u8BC9\u3001\u88AB\u4E3E\u62A5\u7B49\u60C5\u5F62\u4E0B\u65E0\u6CD5\u5B8C\u6210\u6CE8\u9500\u3002")]),(0,p.createElementVNode)("u-text",{class:"off-btn",onClick:t[0]||(t[0]=(...s)=>i.logoff&&i.logoff(...s))},"\u6CE8\u9500")])])}var S=I(q,[["render",z],["styles",[P]]]);var v=plus.webview.currentWebview();if(v){let e=parseInt(v.id),t="pages/mycenter/setting/logOff",r={};try{r=JSON.parse(v.__query__)}catch(o){}S.mpType="page";let u=Vue.createPageApp(S,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:t,__pageQuery:r});u.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...S.styles||[]])),u.mount("#root")}})();
