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

View File

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

View File

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

17
package-lock.json generated
View File

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

View File

@ -1,7 +1,6 @@
{ {
"name": "yer", "name": "yer",
"version": "1.0.0", "version": "1.0.0",
"description": "",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
@ -10,6 +9,11 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "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,8 +1,6 @@
{ {
"easycom": { "easycom": {
// uview-ui
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}, },
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
// { // {
@ -19,29 +17,19 @@
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
}, {
}, "path": "pages/phone/phone",
{ "style": {
"path" : "pages/phone/phone",
"style" :
{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
},
{
"path": "pages/home/home", "path": "pages/home/home",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
} }
], ],
// "tabBar": { // "tabBar": {
// }, // },
@ -51,5 +39,13 @@
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
}, },
"uniIdRouter": {} "uniIdRouter": {},
"condition": { //
"current": 0, //(list )
"list": [{
"name": "", //
"path": "", //
"query": "" //onLoad
}]
}
} }

View File

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

View File

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

View File

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