Browse Source

240831-01

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

1
.gitignore

@ -6,3 +6,4 @@
/.idea/inspectionProfiles/Project_Default.xml
/.idea/.gitignore
/.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 = '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;

17
src/pages/match/ing.vue

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

93
src/pages/promote/learn.vue

@ -6,11 +6,10 @@
:enable-progress-gesture="false"
: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"/>
<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 class="layout-tab" v-if="!matchId">
@ -38,7 +37,8 @@
<!-- </scroll-view>-->
<!-- </view>-->
<!-- 课程 -->
<view class="layout-learn" v-if="tabIndex !== 0">
<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">
@ -47,8 +47,8 @@
<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'"/>
<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"
@ -56,7 +56,7 @@
<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'"/>
<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"
@ -64,7 +64,7 @@
<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'"/>
<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"
@ -78,7 +78,7 @@
}}
</text>
</view>
<uv-icon :name="forth.showChildren ? 'arrow-down' : 'arrow-up'"
<uv-icon :name="forth.showChildren ? 'arrow-up' : 'arrow-down'"
v-if="forth.taskList"/>
</view>
<template v-if="forth.showChildren">
@ -120,7 +120,9 @@
item.minMinute
}}分钟
</view>
<view :class="['state', {ed: item.state === 2}]">已掌握
<view
:class="['state', {ed: item.state === 2}]">
已掌握
</view>
</view>
<view v-else>
@ -131,7 +133,36 @@
</view>
<view class="mt-20 text-25 text-gray ml-25"
style="margin-left: 90rpx"
v-else>未学习 至少学习{{ item.minMinute }}分钟
v-else>未学习 至少学习{{
item.minMinute
}}分钟
</view>
</view>
</view>
</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 class="explain">
<view class="text text-gray">{{
forth.brushHasDone ? '已刷题' : '未刷题'
}}
</view>
</view>
</view>
@ -148,11 +179,11 @@
</view>
</template>
<uv-empty v-else-if="learnList.length === 0 && learnTab !== 0"/>
</view>
</scroll-view>
<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="icon">
<uv-image src="/static/image/error.png" width="48rpx" height="48rpx"></uv-image>
@ -176,6 +207,7 @@
</view>
<view class="popup-btn">
<uv-button
:disabled="clickedAnswerIndex === null"
:custom-style="customStyle"
color="#fff" text="提交"
@click="handSubmit"
@ -254,11 +286,11 @@ export default {
lastLearnTab: 1,
tabList2: [
{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: 5, name: '实训'},
// {id: 5, name: ''},
],
learnList: [],
learnListInKnowledge: [],
@ -278,13 +310,14 @@ export default {
showQaTimer: null,
showQaTimerCount: 0,
exam: null,
clickedAnswerIndex: -1,
clickedAnswerIndex: null,
clickedAnswer: null,
videoContext: null,
resetTimer: true,
trainId: 0,
matchId: 0,
percentage: 0
percentage: 0,
height: 400
};
},
methods: {
@ -298,6 +331,7 @@ export default {
this.videoContext = uni.createVideoContext('myVideo')
if (!this.playing && this.resetTimer) this.timeCount = 0
this.playing = true
this.videoContext.play()
this.setTime()
},
onEnd() {
@ -309,7 +343,7 @@ export default {
if (this.timer) clearInterval(this.timer)
},
handTab(index) {
this.tabIndex = index
if (index < 2) this.tabIndex = index
if (index === 4) {
uni.navigateTo({url: `/pages/promote/wrong`})
} else if (index === 3) {
@ -367,6 +401,7 @@ export default {
this.timeCount = 0
this.currentLearningIndex = index
this.currentLearningId = id
console.log(this.learnList[index].type)
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)
},
@ -643,6 +678,8 @@ export default {
console.log(e)
});
// #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() {
this.getKnowledgeStructure(this.courseId)
@ -687,14 +724,18 @@ page {
align-items: center;
.learn {
width: 220rpx;
height: 72rpx;
//width: 220rpx;
//height: 72rpx;
padding: 15rpx 40rpx;
font-size: 28rpx;
line-height: 72rpx;
//line-height: 72rpx;
color: #fff;
text-align: center;
border-radius: 36rpx;
background: #00b6ff;
display: flex;
align-items: center;
justify-content: center;
}
.last {
@ -818,7 +859,7 @@ page {
}
.layout-learn {
padding: 0 30rpx 150rpx;
padding: 0 30rpx;
}
.learn-item {

10
src/pages/promote/promote.vue

@ -55,8 +55,9 @@
<view class="notice-box">
<swiper class="notice-swiper" :autoplay="true" vertical="true">
<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>
</swiper-item>
@ -227,7 +228,8 @@
<view class="link"></view>
</view>
<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="name">
<uv-text :text="item.title" size="24rpx" lineHeight="40rpx" :lines="1" bold></uv-text>
@ -626,7 +628,7 @@ page {
align-items: center;
.text {
flex: 1;
//flex: 1;
font-size: 28rpx;
line-height: 40rpx;
color: $dark-color;

Loading…
Cancel
Save