let app = getApp() Page({ /** * 页面的初始数据 */ data: { cursor:0, ifName: true }, bindTextAreaBlur(e) { this.setData({ cursor: e.detail.cursor }) }, /** * 生命周期函数--监听页面加载 */ onShow(e) { this.getList() }, getList() { let that = this app.AjaxRequest('get', { 'content-type': 'application/json', 'Authorization': 'Bearer ' + app.Getopenid() }, '/user/profile', {}, function (res) { that.setData({ memberInfo: res.data, sexindex: res.data.sex }) }) }, chooseimage: function () { var that = this let imgUrl = that.data.imgUrl wx.chooseImage({ count: 1, // 默认9 sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 success: function (res) { console.log(res.tempFilePaths[0]) wx.navigateTo({ url: '../cropper/cropper?img=' + res.tempFilePaths[0], }) } }) }, navCropper() { this.chooseimage() } })