查询个人信息

master
zxy19971014 7 years ago
parent a003b437ce
commit 5e4ad58da7

@ -14,9 +14,9 @@ Page({
method: "POST", method: "POST",
}, },
success: function (res) { success: function (res) {
var book = res.data var user = res.data
let bookstr = JSON.stringify(book); let userstr = JSON.stringify(user);
console.log(book);
if (res.data == "100") { if (res.data == "100") {
wx.showModal({ wx.showModal({
title: '登录消息', title: '登录消息',
@ -37,7 +37,12 @@ Page({
title: '登录消息', title: '登录消息',
content: '登录成功', content: '登录成功',
confirmColor: "rgba(253, 153, 65, 1)", confirmColor: "rgba(253, 153, 65, 1)",
success: function (res) { success: function (res) {
wx.setStorageSync('userstr', userstr)
console.log(wx.getStorageSync('userstr'));
if (res.confirm) { if (res.confirm) {
wx.switchTab({ wx.switchTab({
url: '../shouye/shouye', url: '../shouye/shouye',
@ -46,23 +51,8 @@ Page({
} }
}) })
} }
},
fail: function (res) {
console.log("失败");
} }
}) })
},
wx.request({ }
url: 'http://localhost:9528/zxbook/find2',
data: {
'search': e.target.id,
},
header: {
"Content-Type": "application/json"
},
methods: {
method: "POST",
},
}) })

@ -5,63 +5,20 @@ const app = getApp();
// 创建页面实例对象 // 创建页面实例对象
Page({ Page({
/** onLoad: function () {
* 页面名称 var userstr=wx.getStorageSync('userstr')
*/ console.log(userstr);
name: "index", let user = JSON.parse(userstr);
/** console.log(user);
* 页面的初始数据 var that = this
*/ that.setData({
userid: user.userid,
username: user.username,
userauthor: user.userpassword
})
}
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
//以下为自定义点击事件
}) })

@ -1,5 +1,4 @@
<image class="wx-image_TCMtbw" mode="scaleToFill" src="//o3bnyc.creatby.com/diazo/images/image-placeholder.svg" style="background-size: 100% 100%; background-position: 0% 0%; background-repeat: no-repeat; background-image: url(http://o3bnyc.creatby.com/diazo/images/image-placeholder.svg);"/> <image class="wx-image_TCMtbw" mode="scaleToFill" src="//o3bnyc.creatby.com/diazo/images/image-placeholder.svg" style="background-size: 100% 100%; background-position: 0% 0%; background-repeat: no-repeat; background-image: url(http://o3bnyc.creatby.com/diazo/images/image-placeholder.svg);"/>
<text class="c-block wx-text_3ayXhS" > 姓名:</text> <text class="c-block wx-text_3ayXhS" > 姓名:{{username}}</text>
<input class="inputText" maxlength="15" name="userid"value="{{userid}}" /> <text class="c-block wx-text_cEEG0A" > 学号:{{userid}}</text>
<text class="c-block wx-text_cEEG0A" > 学号:${userpassword}</text> <text class="c-block wx-text_lkXRAs" > 密码:</text>
<text class="c-block wx-text_lkXRAs" > 密码:${username}</text>

@ -13,7 +13,7 @@
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.4.0", "libVersion": "2.4.0",
"appid": "wxb280d1925541c356", "appid": "wxb280d1925541c356",
"projectname": "34", "projectname": "35",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
}, },

Loading…
Cancel
Save