//index.js
//获取应用实例
var app = getApp()
Page({
data: {
motto: '欢迎登录WXapp',
userInfo: {},
userName:'',
userPassword:'',
id_token:'',
responseData:'',
boo:false
},
//事件处理函数
bindViewTap: function() {
wx.navigateTo({
url: '../logs/logs'
})
},
userNameInput:function(e){
this.setData({
userName: e.detail.value
})
},
userPasswordInput:function(e){
this.setData({
userPassword: e.detail.value
})
console.log(e.detail.value)
},
logIn:function(){
var that = this
wx.request({
url: 'http://localhost:8000/index/ajax_dict',
// data: {
// username: this.data.userName,
// password: this.data.userPassword,
// },
method: 'GET',
success: function (res) {
that.setData({
responseData:res.data.result[0].body
});
wx.setStorage({
key:"responseData",
data:that.data.responseData
});
try {
wx.setStorageSync('id_token', res.data.id_token)
} catch (e) {
console.log('there is no id_token')
}
wx.navigateTo({
url: '../components/welcome/welcome'
})
console.log(res.data);
},
fail: function (res) {
console.log(res.data);
console.log('is failed')
}
})
},
onLoad: function () {
console.log('onLoad')
var that = this
//调用应用实例的方法获取全局数据
app.getUserInfo(function(userInfo){
//更新数据
that.setData({
userInfo:userInfo
})
})
},
onShow: function(){
console.log('index is show')
},
shuaxin:function(){
wx.redirectTo({
url: '../index/index'
})
},
onReady:function(){
console.log('indx is on ready')
},
onHide:function(){
console.log('index is on hide')
},
onUnload:function(){
console.log('indx is on unload')
},
boo:function(){
this.setData({
boo:!this.data.boo
});
}
})
没有合适的资源?快使用搜索试试~ 我知道了~
小程序实现搜索/检索功能
共36个文件
js:9个
wxml:7个
png:7个
3星 · 超过75%的资源 需积分: 50 103 下载量 103 浏览量
2018-05-07
17:18:46
上传
评论 3
收藏 848KB ZIP 举报
温馨提示
小程序实现页面的搜索功能,保证快捷搜索,页面的检索
资源推荐
资源详情
资源评论
收起资源包目录
搜索功能.zip (36个子文件)
搜索功能
myBlog-wxapp-master
project.config.json 564B
.project 674B
pages
logs
logs.wxml 179B
logs.json 56B
logs.wxss 114B
logs.js 280B
index
index.wxss 461B
index.wxml 801B
index.js 2KB
components
component2
search
search.json 53B
search.js 2KB
search.wxml 1016B
search.wxss 797B
component2.json 124B
component2.js 2KB
component2.wxss 1KB
component2.wxml 2KB
result
result.wxml 37B
result.js 12B
welcome
welcome.wxml 64B
welcome.js 423B
component1
component1.js 777B
component1.wxss 572B
component1.wxml 647B
component1.json 53B
utils
util.js 481B
app.js 760B
image
APIHL.png 634B
hengping.png 826KB
componentHL.png 429B
wechatHL.png 1KB
component.png 431B
wechat.png 1KB
API.png 647B
app.json 1KB
app.wxss 4KB
共 36 条
- 1
资源评论
- 小叶白龙2018-09-04不错得到一个灵感启发
- foxbert2018-07-03UI做的很不好看啊~
- 从小白到小白2018-06-12一般 资源很一般
芥末先生HHt
- 粉丝: 12
- 资源: 26
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功