// pages/my/index.js
Page({
/**
* 页面的初始数据
*/
data: {
screenWidth: 600,
currentSelect: 1,
items: [{
'title': '一年期综合意外保险',
'status': '保障中',
'person': '黄荣品',
'type':'本人',
'date': '2013.03.03-2013.02.02'
},
{
'title': '一年期综合意外保险',
'status': '保障中',
'person': '黄荣品',
'type': '本人',
'date': '2013.03.03-2013.02.02'
},
{
'title': '一年期综合意外保险',
'status': '保障中',
'person': '黄荣品',
'type': '本人',
'date': '2013.03.03-2013.02.02'
}
]
},
MyLogin: function (code, name, avatar) {
//创建一个dialog
var API_URL = "http://wuxiyundongweilai/api/auth/user/wechat";
wx.showToast({
title: '正在登录...',
icon: 'loading',
duration: 10000
});
//请求服务器
wx.request({
url: API_URL,
data: {
name: name,
wechatcode: code,
},
method: 'GET', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
header: {
'content-type': 'application/json'
}, // 设置请求的 header
success: function (res) {
//清空本地缓存
var appInstance = getApp();
wx.setStorageSync('code', code);//持续化存储code
wx.setStorageSync('user_id', res.data.data.id);
wx.setStorageSync('token', res.data.data.token);
if (res.data.data.avatar != "") {
wx.setStorageSync('avatar', res.data.data.avatar);
}
else {
wx.setStorageSync('avatar', avatar);
}
appInstance.globalData.token = res.data.data.token;
wx.hideToast();
},
fail: function () {
// fail
wx.hideToast();
},
complete: function () {
// complete
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this;
wx.getSystemInfo({
success: function (res) {
console.log(res.windowWidth)
that.setData({
screenWidth: res.windowWidth * 0.9,
})
},
})
wx.login({//login流程
success: function (res) {//登录成功
if (res.code) {
var code = res.code;
wx.getUserInfo({//getUserInfo流程
success: function (res2) {//获取userinfo成功
wx.clearStorage()
that.MyLogin(code, res2.userInfo.nickName, res2.userInfo.avatarUrl);
console.log('服务器返回' + code);
var appInstance = getApp();
appInstance.globalData.userInfo = res2.userInfo;
appInstance.globalData.userName = res2.userInfo.nickName;
wx.setStorageSync('username', res2.userInfo.nickName);
//wx.setStorageSync('avatar', res2.userInfo.avatarUrl );
}
,
fail: function (res) {
console.log('服务器返回' + res);
wx.openSetting({
success: function (data) {
if (data) {
if (data.authSetting["scope.userInfo"] == true) {
//允许授权
}
}
},
fail: function () {
console.info("设置失败返回数据");
}
})
}
})
} else {
console.log('获取用户登录态失败!' + res.errMsg)
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
没有合适的资源?快使用搜索试试~ 我知道了~
java平安保险小程序.rar
共100个文件
wxss:47个
png:37个
json:5个
需积分: 2 1 下载量 41 浏览量
2023-04-01
23:00:03
上传
评论
收藏 7.76MB RAR 举报
温馨提示
计算机课程设计|毕业设计之报平安小程序管理系统代码-基于Springboot的报平安小程序管理系统系统 注意:该项目只展示部分功能,如需了解,评论区咨询即可。 > > 所有工具下载链接: JDK版本下载 Eclipse下载链接 Mysql下载链接 tomcat下载链接 向日葵远程工具 1.开发环境 开发语言:Java 技术:Springboot+微信小程序 数据库:MySQL 架构:B/S 源码类型: Web 编译工具:Idea、Eclipse、MyEclipse (选其一) 其他:jdk1.8、Tomcat8.5【不需要】 、Navicat 2.系统的设计与实现 2.1 用户类型 用户角色分为 老师、学生 这两类用户。 2.2 各角色功能模块 2.2.1 老师 微信登录; 创建班级; 我的消息【班级消息】; 个人中心; 2.2.2 学生 微信登录; 申请加入班级; 个人中心; 我的消息 2.
资源推荐
资源详情
资源评论
收起资源包目录
java平安保险小程序.rar (100个子文件)
icon.jpg 66KB
index.js 4KB
index.js 2KB
app.js 1KB
show.js 1KB
util.js 472B
app.json 783B
project.config.json 475B
index.json 45B
show.json 40B
index.json 2B
tab_05_08.png 48KB
tab_08.png 48KB
tab_05_09.png 30KB
tab_09.png 30KB
tab_05_10.png 26KB
tab_10.png 25KB
tab_05_03.png 12KB
tab_03.png 12KB
tab_05_07.png 11KB
tab_07.png 11KB
tab_05_14.png 9KB
tab_05_12.png 9KB
tab_12.png 9KB
car.png 5KB
um.png 4KB
safe_active.png 4KB
safe.png 4KB
health.png 4KB
my_active.png 3KB
my.png 3KB
tab_05_05.png 3KB
tab_05.png 3KB
house.png 3KB
tab_05_04.png 2KB
tab_05_06.png 2KB
tab_04.png 2KB
tab_05_01.png 2KB
tab_06.png 2KB
tab_01.png 2KB
tab_05_02.png 2KB
tab_02.png 2KB
tab_05_15.png 1KB
tab_15.png 1KB
tab_05_13.png 1KB
tab_13.png 1KB
tab_05_11.png 1KB
tab_11.png 1KB
icon.psd 4.49MB
未标题-1.psd 3.53MB
show.wxml 3KB
index.wxml 1KB
index.wxml 835B
ionic.app.wxss 201KB
weui.wxss 22KB
weui-loading.wxss 4KB
weui-form.wxss 4KB
extend.wxss 3KB
weui-form-preview.wxss 2KB
weui-uploader.wxss 2KB
weui-animate.wxss 2KB
weui-media-box.wxss 2KB
show.wxss 2KB
weui-cell.wxss 2KB
weui-searchbar.wxss 1KB
weui-tab.wxss 1KB
app.wxss 1016B
weui-navbar.wxss 923B
weui-form_common.wxss 781B
weui-select.wxss 774B
weui-panel.wxss 769B
weui-loadmore.wxss 737B
weui-footer.wxss 692B
weui-access.wxss 689B
weui-msg.wxss 663B
weui-grid.wxss 628B
weui-agree.wxss 524B
weui-vcode.wxss 442B
weui-article.wxss 405B
weui-check.wxss 394B
weui-progress.wxss 322B
weui-badge.wxss 292B
weui-flex.wxss 163B
index.wxss 153B
index.wxss 150B
weui-button.wxss 131B
reset.wxss 129B
weui-switch.wxss 65B
weui-dialog.wxss 0B
text.wxss 0B
weui-button.wxss 0B
weui-cell.wxss 0B
global.wxss 0B
setArrow.wxss 0B
weui-grid.wxss 0B
color.wxss 0B
weui-progress.wxss 0B
setOnepx.wxss 0B
fn.wxss 0B
weui-msg.wxss 0B
共 100 条
- 1
资源评论
松鼠协会总动员
- 粉丝: 256
- 资源: 180
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功