This commit is contained in:
shijing 2024-06-18 15:38:26 +08:00
parent 1c18dddf66
commit f528764af3
15 changed files with 425 additions and 149 deletions

View File

@ -37,7 +37,7 @@ const install = (Vue, vm) => {
let getExamList = (params={})=>vm.$u.get('/exam/exam/', params);//考试列表 let getExamList = (params={})=>vm.$u.get('/exam/exam/', params);//考试列表
let startExam = (id)=>vm.$u.post(`/exam/exam/${id}/start/`);//开始考试 let startExam = (id)=>vm.$u.post(`/exam/exam/${id}/start/`);//开始考试
let submitExam = (id,params={})=>vm.$u.post(`/exam/examrecord/${id}/submit/`,params);//开始考试 let submitExam = (id,params={})=>vm.$u.post(`/exam/examrecord/${id}/submit/`,params);//开始考试
let examRecord = (id,params={})=>vm.$u.get(`/exam/examrecord/self/`,params);//我的考试记录 let examRecord = (id,params={})=>vm.$u.get(`/exam/examrecord/`,params);//我的考试记录
let examRecordDetail = (id,params={})=>vm.$u.get(`/exam/examrecord/${id}/`,params);//我的考试记录 let examRecordDetail = (id,params={})=>vm.$u.get(`/exam/examrecord/${id}/`,params);//我的考试记录
let paperDetail = (id,params={})=>vm.$u.get(`/exam/paper/${id}/`,params);//测试 let paperDetail = (id,params={})=>vm.$u.get(`/exam/paper/${id}/`,params);//测试
let questionList = (params={})=>vm.$u.get(`/exam/question/`,params);//题目 let questionList = (params={})=>vm.$u.get(`/exam/question/`,params);//题目

View File

@ -137,39 +137,12 @@
} }
} }
// ,{
// "path" : "pages/exam/test",
// "style" :
// {
// "navigationBarTitleText": "练习",
// "enablePullDownRefresh": false
// }
// }
// ,{
// "path" : "pages/exam/question",
// "style" :
// {
// "navigationBarTitleText": "专题练习",
// "enablePullDownRefresh": false
// }
// }
// ,{
// "path" : "pages/exam/testDetail",
// "style" :
// {
// "navigationBarTitleText": "练习题目",
// "enablePullDownRefresh": false
// }
// }
,{ ,{
"path" : "pages/exam/exam", "path" : "pages/exam/exam",
"style" : "style" :
{ {
"navigationBarTitleText": "考试列表", "navigationBarTitleText": "考试列表",
"enablePullDownRefresh": false "enablePullDownRefresh": true
} }
} }
@ -243,12 +216,12 @@
"selectedIconPath": "static/common/homec.png", "selectedIconPath": "static/common/homec.png",
"text": "主页" "text": "主页"
}, },
{ // {
"pagePath": "pages/exam/index", // "pagePath": "pages/exam/index",
"iconPath": "static/common/dati.png", // "iconPath": "static/common/dati.png",
"selectedIconPath": "static/common/datic.png", // "selectedIconPath": "static/common/datic.png",
"text": "考试" // "text": "考试"
}, // },
// { // {
// "pagePath": "pages/vod/video", // "pagePath": "pages/vod/video",
// "iconPath": "static/common/play.png", // "iconPath": "static/common/play.png",

View File

