查询个人信息

master
zxy19971014 6 years ago
parent a003b437ce
commit 5e4ad58da7

@ -14,9 +14,9 @@ Page({
method: "POST",
},
success: function (res) {
var book = res.data
let bookstr = JSON.stringify(book);
console.log(book);
var user = res.data
let userstr = JSON.stringify(user);
if (res.data == "100") {
wx.showModal({
title: '登录消息',
@ -37,7 +37,12 @@ Page({
title: '登录消息',
content: '登录成功',
confirmColor: "rgba(253, 153, 65, 1)",
success: function (res) {
wx.setStorageSync('userstr', userstr)
console.log(wx.getStorageSync('userstr'));
if (res.confirm) {
wx.switchTab({
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({
/**
* 页面名称
*/
name: "index",
/**
* 页面的初始数据
*/
onLoad: function () {
var userstr=wx.getStorageSync('userstr')
console.log(userstr);
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);"/>
<text class="c-block wx-text_3ayXhS" > 姓名:</text>
<input class="inputText" maxlength="15" name="userid"value="{{userid}}" />
<text class="c-block wx-text_cEEG0A" > 学号:${userpassword}</text>
<text class="c-block wx-text_lkXRAs" > 密码:${username}</text>
<text class="c-block wx-text_3ayXhS" > 姓名:{{username}}</text>
<text class="c-block wx-text_cEEG0A" > 学号:{{userid}}</text>
<text class="c-block wx-text_lkXRAs" > 密码:</text>

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

Loading…
Cancel
Save