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.
35 lines
957 B
35 lines
957 B
// pages/content/content.js
|
|
Page({
|
|
data: {
|
|
username: '',
|
|
gender: '女',
|
|
phone:'12365485952',
|
|
QQ:'789546231'
|
|
},
|
|
|
|
onLoad: function(options) {
|
|
this.setData({
|
|
// 收到数据后使用decodeURIComponent()解码
|
|
username: decodeURIComponent(options.username),
|
|
gender: decodeURIComponent(options.gender),
|
|
phone: decodeURIComponent(options.phone),
|
|
QQ: decodeURIComponent(options.QQ)
|
|
})
|
|
},
|
|
formSubmit: function(e) {
|
|
// 表单返回的所有数据
|
|
var formData = e.detail.value
|
|
// 获取上一个页面的对象
|
|
var pages = getCurrentPages()
|
|
var prevPage = pages[pages.length - 2]
|
|
// 调用上一个页面的 setData() 方法,把数据存到上一个页面中去
|
|
prevPage.setData({
|
|
username: formData.username,
|
|
gender: formData.gender,
|
|
phone: formData.phone,
|
|
qq: formData.qq,
|
|
})
|
|
// 返回到上一个页面
|
|
wx.navigateBack()
|
|
}
|
|
}) |