@ -46,6 +46,7 @@
}) })
var filePath = res.tempFilePath; var filePath = res.tempFilePath;
uni.openDocument({ uni.openDocument({
showMenu:true,
filePath: filePath, filePath: filePath,
success: function (res) { success: function (res) {
uni.hideLoading() uni.hideLoading()

View File

@ -1,60 +1,229 @@
<template> <template>
<view> <view class="tabs">
<uni-list> <scroll-view
<!-- 垂直排列无略缩图主标题+副标题显示 --> id="tab-bar"
<uni-list-item direction="column" :key="item.id" v-for="(item, index) in examList"> class="scroll-h"
<template v-slot:header> :scroll-x="true"
<view class="uni-title">{{item.name}}</view> :show-scrollbar="false"
</template> >
<template v-slot:body> <view v-for="(tab,index) in tabBars"
<view class="uni-list-box"> :key="tab.id" class="uni-tab-item"
<view class="uni-content"> :id="tab.id" :data-current="index"
<view class="uni-title-sub uni-ellipsis-2">开启时间: {{item.open_time}}{{item.close_time}}</view> @click="ontabtap">
<view class="uni-note">考试机会: {{item.chance}}</view> <text class="tab-item-title"
</view> :class="tabIndex==index ? 'tab-item-title-active' : ''">{{tab.name}}</text>
</view> </view>
</template> </scroll-view>
<template v-slot:footer> <view class="line-h"></view>
<view class="uni-footer"> <scroll-view class="scroll-v list" enableBackToTop="true" scroll-y="true" @scrolltolower="loadMore()">
<u-button size="mini" type="primary" @click="attendExam(item)">我要参加</u-button> <uni-list>
<u-button size="mini" type="info">成绩排名</u-button> <uni-list-item direction="column" :key="item.id" v-for="(item, index) in examList">
</view> <template v-slot:header>
</template> <view class="uni-title"><view class="blue_line"></view>{{item.name}}</view>
</uni-list-item> </template>
</uni-list> <template v-slot:body>
<view class="uni-list-box">
<view class="uni-content">
<view class="uni-title-sub uni-ellipsis-2">开启时间: {{item.open_time}}</view>
<view class="uni-title-sub uni-ellipsis-2">结束时间: {{item.close_time}}</view>
<view class="uni-note">考试机会: {{item.chance}}</view>
</view>
</view>
</template>
<template v-slot:footer>
<view class="uni-footer">
<u-button v-if="tabIndex==0" type="primary" @click="attendExam(item)">我要参加</u-button>
<!-- <u-button size="mini" type="info" >成绩排名</u-button> -->
</view>
</template>
</uni-list-item>
</uni-list>
<!-- <view class="bottomText" v-if="isLoading">{{loadingText}}</view> -->
<view v-if="isBottom" class="bottomText"> 已经到底了</view>
</scroll-view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
query:{ query:{
page: 1 can_attend:true,
is_my:true,
page:1
}, },
examList: [] examList: [],
tabBars:[
{name:'可参与',
id:'my'},
{name:'我的',
id:'attend'},
],
tabIndex:0,
examsList:[
{},{}
],
isLoading: false,
refreshText: "",
loadingText: '加载中...',
isBottom:false,
// bottomShow:false,
} }
}, },
onLoad() { onLoad() {
this.getExamList(); setTimeout(()=>{
this.getExamList(0);
},350)
}, },
methods: { methods: {
getExamList(){ //获取考试列表
this.$u.api.getExamList(this.query).then(res=>{ getExamList(index){
this.examList = res.data.results let that = this;
if(index==0){
that.query.can_attend = true;
}else{
that.query.can_attend = false;
}
that.isLoading = true;
that.isBottom = true;
that.$u.api.getExamList(that.query).then(res=>{
console.log(res)
if(res.data&&res.data.results.length>0){
that.isBottom = false;
console.log('u有数据')
that.examList = that.examList.concat(res.data.results)
}
}) })
}, },
//参加考试
attendExam(val){ attendExam(val){
console.log(val) console.log(val)
uni.setStorageSync('currentExam', val) uni.setStorageSync('currentExam', val)
uni.navigateTo({ uni.navigateTo({
url:"/pages/exam/preview" url:"/pages/exam/preview"
}) })
} },
//切换列表
ontabtap(e) {
console.log('ontabtap')
this.query.page = 1;
this.examList = [];
this.isBottom=false;
// this.bottomShow=false;
let index = e.target.dataset.current || e.currentTarget.dataset.current;
this.switchTab(index);
},
//列表变动
switchTab(index) {
if (this.tabIndex === index) {
return;
}
this.tabIndex = index;
this.getExamList(index)
},
onpullingdown(e) {
},
//获取更多
loadMore() {
if(!this.isBottom){
this.query.page +=1;
setTimeout(() => {
this.getExamList(this.tabIndex);
}, 100)
}
// else{
// this.bottomShow = true;
// }
},
} }
} }
</script> </script>
<style> <style>
.tabs {
flex: 1;
flex-direction: column;
overflow: hidden;
background-color: #ffffff;
/* #ifndef APP-PLUS */
height: 100vh;
/* #endif */
}
.scroll-h {
width: 750rpx;
/* #ifdef H5 */
width:100%;
/* #endif */
height: 80rpx;
flex-direction: row;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
position: absolute;
top: 0;
z-index: 10;
}
.line-h {
height: 1rpx;
background-color: #cccccc;
}
.uni-tab-item {
/* #ifndef APP-PLUS */
display: inline-block;
/* #endif */
flex-wrap: nowrap;
padding-left: 34rpx;
padding-right: 34rpx;
}
.tab-item-title {
color: #555;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
}
.tab-item-title-active {
color: #007AFF;
}
.list{
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 5;
box-sizing: border-box;
padding: 80rpx 0 20rpx 0;
}
.uni-list-item{
width: 96%;
margin: 10px auto;
border: 1px solid #efefef;
border-radius: 10px;
}
.uni-list--border ,.uni-list--border-bottom{
display: none;
}
.bottomText{
font-size: 20rpx;
text-align: center;
height: 50rpx;
}
.blue_line{
width: 8rpx;
height: 40rpx;
background: #2581e4;
display: inline-block;
margin-right: 6rpx;
}
</style> </style>

