// pages/meeting/meetingPolicy/meetingPolicy.js const app = getApp() import { policyById } from "../../../api/meeting/meetingRoom.js" Page({ /** * 页面的初始数据 */ data: { policy: {}, IMG_NAME: app.IMG_NAME, policyImages:[ "/profile/static/shanghai_changyang/policy/policy0.jpg", "/profile/static/shanghai_changyang/policy/policy1.jpg", "/profile/static/shanghai_changyang/policy/policy2.jpg", "/profile/static/shanghai_changyang/policy/policy3.jpg", "/profile/static/shanghai_changyang/policy/policy4.jpg", "/profile/static/shanghai_changyang/policy/policy5.jpg", ] }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { let _this = this policyById(15).then(res => { _this.setData({ policy: res.data }) }) }, clickImg(e){ console.log(e); var index = e.currentTarget.dataset.index console.log(this.data.IMG_NAME); let img= this.data.policyImages.map(item =>this.data.IMG_NAME +item) //所有图片 wx.previewImage({ //当前显示图片 current: img[index], //所有图片 urls: img }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })