Commit e9c98390 authored by zhengke's avatar zhengke

111

parent bb1da4f0
......@@ -188,4 +188,17 @@ export function getClassFeedBackList(data) {
method: 'post',
data
})
}
/**
* 扫码签到
* @param {JSON参数} data
*/
export function getSweepCode(data) {
return request({
url: "/class/AddClassCheck",
method: 'post',
data
})
}
\ No newline at end of file
......@@ -9,7 +9,18 @@
"style": {
"navigationStyle": "custom"
}
}, {
},{
"path": "pages/index/fail",
"style": {
"navigationStyle": "custom"
}
},{
"path": "pages/index/success",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/timetable/timeTable", //课表
"style": {
"navigationStyle": "custom"
......@@ -49,7 +60,8 @@
"path": "pages/activity/MyExam"
},{
"path": "pages/study/questionNaire"
}],
}
],
"subPackages": [{
"root": "pages/course", //课程分包
"pages": [{
......
......@@ -9,7 +9,7 @@
首页
</view>
<view class="loginBox">
<view class="" v-if="userData && userData.AccountName && userData.AccountId>0">
<view v-if="userData && userData.AccountName && userData.AccountId>0">
{{userData.AccountName}}
</view>
<indexassembly @success='againdata' v-else>
......@@ -21,14 +21,16 @@
</view>
</indexassembly>
</view>
<!-- 扫码登陆 -->
<view class="scanBox" @click="scan">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/scan2x.png"
mode="aspectFit" class="scanIcon"></image>
mode="aspectFit" class="scanIcon">
</image>
</view>
</view>
</navbar>
<view class="activeContent" v-if="ActivityList.length > 0">
<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" indicator-color="#CCCCCC"
indicator-active-color="#000000" :vertical="true" circular>
......@@ -159,6 +161,10 @@
import {
getActivityList
} from "../../api/activity";
import {
getSweepCode
} from '../../api/index.js'
import {
getImageColor
} from '../../utils/index.js'
......@@ -166,6 +172,11 @@
import navbar from '../../components/navbar.vue'
import bottom from '../../components/bottom.vue'
export default {
// data(){
// return{
// }
// }
components: {
indexassembly,
navbar,
......@@ -190,8 +201,8 @@
});
let methods = {
goTongji(){
this.jumpPage('/pages/study/questionNaire?ActivitySurveyId=6');
goTongji() {
this.jumpPage('/pages/study/questionNaire?ActivitySurveyId=6');
},
jumpPage(url) {
uni.navigateTo({
......@@ -207,14 +218,89 @@
goActiveDetail(Id) {
this.jumpPage(`/pages/activity/activityDetails?Id=${Id}`);
},
base64_decode(data) {
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var o1,
o2,
o3,
h1,
h2,
h3,
h4,
bits,
i = 0,
ac = 0,
dec = "",
tmp_arr = [];
if (!data) {
return data;
}
data += "";
do {
h1 = b64.indexOf(data.charAt(i++));
h2 = b64.indexOf(data.charAt(i++));
h3 = b64.indexOf(data.charAt(i++));
h4 = b64.indexOf(data.charAt(i++));
bits = (h1 << 18) | (h2 << 12) | (h3 << 6) | h4;
o1 = (bits >> 16) & 0xff;
o2 = (bits >> 8) & 0xff;
o3 = bits & 0xff;
if (h3 == 64) {
tmp_arr[ac++] = String.fromCharCode(o1);
} else if (h4 == 64) {
tmp_arr[ac++] = String.fromCharCode(o1, o2);
} else {
tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
}
} while (i < data.length);
dec = tmp_arr.join("");
//dec = utf8_decode(dec);
return dec;
},
//{"cmd":"checkin","params":{"classId":0,"ClassDate":"2022-4-19","ClassRoomId":27,
//"School_Id":0,"TeacherId":8,"CheckStatus":0,"StudyNum":"90","ClassTimeId":16531}}
scan() {
// 调起条码扫描
//调起条码扫描
console.log("进来了")
let that = this
uni.scanCode({
scanType: ['qrCode'],
success: function(res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
}
// 解码
var saveObj={};
try {
saveObj = that.base64_decode(res.result)
// console.log(saveObj)
} catch (e) {
//TODO handle the exception
// console.log(e)
}
var jsonObj= JSON.parse(saveObj)
if(jsonObj.cmd =="checkin"){
var userData = uni.getStorageSync('userInfo');
console.log("userData",userData);
jsonObj.params.StuId=userData.AccountId;
var array=[];
array.push(jsonObj.params);
console.log("jsonObj.params",jsonObj.params)
let result = getSweepCode(array);
if (result) {
// console.log(result)
if (result.Code == 1) {
console.log('扫码成功')
uni.navigateTo({
url:'./success',
})
}else{
console.log('扫码失败')
uni.navigateTo({
url: './fail'
})
}
}
}
},
});
},
async getActivityData() {
......@@ -278,13 +364,13 @@
}
},
jumpJiahemini() {
let userinfo=uni.getStorageSync('userInfo');
let userinfo = uni.getStorageSync('userInfo');
wx.navigateToMiniProgram({
appId: 'wx38e054ee42b054f4',
path: '',//为空则打开首页
extraData: {
Id:userinfo.Id||0
}
appId: 'wx38e054ee42b054f4',
path: '', //为空则打开首页
extraData: {
Id: userinfo.Id || 0
}
})
}
......@@ -326,18 +412,21 @@
background-color: #F5F5F5;
box-sizing: border-box;
}
.wenjuan_dc{
.wenjuan_dc {
position: fixed;
width:83rpx;
height:83rpx;
right:30rpx;
bottom:200rpx;
z-index:999;
width: 83rpx;
height: 83rpx;
right: 30rpx;
bottom: 200rpx;
z-index: 999;
}
.wenjuan_dc img{
width:100%;
height:100%;
.wenjuan_dc img {
width: 100%;
height: 100%;
}
.navbarSticky {
display: sticky;
top: 0;
......
......@@ -73,10 +73,6 @@
changeSwiper(val) {
data.curTest = val.detail.current;
const total = data.reviewGroupList.length + data.prepGroupList.length
if (data.curTest == total) {
methods.submitWordsTest()
uni.removeStorageSync("testData", obj);
}
let obj = {
CourseId:data.msg.CourseId,
ChapterId:data.msg.ChapterId,
......@@ -84,6 +80,10 @@
index:data.curTest
}
uni.setStorageSync("testData", obj);
if (data.curTest == total) {
uni.removeStorageSync("testData");
methods.submitWordsTest()
}
},
next(val, item) {
if (val) {
......
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