View File

@ -2,10 +2,26 @@
<view> <view>
<view class="cellWrap"> <view class="cellWrap">
<view class="cellItem" v-for="item in cellList" :index="item.id" :key="item.id" @click="intoPage(item)"> <view class="cellItem" v-for="item in cellList" :index="item.id" :key="item.id" @click="intoPage(item)">
<image class="cellImg" :src="item.img"></image> <view :class="item.class">
<image class="cellImg" :src="item.img"></image>
</view>
<text class="cellText">{{item.title}}</text> <text class="cellText">{{item.title}}</text>
</view> </view>
</view> </view>
<!-- <view class="cellWrap">
<view class="cellItem" @click="intoPage('exam')">
<view class="exam">
<image class="cellImg" src="../../static/exam/exam.png"></image>
</view>
<text class="cellText">正式考试</text>
</view>
<view class="cellItem" @click="intoPage('test')">
<view class="test">
<image class="cellImg" src="../../static/exam/test.png"></image>
</view>
<text class="cellText">考试记录</text>
</view>
</view> -->
</view> </view>
</template> </template>
@ -17,8 +33,8 @@
page: 1 page: 1
}, },
cellList: [ cellList: [
{img:'../../static/exam/exam.png',title:'正式考试',id:'exam'}, {img:'../../static/exam/exam.png',title:'正式考试',id:'exam',class:'exam'},
{img:'../../static/exam/test.png',title:'考试记录',id:'test'}, {img:'../../static/exam/test.png',title:'考试记录',id:'test',class:'test'},
// {img:'../../static/exam/question.png',title:'专题练习',id:'question'}, // {img:'../../static/exam/question.png',title:'专题练习',id:'question'},
// {img:'../../static/exam/errorIcon.png',title:'错题记录',id:'record'}, // {img:'../../static/exam/errorIcon.png',title:'错题记录',id:'record'},
] ]
@ -91,4 +107,20 @@
.cellItem:nth-of-type(4) .cellText{ .cellItem:nth-of-type(4) .cellText{
color: #d81e06; color: #d81e06;
} }
.exam{
width: 200rpx;
height: 200rpx;
background: #46bb5a;
border-radius: 40rpx;
padding: 36rpx;
margin: auto;
}
.test{
width: 200rpx;
height: 200rpx;
background: #ecc041;
border-radius: 40rpx;
padding: 36rpx;
margin: auto;
}
</style> </style>

View File

@ -22,7 +22,7 @@
</view> </view>
<scroll-view class="content" scroll-y="true" v-bind:style="{height:scollHeight+'rpx'}"> <scroll-view class="content" scroll-y="true" v-bind:style="{height:scollHeight+'rpx'}">
<view class="name"> <view class="name">
<view>{{currentIndex}}·{{currentQuestion.name}}</view> <view>{{currentIndex+1}}·{{currentQuestion.name}}</view>
<!-- <rich-text :nodes="currentQuestion.name"></rich-text> --> <!-- <rich-text :nodes="currentQuestion.name"></rich-text> -->
<view v-if="currentQuestion.img"> <view v-if="currentQuestion.img">
{{currentQuestion.img}} {{currentQuestion.img}}
@ -153,11 +153,16 @@
questions_.push(obj); questions_.push(obj);
} }
that.$u.api.submitExam(that.currentExam.examrecord,{questions_:questions_}).then(res=>{ that.$u.api.submitExam(that.currentExam.examrecord,{questions_:questions_}).then(res=>{
uni.showToast({
title:"提交成功",
icon:"none"
})
uni.setStorageSync('currentExam',res.data) uni.setStorageSync('currentExam',res.data)
uni.hideLoading() uni.hideLoading()
uni.redirectTo({ uni.reLaunch({
url:'/pages/exam/result' url:'/pages/exam/result'
}) })
}).catch(e=>{ }).catch(e=>{
if(res.msg){ if(res.msg){
uni.showModal({ uni.showModal({
@ -166,12 +171,11 @@
showCancel:false, showCancel:false,
success(res) { success(res) {
uni.reLaunch({ uni.reLaunch({
url:'/pages/index/index' url:'/pages/exam/exam'
}) })
} }
}) })
} }
}) })
// let questions = this.currentExam.questions // let questions = this.currentExam.questions
// let score=0 // let score=0

