This commit is contained in:
曹辉 2022-10-17 16:00:25 +08:00
parent bdd2ba7934
commit fd437705da
9 changed files with 190 additions and 138 deletions

View File

@ -11,7 +11,7 @@
}
}
</script>
<style>
/*每个页面公共css */
<style lang="scss">
/* 注意要写在第一行同时给style标签加入lang="scss"属性 */
@import "uview-ui/index.scss";
</style>

View File

@ -2,6 +2,9 @@ import baseurl from './baseurl.js'
var request = function(config) {
return new Promise((resolve, rejected) => {
uni.showLoading({
title: ''
});
uni.request({
url: baseurl + config.url,
data: config.data,
@ -11,6 +14,7 @@ var request = function(config) {
// token: uni.getStorageSync('token')
},
success(res) {
uni.hideLoading();
resolve(res.data)
// if (res.data.code == 20002) {
// uni.showModal({
@ -38,6 +42,7 @@ var request = function(config) {
},
fail(err) {
uni.hideLoading();
rejected(err)
}
})

View File

@ -3,9 +3,8 @@ import App from './App'
// #ifndef VUE3
import Vue from 'vue'
import uView from 'uview-ui'
Vue.use(uView)
import uView from "uview-ui";
Vue.use(uView);
Vue.config.productionTip = false
App.mpType = 'app'

17
package-lock.json generated
View File

@ -9,23 +9,20 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"uview-ui": "^2.0.31"
"uview-ui": "^1.8.4"
}
},
"node_modules/uview-ui": {
"version": "2.0.31",
"resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.31.tgz",
"integrity": "sha512-I/0fGuvtiKHH/mBb864SGYk+SJ7WaF32tsBgYgeBOsxlUp+Th+Ac2tgz2cTvsQJl6eZYWsKZ3ixiSXCAcxZ8Sw==",
"engines": {
"HBuilderX": "^3.1.0"
}
"version": "1.8.4",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.8.4.tgz",
"integrity": "sha512-Zr+D5dFdNy6CdHQLBEXeGq/w0LkjxzBtsgaaDwLl0P58g67H7fBBDvy6AzWK/k0c7dwPYMBiK7I4Tr9p92+0DA=="
}
},
"dependencies": {
"uview-ui": {
"version": "2.0.31",
"resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.31.tgz",
"integrity": "sha512-I/0fGuvtiKHH/mBb864SGYk+SJ7WaF32tsBgYgeBOsxlUp+Th+Ac2tgz2cTvsQJl6eZYWsKZ3ixiSXCAcxZ8Sw=="
"version": "1.8.4",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.8.4.tgz",
"integrity": "sha512-Zr+D5dFdNy6CdHQLBEXeGq/w0LkjxzBtsgaaDwLl0P58g67H7fBBDvy6AzWK/k0c7dwPYMBiK7I4Tr9p92+0DA=="
}
}
}

View File

@ -1,7 +1,6 @@
{
"name": "yer",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
@ -10,6 +9,11 @@
"author": "",
"license": "ISC",
"dependencies": {
"uview-ui": "^2.0.31"
}
"uview-ui": "^1.8.4"
},
"repository": {
"type": "git",
"url": "http://192.168.16.64:3000/jihan/KindergartenAppletUI.git"
},
"description": ""
}

View File

@ -1,49 +1,37 @@
{
"easycom": {
// uview-ui
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
},
{
"easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
},
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
// {
// "path" : "pages/login/login",
// "style" :
// {
// "navigationBarTitleText": "",
// "enablePullDownRefresh": false
// }
// },
// {
// "path" : "pages/login/login",
// "style" :
// {
// "navigationBarTitleText": "",
// "enablePullDownRefresh": false
// }
// },
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": ""
}
},
{
"path" : "pages/phone/phone",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
}, {
"path": "pages/phone/phone",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, {
"path": "pages/home/home",
"style": {
"navigationBarTitleText": ""
}
}
],
],
// "tabBar": {
// },
"globalStyle": {
"navigationBarTextStyle": "black",
@ -51,5 +39,13 @@
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"uniIdRouter": {}
"uniIdRouter": {},
"condition": { //
"current": 0, //(list )
"list": [{
"name": "", //
"path": "", //
"query": "" //onLoad
}]
}
}

View File

