// miniprogram/pages/detail/detail.js import { httpCloud } from "../../utils/httpFunc"; Page({ /** * 页面的初始数据 */ data: { detail: {} }, nameText: "", idText: "", /** * 生命周期函数--监听页面加载 */ onLoad: async function (options) { const _this = this; this.nameText = decodeURIComponent(options.title || "详情"); this.idText = options.id || ""; wx.setNavigationBarTitle({ title: this.nameText }) httpCloud({ name: "server", type: "getArticle", data: { id: options.id, }, call(res) { res.article_detail = res.article_detail.replace(/ 9 ? min : '0' + min) + ":" + (sec > 9 ? sec : '0' + sec); }, })