View File

@ -11,16 +11,17 @@
<view>题目分布单选<text>{{currentExam.paper_.danxuan_count}}</text>;多选<text>{{currentExam.paper_.duoxuan_count}}</text>;判断<text>{{currentExam.paper_.panduan_count}}</text></view> <view>题目分布单选<text>{{currentExam.paper_.danxuan_count}}</text>;多选<text>{{currentExam.paper_.duoxuan_count}}</text>;判断<text>{{currentExam.paper_.panduan_count}}</text></view>
<view>判分规则单选{{currentExam.paper_.danxuan_score}},多选{{currentExam.paper_.duoxuan_score}},多选{{currentExam.paper_.panduan_score}},错选少选均不得分</view> <view>判分规则单选{{currentExam.paper_.danxuan_score}},多选{{currentExam.paper_.duoxuan_score}},多选{{currentExam.paper_.panduan_score}},错选少选均不得分</view>
</view> </view>
<view class="subTitle">答题须知</view> <!-- <view class="subTitle">答题须知</view> -->
<view class="tipsArea"> <view class="tipsArea">
<ul> <ul>
<li class="tipsTitle">答题须知</li>
<li>1.进入答题后请不要后退或返回</li> <li>1.进入答题后请不要后退或返回</li>
<li>2.可点击上一题/下一题切换</li> <li>2.可点击上一题/下一题切换</li>
<li>3.可点击答题卡复查</li> <li>3.可点击答题卡复查</li>
<li>4.请合理安排时间答题,可提前交卷</li> <li>4.请合理安排时间答题,可提前交卷</li>
</ul> </ul>
</view> </view>
<u-button type="primary" @click="start()">开始答题</u-button> <u-button type="primary" @click="start()" class="start">开始答题</u-button>
</view> </view>
</template> </template>
@ -53,31 +54,55 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.wrap{ .wrap{
padding: 24rpx; padding: 24rpx;
font-size: 32rpx; font-size: 30rpx;
} }
.subTitle { .subTitle {
font-size: $u-font-size-title; font-size: $u-font-size-title;
font-weight: bold; font-weight: bold;
color: $theme-color; // color: $theme-color;
text-align: center; text-align: center;
margin: 40rpx auto 20rpx auto; margin: 40rpx auto 20rpx auto;
} }
.examContent { .examContent {
line-height: 50rpx; line-height: 50rpx;
margin-left: 80rpx; margin-left: 80rpx;
text { view{
font-weight: bold; margin-bottom: 6rpx;
color:$u-type-warning-dark;
}
} }
.tipsArea { text {
padding: 0 40rpx; font-weight: bold;
margin-left: 0rpx; color:$theme-color;;
margin-bottom: 30rpx;
} }
ul { }
margin: 0 30rpx; .tipsArea {
line-height: 50rpx; padding: 20rpx 40rpx;
margin-left: 0rpx;
margin-bottom: 30rpx;
border: 1px solid #2581e4;
border-radius: 20rpx;
font-size: 28rpx;
margin-top: 50rpx;
.tipsTitle{
font-weight: bold;
color: #2581e4;
} }
}
ul {
margin: 0 30rpx;
line-height: 50rpx;
}
.start{
width: 50%;
font-size: 30rpx;
height: 110rpx;
line-height: 105rpx;
color: #ffffff;
border-color: #2581e4;
background-color: #2581e4;
border-radius: 10rpx;
text-align: center;
margin: auto;
}
</style> </style>

View File