@ -1,7 +1,10 @@
<template>
<view class="content">
<view class="test">幼儿体质检测记录</view>
<view class="score" v-for="item in StudentScore">
<view class="title" v-if="StudentScore==0">
暂无体质检测记录
</view>
<view class="score" v-for="item in StudentScore" v-else>
<view class="">
<view class="itemName">批次名称{{item.batchName}}</view>
</view>
@ -10,16 +13,15 @@
<view class="time">时间{{item.createTime}}</view>
</view>
<!-- <view class="report" v-show="item.existFlag==false" @tap='showToast'>查看报告</view> -->
<u-cell class='report' v-if="item.existFlag==false" :title="aitem.title" v-for="(aitem, index) in list" :key="index"
:icon="aitem.iconUrl" @click="showToast(aitem)">
</u-cell>
<view class="report" style="color: #4486e8;" @tap='lookbook(item)' v-show="item.existFlag">查看报告</view>
<u-loading-page :loading="loading" loading-text="正在打开报告" loading-mode="semicircle"></u-loading-page>
<!-- <u-cell class='report' v-if="item.existFlag==false" :title="aitem.title" v-for="(aitem, index) in list"
:key="index" :icon="aitem.iconUrl" @click="showToast(aitem)">
</u-cell> -->
<view class="report" style="color: #4486e8;" @tap='lookbook(item)' v-if="item.existFlag">查看报告</view>
<view class="report" @tap='showToast(item)' v-else>查看报告</view>
</view>
<u-toast ref="uToast"></u-toast>
<u-cell-group title-bg-color="rgb(243, 244, 246)">
</u-cell-group>
<u-toast ref="uToast" />
<!-- <u-cell-group title-bg-color="rgb(243, 244, 246)">
</u-cell-group> -->
</view>
</template>
@ -33,7 +35,6 @@
data() {
return {
show: false,
loading: false,
yonghuwx: [],
studentId: '',
StudentScore: [],
@ -52,15 +53,18 @@
this.getStudentScore()
},
methods: {
showToast(params) {
showToast() {
this.$refs.uToast.show({
...params
title: '暂无报告',
type: 'error'
})
},
lookbook(item) {
console.log(item)
this.loading = true
uni.showLoading({
title: '获取报告中'
});
var that = this
uni.downloadFile({
url: baseurl + item.downloadAddress,
@ -70,10 +74,10 @@
filePath: filePath,
showMenu: true,
success: function(res) {
that.loading = false
uni.hideLoading();
},
fail: function(err) {
that.loading = false
uni.hideLoading();
}
});
}
@ -119,6 +123,14 @@
</script>
<style lang="scss">
.title {
width: 80%;
margin: 0 auto;
text-align: center;
font-size: 40rpx;
color: #707374;
}
.u-page {
padding: 0;
}
@ -132,6 +144,7 @@
text-align: center;
font-size: 36rpx;
}
::v-deep .u-cell__title-text {
text-align: center;
}

View File

@ -99,7 +99,7 @@
提示
</view>
<view class="text" style="margin-top:40rpx">
您的手机号不符合请更改信息
系统中没有该用户手机号, 请绑定信息!
</view>
<view class="btns">
<view class="btn1" @tap='mask=false'>取消</view>

View File

@ -5,25 +5,42 @@
<uni-card>
<view class="bind">
<view class="name">
家长姓名<input type="text" v-model="data.parentName">
</view>
<view class="id">
学生身份证<input type="text" v-model="data.cardNo" maxlength="18">
<view class="bindtitle">
家长姓名:
</view>
<input type="text" v-model="data.parentName">
</view>
<view class="phone">
家长电话<input type="text" v-model="data.phone" maxlength="11">
<view class="bindtitle">
家长电话:
</view>
<input type="text" v-model="data.phone" maxlength="11">
</view>
<view class="" style="font-size: 30rpx;margin-top:50rpx">
本次操作遵守国家相关法律法规采集的信息仅用于学生体质评估报告的相关信息查询
<view class="id">
<view class="bindtitle">
学生身份证:
</view>
<input type="text" v-model="data.cardNo" maxlength="18">
</view>
<view class="" style="margin:50rpx 0 0 15rpx;font-size: 32rpx;line-height: 50rpx;">
<checkbox value="cb" :checked="checked" />我已阅读并同意
<view class="" style="display: inline-block;color:#4D8CE9;border-bottom:1rpx solid #4D8CE9;" @tap='maskshow=true'>
隐私保护协议
</view>
<!-- <u-checkbox-group @change="checkboxGroupChange">
<u-checkbox @change="checkboxChange" v-model="checkeds.checked" :name="checkeds.name">
{{checkeds.name}}
</u-checkbox>
</u-checkbox-group> -->
</view>
<view class="btn">
<button @tap="cancel()">取消</button>
<button @tap="show=true">确定</button>
<button @tap="bindParent">确定</button>
</view>
</view>
</uni-card>
</uni-section>
<view class="masks" style="" v-if="show">
<view class="masks" style="" v-if="maskshow">
<view class="mask">
<view class="title">
智慧幼儿体质评估与促进系统隐私保护
@ -44,14 +61,15 @@
</view>
</view>
<view class="btns">
<view class="btn1" @tap='show=false'>取消</view>
<view class="btn2" @tap='bindParent'>确定</view>
<view class="btn1" @tap='maskshow=false'>取消</view>
<view class="btn2" @tap='checkeds'>阅读并同意</view>
</view>
</view>
</view>
<!-- <img src="/static/name.png" alt="" sizes="" srcset=""> -->
<!-- <text v-model="data.parentName">{{data.parentName}}</text> -->
<!-- <input type="text" v-model="data.phone">-->
<u-toast ref="uToast" />
</view>
</template>
@ -63,7 +81,8 @@
export default {
data() {
return {
show: false,
checked: false,
maskshow: false,
data: {
// 370883199909083232
// 18363008969
@ -72,41 +91,66 @@
parentName: "",
phone: "",
openId: '',
list: [{
type: 'error',
icon: false,
title: '确定',
message: "",
}],
},
}
},
methods: {
bindParent() {
this.show = false;
uni.removeStorage({
key: 'phone',
success: function(res) {}
});
bindParent(this.data).then(res => {
if (res.code == 200) {
uni.setStorage({
key: 'phone',
data: res.msg
});
uni.navigateTo({
url: '/pages/index/index'
})
uni.showToast({
title: '添加成功',
icon: 'none',
duration: 2000
});
} else if (res.code == 500) {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
//
checkeds() {
this.checked = true;
this.maskshow = false
},
//
bindParent() {
if (this.checked == false) {
this.$refs.uToast.show({
title: '请先阅读《隐私保护协议》',
type: 'error'
})
setTimeout(() => {
this.maskshow = true
}, 500)
} else {
uni.removeStorage({
key: 'phone',
success: function(res) {}
});
bindParent(this.data).then(res => {
if (res.code == 200) {
uni.setStorage({
key: 'phone',
data: res.msg
});
uni.navigateTo({
url: '/pages/index/index'
})
this.$refs.uToast.show({
title: '添加成功',
type: 'success'
})
} else if (res.code == 500) {
this.$refs.uToast.show({
title: res.msg,
type: 'error'
})
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// });
}
})
}
},
//
cancel() {
uni.removeStorageSync('user');
uni.navigateTo({
@ -115,6 +159,7 @@
},
},
//
onLoad(options) {
this.data.openId = options.openId
}
@ -188,22 +233,16 @@
flex-direction: column;
align-items: center;
min-height: 100vh;
background-image: linear-gradient(#55C5E3, #fff);
background-image: linear-gradient(#8CCDDF, #fff);
color: #707374;
// height: 1230rpx;
// margin-top: 50rpx;
}
input:nth-child(2) {
margin-left: 300rpx;
::v-deep .u-checkbox__icon-wrap {
border: 1rpx solid #000000;
}
input {
margin-top: -100rpx;
margin-left: 220rpx;
}
.bind {
// background-color: #eeeeee;
@ -233,24 +272,23 @@
margin-right: 40rpx;
}
.name {
height: 160rpx;
line-height: 160rpx;
// background-color: red;
border-bottom: mediumaquamarine 2rpx solid;
}
.id {
height: 160rpx;
line-height: 160rpx;
border-bottom: mediumaquamarine 2rpx solid;
}
.name,
.id,
.phone {
height: 160rpx;
line-height: 160rpx;
width: 96%;
margin: 0 auto;
display: flex;
height: 130rpx;
line-height: 130rpx;
border-bottom: mediumaquamarine 2rpx solid;
input {
height: 130rpx;
line-height: 130rpx;
padding-left: 30rpx;
}
.bindtitle {}
}
.btn {