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.

59 lines
1.4 KiB

// pages/choose_name/choose_name.js
Page({
/**
* 页面的初始数据
*/
data: {
},
option1: function(e) {
wx.setStorageSync('call_kind', '1');
wx.navigateTo({
url: '/pages/call_the_name/call_the_name',
})
},
option2: function(e) {
wx.setStorageSync('call_kind', '2');
wx.showModal({
editable:true,//显示输入框
placeholderText:'输入学号尾数',//显示输入框提示信息
success: res => {
if (res.confirm) { //点击了确认
console.log(res.content);//用户输入的值
wx.setStorageSync("lastNum", res.content);
wx.navigateTo({
url: '/pages/call_the_name/call_the_name',
})
} else {
console.log('用户点击了取消')
}
}
})
},
option3: function(e) {
wx.setStorageSync('call_kind', '3');
wx.showModal({
editable:true,//显示输入框
placeholderText:'输入姓氏',//显示输入框提示信息
success: res => {
if (res.confirm) { //点击了确认
console.log(res.content);//用户输入的值
wx.setStorageSync("firstname", res.content);
wx.navigateTo({
url: '/pages/call_the_name/call_the_name',
})
} else {
console.log('用户点击了取消')
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
})