Commit 55611f2f authored by liuyuping's avatar liuyuping

'2022-3-8'

parent e70dd7a3
......@@ -43,20 +43,31 @@ App({
// })
},
globalData: {
appBaseUrl: 'https://safe.c-icc.cn:8035',
appBaseUrlV2: 'https://safe.c-icc.cn:8036',
appBaseUrlV3: 'https://safe.c-icc.cn:8030',
// appBaseUrl: 'https://safe.c-icc.cn:8035',
// appBaseUrlV2: 'https://safe.c-icc.cn:8036',
// appBaseUrlV3: 'https://safe.c-icc.cn:8030',
appBaseUrl: 'https://www.kuangshanzhixing.cn:8035',
appBaseUrlV2: 'https://www.kuangshanzhixing.cn:8036',
appBaseUrlV3: 'https://www.kuangshanzhixing.cn:8030',
// appBaseUrl: 'https://8.143.198.78:8035',
// appBaseUrlV2: 'https://8.143.198.78:8036',
// appBaseUrlV3: 'https://8.143.198.78:8030',
userInfo: null,
Authorization: '',
curRole: '', // 运营商 企业管理 企业员工 政府 超级管理员
curRole: '', // 运营商 企业管理 企业员工 政府 超级管理员
companyId: -1,
companyName: '',
currentEnter: {
},
currentEnter: {},
currentHD: {},
currentLawItem: {},
currentAdviceItem: {},
currentCourse: {},
currentTrainImg: {}
currentTrainImg: {},
curEvaluate: {},
testPaperId: -1,
singleScore: 0,
multiScore: 0,
justifyScore: 0,
isNeedNavigateTo: false
}
})
......@@ -25,8 +25,8 @@ Page({
},
data: {
page: this.data.curPage,
size: this.data.curPageSize,
sort: 'noticeId,desc'
size: this.data.curPageSize
//sort: 'noticeId,desc'
},
success: (res) => {
console.log(res, 'app.globalData.appBaseUrlV2')
......@@ -122,8 +122,8 @@ Page({
},
data: {
page: this.data.curPage,
size: this.data.curPageSize,
sort: 'noticeId,desc'
size: this.data.curPageSize
// sort: 'noticeId,desc'
},
success: (res) => {
this.setData({
......
......@@ -34,6 +34,12 @@ Page({
},
success: (res) => {
console.log(res)
this.setData({
title: res.data.noticeTitle,
depart: res.data.noticePublisher,
time: res.data.createTime,
content: res.data.noticeContent
})
/**
* createBy
* createTIme
......@@ -50,14 +56,14 @@ Page({
strips: [],
content
*/
this.setData({
title: res.noticeTitle,
depart: res.noticePublisher,
time: res.updateTime,
content: res.noticeContent
})
// this.setData({
// title: res.data.noticeTitle,
// depart: res.data.noticePublisher,
// time: res.data.updateTime,
// content: res.data.noticeContent
// })
wx.setNavigationBarTitle({
title: res.noticeTitle
title: res.data.noticeTitle
})
},
fail: () => {},
......
......@@ -54,6 +54,7 @@ Page({
* 页面的初始数据
*/
data: {
isShowVideo: true,
curCourse: app.globalData.currentCourse.courseBriefIntroduction,
curCoursePic: 'https://img0.baidu.com/it/u=2265254049,1802113800&fm=26&fmt=auto&gp=0.jpg',
courseVideoSrc: 'http://39.102.232.151:8030/video/8.mp4',
......@@ -75,6 +76,15 @@ Page({
curCourse: app.globalData.currentCourse.courseBriefIntroduction,
courses: app.globalData.currentCourse.coursehour
})
console.log(app.globalData.currentCourse.coursehour, 'app.globaldata.currentCourse.coursehour app.globaldata.currentCourse.coursehour')
const arr1 = app.globalData.currentCourse.coursehour.filter(item => {
return item.lessonFilePath.indexOf(".pdf") > -1
})
if (arr1.length === app.globalData.currentCourse.coursehour.length) {
this.setData({
isShowVideo: false
})
}
},
/**
......
<!--pages/course/course.wxml-->
<view class="course-wrapper">
<view class="course-title">当前课程: {{curCourse}}</view>
<view class="video-wrapper">
<video id="course" show-center-play-btn="{{false}}" src="{{courseVideoSrc}}" bindtimeupdate="videoUpdate"></video>
<view class="video-wrapper" wx:if="{{isShowVideo}}">
<video id="course" show-center-play-btn="{{false}}" src="{{courseVideoSrc}}" bindtimeupdate="videoUpdate" ></video>
<!-- <image class="video-cover" mode="scaleToFill" src="{{curCoursePic}}" animation="{{animationDisappear}}"></image>
<view class="mask-video" animation="{{animationDisappear}}">
<image class="paly-video-btn" src="{{courseVideoPlay}}" bindtap="playvideo">
......
......@@ -10,6 +10,8 @@ Page({
companyId: app.globalData.currentEnter.companyId,
// 隐患验收人
hdAcceptancePerson: "",
// 备注
comment: '',
// 隐患id
hdId: -1,
// 隐患描述
......@@ -42,7 +44,8 @@ Page({
rectFilePath: '',
// 放大图片的路径
enlargeUrl: '',
topAnimation: {}
topAnimation: {},
isToEnLarge: false
},
/**
......@@ -295,7 +298,8 @@ Page({
this.animation.bottom(0).step()
this.setData({
topAnimation: this.animation.export(),
enlargeUrl: this.data.imgsrcurl
enlargeUrl: this.data.imgsrcurl,
isToEnLarge: true
})
// toEnlargePicByRectPic
},
......@@ -303,13 +307,15 @@ Page({
this.animation.bottom(0).step()
this.setData({
topAnimation: this.animation.export(),
enlargeUrl: this.data.imgrecturl
enlargeUrl: this.data.imgrecturl,
isToEnLarge: true
})
},
toCancelEnlargePic() {
this.animation.bottom('-100%').step()
this.setData({
topAnimation: this.animation.export()
topAnimation: this.animation.export(),
isToEnLarge: false
})
}
})
\ No newline at end of file
......@@ -25,7 +25,10 @@
<text>隐患名称:</text>
<textarea type="text" disabled="true" placeholder="请输入隐患名称" value="{{hdName}}" bindinput="" maxlength="-1" />
</view>
<view class="danger-expert">
<text>备注: </text>
<input type="text" disabled="true" placeholder="请输入备注" value="{{comment}}" bindinput="" />
</view>
<!-- <view class="danger-type">
<text>隐患类型:</text>
<radio-group bindchange="">
......@@ -84,7 +87,7 @@
<button type="primary" bindtap="submitEdit" style="background-color: #1d2089;">提交修改</button>
</view>
</scroll-view>
<view class="enlarge-pic-wrapper" animation="{{topAnimation}}">
<view class="enlarge-pic-wrapper {{isToEnLarge? 'enlarge-pic-show': ''}}">
<image
src="{{enlargeUrl}}"
mode="aspectFit"
......
......@@ -160,15 +160,20 @@
}
.enlarge-pic-wrapper {
position: absolute;
bottom: -100%;
width: 100vw;
height: 100vh;
position: fixed;
display: none;
z-index: 999;
left: 0;
top: 0;
bottom: 0;
right: 0;
background-color: black;
display: flex;
align-items: center;
justify-content: center;
}
.enlarge-pic-show {
display: flex;
}
.enlarge-pic {
width: 100vw;
height: 100vh;
......
......@@ -6,6 +6,33 @@ Page({
* 页面的初始数据
*/
data: {
// 总的安全类别
secType: [
{
name: '安全资料类'
},
{
name: '现场检查类'
}
],
//
curSelectSecType: '',
// 安全检查类别
secCheckType: [],
// 安全检查类别替代
secCheckTypeReplace: [],
// 当前选择的安全检查类别
curSelectSecCheckTypeReplace: '',
// 安全检查内容
secCheckContent: [],
// 当前选择的安全检查内容
curSelectCheckContent: '',
// 发现问题
secCheckDiscover: [],
// 整改建议
suggestion: '',
// 检查依据
basis: '',
// 企业id
companyId: app.globalData.currentEnter.companyId,
// 隐患验收人
......@@ -37,7 +64,10 @@ Page({
// 隐患图片文件路径
hdFilePath: '',
// 整改图片文件路径
rectFilePath: ''
rectFilePath: '',
// 备注
comment: '',
//
},
/**
......@@ -65,6 +95,24 @@ Page({
backgroundColor: '#090D9C',
frontColor: '#ffffff',
})
wx.request({
url: app.globalData.appBaseUrl + '/api/enterpriseSafetyInspectionContent',
method: 'GET',
header: {
Authorization: app.globalData.Authorization
},
data: {
level: 1,
page: 0,
size: 9999
},
success: res => {
console.log(res, '企业安全检查类别 企业安全检查类别')
this.setData({
secCheckType: res.data.content
})
}
})
},
/**
......@@ -102,6 +150,58 @@ Page({
},
chooseSecCheckType(event) {
wx.request({
url: app.globalData.appBaseUrl + '/api/enterpriseSafetyInspectionContent',
method: 'get',
header: {
Authorization: app.globalData.Authorization
},
data: {
level: 2,
page: 0,
size: 9999,
pid: this.data.secCheckType[event.detail.value].id
},
success: (res) => {
console.log(res, 'chooseSecCheckType chooseSecCheckType chooseSecCheckType')
this.setData({
secCheckContent: [...res.data.content],
curSelectSecCheckTypeReplace: this.data.secCheckType[event.detail.value].name
})
}
})
},
chooseSecCheckContent(event) {
console.log(this.data.secCheckContent[event.detail.value], 'chooseSecCheckContent chooseSecCheckContent chooseSecCheckContent')
wx.request({
url: app.globalData.appBaseUrl + '/api/enterpriseSafetyMatter',
method: 'get',
header: {
Authorization: app.globalData.Authorization
},
data: {
inspectionContentId: this.data.secCheckContent[event.detail.value].id,
page: 0,
size: 9999
},
success: (res) => {
this.setData({
secCheckDiscover: res.data.content,
curSelectCheckContent: this.data.secCheckContent[event.detail.value].name
})
}
})
},
chooseSecCheckDiscover(event) {
this.data.hdName = this.data.secCheckDiscover[event.detail.value].name
this.setData({
hdName: this.data.hdName,
basis: this.data.secCheckDiscover[event.detail.value].basis,
suggestion: this.data.secCheckDiscover[event.detail.value].suggestion
})
},
/**
* 拍照
*/
......@@ -162,6 +262,10 @@ Page({
inputHdInspectExpert(event) {
this.data.hdInspectExpert = event.detail.value
},
//
inputHdComment(event) {
this.data.comment = event.detail.value
},
// 输入隐患名称
inputHdName(event) {
this.data.hdName = event.detail.value
......@@ -171,10 +275,17 @@ Page({
console.log(event, 'hdTypeInput')
this.data.hdLevel = event.detail.value
},
// 输入检查依据
inpoutBasis(event) {
this.data.basis = event.detail.value
},
// 输入整改建议
inputRectSug(event) {
console.log(event, '请输入整改建议')
this.data.hdRectificationSug = event.detail.value
// this.data.hdRectificationSug = event.detail.value
this.data.suggestion = event.detail.value
},
// 输入整改日期
inputRectDate(event) {
......@@ -306,5 +417,16 @@ Page({
dataString += `\r\nContent-Disposition: form-data; name="${key}"\r\n\r\n${formdata[key]}\r\n--XXX`
}
return dataString
},
chooseSecType(event) {
console.log(event, 'chooseSecType chooseSecType chooseSecType')
// this.setData({
// secCheckTypeReplace:
// })
this.setData({
secCheckTypeReplace: this.data.secCheckType.filter(item => item.type === this.data.secType[event.detail.value].name),
curSelectSecType: this.data.secType[event.detail.value].name
})
}
})
\ No newline at end of file
<!--pages/dangerregister/dangerregister.wxml-->
<view class="danger-register-wrapper">
<view class="danger-form-wrapper">
<!-- <view class="danger-order">
<text>序号:</text>
<input type="text" disabled="true" />
</view> -->
<view class="danger-check-date">
<text>检查日期:</text>
<picker class="danger-pick-date" mode="date" value="{{hdInspectDate}}" bindchange="selectCheckDate">
......@@ -19,29 +15,108 @@
<input type="text" placeholder="请输入专家名称" bindinput="inputHdInspectExpert" />
</view>
<view class="danger-name">
<text>隐患名称:</text>
<textarea type="text" placeholder="请输入隐患名称" bindinput="inputHdName" maxlength="-1"/>
</view>
<view class="danger-type">
<text>隐患类型:</text>
<text>隐患等级:</text>
<radio-group bindchange="inputHDType">
<radio checked="{{true}}" value="1" color="#1d2089">一般隐患</radio>
<radio checked="{{false}}" value="2" color="#1d2089">重大隐患</radio>
</radio-group>
</view>
<view class="c11-1">
<text>安全类别:</text>
<view>
<picker
header-text="安全类别"
mode="selector"
range="{{secType}}"
range-key="name"
bindchange="chooseSecType"
>
当前选择: {{curSelectSecType}}
</picker>
</view>
</view>
<view class="c11-1">
<text>安全检查类别</text>
<view>
<picker
header-text="安全检查类别"
mode="selector"
range="{{secCheckTypeReplace}}"
range-key="name"
bindchange="chooseSecCheckType"
>
当前选择: {{curSelectSecCheckTypeReplace}}
</picker>
</view>
</view>
<view class="c11-1">
<text>安全检查内容</text>
<view>
<picker
header-text="安全检查内容"
mode="selector"
range="{{secCheckContent}}"
range-key="name"
bindchange="chooseSecCheckContent"
>当前选择: {{curSelectCheckContent}}</picker>
</view>
</view>
<view class="c11-1">
<text>发现问题</text>
<view>
<picker
header-text="发现问题"
mode="selector"
range="{{secCheckDiscover}}"
range-key="name"
bindchange="chooseSecCheckDiscover"
>当前选择:{{hdName}}</picker>
</view>
</view>
<view class="c11-1">
<text>检查依据</text>
<view>
<textarea maxlength="-1" bindinput="inpoutBasis" value="{{basis}}"/>
</view>
</view>
<view class="danger-rect">
<text>整改建议:</text>
<textarea maxlength="-1" bindinput="inputRectSug" value="{{}}"></textarea>
<textarea maxlength="-1" bindinput="inputRectSug" value="{{suggestion}}"></textarea>
</view>
<!--<view class="c11-1">
<text>整改建议</text>
<view>
<textarea value="{{suggestion}}" />
</view>
</view>-->
<view class="danger-img">
<text>隐患照片</text>
<!-- <camera device-position="back" flash="off" style="width:100%;height:300px;"></camera> -->
<image mode="aspectFit" src="{{imgsrcurl}}"></image>
<button type="primary" bindtap="takePhoto">拍照</button>
</view>
<view class="danger-expert">
<text>备注</text>
<input type="text" placeholder="备注"
bindinput="inputHdComment" />
</view>
<!-- <view class="danger-preview">
<text>隐患照片预览:</text>
......
......@@ -59,6 +59,12 @@
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
.child-hdname {
padding: 20rpx;
border-radius: 5rpx;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
margin: 10rpx 10rpx;
}
.danger-type {
display: flex;
......@@ -149,4 +155,13 @@
.danger-submit button {
background-color: #1d2089!important;
}
.c11-1 {
display: flex;
background-color: white;
margin: 3vh 5vw;
justify-content: space-between;
padding: 1vh 2vw;
border-radius: 5px;
box-shadow: 1rpx 1rpx 0.5rpx 0.5rpx #eee, -1rpx -1rpx 0.5rpx 0.5rpx #eee;
}
\ No newline at end of file
This diff is collapsed.
{
"usingComponents": {}
"usingComponents": {
"ec-canvas": "../ec-canvas/ec-canvas"
}
}
\ No newline at end of file
<!--pages/evaluate/evaluate.wxml-->
<view class="evaluate-wrapper">
<view class="card-wrapper">
<view class="nickname-wrapper">相善若水</view>
<view class="nickname-interface">当前用户名称</view>
<view class="person-image-wrapper">
<!-- <view class="nickname-wrapper">相善若水</view>
<view class="nickname-interface">当前用户名称</view> -->
<!-- <view class="person-image-wrapper">
<image class="person-image" src="{{headPotraitPic}}"></image>
</view> -->
<!-- <view class="entry-belong-to">所属企业</view>
<view class="entry-name">威海华发房地产开发有限公司</view> -->
<view wx:if="{{ isStaff }}">
<view class="study-info">学习情况</view>
<view class="complete-class">完成<span class="complete-degree">{{completedCourseNum}}</span>课程/共<span class="complete-degree">{{totalCourseNum}}</span>课程</view>
<view class="complete-percent">完成百分比: <span class="complete-degree">{{completedCourseRate}}</span></view>
<view class="evaluate-star">评价: <image wx:for="{{courseStarLevel}}" class="star-for-evaluate" src="{{yelloStar}}"></image><image wx:for="{{5 - courseStarLevel}}" class="star-for-evaluate"src="{{grayStar}}"></image></view>
<view class="study-info to-top-margin">考试情况</view>
<view class="complete-class">完成<span class="complete-degree">{{completedPaperNum}}</span>课程/共<span class="complete-degree">{{totalPaperNum}}</span>课程</view>
<view class="complete-percent">完成百分比: <span class="complete-degree">{{completedPaperRate}}</span></view>
<view class="evaluate-star">评价: <image wx:for="{{courseStarLevel}}"class="star-for-evaluate" src="{{yelloStar}}"></image><image wx:for="{{5 - courseStarLevel}}" class="star-for-evaluate"src="{{grayStar}}"></image></view>
</view>
<view wx:if="{{ isManager }}">
<view>
<view class="class1-0">参与学习情况</view>
<view class="class2-0">
<span class="class2-2">参与<text class="class2-1">{{courseLearnerNum}}</text>人</span>
<span class="class2-2">参与度<text class="class2-1">{{courseLearnerRate}}</text></span>
</view>
<view class="class2-0">
<span class="class2-2">完成全部课程<text class="class2-1">{{courseCompletedLearnerNum}}</text>人</span>
<span class="class2-2">共<text class="class2-1">{{totalPeopleNum}}</text>人</span>
<span class="class2-2">完成度<text class="class2-1">{{courseCompletedLearnerRate}}</text></span>
</view>
</view>
<view>
<view class="class1-0">参与考试情况</view>
<view class="class2-0">
<span class="class2-2">参与<text class="class2-1">{{examineeNum}}</text>人</span>
<span class="class2-2">共<text class="class2-1">{{totalPeopleNum}}</text>人</span>
</view>
<view class="class2-0">
<span class="class2-2">完成全部考试<text class="class2-1">{{examCompletedExamineeNum}}</text>人</span>
<span class="class2-2">共<text class="class2-1">{{totalPeopleNum}}</text>人</span>
<span class="class2-2">完成度<text class="class2-1">{{examCompletedExamineeRate}}</text></span>
</view>
</view>
<view>
<view class="class1-0">成绩统计情况</view>
<view class="class2-0" wx:if="{{avgScore !== null}}">
<span class="class2-2">企业平均成绩<text class="class2-1">{{avgScore}}</text>分</span>
</view>
<view class="evaluate-star">评价: <image wx:for="{{courseStarLevel}}" class="star-for-evaluate" src="{{yelloStar}}"></image><image wx:for="{{5 - courseStarLevel}}" class="star-for-evaluate"src="{{grayStar}}"></image></view>
<view class="container" style="width: 500rpx;height: 500rpx;display: flex;justify-content: center;margin: 0 auto;" wx:if="{{avgScore !== null}}">
<ec-canvas style="width: 700rpx;height: 500rpx;" id="mychart-dom-pie" canvas-id="mychart-pie" ec="{{ ec }}"></ec-canvas>
</view>
</view>
</view>
<view class="entry-belong-to">所属企业</view>
<view class="entry-name">威海华发房地产开发有限公司</view>
<view class="study-info">学习情况</view>
<view class="complete-class">完成<span class="complete-degree">2</span>课程/共<span class="complete-degree">10</span>课程</view>
<view class="complete-percent">完成百分比: <span class="complete-degree">20%</span></view>
<view class="evaluate-star">评价: <image class="star-for-evaluate" src="{{yelloStar}}"></image><image class="star-for-evaluate" src="{{yelloStar}}"></image><image class="star-for-evaluate"src="{{yelloStar}}"></image><image class="star-for-evaluate"src="{{yelloStar}}"></image><image class="star-for-evaluate"src="{{grayStar}}"></image></view>
<view class="study-info to-top-margin">考试情况</view>
<view class="complete-class">完成<span class="complete-degree">2</span>课程/共<span class="complete-degree">10</span>课程</view>
<view class="complete-percent">完成百分比: <span class="complete-degree">20%</span></view>
<view class="evaluate-star">评价: <image class="star-for-evaluate" src="{{yelloStar}}"></image><image class="star-for-evaluate" src="{{yelloStar}}"></image><image class="star-for-evaluate"src="{{yelloStar}}"></image><image class="star-for-evaluate"src="{{yelloStar}}"></image><image class="star-for-evaluate"src="{{grayStar}}"></image></view>
</view>
<view class="bgcolor-cover"></view>
</view>
\ No newline at end of file
......@@ -121,4 +121,39 @@
background-color: #090D9C;
z-index: -1;
border-radius: 0 0 70rpx 70rpx;
}
.class1-0 {
position: relative;
font-size: 34rpx;
font-family: 'PingFang SC';
font-weight: bold;
color: #333333;
line-height: 39rpx;
margin: 10rpx 38rpx;
}
.class1-0::before {
content: '';
display: block;
position: absolute;
left: -20rpx;
top: 50%;
width: 11rpx;
height: 29rpx;
background: #090D9C;
transform: translatey(-50%);
}
.class2-0 {
margin-left: 38rpx;
font-family: 'PingFang-SC-Medium';
font-size: 30rpx;
}
.class2-1 {
color: #090D9C;
font-family: 'PingFang-SC-Medium';
font-size: 38rpx;
margin: 0 10rpx;
}
.class2-2 {
margin-right: 30rpx;
}
\ No newline at end of file
// pages/exam/exam.js
const app = getApp();
Page({
/**
......@@ -27,11 +28,37 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.request({
url: app.globalData.appBaseUrlV2 + '/api/onlineExamPaper/page',
method: 'get',
header: {
Authorization: app.globalData.Authorization
},
data: {
page: 0,
size: 999
},
success: (res) => {
if (res.statusCode === 200) {
console.log(res.data.content, 'res.data.content res.data.content')
res.data.content.forEach(item => {
if(!item.score) {
item.isExamed = false
item.score = 0
} else {
item.isExamed = true
}
})
this.setData({
examList: res.data.content
})
}
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
......@@ -48,6 +75,13 @@ Page({
backgroundColor: '#090D9C',
frontColor: '#ffffff',
})
if (app.globalData.isNeedNavigateTo) {
app.globalData.isNeedNavigateTo = false
wx.navigateTo({
url: '/pages/testpaper/testpaper?id=' + app.globalData.testPaperId +'&singleScore=' + app.globalData.singleScore + '&multiScore=' + app.globalData.multiScore + '&justifyScore=' + app.globalData.justifyScore,
success: function(event) {}
})
}
},
/**
......@@ -97,20 +131,47 @@ Page({
this.setData({
animationSearch: repAnimation.export()
})
},
/**
* 搜索考试内容
*/
searchExam() {
},
/**
* 跳转到考试试题
*/
LinkToTestPaper() {
LinkToTestPaper(event) {
wx.navigateTo({
url: '/pages/testpaper/testpaper',
url: '/pages/testpaper/testpaper?id=' + event.currentTarget.dataset.index.id +'&singleScore=' + event.currentTarget.dataset.index.singleChoiceScore + '&multiScore=' + event.currentTarget.dataset.index.multipleChoiceScore + '&justifyScore=' + event.currentTarget.dataset.index.judgmentScore,
success: function(event) {}
})
},
/**
* 搜索考试内容
*/
searchExam(event) {
wx.request({
url: app.globalData.appBaseUrlV2 + '/api/onlineExamPaper/page',
method: 'get',
header: {
Authorization: app.globalData.Authorization
},
data: {
page: 0,
size: 999,
name: event.detail.value
},
success: (res) => {
if (res.statusCode === 200) {
console.log(res.data.content, 'res.data.content res.data.content')
res.data.content.forEach(item => {
if(!item.score) {
item.isExamed = false
item.score = 0
} else {
item.isExamed = true
}
})
this.setData({
examList: res.data.content
})
}
}
})
}
})
\ No newline at end of file
......@@ -11,18 +11,31 @@
</input>
</view>
<scroll-view scroll-y="true" class="exam-scroll-wrapper">
<view wx:for="{{examList}}" class="exam-list-wrapper">
<view wx:for="{{examList}}" class="class1-0">
<view class="class1-1">{{item.name}}</view>
<view class="class1-2">
<view class="class1-3">
<view class="exam-score" wx:if="{{item.isExamed}}">
已考试: {{item.score}}分
</view>
<view wx:else class="no-exam">还未考试</view>
</view>
<button class="startExamBtn" data-index="{{item}}"
bindtap="LinkToTestPaper">开始考试</button>
</view>
</view>
<!-- <view wx:for="{{examList}}" class="exam-list-wrapper">
<image src="{{item.coverPic}}" class="exam-cover"></image>
<view class="down-wrapper">
<view class="down-title">{{item.examName}}</view>
<view class="down-title">{{item.name}}</view>
<view class="exam-score-wrapper">
<view class="exam-score" wx:if="{{item.isExamed}}">
已考试: {{item.score}}分
</view>
<view wx:else class="no-exam">还未考试</view>
</view>
<button class="startExamBtn" bindtap="LinkToTestPaper">开始考试</button>
<button class="startExamBtn" data-index="{{item}}" bindtap="LinkToTestPaper">开始考试</button>
</view>
</view>
</view> -->
</scroll-view>
</view>
\ No newline at end of file
......@@ -110,4 +110,24 @@
/* line-height: 43rpx!important; */
/* display: flex;
align-items: center; */
}
\ No newline at end of file
}
.class1-0 {
width: 710rpx;
margin: 20rpx auto;
box-shadow: 2rpx 2rpx 2rpx 2rpx #eee, -1rpx -1rpx 1rpx 1rpx #eee;
border-radius: 20rpx;
overflow: hidden;
padding-top: 10rpx;
}
.class1-1 {
margin-top: 20rpx;
margin-left: 20rpx;
}
.class1-2 {
margin-top: 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 5rpx 20rpx;
}
......@@ -165,10 +165,31 @@ Page({
* 跳转到学习评价
*/
LinkToEvaluate() {
wx.navigateTo({
url: '/pages/evaluate/evaluate',
success: function(event) {}
})
if (app.globalData.curRole === '企业管理') {
wx.request({
url: app.globalData.appBaseUrlV2 + '/api/learningEvaluation/evaluateEnterprise',
method: 'GET',
header: {
Authorization: app.globalData.Authorization
},
success: (res) => {
console.log(res ,'app.globalData.curRole>>>>>>>>>>>>>>>>>>')
app.globalData.curEvaluate = {
...res.data
}
wx.navigateTo({
url: '/pages/evaluate/evaluate',
success: function(event) {}
})
}
})
} else {
wx.navigateTo({
url: '/pages/evaluate/evaluate',
success: function(event) {}
})
}
},
/**
* 跳转到隐患管理
......
// pages/info/info.js
const app = getApp();
Page({
/**
......@@ -6,30 +7,6 @@ Page({
*/
data: {
infoList: [
{
title: '[隐患预警] 贵公司“重大隐患”—“联动台紧急停止按钮无效”整改即将到期,请及时整改',
isRead: false,
time: '2020-05-19 19:25',
infoId: '11'
},
{
title: '[隐患预警] 贵公司“一般隐患”—“力矩限位不灵敏”整改即将到期,请及时整改',
isRead: false,
time: '2020-05-19 19:24',
infoId: '22'
},
{
title: '[隐患预警] 贵公司“一般隐患”—“起升钢丝绳排布不均匀”整改已超期,请及时整改',
isRead: true,
time: '2020-05-18 17:23',
infoId: '33'
},
{
title: '[隐患预警] 贵公司“一般隐患”—“脚手架外架与脚手架内架相连,拉接点较少”整改已超期,请及时整改',
isRead: true,
time: '2020-05-18 13:34',
infoId: '44'
}
]
},
......@@ -37,7 +14,29 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.request({
url: app.globalData.appBaseUrlV2 + '/api/infoPush/page',
header: {
Authorization: app.globalData.Authorization
},
method: 'get',
data: {
page: 0,
size: 999
},
success: (res) => {
console.log(res, 'info 推送')
this.setData({
infoList: res.data.content.map(item => {
return {
title: item.content,
isRead: false,
time: item.createTime
}
})
})
}
})
},
/**
......@@ -58,6 +57,8 @@ Page({
backgroundColor: '#090D9C',
frontColor: '#ffffff',
})
},
/**
......
......@@ -2,12 +2,12 @@
<view class="info-page-wrapper">
<scroll-view scroll-y="true" class="info-list-scroll">
<view wx:for="{{infoList}}" class="info-item-wrapper" wx:key="infoId">
<view wx:if="{{item.isRead}}" class="read-icon">已读</view>
<view wx:else class="unread-icon">未读</view>
<!--<view wx:if="{{item.isRead}}" class="read-icon">已读</view>
<view wx:else class="unread-icon">未读</view>-->
<view wx:if="{{item.isRead}}" class="read-time">{{item.time}}</view>
<view wx:else class="unread-time">{{item.time}}</view>
<view wx:if="{{item.isRead}}" class="read-point-icon"></view>
<view wx:else class="unread-point-icon"></view>
<!--<view wx:if="{{item.isRead}}" class="read-point-icon"></view>
<view wx:else class="unread-point-icon"></view>-->
<view wx:if="{{item.isRead}}" class="info-item-read-title">{{item.title}}</view>
<view wx:else class="info-item-title">{{item.title}}</view>
</view>
......
......@@ -17,7 +17,7 @@
box-sizing: border-box;
margin: 30rpx auto;
padding-top: 45rpx;
padding-left: 60rpx;
padding-left: 20rpx;
padding-right: 8rpx;
border-radius: 10rpx;
box-shadow: 2rpx 2rpx 2rpx 2rpx #eee, -1.5rpx -1.5rpx 1.5rpx 1.5rpx #eee;
......
......@@ -29,7 +29,7 @@ Page({
data: {
page: this.data.curPage,
size: this.data.curPageSize,
sort: 'lawDate,desc'
sort: 'law_date,desc'
},
success: (res) => {
console.log(res, 'wx.request')
......
......@@ -144,6 +144,7 @@ Page({
console.log(res, 'authorization authorization authorizatoin')
let courses = []
courses = [...res.data.content]
console.log(courses, 'courses courses courses courses')
for (let i = 0; i < courses.length; i++) {
courses[i].coursehour = []
courses[i].sum = 0
......@@ -230,8 +231,61 @@ Page({
/**
* 用户搜索课程
*/
searchTeachCourse() {
searchTeachCourse(event) {
console.log(event, 'search______________>>>>>>course')
// 获取所有课程
wx.request({
url: app.globalData.appBaseUrlV2 + '/api/onlineTraining/pageCourse',
method: 'get',
header: {
Authorization: app.globalData.Authorization
},
data: {
page: 0,
size: 9999,
courseTitle: event.detail.value
},
success: (res) => {
console.log(res, 'authorization authorization authorizatoin')
let courses = []
courses = [...res.data.content]
console.log(courses, 'courses courses courses courses')
for (let i = 0; i < courses.length; i++) {
courses[i].coursehour = []
courses[i].sum = 0
courses[i].isLearnedSum = 0
courses[i].validDate = 6
}
for (let i = 0; i < courses.length; i++) {
wx.request({
url: app.globalData.appBaseUrlV2 + '/api/onlineTraining/findLesson',
method: 'get',
header: {
Authorization: app.globalData.Authorization
},
data: {
page: 0,
size: 9999,
pid: courses[i].id
},
success: (res1) => {
console.log(res1, 'coursehour coursehour')
courses[i].coursehour = [...res1.data]
courses[i].sum = courses[i].coursehour.length
courses[i].isLearnedSum = courses[i].coursehour.filter(item => parseInt(item.speed) > 98).length
courses[i].cover = app.globalData.appBaseUrlV3 + '/online-training/cover/' + courses[i].courseCoverFilePath.split('\\online-training\\cover\\')[1]
courses[i].introduce = courses[i].courseBriefIntroduction
this.setData({
teachList: courses
})
},
fail: () => {}
})
}
},
fail: () => {}
})
},
/**
* 获取焦点
......
......@@ -21,7 +21,7 @@
<view data-index="{{index}}">{{item.introduce}}</view>
</view>
</view>
<view class="course-subject">课程题目: {{item.title}}</view>
<view class="course-subject">课程题目: {{item.courseTitle}}</view>
<view class="sum-price-wrapper">
<view class="course-sum-wrapper">课程数量: <span>{{item.sum}}</span>课时, 已经学习了<span>{{item.isLearnedSum}}</span>课时</view>
<view class="price-wrapper">
......
This diff is collapsed.
<!--pages/testpaper/testpaper.wxml-->
<view class="testpaper-wrapper">
<scroll-view scroll-y="{{false}}" class="scroll-wrapper">
<view class="class0-0" wx:if="{{singleQuestionNum > 0 }}">
<span class="class1-0">单选题数量: <text class="class1-1">{{singleQuestionNum}}</text></span>
<span class="class2-0">单选题分值: <text class="class2-1">{{singleScore}}</text></span>
</view>
<view wx:for="{{singleQuestions}}" class="test-question-wrapper">
<view class="test-question-outline-wrapper">
{{(index + 1) < 10 ? '0' + (index + 1) : (index + 1 + '')}}
......@@ -9,23 +13,30 @@
<text class="decorate-must">*</text>
</view>
<view class="test-question-body-wrapper">
<radio-group>
<radio-group bindchange="chooseSingle">
<view wx:for="{{item.questionList}}"
wx:for-item="item1"
wx:for-index="index1"
class="test-question-line">{{index1 === 0? 'A、' : (index1 === 1? 'B、' : (index1 === 2? 'C、': (index1 === 3? 'D、' : 'E、')))}}{{item1}}</view>
class="test-question-line">{{index1 === 0? 'A、' : (index1 === 1? 'B、' : (index1 === 2? 'C、': (index1 === 3? 'D、' : (index1 === 4 ? 'E、' : (index1 === 5 ? 'F、' : 'G、')))))}}{{item1}}</view>
<view wx:if="{{isExam&&(!item.isAnswer)}}" class="question-answer"><text class="right-answer">正确答案: </text><text class="answer">{{item.answer}}</text></view>
<view wx:if="{{isExam&&(!item.isAnswer)}}" class="question-analysis"><text class="right-answer">答案解析: </text><text class="answer">{{item.analysis}}</text></view>
<view class="select-optoin-wrapper">
<radio wx:for="{{item.questionList}}"
wx:for-index="index1"
class="one-option"
color="#090D9C"
value="{{index+'|'+index1}}"
>
{{index1 === 0? 'A' : (index1 === 1? 'B' : (index1 === 2? 'C': (index1 === 3? 'D' : 'E')))}}
{{index1 === 0? 'A' : (index1 === 1? 'B' : (index1 === 2? 'C': (index1 === 3? 'D' : (index1 === 4 ? 'E' : (index1 === 5 ? 'F' : 'G')))))}}
</radio>
</view>
</radio-group>
</view>
</view>
<view class="class0-0" wx:if="{{multiQuestionNum > 0}}">
<span class="class1-0">多选题数量: <text class="class1-1">{{multiQuestionNum}}</text></span>
<span class="class2-0">多选题分值: <text class="class2-1">{{multiScore}}</text></span>
</view>
<view wx:for="{{multiQuestions}}" class="test-question-wrapper">
<view class="test-question-outline-wrapper">
{{(index + 1) < 10 ? '0' + (index + 1) : (index + 1 + '')}}
......@@ -34,23 +45,30 @@
<text class="decorate-must">*</text>
</view>
<view class="test-question-body-wrapper">
<checkbox-group>
<checkbox-group bindchange="chooseMulti">
<view wx:for="{{item.questionList}}"
wx:for-item="item1"
wx:for-index="index1"
class="test-question-line">{{index1 === 0? 'A、' : (index1 === 1? 'B、' : (index1 === 2? 'C、': (index1 === 3? 'D、' : 'E、')))}}{{item1}}</view>
class="test-question-line">{{index1 === 0? 'A、' : (index1 === 1? 'B、' : (index1 === 2? 'C、': (index1 === 3? 'D、' : (index1 === 4 ? 'E、' : (index1 === 5 ? 'F、' : 'G、')))))}}{{item1}}</view>
<view wx:if="{{isExam&&(!item.isAnswer)}}" class="question-answer"><text class="right-answer">正确答案: </text><text class="answer">{{item.answer}}</text></view>
<view wx:if="{{isExam&&(!item.isAnswer)}}" class="question-analysis"><text class="right-answer">答案解析: </text><text class="answer">{{item.analysis}}</text></view>
<view class="select-optoin-wrapper">
<checkbox wx:for="{{item.questionList}}"
wx:for-index="index1"
class="one-option"
color="#090D9C"
value="{{index + '|' + index1}}"
>
{{index1 === 0? 'A' : (index1 === 1? 'B' : (index1 === 2? 'C': (index1 === 3? 'D' : 'E')))}}
{{index1 === 0? 'A' : (index1 === 1? 'B' : (index1 === 2? 'C': (index1 === 3? 'D' : (index1 === 4 ? 'E' : (index1 === 5 ? 'F' : 'G、')))))}}
</checkbox>
</view>
</checkbox-group>
</view>
</view>
<view class="class0-0" wx:if="{{justifyQuestionNum > 0}}">
<span class="class1-0">判断题数量: <text class="class1-1">{{justifyQuestionNum}}</text></span>
<span class="class2-0">判断题分值: <text class="class2-1">{{justifyScore}}</text></span>
</view>
<view wx:for="{{checkQuestions}}" class="test-question-wrapper">
<view class="test-question-outline-wrapper">
{{(index + 1) < 10 ? '0' + (index + 1) : (index + 1 + '')}}
......@@ -59,18 +77,21 @@
<text class="decorate-must">*</text>
</view>
<view class="test-question-body-wrapper">
<radio-group>
<view wx:for="{{item.questionList}}"
<radio-group bindchange="chooseJustify">
<!-- <view wx:for="{{item.questionList}}"
wx:for-item="item1"
wx:for-index="index1"
class="test-question-line">{{item1}}</view>
class="test-question-line">{{item1}}</view> -->
<view wx:if="{{isExam&&(!item.isAnswer)}}" class="question-answer"><text class="right-answer">正确答案: </text><text class="answer">{{item.answer}}</text></view>
<view wx:if="{{isExam&&(!item.isAnswer)}}" class="question-analysis"><text class="right-answer">答案解析: </text><text class="answer">{{item.analysis}}</text></view>
<view class="select-optoin-wrapper">
<radio wx:for="{{item.questionList}}"
wx:for-index="index1"
class="one-option"
color="#090D9C"
value="{{index + '|' + index1}}"
>
{{index1 === 0? '是' : (index1 === 1? '否' : (index1 === 2? '是': (index1 === 3? '否' : '否')))}}
{{index1 === 0? '对' : (index1 === 1? '错' : (index1 === 2? '对': (index1 === 3? '错' : '错')))}}
</radio>
</view>
</radio-group>
......@@ -78,19 +99,22 @@
</view>
<view class="submit-row"><button class="submit-btn" bindtap="submitTestPaper">提交考卷</button></view>
</scroll-view>
<view class="score-wrapper" catchtouchmove="cancelmove">
<view class="score-wrapper {{isShowExamPage?'' : ' score-hide'}}" catchtouchmove="cancelmove">
<view class="real-score-outline">
<view class="real-score-outline-title">您的考试得分为</view>
<view class="real-score">90</view>
<view class="real-score">{{resultScore}}</view>
<view class="score-slogan">恭喜您顺利通过考试</view>
<view class="wrong-test-wrapper">
<view class="wrong-btn">查看错题</view>
<view class="test-btn">重新考试</view>
<view class="wrong-btn" bindtap="viewWrong">查看错题</view>
<view class="test-btn" bindtap="quitTest">重新考试</view>
</view>
<view class="close-score-outline">
<view class="close-score-outline" bindtap="closeMySelf">
<image class="close-score-image" mode="aspectFill" src="{{closeBtnImage}}"></image>
</view>
<view class="real-score-book">
<image class="real-score-book-img" mode="aspectFill"
src="{{shuImg}}"></image>
</view>
</view>
</view>
</view>
\ No newline at end of file
......@@ -173,6 +173,8 @@
top: 0;
bottom: 0;
background-color: rgba(0, 0, 0, .3);
}
.score-hide {
display: none;
}
.real-score-outline {
......@@ -260,3 +262,50 @@
width: 100%;
height: 100%;
}
.question-answer {
border-top: 1rpx solid #eee;
}
.right-answer {
color: #1f208c;
}
.answer {
color: #ff0000;
}
.question-analysis {
border-top: 1rpx solid #eee;
color: #ff0000;
}
.class0-0 {
padding: 15rpx;
margin: 15rpx 10rpx;
background-color: #fff;
border-radius: 5rpx;
}
.class1-0 {
margin: 0 20rpx;
}
.class1-1 {
margin: 0 20rpx;
color: #090d9c;
font-size: 30rpx;
}
.class2-0 {
margin: 0 20rpx;
}
.class2-1 {
margin: 0 20rpx;
color: #090d9c;
font-size: 30rpx;
}
.real-score-book {
position: absolute;
left: 50%;
top: 0;
transform: translate(-50%, -50%);
width: 360rpx;
height: 220rpx;
}
.real-score-book-img {
width: 100%;
height: 100%;
}
\ No newline at end of file
......@@ -21,6 +21,7 @@
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
......@@ -29,15 +30,15 @@
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"minifyWXML": true
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false
},
"compileType": "miniprogram",
"libVersion": "2.18.0",
......
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