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"
},
{
"playground" : "custom",
"playground" : "standard",
"type" : "uni-app:app-android"
}
]

View File

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

View File

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

View File

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

View File

@ -851,7 +851,8 @@ export default {
<style lang="scss" scoped>
.wrapper {
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%;
.slot-content {

View File

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