Browse Source

240831-01

master
梁欣 8 months ago
parent
commit
3615bd71c9
  1. 1
      .gitignore
  2. 4
      src/config/index.ts
  3. 23
      src/pages/match/ing.vue
  4. 273
      src/pages/promote/learn.vue
  5. 10
      src/pages/promote/promote.vue

1
.gitignore

@ -6,3 +6,4 @@
/.idea/inspectionProfiles/Project_Default.xml /.idea/inspectionProfiles/Project_Default.xml
/.idea/.gitignore /.idea/.gitignore
/.idea/vcs.xml /.idea/vcs.xml
/src/debugApk/

4
src/config/index.ts

@ -10,7 +10,7 @@ export const SERVER_API_URL = 'https://server.gxwebsoft.com/api';
// 模块接口地址 // 模块接口地址
// export const MODULES_API_URL = 'https://modules.gxwebsoft.com/api'; // export const MODULES_API_URL = 'https://modules.gxwebsoft.com/api';
// export const MODULES_API_URL = 'http://192.168.50.71:9099/api'; // export const MODULES_API_URL = 'http://192.168.50.71:9099/api';
// export const MODULES_API_URL = 'http://127.0.0.1:9099/api';
export const MODULES_API_URL = 'http://120.78.78.131:9335/api';
export const MODULES_API_URL = 'http://127.0.0.1:9099/api';
// export const MODULES_API_URL = 'http://120.78.78.131:9335/api';
export const apiUrl = MODULES_API_URL; export const apiUrl = MODULES_API_URL;

23
src/pages/match/ing.vue

@ -91,6 +91,7 @@ export default {
data() { data() {
return { return {
tabIndex: 1, tabIndex: 1,
matchId: null,
tabList: [ tabList: [
{name: '报名'}, {name: '报名'},
{name: '进行中'}, {name: '进行中'},
@ -169,12 +170,16 @@ export default {
text text
} }
}) })
if (this.matchId) {
this.matchIndex = this.matchList.findIndex(item => item.id === this.matchId)
uni.setStorageSync('matchIndex', this.matchIndex)
}
console.log(this.matchIndex, this.matchId)
this.matchInfo = data[this.matchIndex] this.matchInfo = data[this.matchIndex]
this.raceList = [] this.raceList = []
this.resetRaceList() this.resetRaceList()
}, },
async toSingleMatch() { async toSingleMatch() {
console.log(this.matchInfo.id)
const checkRes = await this.checkHasData(0) const checkRes = await this.checkHasData(0)
if (!checkRes) return if (!checkRes) return
const {data} = await matchSingleRuleGetRuleByMatchReq({matchId: this.matchInfo.id}) const {data} = await matchSingleRuleGetRuleByMatchReq({matchId: this.matchInfo.id})
@ -199,7 +204,7 @@ export default {
// url // url
// }) // })
console.log(data.peopleInfo.teamIndex) console.log(data.peopleInfo.teamIndex)
if (!data.peopleInfo || data.peopleInfo.teamIndex === null){
if (!data.peopleInfo || data.peopleInfo.teamIndex === null) {
return toast("未分组,无法参与") return toast("未分组,无法参与")
} }
uni.navigateTo({ uni.navigateTo({
@ -283,14 +288,19 @@ export default {
type: 'risk' type: 'risk'
}) })
}, },
toHome(){
toHome() {
uni.switchTab({url: '/pages/promote/promote'}) uni.switchTab({url: '/pages/promote/promote'})
} }
}, },
onLoad(option) {
if (option.matchId) this.matchId = parseInt(option.matchId)
},
onShow() { onShow() {
if (uni.getStorageSync('matchIndex')) this.matchIndex = parseInt(uni.getStorageSync('matchIndex'))
else this.matchIndex = 0
this.getMatching()
setTimeout(() => {
if (uni.getStorageSync('matchIndex')) this.matchIndex = parseInt(uni.getStorageSync('matchIndex'))
else this.matchIndex = 0
this.getMatching()
}, 100)
}, },
} }
</script> </script>
@ -553,6 +563,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 100;
} }
</style> </style>

273
src/pages/promote/learn.vue

