This commit is contained in:
binbin_pan 2024-11-26 10:40:46 +08:00
parent 4c278a2e90
commit e56d880ebf
12 changed files with 138 additions and 129 deletions

View File

@ -13,7 +13,7 @@
"type" : "uniCloud" "type" : "uniCloud"
}, },
{ {
"playground" : "custom", "playground" : "standard",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
} }
] ]

View File

@ -19,7 +19,7 @@
<view class="swipe-area"> <view class="swipe-area">
<swiper class="swiper-box" autoplay interval="3000" indicator-dots="true"> <swiper class="swiper-box" autoplay interval="3000" indicator-dots="true">
<swiper-item v-for="(item, index) in imgList" :key="index"> <swiper-item v-for="(item, index) in imgList" :key="index">
<img :src="item.image" alt="" style="width: 100%; height: 100%" /> <image :src="item.image" alt="" style="width: 100%; height: 100%" />
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
@ -79,16 +79,20 @@ export default {
], ],
imgList: [ imgList: [
{ {
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg', image: require('../../../static/images/swiper1.png'),
title: '昨夜星辰昨夜风,画楼西畔桂堂东' title: '1'
}, },
{ {
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg', image: require('../../../static/images/swiper2.png'),
title: '身无彩凤双飞翼,心有灵犀一点通' title: '2'
}, },
{ {
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg', image: require('../../../static/images/swiper3.png'),
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳' title: '3'
},
{
image: require('../../../static/images/swiper4.png'),
title: '4'
} }
], ],
taskList: [], taskList: [],
@ -101,7 +105,6 @@ export default {
this.getMsgList() this.getMsgList()
setTimeout(() => { setTimeout(() => {
this.$verificationToken() this.$verificationToken()
}, 1000) }, 1000)
}, },
methods: { methods: {
@ -247,7 +250,7 @@ export default {
.search { .search {
width: 100%; width: 100%;
margin: 0 auto; margin: 10px auto 0;
display: flex; display: flex;
align-items: center; align-items: center;
} }

View File

@ -1,27 +1,26 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar title="学习项目" @leftClick="leftClick" placeholder /> <u-navbar title="学习项目" @leftClick="leftClick" placeholder />
<view class="status-secs"> <div class="tab-wrapper">
<view <div v-for="(item, index) in statusList" :key="index" class="tab-item" @click="chooseStatus(item, index)">
v-for="(item, index) in statusList" <div :style="{ color: activeIndex === index ? '#409eff' : '#333' }">
:key="item.id"
:class="[{ active: totalStatus.statusCount === item.id }]"
@click="chooseStatus(item.id)"
>
{{ item.text }} {{ item.text }}
</view> </div>
</view> <div :class="{ 'tab-line': activeIndex === index }"></div>
</div>
</div>
<uni-easyinput <uni-easyinput
prefixIcon="search" suffixIcon="search"
v-model="totalStatus.keyword" v-model="totalStatus.keyword"
placeholder="请输入项目名称" placeholder="请输入项目名称"
@iconClick="toggleSearch" @iconClick="toggleSearch"
style="margin-bottom: 10px"
></uni-easyinput> ></uni-easyinput>
<view class="project-cont"> <view class="project-cont">
<view v-for="(item, index) in projList" :key="item.id" class="single-proj" @click="toggleDetail(item.id)"> <view v-for="(item, index) in projList" :key="item.id" class="single-proj" @click="toggleDetail(item.id)">
<h4 class="img"> <h4 class="img">
<image src="https://cdn.uviewui.com/uview/swiper/1.jpg"></image> <image src="../../../static/images/studyPro.png"></image>
</h4> </h4>
<view class="proj-detail"> <view class="proj-detail">
<view class="detail-upper"> <view class="detail-upper">
@ -47,6 +46,10 @@
</view> </view>
</view> </view>
</view> </view>
<div class="no-data" v-if="projList.length == 0">
<image src="/static/images/zanwuneirong.png" mode="aspectFit" />
<view class="no-data-text">暂无内容</view>
</div>
</view> </view>
</view> </view>
</template> </template>
@ -58,6 +61,7 @@ import config from '@/config'
export default { export default {
data() { data() {
return { return {
activeIndex: 0,
statusList: [ statusList: [
// status -1: 1: 0: // status -1: 1: 0:
{ text: '全部', id: 0 }, { text: '全部', id: 0 },
@ -96,71 +100,6 @@ export default {
], ],
// //
projList: [] projList: []
// projList: [
// {
// id: 1,
// img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
// title: '',
// star: 5,
// avatar: '/static/eduImg/avatar.jpg',
// user: '',
// percent: 71
// },
// {
// id: 2,
// img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
// title: '',
// star: 3,
// avatar: '/static/eduImg/avatar.jpg',
// user: '',
// percent: 33
// },
// {
// id: 3,
// img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
// title: '',
// star: 2,
// avatar: '/static/eduImg/avatar.jpg',
// user: '',
// percent: 94
// },
// {
// id: 4,
// img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
// title: '',
// star: 4,
// avatar: '/static/eduImg/avatar.jpg',
// user: '',
// percent: 76
// },
// {
// id: 5,
// img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
// title: '',
// star: 1,
// avatar: '/static/eduImg/avatar.jpg',
// user: '',
// percent: 63
// },
// {
// id: 6,
// img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
// title: '',
// star: 5,
// avatar: '/static/eduImg/avatar.jpg',
// user: '',
// percent: 52
// },
// {
// id: 7,
// img: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
// title: '',
// star: 4,
// avatar: '/static/eduImg/avatar.jpg',
// user: '',
// percent: 18
// }
// ]
} }
}, },
mounted() { mounted() {
@ -176,7 +115,8 @@ export default {
// this.projList = res.data // this.projList = res.data
this.getStudentStudyWorkList(params) this.getStudentStudyWorkList(params)
}, },
async chooseStatus(count) { async chooseStatus(count, index) {
this.activeIndex = index
this.projList = [] this.projList = []
// //
this.totalStatus.keyword = '' this.totalStatus.keyword = ''
@ -184,12 +124,12 @@ export default {
userId: uni.getStorageSync('userId'), userId: uni.getStorageSync('userId'),
status: '-1' status: '-1'
} }
this.totalStatus.statusCount = count this.totalStatus.statusCount = count.id
if (count === 0) { if (count.id === 0) {
params.status = '-1' params.status = '-1'
} else if (count === 1) { } else if (count.id === 1) {
params.status = '1' params.status = '1'
} else if (count === 2) { } else if (count.id === 2) {
params.status = '0' params.status = '0'
} }
// const res = await getStudentStudyWorkList(params) // const res = await getStudentStudyWorkList(params)
@ -265,6 +205,38 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.tab-wrapper {
display: flex;
justify-content: space-around;
/* background: #fff; */
margin-bottom: 10px;
.tab-item {
width: 25%;
display: flex;
flex-direction: column;
align-items: center;
padding: 10px 0;
.tab-line {
margin-top: 5px;
width: 30%;
height: 2px;
background-color: #409eff;
transition: width 0.3s;
}
}
}
.no-data {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 100px;
.no-data-text {
margin-top: 10px;
color: #999;
}
}
.page { .page {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
@ -307,7 +279,7 @@ export default {
.single-proj { .single-proj {
width: 49%; width: 49%;
height: 30vh; height: 22vh;
margin-bottom: 1vh; margin-bottom: 1vh;
border-radius: 10px; border-radius: 10px;
overflow: hidden; overflow: hidden;
@ -332,13 +304,18 @@ export default {
.detail-upper { .detail-upper {
width: 100%; width: 100%;
height: 65%; height: 50%;
border-bottom: 1px solid #dfdfdf; border-bottom: 1px solid #dfdfdf;
box-sizing: border-box; box-sizing: border-box;
padding: 5px; padding: 5px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
h5 {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.icons { .icons {
font-size: 12px; font-size: 12px;
@ -359,7 +336,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
.avatar { /* .avatar {
width: 5vh; width: 5vh;
height: 5vh; height: 5vh;
border-radius: 50%; border-radius: 50%;
@ -370,7 +347,7 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} } */
.progress { .progress {
flex: 1; flex: 1;

View File

@ -7,8 +7,7 @@
<view class="user-info"> <view class="user-info">
<div style="font-size: 18px">{{ createUserName }}</div> <div style="font-size: 18px">{{ createUserName }}</div>
<div class="training-content"> <div class="training-content">
<div style="width: 80px">培训内容:</div> <div>培训内容{{ listStageContentNum || '暂无' }}</div>
<span class="content">{{ listStageContentNum }}</span>
</div> </div>
<!-- <view class="info-lef"> <!-- <view class="info-lef">
<view class="avatar"> <view class="avatar">
@ -39,12 +38,15 @@
</view> --> </view> -->
</view> </view>
<!-- <view class="tip">已开启进度同步其他途径的学习进度已自动同步</view> --> <!-- <view class="tip">已开启进度同步其他途径的学习进度已自动同步</view> -->
<u-collapse>
<div v-for="(stageItem, stageIndex) in listStage" :key="stageIndex" :title="stageItem.stageName"> <div v-for="(stageItem, stageIndex) in listStage" :key="stageIndex" :title="stageItem.stageName">
{{ stageItem.stageName }} <div class="item-stage" @click="handleShow(stageItem)">
<span>{{ stageItem.stageName }}</span>
<u-icon :name="stageItem.isShow ? 'arrow-down' : 'arrow-up'" size="17" />
</div>
<div v-if="stageItem.isShow">
<div v-for="(content, conIndex) in stageItem.listStageContent" :key="conIndex"> <div v-for="(content, conIndex) in stageItem.listStageContent" :key="conIndex">
<u-collapse-item title="素材" v-if="content.stageType == 1"> <u-collapse :border="false">
<uni-list> <u-collapse-item title="素材" v-if="content.stageType == 1" :border="false">
<div <div
class="list-wrapper" class="list-wrapper"
v-for="(item, index) in content.studyList" v-for="(item, index) in content.studyList"
@ -71,10 +73,8 @@
<div>{{ item.studyPercentage || 0 }}%</div> <div>{{ item.studyPercentage || 0 }}%</div>
</div> </div>
</div> </div>
</uni-list>
</u-collapse-item> </u-collapse-item>
<u-collapse-item title="课程" v-if="content.stageType == 2"> <u-collapse-item title="课程" v-if="content.stageType == 2" :border="false">
<uni-list>
<div <div
class="list-wrapper" class="list-wrapper"
v-for="(item, index) in content.studyList" v-for="(item, index) in content.studyList"
@ -101,11 +101,9 @@
<div>{{ item.studyPercentage || 0 }}%</div> <div>{{ item.studyPercentage || 0 }}%</div>
</div> </div>
</div> </div>
</uni-list>
</u-collapse-item> </u-collapse-item>
<u-collapse-item title="练习" v-if="content.stageType == 3"> <u-collapse-item title="练习" v-if="content.stageType == 3" :border="false">
<uni-list>
<div class="list-wrapper" @click="toggleTheoryPrac(content)"> <div class="list-wrapper" @click="toggleTheoryPrac(content)">
<div class="left-content"> <div class="left-content">
<div class="title"> <div class="title">
@ -125,11 +123,9 @@
{{ content.practiceMsg && content.practiceMsg.allQuestionNum == 0 ? '未开始' : '已练习' }} {{ content.practiceMsg && content.practiceMsg.allQuestionNum == 0 ? '未开始' : '已练习' }}
</div> </div>
</div> </div>
</uni-list>
</u-collapse-item> </u-collapse-item>
<u-collapse-item title="考试" v-if="content.stageType == 4"> <u-collapse-item title="考试" v-if="content.stageType == 4" :border="false">
<uni-list>
<div class="list-wrapper" @click="toggleTheoryExam(content)"> <div class="list-wrapper" @click="toggleTheoryExam(content)">
<div class="left-content"> <div class="left-content">
<div class="title"> <div class="title">
@ -155,11 +151,11 @@
{{ !content.examMsg || content.examMsg.examNum == 0 ? '开始考试' : '重考' }} {{ !content.examMsg || content.examMsg.examNum == 0 ? '开始考试' : '重考' }}
</div> </div>
</div> </div>
</uni-list>
</u-collapse-item> </u-collapse-item>
</div>
</div>
</u-collapse> </u-collapse>
</div>
</div>
</div>
</view> </view>
<!-- <view class="comment-area"> <!-- <view class="comment-area">
<h2 style="margin-bottom: 15rpx">最新评论 ({{ commentList.length }})</h2> <h2 style="margin-bottom: 15rpx">最新评论 ({{ commentList.length }})</h2>
@ -255,6 +251,10 @@ export default {
this.getStudyWorkAll() this.getStudyWorkAll()
}, },
methods: { methods: {
handleShow(item) {
console.log('🚀 ~ handleShow ~ item:', item.isShow)
item.isShow = this.$set(item, 'isShow', !item.isShow)
},
// //
async getStudyWorkAll() { async getStudyWorkAll() {
let params = { userId: uni.getStorageSync('userId'), id: this.projId, type: '1' } let params = { userId: uni.getStorageSync('userId'), id: this.projId, type: '1' }
@ -276,6 +276,11 @@ export default {
this.listStageContentNum = res.data.listStageContentNum this.listStageContentNum = res.data.listStageContentNum
this.eligibility = res.data.eligibility this.eligibility = res.data.eligibility
this.listStage = res.data.listStage this.listStage = res.data.listStage
if (this.listStage.length > 0) {
this.listStage.forEach((item, index) => {
this.$set(item, 'isShow', true)
})
}
} }
}) })
}, },
@ -406,13 +411,29 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
::v-deep .u-cell__body {
padding: 5px !important;
}
::v-deep .u-collapse-item__content__text{
padding: 0 5px !important;
}
.page { .page {
width: 100vw; width: 100vw;
height: 100vh;
background-color: #f8f8f8; background-color: #f8f8f8;
box-sizing: border-box; box-sizing: border-box;
padding: 5vw; padding: 5vw 5px;
position: relative; position: relative;
.item-stage {
margin: 8px 0;
font-size: 16px;
display: flex;
justify-content: space-between;
align-items: center;
}
.proj-cont { .proj-cont {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
@ -432,8 +453,11 @@ export default {
margin-bottom: 2vh; margin-bottom: 2vh;
.training-content { .training-content {
word-wrap: break-word; // display: flex;
margin-top: 10px;
white-space: normal; white-space: normal;
word-wrap: break-word;
word-break: break-all;
} }
.info-lef { .info-lef {
@ -498,19 +522,22 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 20px 10px; /* padding: 20px 0; */
margin-bottom: 10px;
padding-bottom: 5px;
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
font-size: 12px; font-size: 12px;
color: #b0b0b0; color: #b0b0b0;
/* height: 400px; */ /* height: 400px; */
overflow: auto; overflow: auto;
.left-content { .left-content {
width: 50vw;
.title { .title {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.note { .note {
width: 130px; /* width: 130px; */
margin-top: 10px; margin-top: 10px;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
@ -518,6 +545,7 @@ export default {
} }
} }
.right-content { .right-content {
width: 35vw;
display: flex; display: flex;
align-items: center; align-items: center;
.progress { .progress {

View File

@ -851,7 +851,8 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.wrapper { .wrapper {
height: 100vh; height: 100vh;
background: url('/static/images/question-bg.png') no-repeat; /* background: url('/static/images/question-bg.png') no-repeat; */
background: #fff;
background-size: 100% 100%; background-size: 100% 100%;
.slot-content { .slot-content {

View File

@ -241,7 +241,7 @@ export default {
// globalConfig: getApp().globalData.config, // globalConfig: getApp().globalData.config,
selectTab: 1, selectTab: 1,
loginForm: { loginForm: {
phone: '', // 18955734761 18700000001 17681010134 15955147005 phone: '', // 18955734761 18700000001 17681010134 15955147005 15656751631
pd: '' //YNsbd@123456 Lv@200018 pd: '' //YNsbd@123456 Lv@200018
}, },
loginForm0: { loginForm0: {
@ -458,17 +458,17 @@ export default {
uni.$u.toast('该账号已注销') uni.$u.toast('该账号已注销')
return return
} }
// console.log(this.loginForm0) // console.log('', this.loginForm0)
this.$refs.uForm0 this.$refs.uForm0
.validate() .validate()
.then(res => { .then(res => {
this.$store this.$store
.dispatch('LoginCode', this.loginForm0) .dispatch('LoginCode', this.loginForm0)
.then(res => { .then(res => {
console.log(res) console.log('短信登录成功', res)
if (res.code == 200) { if (res.code == 200) {
this.isLogin = true this.isLogin = true
uni.switchTab({ uni.reLaunch({
url: '/pages/gzt/index' url: '/pages/gzt/index'
}) })
} else { } else {

BIN
static/images/studyPro.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
static/images/swiper1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 KiB

BIN
static/images/swiper2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 KiB

BIN
static/images/swiper3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 KiB

BIN
static/images/swiper4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 KiB

View File

@ -5,8 +5,8 @@ import errorCode from '@/utils/errorCode'
import { toast, showConfirm, tansParams } from '@/utils/common' import { toast, showConfirm, tansParams } from '@/utils/common'
let timeout = 60000 let timeout = 60000
// const baseUrl = config.loginBaseUrl const baseUrl = config.loginBaseUrl
const baseUrl = config.loginUrl // const baseUrl = config.loginUrl
console.log('baseUrl-请求', baseUrl) console.log('baseUrl-请求', baseUrl)
const request = config => { const request = config => {