import { getMail } from '../../api/mail' import { BASE_URL } from '../../api/request' Page({ data: { mail: {}, attachments: [], BASE_URL: BASE_URL }, onLoad(options) { console.log(options.id) getMail(options.id).then(data => { this.setData({ mail: data, attachments: JSON.parse(data.attachments) }) }) }, });