@ -6,11 +6,10 @@
:enable-progress-gesture="false" :enable-progress-gesture="false"
:poster="`${video}?x-oss-async-process=video/snapshots,ss_1100,f_jpg`"></video> :poster="`${video}?x-oss-async-process=video/snapshots,ss_1100,f_jpg`"></video>
<image v-else-if="!video && info && info.cover" :src="info.cover" class="video" mode="aspectFill"/> <image v-else-if="!video && info && info.cover" :src="info.cover" class="video" mode="aspectFill"/>
<cover-view class="cover-wrap"/>
<cover-view class="cover">
<cover-view class="learn" v-if="video">继续学习</cover-view>
<!-- <cover-view class="last">上次学到:基础知识</cover-view>-->
</cover-view>
<!-- <cover-view class="cover" v-if="video" @click="onPlay">-->
<!-- <cover-view class="learn">继续学习</cover-view>-->
<!-- &lt;!&ndash; <cover-view class="last">上次学到:基础知识</cover-view>&ndash;&gt;-->
<!-- </cover-view>-->
</view> </view>
<!-- 选项卡 --> <!-- 选项卡 -->
<view class="layout-tab" v-if="!matchId"> <view class="layout-tab" v-if="!matchId">
@ -38,121 +37,153 @@
<!-- </scroll-view>--> <!-- </scroll-view>-->
<!-- </view>--> <!-- </view>-->
<!-- 课程 --> <!-- 课程 -->
<view class="layout-learn" v-if="tabIndex !== 0">
<KnowledgeStructure v-if="learnTab === 0" :list="knowledgeStructure"/>
<PracticeCourse v-else-if="learnTab === 4" :knowledgeStructure="brushingList" :trainId="trainId"/>
<template v-if="learnList.length > 0 && learnTab !== 0 && learnTab !== 4">
<view class="bg-white p-20 border-bottom text-25"
v-for="(knowledge, knowledgeIndex) in knowledgeStructure" :key="knowledgeIndex">
<view class="flex justify-start items-start flex-col">
<view class="flex justify-between items-center w-100p"
@click="knowledge.showChildren = !knowledge.showChildren">
<text>{{ knowledge.title }}</text>
<uv-icon :name="knowledge.showChildren ? 'arrow-down' : 'arrow-up'"/>
</view>
<view class="flex flex-col justify-start items-start w-100p" v-if="knowledge.showChildren">
<view class="p-20 flex flex-col justify-start items-start w-95p"
v-for="(second, secondIndex) in knowledge.children" :key="secondIndex">
<view class="flex justify-between items-center w-100p"
@click="second.showChildren = !second.showChildren">
<text>{{ second.title }}</text>
<uv-icon :name="second.showChildren ? 'arrow-down' : 'arrow-up'"/>
</view>
<template v-if="second.showChildren">
<view class="p-20 flex flex-col justify-start items-start w-95p"
v-for="(third, thirdIndex) in second.children" :key="thirdIndex">
<view class="flex justify-between items-center w-100p"
@click="third.showChildren = !third.showChildren">
<text>{{ third.title }}</text>
<uv-icon :name="third.showChildren ? 'arrow-down' : 'arrow-up'"/>
</view>
<template v-if="third.showChildren">
<view class="p-20 flex flex-col justify-start items-start w-95p"
v-for="(forth, forthIndex) in third.children" :key="forthIndex">
<view class="flex justify-between items-center w-100p"
@click="forth.showChildren = !forth.showChildren">
<view>
<text>{{ forth.title }}</text>
<text class="text-gray">{{
(forth.taskList && forth.taskList.length) ? '' : '(无课程)'
}}
</text>
<scroll-view v-if="tabIndex !== 0" scroll-y :style="{height: height}">
<view class="p-20">
<KnowledgeStructure v-if="learnTab === 0" :list="knowledgeStructure"/>
<PracticeCourse v-else-if="learnTab === 4" :knowledgeStructure="brushingList" :trainId="trainId"/>
<template v-if="learnList.length > 0 && learnTab !== 0 && learnTab !== 4">
<view class="bg-white p-20 border-bottom text-25"
v-for="(knowledge, knowledgeIndex) in knowledgeStructure" :key="knowledgeIndex">
<view class="flex justify-start items-start flex-col">
<view class="flex justify-between items-center w-100p"
@click="knowledge.showChildren = !knowledge.showChildren">
<text class="text-28 font-bold">{{ knowledge.title }}</text>
<uv-icon :name="knowledge.showChildren ? 'arrow-up' : 'arrow-down'"/>
</view>
<view class="flex flex-col justify-start items-start w-100p" v-if="knowledge.showChildren">
<view class="p-20 flex flex-col justify-start items-start w-95p"
v-for="(second, secondIndex) in knowledge.children" :key="secondIndex">
<view class="flex justify-between items-center w-100p"
@click="second.showChildren = !second.showChildren">
<text>{{ second.title }}</text>
<uv-icon :name="second.showChildren ? 'arrow-up' : 'arrow-down'"/>
</view>
<template v-if="second.showChildren">
<view class="p-20 flex flex-col justify-start items-start w-95p"
v-for="(third, thirdIndex) in second.children" :key="thirdIndex">
<view class="flex justify-between items-center w-100p"
@click="third.showChildren = !third.showChildren">
<text>{{ third.title }}</text>
<uv-icon :name="third.showChildren ? 'arrow-up' : 'arrow-down'"/>
</view>
<template v-if="third.showChildren">
<view class="p-20 flex flex-col justify-start items-start w-95p"
v-for="(forth, forthIndex) in third.children" :key="forthIndex">
<view class="flex justify-between items-center w-100p"
@click="forth.showChildren = !forth.showChildren">
<view>
<text>{{ forth.title }}</text>
<text class="text-gray">{{
(forth.taskList && forth.taskList.length) ? '' : '(无课程)'
}}
</text>
</view>
<uv-icon :name="forth.showChildren ? 'arrow-up' : 'arrow-down'"
v-if="forth.taskList"/>
</view> </view>
<uv-icon :name="forth.showChildren ? 'arrow-down' : 'arrow-up'"
v-if="forth.taskList"/>
</view>
<template v-if="forth.showChildren">
<view class="learn-item" v-for="(item,index) in forth.taskList"
:key="index">
<view class="grad-box">
<view class="grad">
<view class="title">
<view class="icon">
<template v-if="item.type === 'video'">
<uv-image src="/static/image/l-2.png"
width="30rpx"
height="30rpx"
v-if="currentLearningId === item.id"></uv-image>
<uv-image src="/static/image/play.jpg"
width="30rpx"
height="30rpx"
v-else></uv-image>
</template>
<template v-else>
<uv-image src="/static/image/l-1.png"
width="30rpx"
height="30rpx"></uv-image>
</template>
</view>
<view @click="changeLearn(index, item.id)"
class="font-bold"
:class="['text', {ing: currentLearningId === item.id}]">
{{
index + 1
}}{{
item.title
}}
<template v-if="forth.showChildren">
<view class="learn-item" v-for="(item,index) in forth.taskList"
:key="index">
<view class="grad-box">
<view class="grad">
<view class="title">
<view class="icon">
<template v-if="item.type === 'video'">
<uv-image src="/static/image/l-2.png"
width="30rpx"
height="30rpx"
v-if="currentLearningId === item.id"></uv-image>
<uv-image src="/static/image/play.jpg"
width="30rpx"
height="30rpx"
v-else></uv-image>
</template>
<template v-else>
<uv-image src="/static/image/l-1.png"
width="30rpx"
height="30rpx"></uv-image>
</template>
</view>
<view @click="changeLearn(index, item.id)"
class="font-bold"
:class="['text', {ing: currentLearningId === item.id}]">
{{
index + 1
}}{{
item.title
}}
</view>
</view> </view>
</view>
<view class="explain" v-if="item.hasDone">
<view class="text text-gray">已学习</view>
<view class="text ml-10 text-gray">至少学习{{
item.minMinute
}}分钟
<view class="explain" v-if="item.hasDone">
<view class="text text-gray">已学习</view>
<view class="text ml-10 text-gray">至少学习{{
item.minMinute
}}分钟
</view>
<view
:class="['state', {ed: item.state === 2}]">
已掌握
</view>
</view> </view>
<view :class="['state', {ed: item.state === 2}]">已掌握
<view v-else>
<view class="ing mt-20 text-25 ml-25"
style="margin-left: 90rpx"
v-if="currentLearningId === item.id">学习中
至少学习{{ item.minMinute }}分钟
</view>
<view class="mt-20 text-25 text-gray ml-25"
style="margin-left: 90rpx"
v-else>未学习 至少学习{{
item.minMinute
}}分钟
</view>
</view> </view>
</view> </view>
<view v-else>
<view class="ing mt-20 text-25 ml-25"
style="margin-left: 90rpx"
v-if="currentLearningId === item.id">学习中
至少学习{{ item.minMinute }}分钟
</view>
</view>
<view class="learn-item" v-if="forth.hasBrush">
<view class="grad-box">
<view class="grad">
<view class="title">
<view class="icon">
<uv-icon name="edit-pen" size="30rpx"/>
</view>
<view
@click="$jump(`/pages/exam/practice?knowledgeId=${forth.id}&trainId=${trainId}&title=${forth.title}`)"
class="font-bold"
:class="['text']">
{{
forth.taskList.length + 1
}}{{
forth.title
}}(刷题)
</view>
</view> </view>
<view class="mt-20 text-25 text-gray ml-25"
style="margin-left: 90rpx"
v-else>未学习 至少学习{{ item.minMinute }}分钟
<view class="explain">
<view class="text text-gray">{{
forth.brushHasDone ? '已刷题' : '未刷题'
}}
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view>
</template>
</view>
</template>
</view>
</template>
</template>
</view>
</template>
</view>
</template>
</view>
</view> </view>
</view> </view>
</view> </view>
</view>
</template>
<uv-empty v-else-if="learnList.length === 0 && learnTab !== 0"/>
</view>
</template>
<uv-empty v-else-if="learnList.length === 0 && learnTab !== 0"/>
</view>
</scroll-view>
<TaskIntro v-if="tabIndex === 0" :intro="info.intro"></TaskIntro> <TaskIntro v-if="tabIndex === 0" :intro="info.intro"></TaskIntro>
<!-- 底部 --> <!-- 底部 -->
<view class="layout-fixed">
<view class="layout-fixed" v-if="!matchId">
<view class="huan" @click="wrongLink"> <view class="huan" @click="wrongLink">
<view class="icon"> <view class="icon">
<uv-image src="/static/image/error.png" width="48rpx" height="48rpx"></uv-image> <uv-image src="/static/image/error.png" width="48rpx" height="48rpx"></uv-image>
@ -176,6 +207,7 @@
</view> </view>
<view class="popup-btn"> <view class="popup-btn">
<uv-button <uv-button
:disabled="clickedAnswerIndex === null"
:custom-style="customStyle" :custom-style="customStyle"
color="#fff" text="提交" color="#fff" text="提交"
@click="handSubmit" @click="handSubmit"
@ -254,11 +286,11 @@ export default {
lastLearnTab: 1, lastLearnTab: 1,
tabList2: [ tabList2: [
{id: 0, name: '标准'}, {id: 0, name: '标准'},
{id: 1, name: '视频'},
{id: 2, name: '课件'},
{id: 3, name: '教材'},
// {id: 1, name: ''},
// {id: 2, name: ''},
// {id: 3, name: ''},
{id: 4, name: '刷题'}, {id: 4, name: '刷题'},
{id: 5, name: '实训'},
// {id: 5, name: ''},
], ],
learnList: [], learnList: [],
learnListInKnowledge: [], learnListInKnowledge: [],
@ -278,13 +310,14 @@ export default {
showQaTimer: null, showQaTimer: null,
showQaTimerCount: 0, showQaTimerCount: 0,
exam: null, exam: null,
clickedAnswerIndex: -1,
clickedAnswerIndex: null,
clickedAnswer: null, clickedAnswer: null,
videoContext: null, videoContext: null,
resetTimer: true, resetTimer: true,
trainId: 0, trainId: 0,
matchId: 0, matchId: 0,
percentage: 0
percentage: 0,
height: 400
}; };
}, },
methods: { methods: {
@ -298,6 +331,7 @@ export default {
this.videoContext = uni.createVideoContext('myVideo') this.videoContext = uni.createVideoContext('myVideo')
if (!this.playing && this.resetTimer) this.timeCount = 0 if (!this.playing && this.resetTimer) this.timeCount = 0
this.playing = true this.playing = true
this.videoContext.play()
this.setTime() this.setTime()
}, },
onEnd() { onEnd() {
@ -309,7 +343,7 @@ export default {
if (this.timer) clearInterval(this.timer) if (this.timer) clearInterval(this.timer)
}, },
handTab(index) { handTab(index) {
this.tabIndex = index
if (index < 2) this.tabIndex = index
if (index === 4) { if (index === 4) {
uni.navigateTo({url: `/pages/promote/wrong`}) uni.navigateTo({url: `/pages/promote/wrong`})
} else if (index === 3) { } else if (index === 3) {
@ -367,6 +401,7 @@ export default {
this.timeCount = 0 this.timeCount = 0
this.currentLearningIndex = index this.currentLearningIndex = index
this.currentLearningId = id this.currentLearningId = id
console.log(this.learnList[index].type)
if (this.learnList[index].type === 'video') this.video = this.learnList[index].content if (this.learnList[index].type === 'video') this.video = this.learnList[index].content
else if (['file', 'learnFile'].includes(this.learnList[index].type)) this.openFile(this.learnList[index].content) else if (['file', 'learnFile'].includes(this.learnList[index].type)) this.openFile(this.learnList[index].content)
}, },
@ -643,6 +678,8 @@ export default {
console.log(e) console.log(e)
}); });
// #endif // #endif
if (this.matchId) this.height = (uni.getSystemInfoSync().screenHeight - uni.getSystemInfoSync().safeAreaInsets.top - uni.getSystemInfoSync().statusBarHeight - uni.upx2px(710)) + 'px'
else this.height = (uni.getSystemInfoSync().screenHeight - uni.getSystemInfoSync().safeAreaInsets.top - uni.getSystemInfoSync().statusBarHeight - uni.upx2px(920)) + 'px'
}, },
onShow() { onShow() {
this.getKnowledgeStructure(this.courseId) this.getKnowledgeStructure(this.courseId)
@ -687,14 +724,18 @@ page {
align-items: center; align-items: center;
.learn { .learn {
width: 220rpx;
height: 72rpx;
//width: 220rpx;
//height: 72rpx;
padding: 15rpx 40rpx;
font-size: 28rpx; font-size: 28rpx;
line-height: 72rpx;
//line-height: 72rpx;
color: #fff; color: #fff;
text-align: center; text-align: center;
border-radius: 36rpx; border-radius: 36rpx;
background: #00b6ff; background: #00b6ff;
display: flex;
align-items: center;
justify-content: center;
} }
.last { .last {
@ -818,7 +859,7 @@ page {
} }
.layout-learn { .layout-learn {
padding: 0 30rpx 150rpx;
padding: 0 30rpx;
} }
.learn-item { .learn-item {

10
src/pages/promote/promote.vue

@ -55,8 +55,9 @@
<view class="notice-box"> <view class="notice-box">
<swiper class="notice-swiper" :autoplay="true" vertical="true"> <swiper class="notice-swiper" :autoplay="true" vertical="true">
<swiper-item v-for="(item, index) in newsList" :key="index"> <swiper-item v-for="(item, index) in newsList" :key="index">
<view class="swiper-item" @click="$jump(`/pages/article/info?id=${item.articleId}`)">
<view class="text">{{ item.title }}</view>
<view class="flex justify-between items-center"
@click="$jump(`/pages/article/info?id=${item.articleId}`)">
<view class="uv-line-1" style="width: 500rpx; height: 32rpx">{{ item.title }}</view>
<view class="date">{{ item.createTime }}</view> <view class="date">{{ item.createTime }}</view>
</view> </view>
</swiper-item> </swiper-item>
@ -227,7 +228,8 @@
<view class="link"></view> <view class="link"></view>
</view> </view>
<view class="exam-box"> <view class="exam-box">
<view class="exam-item" v-for="(item,index) in matchList" :key="index">
<view class="exam-item" v-for="(item,index) in matchList" :key="index"
@click="$jump(`/pages/match/ing?matchId=${item.id}`)">
<view class="info info-1"> <view class="info info-1">
<view class="name"> <view class="name">
<uv-text :text="item.title" size="24rpx" lineHeight="40rpx" :lines="1" bold></uv-text> <uv-text :text="item.title" size="24rpx" lineHeight="40rpx" :lines="1" bold></uv-text>
@ -626,7 +628,7 @@ page {
align-items: center; align-items: center;
.text { .text {
flex: 1;
//flex: 1;
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;
color: $dark-color; color: $dark-color;

Loading…
Cancel
Save