Commit f4149c06 by liuquan

no message

parents
var Api = require('utils/api.js');
App({
globalData: {
openid: '',
userInfo: null,
code: '',
scence:'',
shareStatus:0,
},
data: {
deviceInfo: {}
},
onLaunch: function (options) {
this.data.deviceInfo = wx.getSystemInfoSync();
var lastTapTime = 0;
console.log('scene', options.scene)
this.globalData.scence = options.scene;
wx.setStorageSync('scene', options.scene)
// 时间
var start = {
startTime: ""
}
wx.setStorageSync('time01', start);
// 选项
var testData = {
num: 0,
select: [],
answer: []
}
wx.setStorageSync('testData', testData);
// 积分
var scoreData = {
num: 0,
score: []
}
wx.setStorageSync('scoreData', scoreData);
wx.getStorageInfo({
success: function (res) {
}
})
var that = this
var user = wx.getStorageSync('user') || {};
var userInfo = wx.getStorageSync('userInfo') || {};
if (!user.openid || Date.parse(new Date()) / 1000 > (user.expires_in - 600)) {
wx.login({
success: function (res) {
// console.log(res.code, 'grant_type=authorization_code')
if (res.code) {
wx.setStorageSync("code", res.code)
var url = Api.HOST + 'applet.php?s=Applet/getopenid';
var data = {};
data.code = res.code;
Api.fetchPost(url, data, (err, res) => {
// console.log('001')
var obj = {};
obj.openid = res.openid;
if (res.unitid) {
obj.unitid = res.unitid;
}
obj.unionid = res.unionid;
obj.ret = res.ret;
obj.expires_in = Date.parse(new Date()) / 1000 + res.expires_in;
wx.setStorageSync('user', obj);//存储openid
// console.log(obj, '002')
var hosp = wx.getStorageSync("hospital")
// if (res.unitid && !hosp){
// var user = wx.getStorageSync('user');
// var url1 = Api.HOST + 'wechat.php?s=Home/hospital';
// var data1 = {};
// data1.unitid = res.unitid;
// // Api.fetchPost(url1, data1, (err, res) => {
// // console.log(res, 'lll000')
// // wx.setStorageSync('hospital', res)
// // if (res && res.type == 0) {
// // wx.redirectTo({
// // url: '/pages/shenhe/shenhe',
// // })
// // } else if (res && res.type == -1) {
// // wx.redirectTo({
// // url: '/pages/disable/disable',
// // })
// // }
// // })
// }
});
} else {
console.log('获取用户登录态失败!' + res.errMsg)
}
},
fail: function (err) {
console.log("login失败")
}
});
}
},
getUserInfo: function (cb) {
var that = this;
if (this.globalData.userInfo) {
typeof cb == "function" && cb(this.globalData.userInfo)
} else {
//调用登录接口
wx.login({
success: function (res1) {
wx.setStorageSync("code", res1.code)
wx.getUserInfo({
success: function (res) {
that.globalData.userInfo = res.userInfo
typeof cb == "function" && cb(that.globalData.userInfo)
wx.setStorageSync('userInfo', res.userInfo);
if (res1.code) {
var url = Api.HOST + 'applet.php?s=Applet/user_add';
var data = {};
data.code = res1.code;
data.encryptedData = res.encryptedData;
data.iv = res.iv;
data.type = 1;
Api.fetchPost(url, data, (err, res1) => {
console.log(res1, '001')
});
}
},
fail: function (e) {
// console.log(e)
var url = Api.HOST + 'applet.php?s=Applet/user_add';
var data = {};
wx.request({
url: url,
data: {
code: res1.code,
type: 0
},
success: function (e) {
// console.log(e,'e')
}
})
}
})
},
fail: function (err) {
console.log("login失败")
}
})
}
},
// 请求数据判断进入页面
onHide: function(){
// var scence = this.globalData.scence;
// if (scence == 1007){
// wx.reLaunch({
// url: "/pages/index/index"
// })
// }
}
})
\ No newline at end of file
{
"pages": [
"pages/index/index",
"pages/screenshots/screenshots",
"pages/fenxiang/fenxiang",
"pages/disable/disable",
"pages/user/user",
"pages/webinfo/webinfo",
"pages/setperm/setperm",
"pages/personinfo/personinfo",
"pages/swiper/swiper",
"pages/dati/dati",
"pages/dati03/dati03",
"pages/dati02/dati02",
"pages/dati05/dati05",
"pages/qrlist/qrlist",
"pages/shouquan/shouquan",
"pages/showqdetail/showqdetail",
"pages/record/record",
"pages/QRcode/QRcode",
"pages/agreement/agreement",
"pages/liangbiao/liangbiao",
"pages/lbgouwuche/lbgouwuche",
"pages/zaixian/zaixian",
"pages/cashRecord/cashRecord",
"pages/cashregister/cashregister",
"pages/scaleset/scaleset",
"pages/prepaidlist/prepaidlist",
"pages/cashDisbursement/cashDisbursement",
"pages/zhichuRecord/zhichuRecord",
"pages/end/end",
"pages/info/info",
"pages/info1/info1",
"pages/pay/pay",
"pages/invoice/invoice",
"pages/sqtg/sqtg",
"pages/chongzhi/chongzhi",
"pages/fpkj/fpkj",
"pages/fpdetail/fpdetail",
"pages/fapiao/fapiao",
"pages/fenxiangperson/fenxiangperson",
"pages/bslbrecord/bslbrecord",
"pages/webview/webview",
"pages/dati04/dati04",
"pages/addAdm/addAdm",
"pages/shenhe/shenhe",
"pages/setAddm/setAddm",
"pages/banner/banner",
"pages/prepaidcard/prepaidcard",
"pages/canvas/canvas",
"pages/dati06/dati06"
],
"window": {
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "",
"navigationBarTextStyle": "black",
"backgroundColor": "#f2f2f2",
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark"
},
"tabBar": {
"color": "#999",
"selectedColor": "#37c0b8",
"backgroundColor": "#fff",
"borderStyle": "black",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "images/sw@2x.png",
"selectedIconPath": "images/sx@2x.png"
},
{
"pagePath": "pages/record/record",
"text": "报告",
"iconPath": "images/bw@2x.png",
"selectedIconPath": "images/bx@2x.png"
}
]
},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
/**app.wxss**/
@import "/wxParse/wxParse.wxss";
page {
font-family: 'PingFang SC',
'Helvetica Neue',
Helvetica,
'Droid Sans Fallback',
'Microsoft Yahei',
sans-serif;
-webkit-tap-highlight-color: transparent;
-webkit-appearance: none;
background: #f2f2f2;
}
.bg {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.bg image {
width: 100%;
height: 100%;
}
button {
background: transparent;
border: 0;
color: #fff;
height: 100rpx;
line-height: 100rpx;
padding: 0;
}
button::after {
border: 0;
}
.button-hover {
background: transparent;
color: #fff;
}
.clearfix:after {
content: " ";
display: block;
height: 0;
clear: both;
}
/*top 线 */
.line_top {
position: fixed;
width: 100%;
height: 1px;
top: 0;
left: 0;
background: #f0f2f5;
z-index: 999;
}
/* */
.img404 {
width: 100%;
height: 100rpx;
background: red;
}
.show {
display: block;
}
.hid {
display: none;
}
.record404 {
background: #fff;
width: 100%;
height: 100%;
position: relative;
text-align: center;
z-index: 10;
}
.r404{
width: 100%;
height: 32rpx;
line-height: 32rpx;
text-align: center;
margin-top: 250rpx;
}
.r404 text{
color: #999;
font-size: 32rpx;
font-family: "PingFang-SC";
}
.re404-photo {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 900rpx;
text-align: center;
}
.re404-wujilu {
width: 122rpx;
height: 86rpx;
position: absolute;
top: 266rpx;
left: 50%;
margin-left: -61rpx;
}
.re404-txt {
position: absolute;
width: 260rpx;
left: 50%;
margin-left: -130rpx;
top: 390rpx;
display: block;
color: #999;
font-size: 32rpx;
font-family: "PingFang-SC";
}
.t-round {
position: absolute;
top: 21rpx;
left: 76rpx;
width: 40rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
border-radius: 50%;
color: #fff;
background: red;
z-index: 9999;
font-size: 22rpx;
font-weight: bold;
}
.iphonex {
background: #fff;
width: 100%;
height: 2rpx;
margin-top: 150rpx;
}
.loadingImg{
display: block;
width: 128rpx;
height: 128rpx;
position: fixed;
top: 50%;
margin-top: -64rpx;
left: 50%;
margin-left: -64rpx;
}
\ No newline at end of file
<!--普通用户菜单 -->
<template name="menudBtn">
<view class='menue-btn'>
<view class='men-list' bindtap='shouye' style="height:{{iPhoneX?'150rpx':''}}">
<image src="../../images/footer1.png"></image>首页
</view>
<view class='men-list' bindtap='ceshi' style="height:{{iPhoneX?'150rpx':''}}">
<image src="../../images/footer2.png"></image>报告
</view>
</view>
</template>
\ No newline at end of file
/*底部导航栏 */
.menue-btn {
width: 100%;
position: fixed;
bottom: 0rpx;
background: #fff;
border-top: 0.5px solid #e3e3e3;
box-sizing: border-box;
}
.men-list {
width: 50%;
height: 108rpx;
float: left;
font-size: 26rpx;
color: #999;
overflow: hidden;
text-align: center;
}
.men-list image {
width: 50rpx;
height: 50rpx;
display: block;
margin: 0 auto;
margin-top:12rpx
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment