代码拉取完成,页面将自动刷新
//app.js
import {
bus
} from './common/bus/index.js';
import {cloud} from './common/cloud/index.js';
import {formatTime} from './utils/util.js';
let env = 'chiyao-ct0yu';
App({
cloud,
formatTime,
onLaunch: async function() {
console.warn = ()=>{}
wx.cloud.init({env: env,traceUser: true,});
this.db = wx.cloud.database({env: env});
bus.$on('get_medication_reminder',(callBack)=>{
if(typeof this.user.medication_reminder !== 'undefined'){
callBack({total:this.user.medication_reminder})
}else{
this.callBack = callBack;
}
})
let data = await cloud.call('login');
this.id = data.id;
this.up_user();
},
async up_user() {
let res = await this.db.collection('Member').doc(this.id).get();
this.user = res.data;
bus.$emit('up_user',res.data);
if(this.callBack){
this.callBack({total:this.user.medication_reminder})
}
},
user:{},
bus,
week: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。