新增扫码报名和课程管理

main
hcj 4 months ago
parent 0d30235861
commit 84379210be
  1. 18
      pages.json
  2. 168
      pages/index/index.vue
  3. 451
      pages/index/testtraining/testtraining.vue
  4. 151
      pages/personal/courseSign/courseSign.vue
  5. BIN
      pages/personal/courseSign/error.1png
  6. BIN
      pages/personal/courseSign/error.png
  7. BIN
      pages/personal/courseSign/signSuc.1png
  8. BIN
      pages/personal/courseSign/signSuc.png
  9. 115
      pages/personal/myCourse/myCourse.vue
  10. 7
      pages/personal/personal.vue
  11. 4
      pages/personal/personalresume/personalresume.vue
  12. 12
      pages/personal/setup/peixunban.vue
  13. 16
      utils/encodeChinese.js
  14. 2
      utils/http.js

@ -6,7 +6,7 @@
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"navigationBarBackgroundColor": "#284CD1"
"navigationStyle": "custom"
}
}, {
"path": "pages/personal/mytestkit/mytestkit",
@ -380,6 +380,22 @@
"navigationBarTitleText": "我的主页",
"navigationBarBackgroundColor": "#284CD1"
}
},
{
"path" : "pages/personal/myCourse/myCourse",
"style" :
{
"navigationBarTitleText" : "",
"navigationBarBackgroundColor": "#284CD1"
}
},
{
"path" : "pages/personal/courseSign/courseSign",
"style" :
{
"navigationBarTitleText" : "",
"navigationBarBackgroundColor": "#284CD1"
}
}

