onLoad: function (options) {
console.log(options)
//判断当前页面是否有缓存
let sto = wx.getStorageSync('storage');
//判断对象中是否有指定的属性,返回布尔值
let stoBool = sto.hasOwnProperty(options.id);//返回false
//console.log(stoBool)
//
//promise的方法
//从服务器获取数据,条件isgood>0
//let that = this;
let geturl=`${url}/db/cpntent.php?where=id=${options.id}`;
util.getData2(geturl).then((res)=>{
//console.log(res)//没用let
res.pic=url+res.pic;
this.setData({
food:res
})
//动态设置导航栏标题
wx.setNavigationBarTitle({
title:res.title
})
})
//绑定
this.setData({
//创建音频
"IAC":wx.createInnerAudioContext(),
"IAC.src":`${url}/images/music.mp3`,
"IAC.loop":true
})
},