新增扫码报名和课程管理

main
hcj 4 months ago
parent 0d30235861
commit 84379210be
  1. 18
      pages.json
  2. 922
      pages/index/index.vue
  3. 3399
      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. 9
      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,447 +270,497 @@
</template>
<script>
import {
findLabelValueByPropnew
} from '@/utils/util.js'
import mixin from '@/utils/mixin/index.js'
export default {
mixins: [mixin],
data() {
return {
title: '首页',
keywares: '',
toollist: [], //
crowdlist: [], //
tokenshow: false,
}
},
onShow() {
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 == '源代码安全检测工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/5.png'
} else if (item.name == 'C/C++单元测试工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/2.png'
} else if (item.name == '接口测试工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/12.png'
} else if (item.name == 'JAVA单元测试工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/tool/1.png'
} else if (item.name == '功能测试工具AutoFun') {
item.imgs = 'http://image.bjkeyware.com/static/index/3.png'
} else if (item.name == '代码组成分析平台') {
item.imgs = 'http://image.bjkeyware.com/static/index/tool/4.png'
} else if (item.name == '性能测试工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/6.png'
} else if (item.name == '自鉴-交互式应用安全测试系统IAST') {
item.imgs = 'http://image.bjkeyware.com/static/index/tool/3.png'
} else if (item.name == 'Web应用安全测试工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/tool/2.png'
} else if (item.name == '资产识别及漏洞管理工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/zc.png'
} else if (item.name == '性能测试工具KeyTurbo') {
item.imgs = 'http://image.bjkeyware.com/static/index/xn.png'
}
item.typel = item.toolTypeName.slice(0, 2)
})
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.crowdlist = this.crowdlist.splice(0, 3)
})
},
filters: {
tiilnamechange(value) {
if (!value) return ''
if (value.length > 9) {
return value.slice(0, 7) + '...'
}
return value
}
},
methods: {
findLabelValueByPropnew,
test() {
uni.navigateTo({
url: '/pages/index/test',
// url: 'https://w102.ttkefu.com/k/linkurl/?t=6F5CCH6'
})
},
// onShareAppMessage(res) {
// if (res.from === 'button') {//
// console.log(res.target)
// }
// return {
// title: '',
// path: '/pages/test/test?id=123'
// }
// },
//
details(type, id) {
// console.log('id---',id)
if (type == 'tool') {
// uni.showToast({ title: '', icon: 'none', duration: 1000 });
uni.navigateTo({
url: `./toolleasing/tooldetails?id=${id}`
})
} else {
uni.navigateTo({
url: `./testcrowdsourc/crowdsourcingdetails?id=${id}`
})
}
},
//
serchfot() {
uni.navigateTo({
url: './searchfor'
})
},
cleardata() {
},
confirm() {
uni.navigateTo({
url: '/pages/personal/login'
})
},
//
addcart(id) {
uni.showToast({
title: '该功能开发中',
icon: 'none',
duration: 1000
});
return;
let accessToken = uni.getStorageSync('accessToken');
if (!accessToken) {
this.tokenshow = true
} else {
this.http.quickGet(`/my/addShoppingCart/${id}/1`, true).then(response => {
console.log('response', response)
if (response.data.code == 200) {
console.log('111')
this.$refs.uToast.show({
title: '添加购物车成功',
type: 'success',
duration: 1000,
isTab: true,
url: '/pages/shoppingtrolley/shoppingtrolley'
})
}
})
}
},
//
gametype(type) {
if (type == 'test') {
uni.navigateTo({
url: './testtraining/testtraining'
})
} else if (type == 'crowd') {
uni.switchTab({
url: '/pages/index/testcrowdsourc/testcrowdsourc'
})
} else if (type == 'tool') {
// uni.showToast({
// title: '线',
// icon: 'none',
// duration: 1000
// });
uni.navigateTo({
url:'./toolleasing/toolleasing'
})
} else {
// uni.showToast({ title: '线', icon: 'none', duration: 1000 });
const userinform = uni.getStorageSync('wxUserInfo');
if (userinform && userinform.companyStatus == 2) {
uni.navigateTo({
url: '/pages/index/outsourcing/outsourcing'
})
} else {
uni.navigateTo({
url: '/pages/index/outsourcing/cloudUserPage'
})
}
}
},
//
applytest(type) {
uni.navigateTo({
url: `./testtraining/testtraining?currenttab=${type}`
})
}
}
}
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: [], //
crowdlist: [], //
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) => {
if (item.name == '代码静态分析工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/11.png'
} else if (item.name == '源代码安全检测工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/5.png'
} else if (item.name == 'C/C++单元测试工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/2.png'
} else if (item.name == '接口测试工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/12.png'
} else if (item.name == 'JAVA单元测试工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/tool/1.png'
} else if (item.name == '功能测试工具AutoFun') {
item.imgs = 'http://image.bjkeyware.com/static/index/3.png'
} else if (item.name == '代码组成分析平台') {
item.imgs = 'http://image.bjkeyware.com/static/index/tool/4.png'
} else if (item.name == '性能测试工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/6.png'
} else if (item.name == '自鉴-交互式应用安全测试系统IAST') {
item.imgs = 'http://image.bjkeyware.com/static/index/tool/3.png'
} else if (item.name == 'Web应用安全测试工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/tool/2.png'
} else if (item.name == '资产识别及漏洞管理工具') {
item.imgs = 'http://image.bjkeyware.com/static/index/zc.png'
} else if (item.name == '性能测试工具KeyTurbo') {
item.imgs = 'http://image.bjkeyware.com/static/index/xn.png'
}
item.typel = item.toolTypeName.slice(0, 2)
})
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.crowdlist = this.crowdlist.splice(0, 3)
})
},
filters: {
tiilnamechange(value) {
if (!value) return ''
if (value.length > 9) {
return value.slice(0, 7) + '...'
}
return value
},
},
methods: {
findLabelValueByPropnew,
test() {
uni.navigateTo({
url: '/pages/index/test',
// url: 'https://w102.ttkefu.com/k/linkurl/?t=6F5CCH6'
})
},
// onShareAppMessage(res) {
// if (res.from === 'button') {//
// console.log(res.target)
// }
// return {
// title: '',
// path: '/pages/test/test?id=123'
// }
// },
//
details(type, id) {
// console.log('id---',id)
if (type == 'tool') {
// uni.showToast({ title: '', icon: 'none', duration: 1000 });
uni.navigateTo({
url: `./toolleasing/tooldetails?id=${id}`,
})
} else {
uni.navigateTo({
url: `./testcrowdsourc/crowdsourcingdetails?id=${id}`,
})
}
},
//
serchfot() {
uni.navigateTo({
url: './searchfor',
})
},
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',
})
},
//
addcart(id) {
uni.showToast({
title: '该功能开发中',
icon: 'none',
duration: 1000,
})
return
let accessToken = uni.getStorageSync('accessToken')
if (!accessToken) {
this.tokenshow = true
} else {
this.http.quickGet(`/my/addShoppingCart/${id}/1`, true).then((response) => {
console.log('response', response)
if (response.data.code == 200) {
console.log('111')
this.$refs.uToast.show({
title: '添加购物车成功',
type: 'success',
duration: 1000,
isTab: true,
url: '/pages/shoppingtrolley/shoppingtrolley',
})
}
})
}
},
//
gametype(type) {
if (type == 'test') {
uni.navigateTo({
url: './testtraining/testtraining',
})
} else if (type == 'crowd') {
uni.switchTab({
url: '/pages/index/testcrowdsourc/testcrowdsourc',
})
} else if (type == 'tool') {
// uni.showToast({
// title: '线',
// icon: 'none',
// duration: 1000
// });
uni.navigateTo({
url: './toolleasing/toolleasing',
})
} else {
// uni.showToast({ title: '线', icon: 'none', duration: 1000 });
const userinform = uni.getStorageSync('wxUserInfo')
if (userinform && userinform.companyStatus == 2) {
uni.navigateTo({
url: '/pages/index/outsourcing/outsourcing',
})
} else {
uni.navigateTo({
url: '/pages/index/outsourcing/cloudUserPage',
})
}
}
},
//
applytest(type) {
uni.navigateTo({
url: `./testtraining/testtraining?currenttab=${type}`,
})
},
},
}
</script>
<style>
page {
background-color: #F7F7F7;
}
.logobg {
width: 100vw;
height: 51vw;
background-size: 100% 55vw;
background-image: url('http://image.bjkeyware.com/static/index/hhome_page.png');
background-repeat: no-repeat;
padding: 20px 5vw 20px 5vw;
margin-top: -1px;
/* padding:30px 0vw 20px 5vw; */
/* z-index:0; */
}
.keyewar {
width: 72vw;
border-radius: 50rpx;
/* position: relative; */
/* margin:1vw 5vw 20px 0vw;
.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;
}
.myNav image {
position: absolute;
width: 50rpx;
height: 50rpx;
left: 34rpx;
margin-right: 10rpx;
}
.logobg {
width: 100vw;
height: 51vw;
background-size: 100% 55vw;
background-image: url('http://image.bjkeyware.com/static/index/hhome_page.png');
background-repeat: no-repeat;
padding: 20px 5vw 20px 5vw;
margin-top: -1px;
/* padding:30px 0vw 20px 5vw; */
/* z-index:0; */
}
.keyewar {
width: 72vw;
border-radius: 50rpx;
/* position: relative; */
/* margin:1vw 5vw 20px 0vw;
display: flex;
justify-content: space-between; */
/* padding: 10px; */
}
.buttonyz1 {
width: 139rpx;
height: 49rpx;
background: #a8aeb6;
border-radius: 25rpx;
color: #FFFFFF;
font-size: 24rpx;
text-align: center;
line-height: 49rpx;
}
.customActionStyle {
width: 115rpx;
height: 60rpx;
background: linear-gradient(90deg, #5EA6FD, #1A81F9);
border-radius: 39rpx;
text-align: center;
line-height: 55rpx;
color: #FFFFFF;
font-size: 14px;
z-index: 99;
}
/* @media screen and (max-width: 350px) {
/* padding: 10px; */
}
.buttonyz1 {
width: 139rpx;
height: 49rpx;
background: #a8aeb6;
border-radius: 25rpx;
color: #ffffff;
font-size: 24rpx;
text-align: center;
line-height: 49rpx;
}
.customActionStyle {
width: 115rpx;
height: 60rpx;
background: linear-gradient(90deg, #5ea6fd, #1a81f9);
border-radius: 39rpx;
text-align: center;
line-height: 55rpx;
color: #ffffff;
font-size: 14px;
z-index: 99;
}
/* @media screen and (max-width: 350px) {
body {
font-size: 14px;
color: blue;
}
} */
.contents {
padding-bottom: 50px
}
.fouassociation {
position: relative;
/* z-index: 2; */
/* width:90vw; */
margin: -12vw 3vw 0 3vw;
display: flex;
justify-content: space-around;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 29px 0px rgba(187, 86, 25, 0.17);
border-radius: 10px;
padding: 0 5px;
}
.association {
width: 20vw;
margin: 10px 0;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
.association img {
width: 13vw;
height: 13vw;
margin-bottom: 5px;
display: block;
}
.association text {
font-size: 14px;
display: block;
}
.schedule {
width: 94vw;
margin: 30px 3vw 20px 3vw;
}
.koeui {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.currekei {
width: 48%;
/* height: 360rpx; */
background: #FFFFFF;
border-radius: 10px;
padding: 10px 10px;
margin-bottom: 20rpx
}
.leop {
font-size: 30rpx;
/* height:40px ; */
font-weight: bold;
color: #1A1A1A;
/* margin: 13rpx 0; */
display: flex;
align-items: center;
justify-content: center;
}
.leop1 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
justify-content: flex-start;
}
.tabone {
padding: 2rpx 5rpx;
border: 1px solid #2B80FC;
border-radius: 4rpx;
font-size: 20rpx;
font-weight: 500;
color: #2387EE;
text-align: center;
box-sizing: border-box;
}
.currekei :nth-child(4) {
color: #FD461A;
font-weight: 800;
font-size: 34rpx;
}
.imgone {
width: 180rpx;
margin: 10px auto;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.imgone img {
width: 100%;
height: 100%;
}
.imgsone {
width: 150rpx;
margin: 20px auto;
}
.imgsone img {
width: 150rpx;
height: 123rpx;
}
.imgtwo {
width: 32rpx;
height: 32rpx;
}
.notice {
/* width: 90vw; */
/* height: 130px; */
margin-top: 10px;
background: #FFFFFF;
border-radius: 10px;
display: flex;
padding: 10px 15px;
align-items: center;
}
.typej {
font-size: 24rpx;
color: #9D9D9D;
margin: 13rpx 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.buttonyz {
width: 139rpx;
height: 49rpx;
background: linear-gradient(90deg, #5EA6FD, #1A81F9);
border-radius: 25rpx;
color: #FFFFFF;
font-size: 24rpx;
text-align: center;
line-height: 49rpx;
}
.fline {
width: 100%;
height: 1rpx;
border: 1rpx solid #F2F2F2;
opacity: 0.15;
}
.statictosol {
width: 48%;
height: 180px;
background: #FFFFFF;
border-radius: 10rpx;
text-align: center;
margin-top: 20px;
padding: 15px 10px;
}
.statictosol img {
width: 17vw;
height: 17vw;
margin-bottom: 10px;
}
.statictosol p {
font-size: .8rem;
color: #808080;
margin-bottom: 5px;
line-height: 21px
}
.tostnew {
position: absolute;
top: -12rpx;
right: -32rpx;
}
.tostnewimg {
width: 76rpx;
height: 32rpx;
}
.tostnewtext {
position: absolute;
top: 3rpx;
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
font-weight: 500;
font-size: 16rpx !important;
color: #FFFFFF;
}
.contents {
padding-bottom: 50px;
}
.fouassociation {
/* position: relative; */
/* z-index: 2; */
/* width:90vw; */
margin: -12vw 3vw 0 3vw;
display: flex;
justify-content: space-around;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 29px 0px rgba(187, 86, 25, 0.17);
border-radius: 10px;
padding: 0 5px;
}
.association {
width: 20vw;
margin: 10px 0;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
.association img {
width: 13vw;
height: 13vw;
margin-bottom: 5px;
display: block;
}
.association text {
font-size: 14px;
display: block;
}
.schedule {
width: 94vw;
margin: 30px 3vw 20px 3vw;
}
.koeui {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.currekei {
width: 48%;
/* height: 360rpx; */
background: #ffffff;
border-radius: 10px;
padding: 10px 10px;
margin-bottom: 20rpx;
}
.leop {
font-size: 30rpx;
/* height:40px ; */
font-weight: bold;
color: #1a1a1a;
/* margin: 13rpx 0; */
display: flex;
align-items: center;
justify-content: center;
}
.leop1 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
justify-content: flex-start;
}
.tabone {
padding: 2rpx 5rpx;
border: 1px solid #2b80fc;
border-radius: 4rpx;
font-size: 20rpx;
font-weight: 500;
color: #2387ee;
text-align: center;
box-sizing: border-box;
}
.currekei :nth-child(4) {
color: #fd461a;
font-weight: 800;
font-size: 34rpx;
}
.imgone {
width: 180rpx;
margin: 10px auto;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.imgone img {
width: 100%;
height: 100%;
}
.imgsone {
width: 150rpx;
margin: 20px auto;
}
.imgsone img {
width: 150rpx;
height: 123rpx;
}
.imgtwo {
width: 32rpx;
height: 32rpx;
}
.notice {
/* width: 90vw; */
/* height: 130px; */
margin-top: 10px;
background: #ffffff;
border-radius: 10px;
display: flex;
padding: 10px 15px;
align-items: center;
}
.typej {
font-size: 24rpx;
color: #9d9d9d;
margin: 13rpx 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.buttonyz {
width: 139rpx;
height: 49rpx;
background: linear-gradient(90deg, #5ea6fd, #1a81f9);
border-radius: 25rpx;
color: #ffffff;
font-size: 24rpx;
text-align: center;
line-height: 49rpx;
}
.fline {
width: 100%;
height: 1rpx;
border: 1rpx solid #f2f2f2;
opacity: 0.15;
}
.statictosol {
width: 48%;
height: 180px;
background: #ffffff;
border-radius: 10rpx;
text-align: center;
margin-top: 20px;
padding: 15px 10px;
}
.statictosol img {
width: 17vw;
height: 17vw;
margin-bottom: 10px;
}
.statictosol p {
font-size: 0.8rem;
color: #808080;
margin-bottom: 5px;
line-height: 21px;
}
.tostnew {
position: absolute;
top: -12rpx;
right: -32rpx;
}
.tostnewimg {
width: 76rpx;
height: 32rpx;
}
.tostnewtext {
position: absolute;
top: 3rpx;
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
font-weight: 500;
font-size: 16rpx !important;
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
})
@ -446,7 +441,7 @@
uni.navigateTo({
url: '/pages/personal/setup/myreview'
})
}
}
} else {
this.tokenshow = true

@ -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