// pages/home/customer-info/index.js import { getCustomerInfo } from "../../../api/saas" const util = require('../../../utils/util') Page({ /** * 页面的初始数据 */ data: { form: null, base64: null, showEmbedded: false, customerName: '' }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { if(options.id){ wx.showLoading({ title: '正在获取', mask: true }) getCustomerInfo(options.id).then(result => { wx.hideLoading() this.setData({ form: result.data }) }).catch(err => { wx.hideLoading() util.showToast(err) }) } }, onClickHideEmbedded: function(){ this.setData({ showEmbedded: false }) }, registCustomer: function(){ wx.navigateTo({ url: `/pages/client/registe/index?id=${this.data.form.id}` }) } })