// miniprogram/pages/detail/detail.js Page({ /** * 页面的初始数据 */ data: { detail: {} }, nameText: "", idText: "", /** * 生命周期函数--监听页面加载 */ onLoad: async function (options) { console.log(options) this.nameText = decodeURIComponent(options.title || "详情"); this.idText = options.id || ""; wx.setNavigationBarTitle({ title: this.nameText }) // const db = wx.cloud.database(); // const _ = db.command; // let list = await db.collection('data_news').where({ // _id: _.eq(options.id) // }).get(); // let D = list.data[0] || {}; // D.content = D.content.replace(/style=\"([a-z|A-Z|-|:|;|0-9|\.]*)\"/g, "").replace(/width=\"([a-z|A-Z|-|:|;|0-9|\.]*)\"/g, "").replace(/height=\"([a-z|A-Z|-|:|;|0-9|\.]*)\"/g, "").replace(/ 9 ? min : '0' + min) + ":" + (sec > 9 ? sec : '0' + sec); }, })