You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
// pages/revise/revise.js
|
|
|
|
|
Page({
|
|
|
|
|
|
|
|
|
|
data: {
|
|
|
|
|
gender: '女',
|
|
|
|
|
username: 'Lily',
|
|
|
|
|
QQ:'784562136',
|
|
|
|
|
phone:'14236654896',
|
|
|
|
|
imgUrl: "/images/me.jpg",
|
|
|
|
|
color1:'#e3f4ff'
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
changeAvatar: function() {
|
|
|
|
|
wx.chooseImage({
|
|
|
|
|
count: 1,
|
|
|
|
|
sizeType: ['original', 'compressed'],
|
|
|
|
|
sourceType: ['album', 'camera'],
|
|
|
|
|
success: res => {
|
|
|
|
|
// tempFilePath可以作为img标签的src属性显示图片
|
|
|
|
|
var tempFilePaths = res.tempFilePaths
|
|
|
|
|
this.setData({
|
|
|
|
|
imgUrl: tempFilePaths
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
jump: function(e) {
|
|
|
|
|
// 跳转到“个人资料修改页”
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
// 为了避免用户名中的特殊字符破坏字符串结构,使用encodeURIComponent()编码
|
|
|
|
|
url: '/pages/content/content?username=' + encodeURIComponent(this.data.username) + '&gender=' + encodeURIComponent(this.data.gender)+ '&QQ=' + encodeURIComponent(this.data.QQ)+ '&phone=' + encodeURIComponent(this.data.phone)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|