Commit 1b6d2ec5 authored by 罗超's avatar 罗超

2

parent 61126524
<template>
<view class="navbar" :style="{'padding-top':`${statusBarHeight}px`}">
<view class="navbar" :style="{'padding-top':`${statusBarHeight}px`,'background-color':bg}" :class="{'sticky':isSticky}">
<slot></slot>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
export default {
setup() {
let data = reactive({
statusBarHeight:24
});
const os = uni.getSystemInfoSync();
data.statusBarHeight=os.statusBarHeight
return {
...toRefs(data),
};
},
};
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
export default {
props: {
isSticky: {
type: Boolean,
default: true
},
bg:{
type: String,
default: "#ffffff"
}
},
setup() {
let data = reactive({
statusBarHeight: 24
});
const os = uni.getSystemInfoSync();
data.statusBarHeight = os.statusBarHeight
return {
...toRefs(data),
};
},
};
</script>
<style scoped>
.navbar{
.navbar {
height: 100rpx;
}
.sticky {
position: sticky;
top: 0;
z-index: 999;
}
</style>
......@@ -150,16 +150,13 @@
setTimeout(() => {
emit('next',1)
}, 500)
}
},
todo() {
emit('next',0)
emit('next')
}
}
onMounted(() => {
// console.log(136, props.item)
})
let that = methods;
return {
......
......@@ -136,15 +136,13 @@
})
return
}
//去掉接口
if(data.test==props.item.Answer||props.item.Answer.indexOf(data.test)>-1){
data.type=1
setTimeout(()=>{
emit('next')
emit('next',1)
},500)
}else{
data.type=2
console.log(data.isShowExplain)
setTimeout(()=>{
data.isShowExplain=true
},500)
......
......@@ -127,7 +127,6 @@
"selectedColor": "#929292",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"iconWidth": "30rpx",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "static/image/index.png",
......
<template>
<view class="indexpage">
<van-sticky>
<navbar class="navbarSticky">
<view class="navbarCon">
<view class="pagetitle" @click="jumpPage('/pages/login/login')">
首页
<navbar class="navbarSticky" bg="#F5F5F5">
<view class="navbarCon">
<view class="pagetitle" @click="jumpPage('/pages/login/login')">
首页
</view>
<view class="loginBox">
<view class="" v-if="userData && userData.AccountName && userData.AccountId>0">
{{userData.AccountName}}
</view>
<view class="loginBox">
<view class="" v-if="userData && userData.AccountName && userData.AccountId>0">
{{userData.AccountName}}
<indexassembly @success='againdata' v-else>
<view class="flex_start_center">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/login2x.png"
mode="aspectFit" class="loginIcon" id="loadImg"></image>
登录
</view>
<indexassembly @success='againdata' v-else>
<view class="flex_start_center">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/login2x.png"
mode="aspectFit" class="loginIcon" id="loadImg"></image>
登录
</view>
</indexassembly>
</view>
</indexassembly>
</view>
<view class="scanBox">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/scan2x.png"
mode="aspectFit" class="scanIcon"></image>
<view class="scanText">
签到
</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>
<view class="scanText">
签到
</view>
</view>
</navbar>
</van-sticky>
</view>
</navbar>
<view class="activeContent" v-if="ActivityList.length >= 0">
<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" indicator-color="#CCCCCC"
......@@ -120,7 +117,8 @@
<view class="gardenCon" v-for="(item1,index1) in item.List" :key="index1" id="img">
<image :src="item1.Img" mode="aspectFill" :id="'img'+index1"
style="width: 100%;height:100%;border-radius: 24rpx 24rpx 0 0;"></image>
<view class="gardenTextBox" :style="{'background':`linear-gradient(to bottom,${item1.bgcolor},${item1.bgcolor1} , ${item1.bgcolor2})` }">
<view class="gardenTextBox"
:style="{'background':`linear-gradient(to bottom,${item1.bgcolor},${item1.bgcolor1} , ${item1.bgcolor2})` }">
<view class="gardenTitle one_line">
{{item1.Title}}
</view>
......@@ -187,6 +185,16 @@
url: url,
});
},
scan() {
// 调起条码扫描
uni.scanCode({
scanType: ['qrCode'],
success: function(res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
}
});
},
async getActivityData() {
let res = await getActivityList(data.ActiveMsg);
if (res.resultCode == 1) {
......@@ -197,15 +205,18 @@
proxy.$request("/AppletIndex/GetIndexInfo_V2", {}).then(res => {
data.pageData = res.Data
uni.setStorageSync("indexData", res.Data);
if(data.pageData.LearningGardenList.length>0){
data.pageData.LearningGardenList.forEach((x,y)=>{
if(x.List.length>0){
x.List.forEach((item,index)=>{
this.getColor(item.Img,index,y).then(v=>{
data.pageData.LearningGardenList[v.y].List[v.index].bgcolor = v.formatres;
data.pageData.LearningGardenList[v.y].List[v.index].bgcolor1 = v.formatres1;
data.pageData.LearningGardenList[v.y].List[v.index].bgcolor2 = v.formatres2;
if (data.pageData.LearningGardenList.length > 0) {
data.pageData.LearningGardenList.forEach((x, y) => {
if (x.List.length > 0) {
x.List.forEach((item, index) => {
this.getColor(item.Img, index, y).then(v => {
data.pageData.LearningGardenList[v.y].List[
v.index].bgcolor = v.formatres;
data.pageData.LearningGardenList[v.y].List[
v.index].bgcolor1 = v.formatres1;
data.pageData.LearningGardenList[v.y].List[
v.index].bgcolor2 = v.formatres2;
})
})
}
......@@ -213,10 +224,10 @@
}
})
},
async getColor(src,index,y) {
let res = await getImageColor('myCanvas', 'img'+index, src)
console.log(index,res)
let obj={}
async getColor(src, index, y) {
let res = await getImageColor('myCanvas', 'img' + index, src)
console.log(index, res)
let obj = {}
obj.formatres = `rgba(${res.r},${res.g},${res.b},0.01)`
obj.formatres1 = `rgba(${res.r},${res.g},${res.b},0.6)`
obj.formatres2 = `rgba(${res.r},${res.g},${res.b},1)`
......@@ -229,12 +240,12 @@
methods.getIndexData();
methods.getActivityData();
},
jumpGarden(id){
if(id==1){
jumpGarden(id) {
if (id == 1) {
uni.navigateTo({
url:"/pages/learningGarden/learningGardenList"
url: "/pages/learningGarden/learningGardenList"
})
}else if(id==2){
} else if (id == 2) {
// uni.navigateTo({
// url:"/pages/learningGarden/learningGardenList"
// })
......@@ -290,6 +301,7 @@
padding: 0 30rpx;
display: flex;
align-items: center;
background-color: #F5F5F5;
}
.pagetitle {
......
......@@ -175,8 +175,8 @@
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/piao4.png" alt="" />
<view class="study_Jiyi">记忆时长</view>
<view class="study_GoCeshi" @click="goTest(url)">马上去测试</view>
<view class="study_GoLearn">再学习一次</view>
<!-- <view class="study_GoCeshi" @click="goTest(url)">马上去测试</view>
<view class="study_GoLearn">再学习一次</view> -->
<view class="studyBack" @click="goIndex">返回首页</view>
</view>
</view>
......@@ -230,8 +230,10 @@
};
},
onLoad(options) {
console.log(226, options)
this.url=`/pages/word/test?CourseId=${options.CourseId}&&ChapterId=${options.ChapterId} &&NextChapterId=${options.NextChapterId}`
// const obj=JSON.parse()
console.log(226, decodeURIComponent(options.data))
// this.url=`/pages/word/test?CourseId=${options.CourseId}&&ChapterId=${options.ChapterId} &&NextChapterId=${options.NextChapterId}`
}
}
</script>
......@@ -43,6 +43,7 @@
<script>
import { ref, reactive, toRefs, getCurrentInstance, onMounted } from "vue";
import {getCurrentTime} from '../../utils/date.js'
import Choice from "../../components/word/choiceQuestion.vue";
import FillIn from "../../components/word/fillInTheBlanks.vue";
export default {
......@@ -58,7 +59,8 @@ export default {
ChapterId: 0,
NextChapterId: 0,
},
curTest: 0,
startTime:"",
curTest: 33,
reviewGroupList: [],
prepGroupList: [],
});
......@@ -73,6 +75,14 @@ export default {
},
changeSwiper(val) {
data.curTest = val.detail.current;
const total=data.reviewGroupList.length+data.prepGroupList.length
console.log(data.curTest,total)
if(data.curTest== total){
// methods.submitWordsTest()
data.curTest=total-1
}
console.log(2,data.curTest,total)
},
next(val, item) {
if (val) {
......@@ -82,19 +92,29 @@ export default {
},
//提交单词测试
submitWordsTest() {
var postMsg = {
ClassId: 1,
CourseId: 1,
ChapterId: 1,
ExamStartTime: "2021-01-12 10:00:00",
const indexData = uni.getStorageSync("indexData");
let postMsg = {
ClassId: indexData.ClassId,
CourseId: data.msg.CourseId,
ChapterId: data.msg.ChapterId,
ExamStartTime: data.startTime,
Details: data.reviewGroupList,
};
proxy.$request("/AppletWords/SubmitWordsExam", postMsg).then((res) => {
console.log("SubmitWordsExam", res);
const obj={
score:res.Data.Score,
time:2
}
uni.navigateTo({
url:"/pages/word/studyComplete?data="+encodeURIComponent(JSON.stringify(obj))
})
});
},
};
onMounted(() => {});
onMounted(() => {
data.startTime=getCurrentTime()
});
let that = methods;
return {
...toRefs(data),
......
......@@ -10,7 +10,8 @@ export let getWeek = (year, month) => {
let weekStr = ""
let isToday = 0
let today = new Date(getToday()).getTime()
let today2 = new Date(year + '-' + (month < 10 ? '0' + month : month) + '-' + (i < 10 ? '0' + i : i)).getTime()
let today2 = new Date(year + '-' + (month < 10 ? '0' + month : month) + '-' + (i < 10 ? '0' + i : i))
.getTime()
if (today === today2) {
isToday = 1
}
......@@ -37,6 +38,19 @@ export let getToday = (y, m, d) => {
}
}
export let getCurrentTime = () => {
let date = new Date()
let year = date.getFullYear()
let month = date.getMonth() + 1
let day = date.getDate()
let h = date.getHours()
let m = date.getMinutes()
let s = date.getSeconds()
let CurrentTime = year + "-" + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) + ' ' + (
h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s)
return CurrentTime
}
export let getdate = (time, tomorrow) => {
let date = new Date(time)
let year = date.getFullYear()
......
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