import { deprecate} from "../../js/utils"; const app = getApp(); Component({ properties: { user_id:{ type:Number, value:-1 }, message:{ type:"String", value:"点击登录,获取更多内容" }, bg:{ type:String, value:"#0080f0" } }, attached(){ deprecate("require-login"); }, pageLifetimes:{ show:function(){ app.syncUser() .then(res=>{ if(this.data.user_id!=res.user.user_id){ if(this.data.user_id!=-1) this.triggerEvent("change",{}); this.setData({user_id: res.user.user_id}); } }) } } })