KindergartenAppletUI/pages/index/index.vue

561 lines
10 KiB
Vue
Raw Normal View History

2022-08-24 15:01:04 +08:00
<template>
<view class="content">
2023-04-19 11:28:12 +08:00
<view class="top" v-show="top"></view>
<view class="tucengstyle">
<image src="/static/tuceng.png"></image>
</view>
2023-07-21 17:10:55 +08:00
<view class="zhihui">幼儿体质健康</br>促进系统
2023-04-19 11:28:12 +08:00
</view>
<button class="denglu" open-type="getPhoneNumber" @getphonenumber='getPhoneNumberp'>微信一键登录</button>
<view class="masks" style="" v-if="mask">
<view class="mask">
<view class="imageitem">
<img src="/static/tishiimage.png" alt="" sizes="" srcset="">
2022-08-24 15:01:04 +08:00
</view>
2023-04-19 11:28:12 +08:00
<view class="title">
提示信息
2022-08-24 15:01:04 +08:00
</view>
2023-04-19 11:28:12 +08:00
<view class="text" style="margin-top:40rpx">
使用前请先绑定账号信息
2022-08-24 15:01:04 +08:00
</view>
2023-04-19 11:28:12 +08:00
<view class="btns">
<view class="btn1" @tap='mask=false'>拒绝</view>
<view class="btn2" @tap='gophone()'>同意</view>
2022-08-24 15:01:04 +08:00
</view>
</view>
</view>
2023-04-19 11:28:12 +08:00
<u-toast ref="uToast" />
</view>
2022-08-24 15:01:04 +08:00
</template>
<script>
import {
2022-08-26 17:51:21 +08:00
getPreOrderById,
2023-04-19 11:28:12 +08:00
getInfoByPhone,
loginLogging,
prescriptionLogging
2022-08-24 15:01:04 +08:00
} from '@/api/index/index.js'
2023-04-19 11:28:12 +08:00
import baseurl from '@/api/baseurl.js'
2022-08-24 15:01:04 +08:00
export default {
components: {},
data() {
return {
top: true,
mask: false,
2023-04-19 11:28:12 +08:00
DATAList: [],
2022-08-25 09:57:30 +08:00
logincode: '',
phonecode: '',
2022-08-26 17:51:21 +08:00
phone: '',
openId: '',
2022-08-24 15:01:04 +08:00
}
},
methods: {
gophone() {
2022-08-26 17:51:21 +08:00
const openid = this.openId
2022-08-24 15:01:04 +08:00
uni.navigateTo({
2023-04-19 11:28:12 +08:00
url: `/pages/Parentinformation/Parentinformation?openId=${openid}`
2022-08-24 15:01:04 +08:00
})
2022-10-08 16:52:26 +08:00
this.mask = false;
2022-08-24 15:01:04 +08:00
},
getPreOrderById() {
2022-08-25 09:57:30 +08:00
getPreOrderById(this.logincode, this.phonecode).then(res => {
2022-08-24 15:01:04 +08:00
if (res.code == 200) {
2022-08-26 17:51:21 +08:00
if (res.data.flag == "EMPTY") {
this.mask = true;
this.openId = res.data.openId
} else {
this.phone = res.data.phone
2023-04-20 10:46:23 +08:00
uni.setStorageSync("phone", res.data.phone)
2022-08-26 17:51:21 +08:00
if (this.phone != '') {
this.getInfoByPhoneinfo()
}
2023-04-19 11:28:12 +08:00
this.$refs.uToast.show({
2023-08-04 14:09:59 +08:00
message: "登录成功",
2023-04-19 11:28:12 +08:00
type: 'success',
duration: '5000'
})
setTimeout(() => {
uni.switchTab({
url: '/pages/homepage/homepage'
})
2023-04-20 10:46:23 +08:00
}, 1000)
2022-08-26 17:51:21 +08:00
this.top = false
}
2023-04-19 15:32:39 +08:00
} else {
this.$refs.uToast.show({
2023-08-04 14:09:59 +08:00
message: "登录失败",
2023-04-19 15:32:39 +08:00
type: 'error',
duration: '5000'
})
2022-08-24 15:01:04 +08:00
}
})
},
getPhoneNumberp(val) {
2022-08-25 09:57:30 +08:00
this.phonecode = val.detail.code
let that = this;
2022-08-24 15:01:04 +08:00
wx.login({
provider: 'weixin',
success: function(loginRes) {
2022-08-25 09:57:30 +08:00
that.logincode = loginRes.code
that.getPreOrderById();
2022-08-24 15:01:04 +08:00
}
});
},
2023-04-19 11:28:12 +08:00
info() {
const items = uni.getStorageSync("this.DATAList");
2023-04-19 15:04:30 +08:00
loginLogging(items).then(res => {})
2023-04-19 11:28:12 +08:00
},
2022-08-26 17:51:21 +08:00
getInfoByPhoneinfo() {
2022-10-10 17:49:31 +08:00
var that = this
2022-08-26 17:51:21 +08:00
getInfoByPhone(this.phone).then(res => {
if (res.code == 200) {
2023-04-19 11:28:12 +08:00
this.DATAList = res.data
let items = JSON.stringify(this.DATAList);
uni.setStorageSync("this.DATAList", items)
this.info();
2023-04-19 15:12:14 +08:00
} else {}
2022-08-26 17:51:21 +08:00
})
}
2022-08-24 15:01:04 +08:00
},
filters: {
// 格式化性别
formatSex(str) {
const sexEnum = {
2022-10-14 17:47:45 +08:00
"FEMALE": "女",
"MALE": "男"
2022-08-24 15:01:04 +08:00
}
return sexEnum[str];
},
},
2023-04-19 11:28:12 +08:00
onShow() {
2022-08-26 12:48:59 +08:00
let that = this;
2023-04-20 10:46:23 +08:00
that.phone = uni.getStorageSync('phone');
if (that.phone) {
that.getInfoByPhoneinfo();
2023-04-19 11:28:12 +08:00
} else {
2023-04-20 10:46:23 +08:00
that.top = true
2023-04-19 11:28:12 +08:00
}
2022-08-24 15:01:04 +08:00
},
}
</script>
<style>
2023-04-19 11:28:12 +08:00
button {
line-height: 97rpx;
width: 357rpx;
bottom: 30%;
height: 97rpx;
background: linear-gradient(90deg, #6ACAA3, #37A97B);
border-radius: 10rpx;
color: #fff;
top: 58%;
position: absolute;
}
.zhihui {
width: 381rpx;
font-size: 48rpx;
text-align: center;
color: #000000;
line-height: 72rpx;
top: 38%;
position: absolute;
}
.btns {
display: flex;
}
.imageitem {
width: 136rpx;
height: 136rpx;
margin: 0 auto;
/* position: relative; */
}
2022-08-24 15:01:04 +08:00
.btn1,
.btn2 {
2023-04-19 11:28:12 +08:00
top: 75%;
width: 254rpx;
height: 69rpx;
background: #F4F5F9;
border-radius: 10rpx;
/* width: 50%;
height: 80rpx; */
2022-08-24 15:01:04 +08:00
line-height: 80rpx;
text-align: center;
display: inline-block;
position: absolute;
bottom: 0;
}
.btn2 {
2023-04-19 11:28:12 +08:00
/* border-top: 1px solid #eeeeee; */
background-color: #35A97A;
right: 3%;
font-size: 24rpx;
2022-08-24 15:01:04 +08:00
}
2022-08-26 17:51:21 +08:00
2022-08-24 15:01:04 +08:00
.btn1 {
2023-04-19 11:28:12 +08:00
background: #F4F5F9;
color: #000;
left: 3%;
font-size: 24rpx;
2022-08-24 15:01:04 +08:00
}
.masks {
2023-04-19 11:28:12 +08:00
/* width: 600rpx;
height: 434rpx;
background: #FFFFFF;
border-radius: 10rpx; */
2022-08-24 15:01:04 +08:00
background-color: #f0f0f0;
2022-08-26 12:48:59 +08:00
height: 100%;
2022-08-24 15:01:04 +08:00
width: 100%;
position: absolute;
opacity: 0.9;
top: 0;
z-index: 999;
2023-04-19 11:28:12 +08:00
2022-08-24 15:01:04 +08:00
}
2022-08-26 17:51:21 +08:00
2022-08-26 12:48:59 +08:00
.sq {
2022-08-25 09:57:30 +08:00
width: 90rpx;
height: 90rpx;
/* background-color: red; */
2022-08-26 12:48:59 +08:00
margin: 0 auto;
2022-08-25 09:57:30 +08:00
padding-top: 25rpx;
padding-bottom: 40rpx;
}
2022-08-26 12:48:59 +08:00
.masks img {
2023-04-19 11:28:12 +08:00
width: 136rpx;
height: 136rpx;
top: -10%;
position: relative;
2022-08-25 09:57:30 +08:00
}
2022-08-24 15:01:04 +08:00
.text {
font-size: 30rpx;
width: 100%;
text-align: left;
2022-08-25 09:57:30 +08:00
/* padding-top: 40rpx; */
2022-08-24 15:01:04 +08:00
text-align: center;
2022-08-25 09:57:30 +08:00
2022-08-24 15:01:04 +08:00
}
.title {
2023-04-19 11:28:12 +08:00
/* height: 80rpx; */
/* line-height: 100rpx; */
margin-top: 3%;
/* border-bottom: 1px solid #eeeeee; */
2022-08-25 09:57:30 +08:00
/* background-color: red; */
font-size: 36rpx;
margin: 0px auto;
width: 100%;
2022-08-24 15:01:04 +08:00
text-align: center;
2022-08-25 09:57:30 +08:00
/* line-height: 80rpx; */
2022-08-24 15:01:04 +08:00
}
.mask {
2023-04-19 11:28:12 +08:00
width: 80%;
height: 400rpx;
2022-08-24 15:01:04 +08:00
background-color: #fff;
2023-04-19 11:28:12 +08:00
margin: 500rpx auto;
2022-08-24 15:01:04 +08:00
position: relative;
}
.content {
display: flex;
flex-direction: column;
align-items: center;
background-color: #ffffff;
min-height: 100vh;
}
.top {
/* background-color: #4486e8; */
/* background: url(@/static/bjt.png) no-repeat; */
2023-04-19 11:28:12 +08:00
background-image: linear-gradient(#D7EEE8, #fff);
2022-08-24 15:01:04 +08:00
width: 100%;
height: 600rpx;
float: left;
/* display:inline-block; */
}
.info {
color: #eeeeee;
text-align: center;
margin-top: 40rpx;
font-size: 36rpx;
}
/* 头像 */
.tx-w {
margin-top: 50rpx;
}
.tx {
margin-left: 90rpx;
}
2023-04-19 11:28:12 +08:00
.tucengstyle image {
width: 50%;
height: 400rpx;
position: absolute;
left: 38%;
top: 15%;
/* background-color: red; */
2023-07-21 16:45:18 +08:00
width: 200rpx;
2023-04-19 11:28:12 +08:00
height: 189rpx;
text-align: center;
/* vertical-align:middle;
top:-50%;left:-50%; */
/* position:relative; */
/* margin-top: 10%; */
}
2022-08-24 15:01:04 +08:00
.tx image {
width: 140rpx;
height: 140rpx;
border-radius: 50%;
color: #fff;
}
.studentName {
margin-left: 280rpx;
}
.infos {
margin-top: -100rpx;
color: #707374;
}
.name {
2022-08-25 09:57:30 +08:00
margin-left: 280rpx;
2022-08-24 15:01:04 +08:00
}
.name-qm {
margin-left: ;
text-align: center;
margin-top: 40rpx;
font-size: 60rpx;
}
.nicheng {
width: 700rpx;
height: 240rpx;
background-color: rgba(255, 255, 255, 0.8);
position: absolute;
margin-top: 50px;
margin-left: 3.3%;
/* display: flex;
flex-direction: column; */
/* box-shadow: 0rpx 2rpx 0rpx 0rpx #a9caf5; */
border-radius: 20rpx;
}
.nicheng2 {
width: 90%;
height: 240rpx;
background-color: rgba(255, 255, 255, 0.3);
position: absolute;
margin-top: 150rpx;
margin-left: 5%;
/* display: flex;
flex-direction: column; */
/* box-shadow: 0rpx 2rpx 0rpx 0rpx #a9caf5; */
border-radius: 20rpx;
}
/* 学生信息 */
.student {
width: 700rpx;
/* height: 180px; */
margin-top: 360rpx;
box-shadow: 0rpx 2rpx 0rpx 0rpx #e6ebfe;
2023-04-19 11:28:12 +08:00
border-radius: 10rpx;
2022-08-24 15:01:04 +08:00
margin-bottom: 16rpx;
/* color: cornflowerblue; */
background-color: #eef9fc;
color: #707374;
/* display: flex; */
/* flex-direction: row; */
}
img {
/* margin-top: 10px; */
width: 40rpx;
height: 40rpx;
/* margin-top: 9px; */
margin-right: 30rpx;
margin-bottom: -4rpx;
}
.st {
display: inline-block;
margin-bottom: 3rpx;
/* width: 20px;
height: 20px; */
/* margin-top: 10px; */
/* background-color: red; */
}
.stinfo {
/* height: 30px; */
margin-left: 30rpx;
font-size: 40rpx;
color: #4486e8;
/* border-bottom: #eeecec 1px solid; */
/* text-align: center; */
font-weight: 500;
}
.th {
/* background-color: orange; */
display: flex;
justify-content: flex-start;
border-top: lightsteelblue 2rpx solid;
}
.tr {
display: flex;
justify-content: flex-start;
}
.stname {
width: 140rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
/* background-color: red; */
border-bottom: lightsteelblue 2rpx solid;
}
.sex {
width: 140rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
/* background-color: blueviolet; */
border-bottom: lightsteelblue 2rpx solid;
}
.age {
width: 140rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
/* background-color: burlywood; */
border-bottom: lightsteelblue 2rpx solid;
}
.class {
width: 140rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
/* background-color: orange; */
border-bottom: lightsteelblue 2rpx solid;
}
/* 幼儿园 */
.kindergarten {
width: 700rpx;
background-color: #eef9fc;
box-shadow: 0rpx 2rpx 0px 0px #e6ebfe;
border-radius: 20rpx;
margin-bottom: 16rpx;
color: #707374;
}
.kinderclass {
2022-10-08 16:52:26 +08:00
padding-left: 10rpx;
width: 400rpx;
/* height: 100rpx; */
line-height: 50rpx;
2022-08-24 15:01:04 +08:00
text-align: center;
/* background-color: red; */
border-bottom: lightsteelblue 1px solid;
2022-10-08 16:52:26 +08:00
/* overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; */
}
2022-08-24 15:01:04 +08:00
2022-10-08 16:52:26 +08:00
.teachername {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
2022-08-24 15:01:04 +08:00
}
.teacher {
width: 360rpx;
2022-10-08 16:52:26 +08:00
/* height: 100rpx; */
/* line-height: 100rpx; */
2022-08-24 15:01:04 +08:00
text-align: center;
/* background-color: red; */
border-bottom: lightsteelblue 2rpx solid;
/* padding-left: 50px; */
2022-10-08 16:52:26 +08:00
position: relative;
2022-08-24 15:01:04 +08:00
}
.score {
width: 140rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
border-bottom: lightsteelblue 2rpx solid;
}
.read {
width: 140rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
border-bottom: lightsteelblue 2rpx solid;
color: cornflowerblue;
}
/* 家长信息 */
.parentinfo {
/* position: absolute; */
width: 700rpx;
/* height: 106px; */
/* margin-top: 510px; */
background-color: #eef9fc;
box-shadow: 0rpx 2rpx 0rpx 0rpx #e6ebfe;
border-radius: 20rpx;
color: #707374;
}
.parent {
width: 350rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
/* background-color: red; */
border-bottom: lightsteelblue 2rpx solid;
}
.phone {
width: 350rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
/* background-color: red; */
border-bottom: lightsteelblue 2rpx solid;
}
2023-07-21 16:45:18 +08:00
</style>