@ -1,11 +1,14 @@
<template> <template>
<view> <view>
<uni-list> <uni-list class="ulist">
<uni-list-item v-for="item in list" :key="item.id" @click="goDetail(item.id)" :clickable="true" link style="padding: 10upx;"> <uni-list-item v-for="item in list" :key="item.id" @click="goDetail(item.id)" :clickable="true" link style="padding: 10upx;padding: 5px;
border-radius: 20rpx;
border: 1rpx solid #dddddd;margin-bottom: 20rpx;">
<!-- 自定义 body --> <!-- 自定义 body -->
<template slot="body" style="display: block;width: 100%;"> <template slot="body" style="display: block;width: 100%;">
<view class="infoHead" style=""> <view class="infoHead" style="">
<view> <view>
<view class="blue_line"></view>
<text style="font-weight: bold;">{{item.exam_name}}</text> <text style="font-weight: bold;">{{item.exam_name}}</text>
<text v-if="item.name.indexOf('(补)') != -1">()</text> <text v-if="item.name.indexOf('(补)') != -1">()</text>
</view> </view>
@ -13,7 +16,7 @@
</view> </view>
<view class="infoLine"> <view class="infoLine">
<span>耗时 <span>耗时
<span style="color:#e47d25;">{{item.took_format}}</span> <span style="color:#40991c;">{{item.took_format}}</span>
</span> </span>
</view> </view>
<view class="infoLine"> <view class="infoLine">
@ -37,7 +40,8 @@
return { return {
listQuery: { listQuery: {
page: 1, page: 1,
page_size: 20 page_size: 20,
can_attend:true,
}, },
list: [], list: [],
loadingText: '加载中...' loadingText: '加载中...'
@ -76,16 +80,23 @@
this.$u.api.examRecordDetail(id).then(res=>{ this.$u.api.examRecordDetail(id).then(res=>{
uni.hideLoading() uni.hideLoading()
uni.setStorageSync('currentExam', res.data) uni.setStorageSync('currentExam', res.data)
if (res.data.questions_.length>0){ if (res.data.questions_&&res.data.questions_.length>0){
uni.navigateTo({ uni.navigateTo({
url:'/pages/exam/detail?examrecord='+id url:'/pages/exam/detail?examrecord='+id
}) })
} }
else{ else{
uni.showToast({ uni.showModal({
title:'获取失败', title: '提示',
icon:'none' content: '考试未结束,请考试结束后再查看',
}) success: function (res) {
}
});
// uni.showToast({
// title:'考试未结束,请考试结束后再查看',
// icon:'none'
// })
return return
} }
}).catch(e=>{ }).catch(e=>{
@ -110,9 +121,23 @@
<style lang='scss'> <style lang='scss'>
page { page {
background-color: $u-bg-color; /* background-color: $u-bg-color; */
background-color: none;
} }
.ulist{
width: 96%;
margin: 10rpx auto;
display: block;
}
.blue_line{
width: 18rpx;
height: 20rpx;
background: #2581e4;
display: inline-block;
margin-right: 6rpx;
}
.infoHead{ .infoHead{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -135,4 +160,7 @@
text-align: center; text-align: center;
margin-top:20upx margin-top:20upx
} }
.uni-list--border ,.uni-list--border-bottom{
display: none;
}
</style> </style>

View File

@ -20,7 +20,7 @@
export default { export default {
data() { data() {
return { return {
imageSrcPass: '/static/exam/result.png', imageSrcPass: '/static/exam/cross.png',
imageSrc: '/static/exam/error.png', imageSrc: '/static/exam/error.png',
currentExam:{} currentExam:{}
} }
@ -48,7 +48,7 @@
}, },
backToHome(){ backToHome(){
uni.reLaunch({ uni.reLaunch({
url:'/pages/exam/index' url:'/pages/home/home'
}) })
} }
}, },

View File

@ -2,7 +2,7 @@
<view> <view>
<!-- <view :style="{background: 'url('+imageURL+')'}"> <!-- <view :style="{background: 'url('+imageURL+')'}">
</view> --> </view> -->
<view style="background-color: #2581e4;"> <view>
<u-image :src="imageURL" mode="widthFix"></u-image> <u-image :src="imageURL" mode="widthFix"></u-image>
<view class="welcome">欢迎您{{vuex_user.name}}</view> <view class="welcome">欢迎您{{vuex_user.name}}</view>
</view> </view>
@ -11,7 +11,7 @@
:indicator-pos="indicatorPos" :mode="mode" :interval="3000" @click="click"></u-swiper> --> :indicator-pos="indicatorPos" :mode="mode" :interval="3000" @click="click"></u-swiper> -->
<view style="margin: 12rpx;"> <view style="margin: 12rpx;">
<u-grid :col="3" :border="false"> <u-grid :col="2" :border="false">
<u-grid-item v-for="(item, index) in grids" v-bind:key="index" @click="clickGrid(item)"> <u-grid-item v-for="(item, index) in grids" v-bind:key="index" @click="clickGrid(item)">
<u-icon :name="item.icon" color="#2b85e4" size="80"></u-icon> <u-icon :name="item.icon" color="#2b85e4" size="80"></u-icon>
<view class="grid-text">{{item.name}}</view> <view class="grid-text">{{item.name}}</view>
@ -91,17 +91,17 @@
}, },
{ {
name: '考试', name: '考试',
icon: 'file-text', icon: 'order',
path: '/pages/exam/exam', path: '/pages/exam/exam',
}, },
{ {
name: '考试记录', name: '考试记录',
icon: 'file-text', icon: 'list-dot',
path: '/pages/exam/record', path: '/pages/exam/record',
}, },
{ {
name: '证书查询', name: '证书查询',
icon: 'file-text', icon: 'qzone-circle-fill',
path: '/pages/certificate/index', path: '/pages/certificate/index',
} }
], ],
@ -178,12 +178,17 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.welcome{ .welcome{
background-color: #2581e4; background-color: #2581e4;
// font-weight: bold; font-size: 30rpx;
font-size: 24rpx;
color:white; color:white;
padding-left:8rpx; text-align: center;
height: 50rpx; height: 60rpx;
line-height: 46rpx; line-height: 58rpx;
border-radius: 10rpx;
width: 98%;
margin: auto;
}
.ugriditem{
} }
.u-body-item-title { .u-body-item-title {
font-size: 32rpx; font-size: 32rpx;

View File

@ -16,7 +16,7 @@
<!-- <button :style="[inputStyle]" class="getCaptcha">登录</button> --> <!-- <button :style="[inputStyle]" class="getCaptcha">登录</button> -->
<!-- <u-gap height="0.5" bg-color="#bbb"></u-gap> --> <!-- <u-gap height="0.5" bg-color="#bbb"></u-gap> -->
<view style="margin-top: 16rpx;"> <view style="margin-top: 16rpx;">
<u-button @click="submit" type="warning">登录</u-button> <u-button @click="submit" type="primary" style="background-color: #2581e4!important;">登录</u-button>
</view> </view>
<view class="alternative"> <view class="alternative">
<navigator url="login_password" class="password" open-type="navigate">密码登录</navigator> <navigator url="login_password" class="password" open-type="navigate">密码登录</navigator>

View File

@ -14,7 +14,7 @@
</u-form-item> </u-form-item>
</u-form> </u-form>
<view style="margin-top: 16rpx;"> <view style="margin-top: 16rpx;">
<u-button @click="submit" type="warning" >登录</u-button> <u-button @click="submit" type="primary" >登录</u-button>
</view> </view>
<view class="alternative"> <view class="alternative">
<navigator url="login" class="password" open-type="navigate">验证码登录</navigator> <navigator url="login" class="password" open-type="navigate">验证码登录</navigator>

View File

@ -1,33 +1,24 @@
<template> <template>
<view> <view>
<!-- <u-navbar :is-back="false" title=" " :border-bottom="false"> <vie style=" width: 100%;
<view class="u-flex u-row-right" style="width: 100%;"> height: 100px;
<view class="camera u-flex u-row-center"> display: block;
<u-icon name="camera-fill" color="#000000" size="48"></u-icon> background: #ffffff;"></vie>
</view>
</view>
</u-navbar> -->
<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30"> <view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
<view class="u-m-r-10"> <view class="avatarContainer">
<u-avatar :src="vuex_user.avatar" size="140"></u-avatar> <img :src="vuex_user.avatar" class='avatar'>
</view> </view>
<view class="u-flex-1"> <view class="u-flex-1">
<view class="u-font-18 u-p-b-20">{{vuex_user.name}}</view> <view class="u-font-18 u-p-b-20 u-p-t-20 userName">{{vuex_user.name}}</view>
<view class="u-font-14 u-type-info">{{vuex_user.username}}-{{vuex_user.dept_name}}</view> <view class="u-font-14 u-type-info deptName">{{vuex_user.username}}-{{vuex_user.dept_name}}</view>
<view class="u-font-14 u-tips-color" v-if="vuex_user.wxmp_openid">已绑定微信</view> <!-- <view class="u-font-14 u-tips-color" v-if="vuex_user.wxmp_openid">已绑定微信</view> -->
</view> </view>
<!-- <view class="u-m-l-10 u-p-10">
<u-icon name="scan" color="#969799" size="28"></u-icon>
</view> </view>
<view class="u-m-l-10 u-p-10"> <view class="u-m-t-20 u-m-l-20 u-m-r-20" style="position: relative;top:-50px">
<u-icon name="arrow-right" color="#969799" size="28"></u-icon> <u-cell-group style="border-radius: 20rpx;">
</view> -->
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item icon="weixin-fill" title="绑定微信" :arrow="false" @click="bindMP" v-if="!vuex_user.wxmp_openid"></u-cell-item> <u-cell-item icon="weixin-fill" title="绑定微信" :arrow="false" @click="bindMP" v-if="!vuex_user.wxmp_openid"></u-cell-item>
<u-cell-item icon="list-dot" title="考试记录" @click="examRecord"></u-cell-item> <u-cell-item icon="list-dot" title="考试记录" @click="examRecord"></u-cell-item>
<u-cell-item icon="close" title="退出" @click="Logout"></u-cell-item> <u-cell-item icon="backspace" title="退出" @click="Logout"></u-cell-item>
</u-cell-group> </u-cell-group>
</view> </view>
</view> </view>
@ -53,7 +44,6 @@
}); });
} }
) )
}, },
bindMP(){ bindMP(){
uni.login({ uni.login({
@ -93,7 +83,35 @@ page{
} }
} }
.user-box{ .user-box{
background-color: #fff; // background-color: #2581e4;
padding-top:24rpx; // background-color: rgba(37,129,228,0.9);
background-image: linear-gradient(45deg, #2581e4, #253a54);
padding-top: 24rpx;
width: 94%;
margin: auto;
border-radius: 10rpx;
position: relative;
top: -110rpx;
padding-top:80rpx;
}
.avatarContainer{
width: 150rpx;
height: 150rpx;
border-radius: 75rpx;
position: absolute;
top: -32%;
left: 50%;
padding: 50rpx 10rpx;
background: #ffffff;
-webkit-transform: translate(-50%);
transform: translate(-50%);
}
.avatar{
width: 130rpx;
height: 67rpx;
}
.userName,.deptName{
color: #ffffff;
text-align: center;
} }
</style> </style>

View File

@ -32,7 +32,19 @@
export default { export default {
data() { data() {
return { return {
myinspecttaskList: [], myinspecttaskList: [
{
state:'已完成',
name:'石静',
inspecttask_:{
name:'任务一',
start_date:'2024-05-20',
end_date:'2024-05-25',
},
members:[],
depts_count:3,
}
],
headstyle: { headstyle: {
"padding-top": "12rpx", "padding-top": "12rpx",
"padding-bottom": "12rpx" "padding-bottom": "12rpx"
@ -45,7 +57,16 @@
methods: { methods: {
getMyInspectTaskList() { getMyInspectTaskList() {
this.$u.api.getMyInspectTaskList({}).then(res => { this.$u.api.getMyInspectTaskList({}).then(res => {
this.myinspecttaskList = res.data this.myinspecttaskList = res.data;
if(res.data.length>0){}else{
uni.showModal({
title: '提示',
content: '您还没有巡查任务,请分配任务后查看',
success: function (res) {
uni.navigateBack(1)
}
});
}
}).catch(e => {}) }).catch(e => {})
}, },
taskClick(index) { taskClick(index) {

View File

@ -10,7 +10,7 @@ $u-light-color: #c0c4cc;
$u-border-color: #e4e7ed; $u-border-color: #e4e7ed;
$u-bg-color: #f3f4f6; $u-bg-color: #f3f4f6;
$u-type-primary: #2979ff; $u-type-primary: #2581e4;
$u-type-primary-light: #ecf5ff; $u-type-primary-light: #ecf5ff;
$u-type-primary-disabled: #a0cfff; $u-type-primary-disabled: #a0cfff;
$u-type-primary-dark: #2b85e4; $u-type-primary-dark: #2b85e4;