@ -1,5 +1,11 @@
<template>
<view>
<view class="infoNav" :style="{height:infoHeight+ 4 + 'px'}" ></view>
<view class="myNav" :style="{height:navHeight + 'px',top:infoHeight+ 3 + 'px'}">
<view>首页</view>
<image @click="scan" src="http://image.bjkeyware.com/static/index/renliwb/scan.png" class="cycontentitimg" mode=""></image>
</view>
<view :style="{height:infoHeight+navHeight+7+'px'}"></view>
<!-- <button type="primary" open-type="contact">在线咨询</button> -->
<!-- <button type="primary" @click="test">在线咨询</button> -->
<!-- class="contents" :actionStyle="customActionStyle"actionText="搜索" @custom='serchfot'-->
@ -264,14 +270,14 @@
</template>
<script>
import {
findLabelValueByPropnew
} from '@/utils/util.js'
import { findLabelValueByPropnew } from '@/utils/util.js'
import mixin from '@/utils/mixin/index.js'
export default {
mixins: [mixin],
data() {
return {
navHeight: 0,
infoHeight: 0,
title: '首页',
keywares: '',
toollist: [], //
@ -279,10 +285,22 @@
tokenshow: false,
}
},
created() {
this.infoHeight = uni.getSystemInfoSync().statusBarHeight
// #ifdef MP-WEIXIN
// width,height,top,right,left,bottom
const custom = wx.getMenuButtonBoundingClientRect()
const { height, top } = custom
console.log(custom)
// #endif
this.navHeight = height + (top - this.infoHeight) * 2
// console.log(custom.height);
},
onShow() {
this.http.quickGet('/business/tool/listAnon?status=1').then(res => {
let tooldata = res.data.rows;
tooldata.forEach(item => {
this.http.quickGet('/business/tool/listAnon?status=1').then((res) => {
let tooldata = res.data.rows
tooldata.forEach((item) => {
if (item.name == '代码静态分析工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/11.png'
} else if (item.name == '源代码安全检测工具') {
@ -312,8 +330,8 @@
})
this.toollist = res.data.rows.splice(0, 6)
}),
this.http.quickGet('/crowdsource/listAnon?pageNum=1&pageSize=10').then(res => {
this.crowdlist = res.data.rows;
this.http.quickGet('/crowdsource/listAnon?pageNum=1&pageSize=10').then((res) => {
this.crowdlist = res.data.rows
this.crowdlist = this.crowdlist.splice(0, 3)
})
},
@ -324,7 +342,7 @@
return value.slice(0, 7) + '...'
}
return value
}
},
},
methods: {
findLabelValueByPropnew,
@ -332,7 +350,6 @@
uni.navigateTo({
url: '/pages/index/test',
// url: 'https://w102.ttkefu.com/k/linkurl/?t=6F5CCH6'
})
},
// onShareAppMessage(res) {
@ -350,26 +367,43 @@
if (type == 'tool') {
// uni.showToast({ title: '', icon: 'none', duration: 1000 });
uni.navigateTo({
url: `./toolleasing/tooldetails?id=${id}`
url: `./toolleasing/tooldetails?id=${id}`,
})
} else {
uni.navigateTo({
url: `./testcrowdsourc/crowdsourcingdetails?id=${id}`
url: `./testcrowdsourc/crowdsourcingdetails?id=${id}`,
})
}
},
//
serchfot() {
uni.navigateTo({
url: './searchfor'
url: './searchfor',
})
},
cleardata() {
cleardata() {},
//
scan() {
console.log('二维码扫描')
// uni.navigateTo({
// url:`/pages/personal/courseSign/courseSign`
// })
uni.scanCode({
onlyFromCamera: true,
success: function (res) {
if (res.result) {
uni.navigateTo({
url: `/pages/personal/courseSign/courseSign?objStr=${res.result}`,
})
} else {
uni.showToast({ title: '无法识别二维码', icon: 'none', duration: 1000 })
}
},
})
},
confirm() {
uni.navigateTo({
url: '/pages/personal/login'
url: '/pages/personal/login',
})
},
//
@ -377,14 +411,14 @@
uni.showToast({
title: '该功能开发中',
icon: 'none',
duration: 1000
});
return;
let accessToken = uni.getStorageSync('accessToken');
duration: 1000,
})
return
let accessToken = uni.getStorageSync('accessToken')
if (!accessToken) {
this.tokenshow = true
} else {
this.http.quickGet(`/my/addShoppingCart/${id}/1`, true).then(response => {
this.http.quickGet(`/my/addShoppingCart/${id}/1`, true).then((response) => {
console.log('response', response)
if (response.data.code == 200) {
console.log('111')
@ -393,22 +427,21 @@
type: 'success',
duration: 1000,
isTab: true,
url: '/pages/shoppingtrolley/shoppingtrolley'
url: '/pages/shoppingtrolley/shoppingtrolley',
})
}
})
}
},
//
gametype(type) {
if (type == 'test') {
uni.navigateTo({
url: './testtraining/testtraining'
url: './testtraining/testtraining',
})
} else if (type == 'crowd') {
uni.switchTab({
url: '/pages/index/testcrowdsourc/testcrowdsourc'
url: '/pages/index/testcrowdsourc/testcrowdsourc',
})
} else if (type == 'tool') {
// uni.showToast({
@ -417,36 +450,61 @@
// duration: 1000
// });
uni.navigateTo({
url:'./toolleasing/toolleasing'
url: './toolleasing/toolleasing',
})
} else {
// uni.showToast({ title: '线', icon: 'none', duration: 1000 });
const userinform = uni.getStorageSync('wxUserInfo');
const userinform = uni.getStorageSync('wxUserInfo')
if (userinform && userinform.companyStatus == 2) {
uni.navigateTo({
url: '/pages/index/outsourcing/outsourcing'
url: '/pages/index/outsourcing/outsourcing',
})
} else {
uni.navigateTo({
url: '/pages/index/outsourcing/cloudUserPage'
url: '/pages/index/outsourcing/cloudUserPage',
})
}
}
},
//
applytest(type) {
uni.navigateTo({
url: `./testtraining/testtraining?currenttab=${type}`
url: `./testtraining/testtraining?currenttab=${type}`,
})
}
}
},
},
}
</script>
<style>
.infoNav {
position: fixed;
width: 100%;
background-color: #284cd1;
z-index: 99;
}
.myNav {
position: fixed;
width: 100%;
text-align: center;
color: #ffffff;
font-family: PingFang-SC-Bold;
display: flex;
align-items: center;
justify-content: center;
background-color: #284cd1;
z-index: 99;
/* position: relative; */
}
page {
background-color: #F7F7F7;
background-color: #f7f7f7;
}
.myNav image {
position: absolute;
width: 50rpx;
height: 50rpx;
left: 34rpx;
margin-right: 10rpx;
}
.logobg {
@ -476,7 +534,7 @@
height: 49rpx;
background: #a8aeb6;
border-radius: 25rpx;
color: #FFFFFF;
color: #ffffff;
font-size: 24rpx;
text-align: center;
line-height: 49rpx;
@ -484,11 +542,11 @@
.customActionStyle {
width: 115rpx;
height: 60rpx;
background: linear-gradient(90deg, #5EA6FD, #1A81F9);
background: linear-gradient(90deg, #5ea6fd, #1a81f9);
border-radius: 39rpx;
text-align: center;
line-height: 55rpx;
color: #FFFFFF;
color: #ffffff;
font-size: 14px;
z-index: 99;
}
@ -500,11 +558,11 @@
}
} */
.contents {
padding-bottom: 50px
padding-bottom: 50px;
}
.fouassociation {
position: relative;
/* position: relative; */
/* z-index: 2; */
/* width:90vw; */
margin: -12vw 3vw 0 3vw;
@ -546,23 +604,22 @@
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.currekei {
width: 48%;
/* height: 360rpx; */
background: #FFFFFF;
background: #ffffff;
border-radius: 10px;
padding: 10px 10px;
margin-bottom: 20rpx
margin-bottom: 20rpx;
}
.leop {
font-size: 30rpx;
/* height:40px ; */
font-weight: bold;
color: #1A1A1A;
color: #1a1a1a;
/* margin: 13rpx 0; */
display: flex;
align-items: center;
@ -580,17 +637,17 @@
.tabone {
padding: 2rpx 5rpx;
border: 1px solid #2B80FC;
border: 1px solid #2b80fc;
border-radius: 4rpx;
font-size: 20rpx;
font-weight: 500;
color: #2387EE;
color: #2387ee;
text-align: center;
box-sizing: border-box;
}
.currekei :nth-child(4) {
color: #FD461A;
color: #fd461a;
font-weight: 800;
font-size: 34rpx;
}
@ -628,7 +685,7 @@
/* width: 90vw; */
/* height: 130px; */
margin-top: 10px;
background: #FFFFFF;
background: #ffffff;
border-radius: 10px;
display: flex;
padding: 10px 15px;
@ -637,7 +694,7 @@
.typej {
font-size: 24rpx;
color: #9D9D9D;
color: #9d9d9d;
margin: 13rpx 0;
overflow: hidden;
text-overflow: ellipsis;
@ -647,9 +704,9 @@
.buttonyz {
width: 139rpx;
height: 49rpx;
background: linear-gradient(90deg, #5EA6FD, #1A81F9);
background: linear-gradient(90deg, #5ea6fd, #1a81f9);
border-radius: 25rpx;
color: #FFFFFF;
color: #ffffff;
font-size: 24rpx;
text-align: center;
line-height: 49rpx;
@ -658,14 +715,14 @@
.fline {
width: 100%;
height: 1rpx;
border: 1rpx solid #F2F2F2;
border: 1rpx solid #f2f2f2;
opacity: 0.15;
}
.statictosol {
width: 48%;
height: 180px;
background: #FFFFFF;
background: #ffffff;
border-radius: 10rpx;
text-align: center;
margin-top: 20px;
@ -679,17 +736,16 @@
}
.statictosol p {
font-size: .8rem;
font-size: 0.8rem;
color: #808080;
margin-bottom: 5px;
line-height: 21px
line-height: 21px;
}
.tostnew {
position: absolute;
top: -12rpx;
right: -32rpx;
}
.tostnewimg {
@ -705,6 +761,6 @@
white-space: nowrap;
font-weight: 500;
font-size: 16rpx !important;
color: #FFFFFF;
color: #ffffff;
}
</style>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,151 @@
<template>
<view class="sourseSignIn">
<view class="scanSuc" v-if="scanResult">
<view class="className">
{{ className }}
</view>
<view class="courseName">
{{ courseName }}
</view>
<view class="signBtn" @click="signIn" v-if="!isSignin">
<view>签到</view>
<view>{{ nowTime }}</view>
</view>
<view class="signBtn" v-else>
<img src="./signSuc.png" alt="" />
<view>已签到</view>
</view>
</view>
<view class="scanFail" v-else>
<img src="./error.png" alt="" />
<view>无法识别二维码</view>
</view>
</view>
</template>
<script>
import { decodeChinse } from '@/utils/encodeChinese.js'
export default {
data() {
return {
courseId: '',
className: '',
courseName: '',
scanResult: true,
isSignin: false,
}
},
onLoad(options) {
try {
const obj = JSON.parse(JSON.parse(options.objStr))
console.log(obj)
this.courseId = obj.courseId
console.log(this.courseId)
this.className = decodeChinse(obj.className)
this.courseName = decodeChinse(obj.courseName)
uni.setNavigationBarTitle({ title: this.courseName })
this.init()
} catch (e) {
this.scanResult = false
}
},
computed: {
nowTime() {
const currentDate = new Date()
let hours = currentDate.getHours()
if (hours < 10) hours = '0' + hours
let minutes = currentDate.getMinutes()
if (minutes < 10) minutes = '0' + minutes
let second = currentDate.getSeconds()
if (second < 10) second = '0' + second
const formattedDate = `${hours}:${minutes}:${second}`
return formattedDate
},
},
methods: {
signIn() {
const data = {
courseId: this.courseId,
}
console.log(data)
this.http.quickPost(`/course/singin`, data, true).then((response) => {
console.log(response)
if (response.data.code == 500) {
uni.showToast({ title: response.data.msg, icon: 'none', duration: 1000 })
} else if (response.data.code == 200) {
this.isSignin = true
}
})
},
init() {
this.http.quickGet(`/course/singin/${this.courseId}`,true).then((response) => {
console.log(response);
if(response.data.msg == '已签到'){
this.isSignin = true
}
})
},
},
}
</script>
<style lang="scss">
.sourseSignIn {
height: 100%;
overflow: hidden;
background: linear-gradient(0deg, #d1e9fe, #ffffff);
.scanSuc {
font-family: PingFang SC;
.className {
font-weight: bold;
font-size: 30rpx;
color: #000000;
line-height: 46rpx;
margin: 30rpx;
}
.courseName {
font-weight: 500;
font-size: 30rpx;
color: #4d4d4d;
line-height: 46rpx;
margin-left: 30rpx;
}
.signBtn {
margin: 0 auto;
margin-top: 300rpx;
background-color: #4899f7;
color: #fff;
border-radius: 50%;
width: 250rpx;
height: 250rpx;
text-align: center;
display: flex;
// font-weight: bold;
flex-direction: column;
align-items: center;
justify-content: center;
img {
width: 50rpx;
height: 50rpx;
margin-bottom: 5rpx;
}
}
}
.scanFail {
margin: 0 auto;
margin-top: 500rpx;
height: 200rpx;
text-align: center;
font-weight: bold;
font-size: 30rpx;
img {
width: 50rpx;
height: 50rpx;
margin-bottom: 5rpx;
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1,115 @@
<template>
<view class="courseWrapper">
<view v-if="courseList.length">
<view class="courseItem" v-for="course in courseList" :key="course.courseId">
<view class="courseName">{{ course.courseName }}</view>
<view class="courseTime">{{ course.courseTime }}</view>
<view class="courseSource" @click="courseDialog">课程资料</view>
<view class="signInfo" :style="{ background: course.status ? '#28D17C' : '#FBA02A' }">{{
course.status ? '已签到' : '未签到'
}}</view>
</view>
</view>
<view class="mycourseWrapper" v-else> 暂未配置课程 </view>
</view>
</template>
<script>
export default {
data() {
return {
courseList: [],
}
},
onLoad(options) {
console.log('进入course')
const classId = options.id
const className = options.name
console.log(options)
uni.setNavigationBarTitle({ title: className })
this.getCourseList(classId)
},
methods: {
async getCourseList(classId) {
this.http.quickGet(`/course/myCourse/class/${classId}`, true).then((res) => {
console.log(res)
this.courseList = res.data.rows
})
},
courseDialog() {
const url = 'https://www.bjkeyware.com'
uni.showModal({
title: '请去PC端下载资料',
content: 'PC端网址:'+url,
showCancel: false,
confirmText: '复制网址',
success: function (res) {
if (res.confirm) {
uni.setClipboardData({
data: url,
success: function () {
uni.showToast({
title: '复制成功',
})
},
fail: function () {
uni.showToast({
title: '复制失败',
})
},
})
console.log('用户点击确定')
}
},
})
},
},
}
</script>
<style scoped>
.courseWrapper {
}
.mycourseWrapper {
text-align: center;
line-height: 300rpx;
}
.courseItem {
position: relative;
margin: 25rpx;
width: 700rpx;
height: 210rpx;
margin-bottom: 0;
padding: 30rpx;
background: #ffffff;
border-radius: 10rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
line-height: 50rpx;
}
.courseName {
/* width: 369rpx; */
/* height: 29rpx; */
font-weight: bold;
font-size: 30rpx;
color: #000000;
}
.courseTime {
color: #4d4d4d;
}
.courseSource {
color: #2853e4;
}
.signInfo {
width: 110rpx;
/* height: 40rpx; */
line-height: 40rpx;
border-radius: 20rpx;
text-align: center;
color: #fff;
position: absolute;
top: 85rpx;
right: 25rpx;
}
</style>

@ -78,7 +78,6 @@
</view>
</view>
</block>
<!-- <u-tag :text="testerStatustext" plan type="info" shape='circle' color='#FEFEFE'
bg-color='#1A81F9' border-color='transparent' @click="nextcert" /> -->
</view>
@ -188,12 +187,7 @@
</view>
</view>
</view>
</view>
<view style="height:15px"> </view>
<u-toast ref="uToast" />
<u-modal title='温馨提示' v-model="tokenshow" content="您还没有登录" confirm-text='现在就去' cancel-text='稍等一下'
@ -285,6 +279,7 @@
//
async getNum() {
this.http.quickGet(`/train/myTrainingList`, true).then(res => {
// console.log(res);
this.signuplistLength = res.data.rows.length
})

@ -159,10 +159,6 @@
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>

@ -11,7 +11,9 @@
<p v-if="item.registrationTime" style="font-size:24rpx;color: #808080;">报名时间{{ dateFormat(new Date(item.registrationTime))}} </p>
</view>
<view class="fline"></view>
<view style="display: flex;justify-content: space-between;margin: 19px 15px 0 15px;align-items: center;">
<view
@click="catCourse(item)"
style="display: flex;justify-content: space-between;margin: 19px 15px 0 15px;align-items: center;">
<view style="color:#333333FF;font-size:13px;line-height:27px;">
<p>班级名称{{item.trainClassName}}</p>
<!-- start_time -->
@ -68,6 +70,14 @@
url:`/pages/index/testtraining/signup?issueId=${id}&type=1`
})
},
catCourse(state){
console.log(state);
// if(state.status == '4'){
uni.navigateTo({
url:`/pages/personal/myCourse/myCourse?id=${state.trainClassId}&name=${state.trainClassName}`
})
// }
}
}
}
</script>

@ -0,0 +1,16 @@
function encodeChinese(str){
if(!str){
return ''
}
return encodeURIComponent(str)
}
function decodeChinse(str){
if(str){
return decodeURIComponent(str)
}
}
export {
encodeChinese,decodeChinse
}

@ -1,7 +1,7 @@
import comstemutil from "./comstemutil";
//es6
// const baseUrl = 'http://192.168.0.229:9999';
// const baseUrl = 'http://192.168.0.230:9999';
const baseUrl = 'https://www.bjkeyware.com/test-api';
// const baseUrl = 'https://www.bjkeyware.com/prod-api';

Loading…
Cancel
Save