// pages/mUser/pAbout/pAbout.js const app = getApp() Page({ /** * 页面的初始数据 */ data: { version: app.globalData.version, }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { }, goto(e) { var url = "" var index = e.currentTarget.dataset.index switch (index) { case "0": wx.downloadFile({ url: app.globalData.agreement, success: function (res) { wx.hideLoading() const filePath = res.tempFilePath wx.openDocument({ filePath: filePath, success: function (res) { console.log('打开文档成功') }, fail(error) { console.log(error); } }) } }) return; case "1": url = "/pages/mUser/pChangepw/pChangepw" break; } if (url != "") { wx.navigateTo({ url: url }) } else { wx.showToast({ title: '功能敬请期待', duration: 1000, icon: 'none', mask: true, }) } }, })