This commit is contained in:
2025-11-06 15:54:23 +08:00
15 changed files with 2438 additions and 1072 deletions

View File

@@ -1,497 +1,500 @@
<template>
<view class="help-filter-page">
<view class="header">
<view class="back-btn" @click="goBack">
<uni-icons type="arrowleft" size="24" color="#fff" />
<AppLayout :title="title" :show-bg-image="false" @onScrollBottom="getDataList('add')">
<!-- <template #headerleft>
<view class="btnback">
<image src="@/static/icon/back.png" @click="navBack"></image>
</view>
</template> -->
<view class="main-list" :style="getBackgroundStyle('k.png')">
<view class="list-top">
<view class="list-title">
<text>筛选条件</text>
<view class="title-line"></view>
</view>
<view class="title-right button-sp-area">
<button class="mini-btn search-box-btn" type="primary" size="mini" @click="handleSearch">查询</button>
<button class="mini-btn reset-box-btn" type="default" size="mini">重置</button>
</view>
<view class="title">筛选和帮扶</view>
</view>
<!-- 筛选条件区域 -->
<view class="filter-section">
<view class="filter-item">
<view class="filter-label">人员姓名</view>
<input class="filter-input" v-model="filters.personName" placeholder="请输入人员姓名" />
<view class="search-container">
<!-- 人员姓名 -->
<view class="search-item">
<text class="label">人员姓名</text>
<input
v-model="formData.name"
class="input"
type="text"
placeholder="请输入人员姓名"
/>
</view>
<view class="filter-item">
<view class="filter-label">身份证号</view>
<input class="filter-input" v-model="filters.idCard" placeholder="请输入身份证号" />
<!-- 身份证号 -->
<view class="search-item">
<text class="label">身份证号</text>
<input
v-model="formData.idCard"
class="input"
type="text"
placeholder="请输入身份证号"
/>
</view>
<view class="filter-item">
<view class="filter-label">帮扶类型</view>
<picker class="filter-picker" mode="selector" range="{{helpTypes}}" bindchange="onHelpTypeChange">
<view class="picker-text">{{filters.helpType || '请选择帮扶类型'}}</view>
<!-- 帮扶类型下拉选择 -->
<view class="search-item">
<text class="label">帮扶类型</text>
<picker
mode="selector"
:range="helpTypes"
:value="helpTypeIndex"
@change="onHelpTypeChange"
class="picker"
>
<view class="picker-value">{{ helpTypes[helpTypeIndex] || '请选择帮扶类型' }}</view>
</picker>
</view>
<view class="filter-item">
<view class="filter-label">帮扶人员</view>
<input class="filter-input" v-model="filters.helperName" placeholder="请输入帮扶人员姓名" />
<!-- 帮扶人员 -->
<view class="search-item">
<text class="label">帮扶人员</text>
<input
v-model="formData.helperName"
class="input"
type="text"
placeholder="请输入帮扶人员姓名"
/>
</view>
<view class="filter-item">
<view class="filter-label">所属区域</view>
<picker class="filter-picker" mode="selector" range="{{regions}}" bindchange="onRegionChange">
<view class="picker-text">{{filters.region || '请选择所属区域'}}</view>
<!-- 所属区域下拉选择 -->
<view class="search-item">
<text class="label">所属区域</text>
<picker
mode="selector"
:range="regions"
:value="regionIndex"
@change="onRegionChange"
class="picker"
>
<view class="picker-value">{{ regions[regionIndex] || '请选择所属区域' }}</view>
</picker>
</view>
<view class="date-range">
<view class="filter-label">帮扶时间</view>
<view class="date-inputs">
<input class="date-input" v-model="filters.startDate" type="date" placeholder="开始日期" />
<view class="date-separator"></view>
<input class="date-input" v-model="filters.endDate" type="date" placeholder="结束日期" />
</view>
<!-- 开始时间 -->
<view class="search-item">
<text class="label">开始时间</text>
<picker
mode="date"
:value="formData.startTime"
@change="onStartTimeChange"
class="picker"
>
<view class="picker-value">{{ formData.startTime || '请选择开始时间' }}</view>
</picker>
</view>
<view class="filter-buttons">
<button class="query-btn" type="primary" @click="queryData">查询</button>
<button class="reset-btn" @click="resetFilters">重置</button>
<!-- 结束时间 -->
<view class="search-item">
<text class="label">结束时间</text>
<picker
mode="date"
:value="formData.endTime"
@change="onEndTimeChange"
class="picker"
>
<view class="picker-value">{{ formData.endTime || '请选择结束时间' }}</view>
</picker>
</view>
</view>
<!-- 帮扶记录列表 -->
<view class="list-section">
<view class="list-header">
<view class="list-title">帮扶记录列表</view>
<view class="list-count">{{helpRecords.length}}条记录</view>
<!-- <empty v-else pdTop="200"></empty> -->
</view>
<view class="records-list">
<view class="record-item" v-for="record in helpRecords" :key="record.id">
<view class="record-header">
<view class="person-name">{{record.personName}}</view>
<view class="job-tag" @click="showJobRecommend(record)">{{record.jobTag}}</view>
<view class="main-list" :style="getBackgroundStyle('k.png')">
<view class="list-top">
<view class="list-title">
<text>帮扶记录列表</text>
<view class="title-line"></view>
</view>
<view class="record-info">
<view class="info-row">
<uni-icons type="call" size="14" color="#999" />
<span class="info-label">联系电话</span>
<span class="info-value">{{record.phone}}</span>
</view>
<view class="info-row">
<uni-icons type="card" size="14" color="#999" />
<span class="info-label">身份证号</span>
<span class="info-value">{{record.idCard}}</span>
</view>
<view class="info-row">
<uni-icons type="location" size="14" color="#999" />
<span class="info-label">所属区域</span>
<span class="info-value">{{record.region}}</span>
</view>
<view class="info-row">
<uni-icons type="person" size="14" color="#999" />
<span class="info-label">帮扶人员</span>
<span class="info-value">{{record.helperName}}</span>
</view>
<view class="info-row">
<uni-icons type="briefcase" size="14" color="#999" />
<span class="info-label">帮扶单位</span>
<span class="info-value">{{record.helperUnit}}</span>
</view>
<view class="info-row">
<uni-icons type="calendar" size="14" color="#999" />
<span class="info-label">帮扶日期</span>
<span class="info-value">{{record.helpDate}}</span>
</view>
<view class="info-row">
<uni-icons type="time" size="14" color="#999" />
<span class="info-label">下次联系</span>
<span class="info-value">{{record.nextContactDate}}</span>
<view class="title-total">
<text class="total-num">7</text>条记录
</view>
</view>
<view class="record-actions">
<button class="detail-btn" @click="showDetail(record)">详情</button>
<button class="follow-btn" @click="followUp(record)">跟进</button>
<button class="recommend-btn" @click="showJobRecommend(record)">智能推荐</button>
</view>
<!-- v-if="dataList.length>0" -->
<view class="list-box" >
<view class="con-box" v-for="(item,index) in dataList" :key="index">
<view class="form-title">
<view class="form-name">
{{item.name}}
</view>
<view class="form-type">
{{item.type}}
</view>
</view>
<view class="form-item">
<view class="item-left">
<image class="item-img" :src="baseUrl+'/dispatch/tele.png'" mode=""></image>
<view class="item-label">
联系电话
</view>
</view>
<view class="item-right">
{{item.phone}}
</view>
</view>
<view class="form-item">
<view class="item-left">
<image class="item-img" :src="baseUrl+'/dispatch/num.png'" mode=""></image>
<view class="item-label">
身份证号
</view>
</view>
<view class="item-right">
{{item.idCard}}
</view>
</view>
<view class="form-item">
<view class="item-left">
<image class="item-img" :src="baseUrl+'/dispatch/base.png'" mode=""></image>
<view class="item-label">
所属区域
</view>
</view>
<view class="item-right">
{{item.region}}
</view>
</view>
<view class="form-item">
<view class="item-left">
<image class="item-img" :src="baseUrl+'/dispatch/person.png'" mode=""></image>
<view class="item-label">
帮扶人员
</view>
</view>
<view class="item-right">
{{item.helperName}}
</view>
</view>
<view class="form-item">
<view class="item-left">
<image class="item-img" :src="baseUrl+'/dispatch/help.png'" mode=""></image>
<view class="item-label">
帮扶单位
</view>
</view>
<view class="item-right">
{{item.unit}}
</view>
</view>
<view class="form-item">
<view class="item-left">
<image class="item-img" :src="baseUrl+'/dispatch/date.png'" mode=""></image>
<view class="item-label">
帮扶日期
</view>
</view>
<view class="item-right">
{{item.assistanceDate}}
</view>
</view>
<view class="form-item">
<view class="item-left">
<image class="item-img" :src="baseUrl+'/dispatch/next.png'" mode=""></image>
<view class="item-label">
下次联系
</view>
</view>
<view class="item-right">
{{item.nextContact}}
</view>
</view>
<view class="form-btns">
<button class="mini-btn form-box-btn detail-btn" size="mini" >详情</button>
<button class="mini-btn form-box-btn follow-btn" size="mini" @click="goFollow(item)">跟进</button>
<button class="mini-btn form-box-btn recommend-btn" size="mini" >智能推荐</button>
</view>
</view>
</view>
<!-- <empty v-else pdTop="200"></empty> -->
</view>
</AppLayout>
</template>
<script>
import { ref, reactive, onMounted } from 'vue'
import { useRouter } from 'uni-app'
<script setup>
import { inject, ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
const { $api, navTo, navBack } = inject('globalFunction');
import config from "@/config.js"
export default {
name: 'HelpFilter',
setup() {
const router = useRouter()
// 筛选条件
const filters = reactive({
personName: '',
// state
const title = ref('');
const formData = reactive({
name: '',
idCard: '',
helpType: '',
helperName: '',
region: '',
startDate: '',
endDate: ''
startTime: '',
endTime: ''
})
const searchKeyword = ref('');
const dataList=ref([])
const pageSize=ref(10)
const pageNum=ref(1)
const totalNum=ref(0)
const baseUrl = config.imgBaseUrl
const getBackgroundStyle = (imageName) => ({
backgroundImage: `url(${baseUrl}/dispatch/${imageName})`,
backgroundSize: 'cover', // 覆盖整个容器
backgroundPosition: 'center', // 居中
backgroundRepeat: 'no-repeat'
});
const trainVideoImgUrl=config.trainVideoImgUrl
// 帮扶类型选项
const helpTypes = ['经济帮扶', '教育帮扶', '医疗帮扶', '就业帮扶']
const helpTypeIndex = ref(0)
// 所属区域选项(可根据实际替换为动态数据)
const regions = ['北京市', '上海市', '广州市', '深圳市', '杭州市']
const regionIndex = ref(0)
// 事件处理
const onHelpTypeChange = (e) => {
helpTypeIndex.value = e.detail.value
}
const onRegionChange = (e) => {
regionIndex.value = e.detail.value
}
const onStartTimeChange = (e) => {
formData.startTime = e.detail.value
}
const onEndTimeChange = (e) => {
formData.endTime = e.detail.value
}
const handleSearch = () => {
console.log('当前搜索条件:', {
...formData,
helpType: helpTypes[helpTypeIndex.value],
region: regions[regionIndex.value]
})
// 在这里调用接口进行搜索
}
onLoad(() => {
getDataList('refresh');
});
// 帮扶类型选项
const helpTypes = ref(['就业帮扶', '技能培训', '创业支持', '政策咨询'])
// 区域选项
const regions = ref(['喀什地区/疏勒县', '喀什地区/疏附县', '喀什地区/伽师县', '喀什地区/岳普湖县'])
// 帮扶记录数据
const helpRecords = ref([
// 获取视频列表
function getDataList(type = 'add') {
// let maxPage=Math.ceil(totalNum.value/pageSize.value)
// let params={}
// if (type === 'refresh') {
// pageNum.value = 1;
// params={
// category:'',
// hour:'',
// level:'',
// searchValue:searchKeyword.value,
// orderStr:'',
// pageSize:pageSize.value,
// pageNum:pageNum.value
// }
// $api.myRequest('/train/public/trainVideo/trainVideoList', params).then((resData) => {
// dataList.value=resData.rows
// totalNum.value=resData.total
// });
// }
// if (type === 'add' && pageNum.value < maxPage) {
// pageNum.value += 1;
// params={
// category:'',
// hour:'',
// level:'',
// searchValue:searchKeyword.value,
// orderStr:'',
// pageSize:pageSize.value,
// pageNum:pageNum.value
// }
// $api.myRequest('/train/public/trainVideo/trainVideoList', params).then((resData) => {
// dataList.value=dataList.value.concat(resData.rows)
// totalNum.value=resData.total
// });
// }
dataList.value=[
{
id: 1,
personName: '王小明',
jobTag: '招聘岗位推荐',
phone: '13912345678',
idCard: '371302198801112024',
region: '喀什地区/疏勒县',
helperName: '新兴社区管理员',
helperUnit: '新社区',
helpDate: '2023-11-05',
nextContactDate: '2023-11-06'
name: '王小明',
idCard: '370781199107166029',
helperName: '喀什',
startTime: '2025/11/24',
endTime: '2025/11/25',
phone:'18340050862',
region:'喀什地区',
unit:'新社区',
type:'招聘单位推荐',
assistanceDate:'2025/11/25',
nextContact:'2025/11/30',
id:'1'
},
{
id: 2,
personName: '赵小美',
jobTag: '招聘岗位推荐',
phone: '15912345678',
idCard: '371302198801112024',
region: '喀什地区/疏勒县',
helperName: '新兴社区管理员',
helperUnit: '新社区',
helpDate: '2023-11-05',
nextContactDate: '2023-11-06'
name: '王大明',
idCard: '370781199107166029',
helperName: '喀什',
startTime: '2025/11/24',
endTime: '2025/11/25',
phone:'18340050862',
region:'喀什地区',
unit:'新社区',
type:'招聘单位推荐',
assistanceDate:'2025/11/25',
nextContact:'2025/11/30',
id:'2'
},
{
id: 3,
personName: '赵小美',
jobTag: '招聘岗位推荐',
phone: '15912345678',
idCard: '371302198801112024',
region: '喀什地区/疏勒县',
helperName: '新兴社区管理员',
helperUnit: '新兴社区',
helpDate: '2023-11-05',
nextContactDate: '2023-11-06'
}
])
]
}
// 返回上一页
const goBack = () => {
router.back()
}
// 重置筛选条件
const resetFilters = () => {
Object.keys(filters).forEach(key => {
filters[key] = ''
})
}
// 查询数据
const queryData = () => {
// 这里是模拟查询实际项目中应该调用API
console.log('查询条件:', filters)
// 实际开发中这里应该调用接口获取数据
// fetchHelpRecords(filters)
}
// 显示详情
const showDetail = (record) => {
console.log('查看详情:', record)
// 跳转到详情页面
// router.push({ path: '/detail', query: { id: record.id } })
}
// 跟进
const followUp = (record) => {
console.log('跟进记录:', record)
// 跳转到跟进页面
router.push({ path: '/packageB/priority/helpFollow', query: { personId: record.id, personName: record.personName } })
}
// 智能推荐
const showJobRecommend = (record) => {
console.log('智能推荐:', record)
// 跳转到推荐页面
// router.push({ path: '/recommend', query: { id: record.id } })
}
// 帮扶类型选择变化
const onHelpTypeChange = (e) => {
filters.helpType = helpTypes.value[e.detail.value]
}
// 区域选择变化
const onRegionChange = (e) => {
filters.region = regions.value[e.detail.value]
}
onMounted(() => {
// 组件挂载时的初始化逻辑
})
return {
filters,
helpTypes,
regions,
helpRecords,
goBack,
resetFilters,
queryData,
showDetail,
followUp,
showJobRecommend,
onHelpTypeChange,
onRegionChange
}
}
// 播放视频
function goFollow(item) {
navTo(`/packageB/priority/helpFollow?id=${item.id}`);
}
</script>
<style scoped>
.help-filter-page {
background-color: #f5f5f5;
min-height: 100vh;
}
<style lang="stylus" scoped>
.btnback
width: 64rpx
height: 64rpx
.header {
background-color: #1989fa;
display: flex;
align-items: center;
padding: 20rpx 30rpx;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
}
image
height: 100%
width: 100%
.back-btn {
padding: 10rpx;
}
.main-list
background-color: #ffffff
padding: 20rpx 20rpx 28rpx 20rpx
margin: 30rpx 30rpx
box-shadow: 0px 3px 20px 0px rgba(0,105,234,0.1)
border-radius: 12px
.list-top
display: flex
align-items: center
justify-content: space-between
.list-title
font-weight: bold
font-size: 36rpx
color: #404040
position: relative
.title {
color: #fff;
font-size: 36rpx;
font-weight: bold;
flex: 1;
text-align: center;
margin-right: 60rpx;
}
.title-line
position: absolute
bottom: -10rpx
left: 36rpx
width: 70rpx
height: 8rpx
background: linear-gradient(90deg, #FFAD58 0%, #FF7A5B 100%)
border-radius: 4rpx
.search-box-btn
border-radius: 32rpx !important
background: #3088FF !important
margin-right: 16rpx
.reset-box-btn
border-radius: 32rpx !important
background: #02B44D
color: #fff
.search-container
padding: 20rpx 0rpx 0rpx 0rpx
.title-total
font-size: 24rpx
color: #999999
.total-num
color: #3088FF
margin-left: 4rpx
margin-right: 4rpx
font-weight: bold
font-size: 26rpx
.search-item
display: flex
align-items: center
margin-bottom: 30rpx
.filter-section {
background-color: #fff;
margin-top: 100rpx;
padding: 30rpx;
border-radius: 10rpx;
margin-bottom: 20rpx;
}
.label
width: 160rpx
font-size: 28rpx
color: #404040
.filter-item {
display: flex;
align-items: center;
margin-bottom: 30rpx;
}
.input,
.picker
background: #FFFFFF
flex: 1
height: 72rpx
padding: 0 20rpx
border: 1px solid #A0A0A0
border-radius: 8rpx
font-size: 28rpx
line-height: 72rpx
.filter-label {
font-size: 28rpx;
color: #333;
width: 200rpx;
}
.picker-value
color: #666
.list-box
margin-top: 40rpx
.con-box
background: #fff
padding: 20rpx
box-shadow: 0px 0px 6rpx 0px rgba(0,71,200,0.16)
border-radius: 24rpx
border: 1rpx solid #EDF5FF
margin-top: 30rpx
.form-title
display: flex
align-items: center
.filter-input {
flex: 1;
height: 80rpx;
border: 1rpx solid #e0e0e0;
.form-name
font-weight: bold
font-size: 32rpx
color: #595959
margin-right:16rpx
.form-type
border-radius: 8rpx;
padding: 0 20rpx;
font-size: 28rpx;
}
.filter-picker {
flex: 1;
height: 80rpx;
border: 1rpx solid #e0e0e0;
border-radius: 8rpx;
display: flex;
align-items: center;
padding: 0 20rpx;
}
.picker-text {
font-size: 28rpx;
color: #999;
}
.date-range {
display: flex;
align-items: flex-start;
margin-bottom: 30rpx;
}
.date-inputs {
flex: 1;
display: flex;
align-items: center;
}
.date-input {
flex: 1;
height: 80rpx;
border: 1rpx solid #e0e0e0;
border-radius: 8rpx;
padding: 0 20rpx;
font-size: 28rpx;
}
.date-separator {
margin: 0 20rpx;
color: #999;
}
.filter-buttons {
display: flex;
gap: 20rpx;
}
.query-btn {
flex: 1;
background-color: #1989fa;
color: #fff;
font-size: 32rpx;
border: none;
height: 88rpx;
line-height: 88rpx;
}
.reset-btn {
flex: 1;
background-color: #fff;
color: #333;
font-size: 32rpx;
border: 1rpx solid #e0e0e0;
height: 88rpx;
line-height: 88rpx;
}
.list-section {
background-color: #fff;
padding: 30rpx;
border-radius: 10rpx;
}
.list-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30rpx;
}
.list-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.list-count {
font-size: 28rpx;
color: #999;
}
.record-item {
border: 1rpx solid #e0e0e0;
border-radius: 10rpx;
padding: 30rpx;
margin-bottom: 30rpx;
}
.record-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.person-name {
font-size: 36rpx;
font-weight: bold;
color: #333;
}
.job-tag {
font-size: 24rpx;
color: #ff6600;
padding: 5rpx 15rpx;
border: 1rpx solid #ff6600;
border-radius: 15rpx;
}
.record-info {
margin-bottom: 30rpx;
}
.info-row {
display: flex;
align-items: center;
margin-bottom: 15rpx;
font-size: 28rpx;
}
.info-label {
color: #666;
margin-left: 10rpx;
}
.info-value {
color: #333;
margin-left: 10rpx;
}
.record-actions {
display: flex;
gap: 20rpx;
}
.detail-btn {
flex: 1;
background-color: #e8f3ff;
color: #1989fa;
font-size: 28rpx;
border: none;
height: 70rpx;
line-height: 70rpx;
}
.follow-btn {
flex: 1;
background-color: #e6f7ff;
color: #1890ff;
font-size: 28rpx;
border: none;
height: 70rpx;
line-height: 70rpx;
}
.recommend-btn {
flex: 1;
background-color: #f6ffed;
color: #52c41a;
font-size: 28rpx;
border: none;
height: 70rpx;
line-height: 70rpx;
}
border: 2rpx solid #FF7D26;
font-size: 24rpx
color: #F1690E
padding: 4rpx 10rpx
.form-item
display: flex
align-items: center
justify-content: space-between
margin-top: 30rpx
.item-left
display: flex
align-items: center
.item-img
width: 26rpx
height: 26rpx
margin-right: 10rpx
.item-label
font-size: 26rpx
color: #B3B3B3
.item-right
font-size: 26rpx
color: #737373
.form-btns
margin-top:30rpx
.form-box-btn
border-radius: 50rpx !important
margin-right: 24rpx
padding: 0rpx 40rpx
.detail-btn
background: #EDF5FF
border: 1px solid #3088FF
font-size: 28rpx
color: #3088FF
.follow-btn
background: #EEF9F3
border: 1px solid #00933E
font-size: 28rpx
color: #00933E
.recommend-btn
background: linear-gradient(92deg, #0DCCFF 0%, #4760FF 100%)
font-size: 28rpx
color: #FFFFFF
</style>

View File

@@ -1,442 +1,503 @@
<template>
<view class="help-follow-page">
<view class="header">
<view class="back-btn" @click="goBack">
<uni-icons type="arrowleft" size="24" color="#fff" />
<AppLayout :title="title" :show-bg-image="false" @onScrollBottom="getDataList('add')">
<!-- <template #headerleft>
<view class="btnback">
<image src="@/static/icon/back.png" @click="navBack"></image>
</view>
<view class="title">跟进</view>
</template> -->
<view class="info-box">
<view class="info-item info-line">
<image class="info-img" :src="baseUrl+'/dispatch/person-icon.png'" mode=""></image>
<view class="info-label">
人员姓名
</view>
<view class="info-value">
王小美
</view>
<!-- 人员信息卡片 -->
<view class="person-info-card">
<view class="info-item">
<uni-icons type="person" size="20" color="#1989fa" />
<span class="info-label">人员姓名</span>
<span class="info-value">{{personInfo.personName}}</span>
</view>
<view class="info-item">
<uni-icons type="briefcase" size="20" color="#1989fa" />
<span class="info-label">帮扶类型</span>
<span class="info-value">{{personInfo.helpType}}</span>
<image class="info-img" :src="baseUrl+'/dispatch/help-icon.png'" mode=""></image>
<view class="info-label">
帮扶类型
</view>
<view class="info-value">
招聘岗位推荐
</view>
</view>
</view>
<view class="main-list" :style="getBackgroundStyle('k.png')">
<view class="list-top">
<view class="list-title">
<text>新增跟进记录</text>
<view class="title-line"></view>
</view>
</view>
<!-- 新增跟进记录 -->
<view class="follow-form-section">
<view class="section-title">新增跟进记录</view>
<view class="form-item">
<view class="form-label required">跟进日期</view>
<input class="form-input date-input" v-model="followData.followDate" type="date" placeholder="请选择跟进日期" />
</view>
<view class="form-item">
<view class="form-label required">跟进方式</view>
<picker class="form-picker" mode="selector" range="{{followMethods}}" @change="onFollowMethodChange">
<view class="picker-text">{{followData.followMethod || '请选择跟进方式'}}</view>
<view class="form-container">
<uni-forms ref="formRef" v-model="formData" :rules="rules" validate-trigger="submit">
<!-- 跟进日期 -->
<uni-forms-item label="跟进日期:" name="followDate" required>
<picker mode="date" :value="formData.followDate" @change="onDateChange('followDate', $event)">
<view class="picker-value">{{ formData.followDate || '请选择跟进日期' }}</view>
</picker>
</view>
</uni-forms-item>
<view class="form-item">
<view class="form-label required">跟进内容</view>
<textarea class="form-textarea" v-model="followData.followContent" placeholder="请输入跟进内容" rows="4"></textarea>
</view>
<!-- 跟进方式 -->
<uni-forms-item label="跟进方式:" name="followMethod" required>
<picker mode="selector" :range="followMethods" :value="methodIndex" @change="onMethodChange">
<view class="picker-value">{{ followMethods[methodIndex] || '请选择跟进方式' }}</view>
</picker>
</uni-forms-item>
<view class="form-item">
<view class="form-label required">跟进结果</view>
<textarea class="form-textarea" v-model="followData.followResult" placeholder="请输入跟进结果" rows="3"></textarea>
</view>
<!-- 跟进内容 -->
<uni-forms-item label="跟进内容:" name="followContent" required>
<textarea
v-model="formData.followContent"
class="textarea"
placeholder="请输入跟进内容"
:maxlength="500"
/>
</uni-forms-item>
<view class="form-item">
<view class="form-label">下一步计划</view>
<textarea class="form-textarea" v-model="followData.nextPlan" placeholder="请输入下一步计划" rows="3"></textarea>
</view>
<!-- 跟进结果 -->
<uni-forms-item label="跟进结果:" name="followResult" required>
<textarea
v-model="formData.followResult"
class="textarea"
placeholder="请输入跟进结果"
:maxlength="500"
/>
</uni-forms-item>
<view class="form-item">
<view class="form-label">下次联系</view>
<input class="form-input date-input" v-model="followData.nextContactDate" type="date" placeholder="请选择下次联系日期" />
</view>
<!-- 下一步计划 -->
<uni-forms-item label="下一步计划:" name="nextPlan">
<textarea
v-model="formData.nextPlan"
class="textarea"
placeholder="请输入下一步计划(可选)"
:maxlength="500"
/>
</uni-forms-item>
<view class="form-buttons">
<button class="save-btn" type="primary" @click="saveFollowRecord">保存跟进</button>
<button class="reset-btn" @click="resetForm">重置</button>
</view>
</view>
<!-- 下次联系时间 -->
<uni-forms-item label="下次联系:" name="nextContactDate">
<picker mode="date" :value="formData.nextContactDate" @change="onDateChange('nextContactDate', $event)">
<view class="picker-value">{{ formData.nextContactDate || '请选择下次联系时间' }}</view>
</picker>
</uni-forms-item>
</uni-forms>
<!-- 跟进历史记录 -->
<view class="history-section">
<view class="section-header">
<view class="section-title">跟进历史记录</view>
<view class="record-count">{{historyRecords.length}}条记录</view>
</view>
<view class="history-list">
<view class="history-item" v-for="record in historyRecords" :key="record.id">
<view class="history-header">
<uni-icons type="time" size="16" color="#1989fa" />
<span class="history-date">{{record.date}}</span>
</view>
<view class="history-content">
<view class="history-row">
<span class="history-label">跟进方式</span>
<span class="history-value">{{record.method}}</span>
</view>
<view class="history-row">
<span class="history-label">跟进人</span>
<span class="history-value">{{record.follower}}</span>
</view>
<view class="history-row">
<span class="history-label">跟进内容</span>
<span class="history-value">{{record.content}}</span>
<!-- 按钮组 -->
<view class="button-group">
<button class="btn submit-btn" @click="handleSubmit">保存跟进</button>
<button class="btn reset-btn" @click="handleReset">重置</button>
</view>
</view>
</view>
<view class="main-list" :style="getBackgroundStyle('k.png')">
<view class="list-top">
<view class="list-title">
<text>跟进历史记录</text>
<view class="title-line"></view>
</view>
<view class="title-total">
<text class="total-num">7</text>条记录
</view>
</view>
<!-- v-if="dataList.length>0" -->
<view class="list-box" >
<uni-steps :options="list2" active-color="#007AFF" :active="active" direction="column" />
</view>
<!-- <empty v-else pdTop="200"></empty> -->
</view>
</AppLayout>
</template>
<script>
import { ref, reactive, onMounted } from 'vue'
import { useRouter, useRoute } from 'uni-app'
<script setup>
import { inject, ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
const { $api, navTo, navBack } = inject('globalFunction');
import config from "@/config.js"
export default {
name: 'HelpFollow',
setup() {
const router = useRouter()
const route = useRoute()
// state
const title = ref('');
const formData = reactive({
followDate: null,
followMethod: null,
followContent: null,
followResult: null,
nextPlan: null,
nextContactDate: null
})
const followMethods = ['电话', '面谈', '微信', '邮件', '其他']
const methodIndex = ref(0)
const list2=[{
title: '买家下单',
desc: '跟进方式:电话\n跟进人新生社区管理员\n跟进内容内容内容内容'
}, {
title: '卖家发货',
desc: '跟进方式:电话\n跟进人新生社区管理员\n跟进内容内容内容内容'
}, {
title: '买家签收',
desc: '跟进方式:电话\n跟进人新生社区管理员\n跟进内容内容内容内容'
}, {
title: '交易完成',
desc: '跟进方式:电话\n跟进人新生社区管理员\n跟进内容内容内容内容'
}]
const active=ref(null)
// 表单引用
const formRef = ref(null)
// 人员信息
const personInfo = reactive({
personName: '王小美',
helpType: '招聘岗位推荐'
})
// 跟进方式选项
const followMethods = ref(['电话', '微信', '邮件', '上门拜访', '视频会议', '其他'])
// 跟进表单数据
const followData = reactive({
followDate: '',
followMethod: '',
followContent: '',
followResult: '',
nextPlan: '',
nextContactDate: ''
})
// 历史记录数据
const historyRecords = ref([
{
id: 1,
date: '2025-11-05',
method: '电话',
follower: '新兴社区管理员',
content: '内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容。'
// 校验规则
const rules = {
followDate: {
required: true,
message: '请选择跟进日期'
},
{
id: 2,
date: '2025-11-05',
method: '电话',
follower: '新兴社区管理员',
content: '内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容。'
followMethod: {
required: true,
message: '请选择跟进方式'
},
followContent: {
required: true,
message: '请填写跟进内容'
},
followResult: {
required: true,
message: '请填写跟进结果'
}
])
}
// 返回上一页
const goBack = () => {
router.back()
}
const searchKeyword = ref('');
const dataList=ref([])
const pageSize=ref(10)
const pageNum=ref(1)
const totalNum=ref(0)
const baseUrl = config.imgBaseUrl
const getBackgroundStyle = (imageName) => ({
backgroundImage: `url(${baseUrl}/dispatch/${imageName})`,
backgroundSize: 'cover', // 覆盖整个容器
backgroundPosition: 'center', // 居中
backgroundRepeat: 'no-repeat'
});
const trainVideoImgUrl=config.trainVideoImgUrl
// 重置表单
const resetForm = () => {
Object.keys(followData).forEach(key => {
followData[key] = ''
// 所属区域选项(可根据实际替换为动态数据)
const regions = ['北京市', '上海市', '广州市', '深圳市', '杭州市']
const regionIndex = ref(0)
// 事件处理
const onDateChange = (field, e) => {
formData[field] = e.detail.value
}
const onMethodChange = (e) => {
const idx = e.detail.value
methodIndex.value = idx
formData.followMethod = followMethods[idx]
}
const handleSubmit = () => {
formRef.value?.validate()
.then(() => {
uni.showToast({ title: '校验通过', icon: 'success' });
})
}
.catch((errors) => {
console.log('校验失败:', errors);
uni.showToast({ title: '请填写必填项', icon: 'none' });
});
};
// 保存跟进记录
const saveFollowRecord = () => {
// 表单验证
if (!followData.followDate) {
uni.showToast({ title: '请选择跟进日期', icon: 'none' })
return
}
if (!followData.followMethod) {
uni.showToast({ title: '请选择跟进方式', icon: 'none' })
return
}
if (!followData.followContent) {
uni.showToast({ title: '请输入跟进内容', icon: 'none' })
return
}
if (!followData.followResult) {
uni.showToast({ title: '请输入跟进结果', icon: 'none' })
return
}
// 这里是模拟保存实际项目中应该调用API
console.log('保存跟进记录:', followData)
// 保存成功后添加到历史记录列表
const newRecord = {
id: historyRecords.value.length + 1,
date: followData.followDate,
method: followData.followMethod,
follower: '当前登录用户', // 实际应该从登录信息中获取
content: followData.followContent
}
historyRecords.value.unshift(newRecord)
// 清空表单
resetForm()
uni.showToast({ title: '保存成功', icon: 'success' })
}
// 跟进方式选择变化
const onFollowMethodChange = (e) => {
followData.followMethod = followMethods.value[e.detail.value]
}
onMounted(() => {
// 组件挂载时的初始化逻辑
// 可以从路由参数中获取人员ID等信息
console.log('路由参数:', route.query)
// 实际项目中应该根据ID加载人员信息和历史记录
// loadPersonInfo(route.query.personId)
// loadHistoryRecords(route.query.personId)
const handleReset = () => {
Object.keys(formData).forEach(key => {
formData[key] = ''
})
methodIndex.value = 0
uni.showToast({ title: '已重置', icon: 'none' })
}
onLoad(() => {
// getDataList('refresh');
});
return {
personInfo,
followMethods,
followData,
historyRecords,
goBack,
resetForm,
saveFollowRecord,
onFollowMethodChange
}
}
// 获取视频列表
function getDataList(type = 'add') {
// let maxPage=Math.ceil(totalNum.value/pageSize.value)
// let params={}
// if (type === 'refresh') {
// pageNum.value = 1;
// params={
// category:'',
// hour:'',
// level:'',
// searchValue:searchKeyword.value,
// orderStr:'',
// pageSize:pageSize.value,
// pageNum:pageNum.value
// }
// $api.myRequest('/train/public/trainVideo/trainVideoList', params).then((resData) => {
// dataList.value=resData.rows
// totalNum.value=resData.total
// });
// }
// if (type === 'add' && pageNum.value < maxPage) {
// pageNum.value += 1;
// params={
// category:'',
// hour:'',
// level:'',
// searchValue:searchKeyword.value,
// orderStr:'',
// pageSize:pageSize.value,
// pageNum:pageNum.value
// }
// $api.myRequest('/train/public/trainVideo/trainVideoList', params).then((resData) => {
// dataList.value=dataList.value.concat(resData.rows)
// totalNum.value=resData.total
// });
// }
}
// 播放视频
function playVideo(video) {
navTo(`/packageB/train/video/videoDetail?id=${video.videoId}`);
}
</script>
<style scoped>
.help-follow-page {
background-color: #f5f5f5;
min-height: 100vh;
}
<style lang="stylus" scoped>
.btnback
width: 64rpx
height: 64rpx
.header {
background-color: #1989fa;
display: flex;
align-items: center;
padding: 20rpx 30rpx;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
}
image
height: 100%
width: 100%
.info-box
margin: 30rpx 30rpx
background: linear-gradient(0deg, #D9ECFF 0%, #F0F7FF 100%)
border-radius: 20rpx
padding: 40rpx 0
display: flex
align-items: center
.info-img
width: 40rpx
height: 40rpx
margin-bottom: 20rpx
.info-line
border-right: 2rpx solid #B7D6FF
.info-item
display: flex
flex-direction: column
align-items: center
justify-content: center
width: 50%
.info-label
font-size: 26rpx
color: #6E7E9B
margin-bottom: 20rpx
.info-value
font-weight: bold
font-size: 28rpx
color: #3D61AC
.main-list
background-color: #ffffff
padding: 20rpx 20rpx 28rpx 20rpx
margin: 30rpx 30rpx
box-shadow: 0px 3px 20px 0px rgba(0,105,234,0.1)
border-radius: 12px
.list-top
display: flex
align-items: center
justify-content: space-between
.list-title
font-weight: bold
font-size: 36rpx
color: #404040
position: relative
.back-btn {
padding: 10rpx;
}
.title-line
position: absolute
bottom: -10rpx
left: 70rpx
width: 70rpx
height: 8rpx
background: linear-gradient(90deg, #FFAD58 0%, #FF7A5B 100%)
border-radius: 4rpx
.search-box-btn
border-radius: 32rpx !important
background: #3088FF !important
margin-right: 16rpx
.reset-box-btn
border-radius: 32rpx !important
background: #02B44D
color: #fff
.search-container
padding: 20rpx 0rpx 0rpx 0rpx
.title-total
font-size: 24rpx
color: #999999
.total-num
color: #3088FF
margin-left: 4rpx
margin-right: 4rpx
font-weight: bold
font-size: 26rpx
.search-item
display: flex
align-items: center
margin-bottom: 20rpx
.title {
color: #fff;
font-size: 36rpx;
font-weight: bold;
flex: 1;
text-align: center;
margin-right: 60rpx;
}
.label
width: 160rpx
font-size: 28rpx
color: #404040
.person-info-card {
background-color: #fff;
margin-top: 100rpx;
padding: 30rpx;
display: flex;
justify-content: space-around;
border-radius: 10rpx;
margin-bottom: 20rpx;
}
.input,
.picker
background: #FFFFFF
flex: 1
height: 72rpx
padding: 0 20rpx
border: 1px solid #A0A0A0
border-radius: 8rpx
font-size: 28rpx
line-height: 72rpx
.info-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 10rpx;
}
.picker-value
color: #666
.list-box
margin-top: 40rpx
.con-box
background: #fff
padding: 20rpx
box-shadow: 0px 0px 6rpx 0px rgba(0,71,200,0.16)
border-radius: 24rpx
border: 1rpx solid #EDF5FF
margin-top: 30rpx
.form-title
display: flex
align-items: center
.info-label {
font-size: 26rpx;
color: #666;
}
.info-value {
font-size: 28rpx;
color: #333;
font-weight: 500;
}
.follow-form-section {
background-color: #fff;
padding: 30rpx;
border-radius: 10rpx;
margin-bottom: 20rpx;
}
.history-section {
background-color: #fff;
padding: 30rpx;
border-radius: 10rpx;
margin-bottom: 30rpx;
}
.section-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 30rpx;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30rpx;
}
.record-count {
font-size: 28rpx;
color: #999;
}
.form-item {
margin-bottom: 30rpx;
}
.form-label {
font-size: 28rpx;
color: #333;
margin-bottom: 10rpx;
display: inline-block;
}
.required::before {
content: '*';
color: #ff4d4f;
margin-right: 5rpx;
}
.form-input {
width: 100%;
height: 80rpx;
border: 1rpx solid #e0e0e0;
.form-name
font-weight: bold
font-size: 32rpx
color: #595959
margin-right:16rpx
.form-type
border-radius: 8rpx;
padding: 0 20rpx;
border: 2rpx solid #FF7D26;
font-size: 24rpx
color: #F1690E
padding: 4rpx 10rpx
.form-item
display: flex
align-items: center
justify-content: space-between
margin-top: 20rpx
.item-left
display: flex
align-items: center
.item-img
width: 26rpx
height: 26rpx
margin-right: 10rpx
.item-label
font-size: 26rpx
color: #B3B3B3
.item-right
font-size: 26rpx
color: #737373
.form-btns
margin-top:30rpx
.form-box-btn
border-radius: 50rpx !important
margin-right: 24rpx
padding: 0rpx 40rpx
.detail-btn
background: #EDF5FF
border: 1px solid #3088FF
font-size: 28rpx
color: #3088FF
.follow-btn
background: #EEF9F3
border: 1px solid #00933E
font-size: 28rpx
color: #00933E
.recommend-btn
background: linear-gradient(92deg, #0DCCFF 0%, #4760FF 100%)
font-size: 28rpx
color: #FFFFFF
.form-container
margin-top: 30rpx
:deep(.uni-forms-item__label)
width: 194rpx !important
font-size: 28rpx;
}
.date-input {
background-color: #fafafa;
}
.form-picker {
color: #404040;
/* 统一 picker 和 textarea 样式 */
.picker-value,
.textarea {
width: 100%;
height: 80rpx;
border: 1rpx solid #e0e0e0;
border-radius: 8rpx;
display: flex;
align-items: center;
padding: 0 20rpx;
background-color: #fafafa;
}
.picker-text {
font-size: 28rpx;
color: #999;
}
.form-textarea {
width: 100%;
border: 1rpx solid #e0e0e0;
border-radius: 8rpx;
min-height: 60rpx;
padding: 20rpx;
border: 1px solid #ddd;
border-radius: 8rpx;
font-size: 28rpx;
min-height: 150rpx;
box-sizing: border-box;
}
.textarea {
height: 120rpx;
resize: none;
}
.form-buttons {
.button-group {
display: flex;
gap: 20rpx;
margin-top: 40rpx;
justify-content: space-between;
padding: 40rpx 20rpx 20rpx;
}
.save-btn {
flex: 1;
background-color: #1989fa;
color: #fff;
font-size: 32rpx;
border: none;
height: 88rpx;
line-height: 88rpx;
.btn {
width: 45%;
height: 80rpx;
font-size: 30rpx;
border-radius: 8rpx;
}
.reset-btn {
flex: 1;
background-color: #fff;
color: #333;
font-size: 32rpx;
border: 1rpx solid #e0e0e0;
height: 88rpx;
line-height: 88rpx;
background-color: #D8E9FF;
color: #1176FF;
}
.history-list {
display: flex;
flex-direction: column;
gap: 20rpx;
}
.history-item {
border: 1rpx solid #e0e0e0;
border-radius: 10rpx;
padding: 20rpx;
}
.history-header {
display: flex;
align-items: center;
margin-bottom: 15rpx;
gap: 10rpx;
}
.history-date {
font-size: 28rpx;
color: #1989fa;
font-weight: 500;
}
.history-content {
padding-left: 30rpx;
}
.history-row {
margin-bottom: 10rpx;
font-size: 28rpx;
}
.history-label {
color: #666;
margin-right: 10rpx;
}
.history-value {
color: #333;
.submit-btn {
background-color: #368BFF;
color: white;
}
:deep(.uni-steps__column-circle )
width: 24rpx !important
height: 24rpx !important
background: radial-gradient(circle,
#00C0FA 0%,
#015EEA 50%,
#FFFFFF 51%,
#FFFFFF 100%) !important
border-radius: 50%
border: 2rpx solid #015EEA
:deep(.uni-steps__column-title)
font-size: 28rpx !important
color: #006CFF !important
margin-bottom: 24rpx
:deep(.uni-steps__column-desc)
font-size: 28rpx
color: #898989 !important
line-height: 1.5
:deep(.uni-steps__column-text )
padding: 16rpx 0 !important
border: none
:deep(.uni-steps__column-line)
background-color: #368BFF !important
:deep(.uni-steps__column-line--before)
background-color:rgba(0,0,0,0) !important
</style>

View File

@@ -26,38 +26,103 @@
</view>
</template>
<scroll-view scroll-y class="main-scroll" @scrolltolower="handleScrollToLower">
<div class="cards">
<div class="cards" v-for="(item,index) in dataList">
<div class="cardHead">
<div class="cardHeadLeft">
<div class="cardTitle">2025年注册会计师证</div>
<div class="titleType primary">未开始</div>
<div class="cardTitle">{{item.name}}</div>
<div class="titleType success" v-if="item.score">已完成</div>
<div class="titleType info" v-else-if="dates<item.startDate">未开始</div>
<div class="titleType primary" v-else-if="(dates>item.startDate||dates==item.startDate)&&dates<item.dueDate">
进行中
</div>
<div class="rightBtn">立即练习</div>
<div class="titleType info" v-else-if="dates>item.dueDate">已过期</div>
</div>
<div class="rightBtn" v-if="(dates>item.startDate||dates==item.startDate)&&dates<item.dueDate&&item.isContinue!=1">开始考试</div>
<div class="rightBtn" v-if="(dates>item.startDate||dates==item.startDate)&&dates<item.dueDate&&item.isContinue==1">继续考试</div>
</div>
<div class="heng"></div>
<div class="cardCon">
<div class="conten">考试时长120分钟</div>
<div class="conten">题目数量88</div>
<div class="conten">及格分数60</div>
<div class="conten">截止日期2025-12-31</div>
<div class="conten">考试时长{{item.timeLimit}}分钟</div>
<div class="conten">题目数量{{item.totalQuestions}}</div>
<div class="conten">分类
<span v-for="(val, key) in classification">
<template v-if="item.category==val.dictValue">{{ val.dictLabel }}</template>
</span>
</div>
<div class="conten">成绩
<span v-if="item.gradeUser" >{{ item.gradeUser.score }}</span>
<span v-else>--</span>
</div>
<div class="conten">开始时间{{item.startDate}}</div>
<div class="conten">截止时间{{item.dueDate}}</div>
</div>
<div class="flooter">
<div @click="jumps('/packageB/train/mockExam/viewGrades')">查看成绩</div>
<div>详情</div>
<div>收藏</div>
<div v-if="item.gradeUser" @click="jumps('/packageB/train/mockExam/viewGrades')">查看成绩</div>
<div @click="handleDetail(item)">详情</div>
<div @click="collects(item,1)" v-if="item.isCollect==0">
<image :src="urls+'wsc.png'" mode="" style="width: 32rpx;height: 30rpx;"></image>
收藏
</div>
<div v-else @click="collects(item,0)">
<image :src="urls+'video-sc.png'" mode="" style="width: 32rpx;height: 30rpx;"></image>
取消
</div>
</div>
</div>
<div class="cards"></div>
<div class="cards"></div>
</scroll-view>
</div>
<div class="cards2" v-if="dialogVisible">
<div class="cardCon">
<div class="cardHead">
<div></div>
<div class="cardHead" style="margin-bottom: 20rpx;">
<div>{{examInfo.name}}</div>
<div style="font-size: 40rpx;" @click="clones()">×</div>
</div>
<div class="status-tags">
<div class="titleType success" v-if="examInfo.score">已完成</div>
<div class="titleType info" v-else-if="dates<examInfo.startDate">未开始</div>
<div class="titleType primary" v-else-if="(dates>examInfo.startDate||dates==examInfo.startDate)&&dates<examInfo.dueDate">
进行中
</div>
<div class="titleType info" v-else-if="dates>examInfo.dueDate">已过期</div>
<div class="titleType success" v-if="examInfo.difficulty=='easy'">初级</div>
<div class="titleType tertiary" v-if="examInfo.difficulty=='medium'">中级</div>
<div class="titleType primary2" v-if="examInfo.difficulty=='hard'">高级</div>
</div>
<div class="detailTitle">考试简介</div>
<div class="detailCon">{{ examInfo.description }}</div>
<div class="exam-info">
<div class="info-item">
<div class="info-value">{{ examInfo.timeLimit }}</div>
<div class="info-label">考试时长</div>
<div class="info-label">(分钟)</div>
</div>
<div class="info-divider"></div>
<div class="info-item">
<div class="info-value">{{ examInfo.totalQuestions }}</div>
<div class="info-label">题目总数</div>
</div>
<div class="info-divider"></div>
<div class="info-item">
<div class="info-value">{{ examInfo.passScore }}</div>
<div class="info-label">及格分数</div>
</div>
<div class="info-divider"></div>
<div class="info-item">
<div class="info-value">{{ examInfo.totalScore }}</div>
<div class="info-label">总分</div>
</div>
</div>
<div class="detailTitle">考试要求</div>
<div class="detailCon">考试过程中请勿刷新页面或关闭浏览器</div>
<div class="detailCon">请在规定时间内完成所有题目</div>
<div class="detailCon">考试开始后不可暂停请确保网络连接稳定</div>
<div class="detailCon">考试结束后可查看成绩和答案解析</div>
<div style="display: flex;justify-content: center;margin-top: 30rpx;">
<div class="rightBtn" v-if="(dates>examInfo.startDate||dates==examInfo.startDate)&&dates<examInfo.dueDate&&examInfo.isContinue!=1">开始考试</div>
<div class="rightBtn" v-if="(dates>examInfo.startDate||dates==examInfo.startDate)&&dates<examInfo.dueDate&&examInfo.isContinue==1">继续考试</div>
</div>
</div>
</div>
</div>
@@ -66,22 +131,138 @@
<script setup>
import { inject, ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
const { $api, navTo, navBack } = inject('globalFunction');
const { $api, navTo, navBack,urls } = inject('globalFunction');
import config from "@/config.js"
const userInfo = ref({});
const Authorization = ref('');
const searchKeyword = ref('');
const pageState = reactive({
page: 0,
list: [],
total: 0,
maxPage: 1,
pageSize: 12,
search: {},
});
const dataList=ref([])
const pageSize=ref(10)
const pageNum=ref(1)
const totalNum=ref(0)
const dates=ref('')
const classification=ref([])
const levalLabels=ref([])
const examInfo = ref({})
const baseUrl = config.imgBaseUrl
const dialogVisible = ref(false);
const handleScrollToLower = () => {
};
onLoad(() => {
getDictionary()
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1; // 月份从0开始需要加1
let day = date.getDate();
month=month>9?month:'0'+month
day=day>9?day:'0'+day
dates.value=year+'-'+month+'-'+day
Authorization.value=uni.getStorageSync('Padmin-Token')||''
getHeart();
});
function getHeart() {
const raw =Authorization.value;
const token = typeof raw === "string" ? raw.trim() : "";
const headers = token ? { 'Authorization': raw.startsWith("Bearer ") ? raw : `Bearer ${token}` }: {}
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
if (resData.code == 200) {
getUserInfo();
} else {
navTo('/packageB/login')
}
});
};
function getUserInfo(){
let header={
'Authorization':Authorization.value
}
$api.myRequest('/system/user/login/user/info', {},'get',10100,header).then((resData) => {
userInfo.value = resData.info || {};
getDataList('refresh');
});
};
function getDictionary(){
$api.myRequest('/system/public/dict/data/type/question_classification', {},'get',9100).then((resData) => {
classification.value=resData.data
});
$api.myRequest('/system/public/dict/data/type/question_level', {},'get',9100).then((resData) => {
levalLabels.value=resData.data
});
}
// 搜索视频
function searchVideo() {
getDataList('refresh');
}
// 清除搜索内容
function clearSearch() {
searchKeyword.value = '';
getDataList('refresh');
}
// 获取考试列表
function getDataList(type = 'add') {
let maxPage=Math.ceil(totalNum.value/pageSize.value)
let params={}
if (type === 'refresh') {
pageNum.value = 1;
params={
name:searchKeyword.value,
pageSize:pageSize.value,
pageNum:pageNum.value,
userId:userInfo.value.userId
}
$api.myRequest('/train/public/trainExamDash/getExamPublishTable', params).then((resData) => {
if(resData.code==200){
dataList.value=resData.rows
totalNum.value=resData.total
}
});
}
if (type === 'add' && pageNum.value < maxPage) {
pageNum.value += 1;
params={
name:searchKeyword.value,
pageSize:pageSize.value,
pageNum:pageNum.value,
userId:userInfo.value.userId
}
$api.myRequest('/train/public/trainExamDash/getExamPublishTable', params).then((resData) => {
if(resData.code==200){
dataList.value=dataList.value.concat(resData.rows)
totalNum.value=resData.total
}
});
}
}
function collects(row,i){
$api.myRequest('/train/public/examUser/addOrUpdateExamUser', {
userId:userInfo.value.userId,
examPaperId:row.examPaperId,
collect:i,
}).then((resData) => {
if(resData.code==200){
if(i==1){
$api.msg('收藏成功',2000)
}else{
$api.msg('已取消收藏',2000)
}
getDataList('refresh');
}
});
}
function handleDetail(row){
$api.myRequest('/train/public/trainExamDash/getExamPublishModel', {
userId:userInfo.value.userId,
examPaperId:row.examPaperId,
}).then((resData) => {
if(resData&&resData.code==200){
examInfo.value=resData.data
dialogVisible.value=true;
}
});
}
function jumps(url){
navTo(url);
}
@@ -149,10 +330,10 @@ function clones(){
}
.main-scroll {
width: 100%;
height: 100%;
height: 90%;
.cards{
width: 100%;
height: 260rpx;
height: 280rpx;
background: linear-gradient(0deg, #E3EFFF 0%, #FBFDFF 100%);
// box-shadow: 0px 0px 6px 0px rgba(0,71,200,0.32);
border-radius: 12rpx;
@@ -187,35 +368,15 @@ function clones(){
line-height: 38rpx;
margin-left: 10rpx;
}
.primary{
border: 1px solid #157EFF;
color: #157EFF
}
.success{
border: 1px solid #05A636;
color: #05A636
}
.info{
border: 1px solid #898989;
color: #898989
}
}
.rightBtn{
width: 140rpx;
height: 44rpx;
line-height: 44rpx;
background: linear-gradient(90deg, #00C0FA 0%, #1271FF 100%);
border-radius: 4px;
color: #fff;
font-size: 24rpx;
text-align: center
}
}
.heng{
width: 120rpx;
height: 4rpx;
background: linear-gradient(88deg, #015EEA 0%, #00C0FA 100%);
margin: 10rpx 0 30rpx;
margin: 10rpx 0 20rpx;
}
.cardCon{
display: flex;
@@ -226,7 +387,11 @@ function clones(){
color: #666666;
display: flex;
align-items: center
margin-bottom: 20rpx;
margin-bottom: 10rpx;
}
.status-tags{
display: flex;
align-items: center;
}
}
.flooter{
@@ -238,6 +403,7 @@ function clones(){
font-size: 28rpx;
margin-left: 30rpx;
color: #2175F3;
padding-top: 14rpx;
}
}
}
@@ -254,7 +420,7 @@ function clones(){
padding: 100rpx 50rpx;
box-sizing: border-box;
.cardCon{
height: 100%;
height: 70%;
background-color: #fff;
padding: 20rpx;
box-sizing: border-box;
@@ -269,4 +435,83 @@ function clones(){
}
}
}
.titleType{
display: inline-block
border-radius: 4px;
font-size: 22rpx;
color: #157EFF;
width: 100rpx;
height: 38rpx;
text-align: center;
line-height: 38rpx;
margin-left: 10rpx;
}
.primary{
border: 1px solid #157EFF!important;
color: #157EFF!important
}
.success{
border: 1px solid #05A636!important;
color: #05A636!important
}
.info{
border: 1px solid #898989!important;
color: #898989!important
}
.tertiary{
border: 1px solid #E6A340!important;
color: #E6A340!important
}
.primary2{
border: 1px solid #F56C6C!important;
color: #F56C6C!important
}
.rightBtn{
width: 140rpx;
height: 44rpx;
line-height: 44rpx;
background: linear-gradient(90deg, #00C0FA 0%, #1271FF 100%);
border-radius: 4px;
color: #fff;
font-size: 24rpx;
text-align: center;
}
.detailTitle{
font-size: 32rpx;
font-weight: 600;
margin: 30rpx 0;
}
.detailCon{
font-size: 28rpx;
line-height: 40rpx;
}
.exam-info {
display: flex;
justify-content: space-between;
margin-bottom: 35rpx;
margin-top: 20rpx;
}
.info-item {
flex: 1;
text-align: center;
}
.info-value {
font-family: 'D-DIN-Medium';
font-size: 26rpx;
font-weight: 600;
color: #409EFF;
margin-bottom: 8rpx;
}
.info-label {
font-size: 26rpx;
color: #333;
}
.info-divider {
width: 2px;
background-color: #C3E1FF;
}
</style>

View File

@@ -0,0 +1,605 @@
<template>
<div class="app-box">
<image src="../../../static/images/train/bj.jpg" class="bjImg" mode=""></image>
<div class="con-box">
<div class="header">
<div>正确率{{accuracyRate}}%</div>
<div>用时{{formattedTime}}</div>
<div class="headBtn" v-if="isRunning" @click="pause">暂停</div>
<div class="headBtn" v-if="!isRunning" @click="start">继续</div>
</div>
<div class="problemCard">
<div v-for="(item,index) in problemData" :key="index">
<template v-if="questionIndex==(index+1)">
<div class="problemTitle">
<span class="titleType" v-if="item.type=='single'">单选题</span>
<span class="titleType" v-if="item.type=='multiple'">多选题</span>
<span class="titleType" v-if="item.type=='judge'">判断题</span>
<span>{{item.content}}</span>
</div>
<div class="options" v-if="item.type=='single'">
<div class="opt" @click="selected(i)" :class="radio!==''&&i==radio?'active':''" v-for="(val,i) in parseOptions(item.trainChooses)">
<div class="optLab">{{indexToLetter(i)}}</div>
<span>{{val}}</span>
</div>
</div>
<div class="options" v-if="item.type=='multiple'">
<div class="opt" @click="selected2(i)" :class="judgment(i)?'active':''" v-for="(val,i) in parseOptions(item.trainChooses)">
<div class="optLab">{{indexToLetter(i)}}</div>
<span>{{val}}</span>
</div>
</div>
<div class="options" v-if="item.type=='judge'">
<div class="opt" @click="selected3('正确')" :class="radio2=='正确'?'active':''">
<span>正确</span>
</div>
<div class="opt" @click="selected3('错误')" :class="radio2=='错误'?'active':''">
<span>错误</span>
</div>
</div>
<div class="analysis" v-if="analysis">
<div class="analysisHead correct" v-if="judgWhether=='正确'">
<div>回答正确</div>
<div></div>
</div>
<div class="analysisHead errors" v-if="judgWhether=='错误'">
<div>回答错误</div>
<div></div>
</div>
<div class="analysisCon">
<div class="parse1">正确答案</div>
<div class="parse2" v-if="item.type=='single'" style="color: #30A0FF;font-weight: bold;">{{String.fromCharCode(65 + Number(item.answer))}}.</div>
<div class="parse2" v-if="item.type=='multiple'" style="color: #30A0FF;font-weight: bold;">
<span v-for="(val,i) in parseOptions(item.answer)">{{indexToLetter(val-1)}}.</span>
</div>
<div class="parse2" v-if="item.type=='judge'" style="color: #30A0FF;font-weight: bold;">{{item.answer}}</div>
</div>
<div class="analysisCon">
<div class="parse1">答案解析</div>
<div class="parse2">{{item.answerDesc}}</div>
</div>
<div class="analysisCon">
<div class="parse1">知识点</div>
<div>
<el-tag style="margin-right: 10px;">{{item.knowledgePoint}}</el-tag>
</div>
</div>
</div>
<div class="problemBtns">
<div v-if="analysis&&judgWhether!=''&&questionIndex!=problemData.length" @click="questionIndex+=1">下一题</div>
<div v-else :class="((radio===''&&radio2===''&&checkList.length==0&&isRunning)||analysis)?'events':''" @click="submit()">提交答案</div>
</div>
</template>
</div>
</div>
<div class="footer">
<div class="footerLeft">
<div class="zuo" :class="questionIndex==1?'events':''" @click="questionIndex-=1"></div>
<div class="you" :class="questionIndex==problemData.length?'events':''" @click="questionIndex+=1"></div>
<div @click="collect(1)" style="text-align: center;font-size: 24rpx;" v-if="(problemData[questionIndex - 1]?.isCollect || 0)!=1">
<image :src="urls+'wsc.png'" mode="" style="width: 34rpx;height: 32rpx;"></image>
<div>收藏</div>
</div>
<div @click="collect(0)" style="text-align: center;font-size: 24rpx;" v-if="(problemData[questionIndex - 1]?.isCollect || 0)==1">
<image :src="urls+'video-sc.png'" mode="" style="width: 34rpx;height: 32rpx;"></image>
<div>取消</div>
</div>
</div>
<div class="footerBtn" @click="exit()">完成练习</div>
<div class="footerLeft">
<div>
<div class="icons" style="background-color: #1CADF5;"></div>
<div class="texts" style="color: #1CADF5;">{{correctIndex}}</div>
</div>
<div>
<div class="icons" style="background-color: #FF6668;">×</div>
<div class="texts" style="color: #FF6668;">{{errorsIndex}}</div>
</div>
<div @click="dialogVisible=true">
<div><span style="color: #1CADF5;">{{questionIndex}}</span>/{{problemData.length}}</div>
<div>题号</div>
</div>
</div>
</div>
</div>
<div class="cards" v-if="dialogVisible">
<div class="cardCon">
<div class="cardHead">
<div>题号</div>
<div style="font-size: 40rpx;" @click="clones()">×</div>
</div>
<div class="questionNums">
<div class="questions" :class="item.whether=='正确'?'questionCorrect':item.whether=='错误'?'questionError':questionIndex==(index+1)?'questionsActive':''" @click="switchs(index)" v-for="(item,index) in problemList" :key="index">{{index+1}}</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { reactive, inject, watch, ref, onMounted,onBeforeUnmount,computed } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api,urls , navTo,navBack , vacanciesTo, formatTotal, config } = inject('globalFunction');
import useUserStore from '@/stores/useUserStore';
import useDictStore from '@/stores/useDictStore';
const userInfo = ref({});
const Authorization = ref('');
const radio = ref('');
const radio2 = ref('');
const checkList = ref([]);
const questionIndex = ref(1);
const correctIndex = ref(0);
const errorsIndex = ref(0);
const accuracyRate = ref(0);
const elapsedTime = ref(0);
const analysis = ref(false);
const judgWhether = ref('');
const isRunning = ref(false);
const dialogVisible = ref(false);
const problemData = ref([]);
const problemList = ref([]);
let timer = null;
const formattedTime = computed(() => {
const minutes = Math.floor(elapsedTime.value / 60)
const seconds = elapsedTime.value % 60
return `${padTime(minutes)}:${padTime(seconds)}`
});
watch(questionIndex, (newVal, oldVal) => {
radio.value=""
radio2.value=""
checkList.value=[]
analysis.value=false
judgWhether.value=""
});
// watch(problemData, (newVal, oldVal) => {
// problemList.value=[];
// newVal.forEach((item,i)=>{
// problemList.value.push({index:i+1,whether:""})
// })
// });
onLoad((options) => {
Authorization.value=uni.getStorageSync('Padmin-Token')||''
getHeart();
});
onShow(()=>{
})
onBeforeUnmount(() => {
if (timer) {
clearInterval(timer); // 清除定时器
timer = null; // 防止内存泄漏,确保下次不会再误用已清除的定时器
}
});
function getHeart() {
const raw =Authorization.value;
const token = typeof raw === "string" ? raw.trim() : "";
const headers = token ? { 'Authorization': raw.startsWith("Bearer ") ? raw : `Bearer ${token}` }: {}
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
if (resData.code == 200) {
getUserInfo();
} else {
navTo('/packageB/login')
}
});
};
function getUserInfo(){
let header={
'Authorization':Authorization.value
}
$api.myRequest('/system/user/login/user/info', {},'get',10100,header).then((resData) => {
userInfo.value = resData.info || {};
// userId.value=resData.info.userId
queryData()
});
};
function queryData(){
problemData.value=[]
let header={
'Authorization':Authorization.value,
'Content-Type':"application/x-www-form-urlencoded"
}
$api.myRequest('/train/public/trainPractice/getQuestions', {
userId: userInfo.value.userId
},'post',9100,header).then((resData) => {
resData.forEach((item,i)=>{
problemData.value.push(item)
problemList.value.push({index:i+1,whether:""})
})
start()
accuracyRates()
});
}
function collect(is){
let header={
'Authorization':Authorization.value,
'Content-Type':"application/x-www-form-urlencoded"
}
$api.myRequest('/train/public/questionUser/addOrUpdateCollect', {
userId: userInfo.value.userId,
questionId:problemData.value[questionIndex.value-1].questionId,
collect:is
},'post',9100,header).then((resData) => {
problemData.value[questionIndex.value-1].isCollect=is
});
};
//正确率
function accuracyRates(){
let header={
'Authorization':Authorization.value,
'Content-Type':"application/x-www-form-urlencoded"
}
$api.myRequest('/train/public/trainPractice/getCount', {
userId: userInfo.value.userId,
},'post',9100,header).then((resData) => {
accuracyRate.value=resData.truePresent
});
};
//提交答案
function submit(){
let indexs=questionIndex.value-1
let parm={
questionId:problemData.value[indexs].questionId,
userId:userInfo.value.userId,
answer:problemData.value[indexs].answer
}
if(problemData.value[indexs].type=='single'){
parm.submitAnswer=radio.value
}else if(problemData.value[indexs].type=='multiple'){
parm.submitAnswer=checkList.value.join(',')
}else if(problemData.value[indexs].type=='judge'){
parm.submitAnswer=radio2.value
}
let header={
'Authorization':Authorization.value,
'Content-Type':"application/json"
}
$api.myRequest('/train/public/trainPractice/submitAnswer', parm,'post',9100,header).then((resData) => {
if(resData&&resData.code==200){
analysis.value=true
judgWhether.value=resData.msg
problemList.value[indexs].whether=resData.msg
if(resData.msg=='正确'){
correctIndex.value++
}else if(resData.msg=='错误'){
errorsIndex.value++
}
accuracyRates()
}
});
};
function selected(i){
radio.value=i
};
//多选
function selected2(i){
let arr=checkList.value.join(",")
if(arr.indexOf(i) !== -1){
const index = checkList.value.indexOf(i);
if (index !== -1) {
checkList.value.splice(index, 1);
}
}else{
checkList.value.push(i)
}
};
function judgment(i){
let arr=checkList.value.join(",")
if(arr.indexOf(i) !== -1){
return true
}else{
return false
}
};
function selected3(i){
radio2.value=i
};
// 解析选项
function parseOptions(options) {
if (!options) return [];
// 假设options是字符串格式以分号分隔
if (typeof options === 'string') {
return options.split(',').filter(opt => opt.trim());
}
// 如果是数组,直接返回
if (Array.isArray(options)) {
return options;
}
return [];
};
function indexToLetter(index) {
// 将索引转换为对应的字母
return String.fromCharCode(65 + index);
};
function padTime(time) {
return time < 10 ? `0${time}` : time
};
function start() {
if (isRunning.value) return
isRunning.value = true
timer = setInterval(() => {
elapsedTime.value++
}, 1000)
};
function pause() {
if (!isRunning.value) return
clearInterval(timer)
isRunning.value = false
};
function clones(){
dialogVisible.value=false
};
function switchs(i){
questionIndex.value=(i+1)
dialogVisible.value=false
};
function exit(){
navBack()
}
</script>
<style lang="stylus" scoped>
.app-box{
width: 100%;
height: 100vh;
position: relative;
.bjImg{
position: absolute;
width: 100%;
height: 100%;
}
.con-box{
position: absolute;
width: 100%;
height: 100%;
left: 0;
top:0;
z-index: 10;
padding: 20rpx 28rpx;
box-sizing: border-box;
.header{
height: 100rpx;
padding: 0 10rpx;
display: flex;
align-items: center;
justify-content: space-between;
background: linear-gradient(0deg, #4285EC 0%, #0BBAFB 100%);
color: #fff;
font-size: 26rpx;
border-radius: 10rpx
.headBtn{
background: #499FFF;
border-radius: 4px;
width: 100rpx;
text-align: center;
height: 50rpx;
line-height: 50rpx;
}
}
.problemCard{
margin-top: 30rpx;
.problemTitle{
font-size: 30rpx;
.titleType{
display: inline-block;
background-color: #499FFF;
border-radius: 10rpx 10rpx 10rpx 0;
padding: 8rpx 12rpx;
color: #fff;
font-size: 26rpx;
margin-right: 20rpx;
}
}
.options{
margin-top: 30rpx;
.opt{
height: 60rpx;
/* background-color: #F8F9FA; */
border-radius: 5px;
margin-bottom: 15px;
display: flex;
align-items: center;
padding-left: 30rpx;
box-sizing: border-box;
color: #808080;
font-size: 30rpx;
.optLab{
width: 40rpx;
height: 40rpx;
text-align: center;
line-height: 40rpx;
border-radius: 50%;
background-color: #8C8C8C;
color: #fff;
font-weight: 600;
font-size: 32rpx;
margin-right: 20rpx;
}
}
.active{
background: linear-gradient(90deg, #25A9F5 0%, #B1DBFF 100%);
color: #fff!important;
font-weight: bold;
}
.active>view{
background-color: #fff!important;
color: #25A9F5!important;
}
}
.analysis{
margin-top: 30rpx;
background-color: #fff;
border-radius: 6px;
margin-bottom: 15rpx;
border: 1px solid #10A8FF;
padding: 20rpx;
box-sizing: border-box;
.analysisHead{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 32rpx;
font-family: Microsoft YaHei;
font-weight: bold;
letter-spacing: 2px;
}
.correct{
color: #67C23A;
}
.errors{
color: #F06A6A;
}
.analysisCon{
margin-top: 30rpx;
.parse1{
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: bold;
}
.parse2{
font-size: 26rpx;
color: #333;
margin-top: 10px;
}
}
}
.problemBtns{
display: flex
align-items: center
justify-content: center
view{
width: 140rpx
height: 50rpx
text-align: center
line-height: 50rpx
background-color: #10A8FF
color: #fff
font-size: 28rpx
border-radius: 5rpx
margin-right: 10rpx;
}
}
}
.footer{
width: 100%;
height: 120rpx;
border-top: 1px solid #ddd
position: fixed
bottom: 0
left: 0
display: flex
align-items: center
justify-content: space-between
.footerLeft{
display: flex
align-items: center
font-size: 30rpx;
text-align: center
.zuo{
width: 26rpx;
height: 26rpx;
border-top: 2px solid #666
border-left: 2px solid #666
transform: rotate(-45deg); /* 鼠标悬停时旋转360度 */
margin-left: 60rpx;
}
.you{
width: 26rpx;
height: 26rpx;
border-right: 2px solid #666
border-bottom: 2px solid #666
transform: rotate(-45deg); /* 鼠标悬停时旋转360度 */
// margin-left: 30rpx;
margin-right: 50rpx;
}
.icons{
width: 30rpx;
height: 30rpx;
color: #fff;
text-align: center;
line-height: 30rpx;
border-radius: 50%
}
.texts{
font-size: 24rpx;
}
}
.footerLeft>view{
margin-right: 40rpx;
}
.footerBtn{
width: 140rpx
height: 50rpx
text-align: center
line-height: 50rpx
background-color: #67C23A
color: #fff
font-size: 28rpx
border-radius: 5rpx
}
}
}
.cards{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100vh;
background-color: rgba(0,0,0,0.5);
z-index: 1000;
padding: 100rpx 50rpx;
box-sizing: border-box;
.cardCon{
height: 100%;
background-color: #fff;
padding: 20rpx;
box-sizing: border-box;
.cardHead{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 30rpx;
font-weight: 600;
}
.questionNums{
width: 100%;
display: flex;
flex-wrap: wrap;
}
.questions{
width: 60rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
border-radius: 8rpx;
border: 2px solid #E0E0E0;
font-size: 28rpx;
margin-right: 15px;
cursor: pointer;
}
.questionsActive{
background-color: #F0F9FF;
border: 2px solid #409EFF;
}
.questionCorrect{
background-color: #F0F9FF;
border: 2px solid #64BC38;
color: #6BC441;
}
.questionError{
background-color: #FFF1F0;
border: 2px solid #F56C6C;
color: #F36B6B;
}
}
}
}
.events{
pointer-events: none; /* 这会禁用所有指针事件 */
opacity: 0.5; /* 可选:改变透明度以视觉上表示不可点击 */
cursor: not-allowed; /* 可选:改变鼠标光标样式 */
}
</style>

View File

@@ -68,7 +68,7 @@
</div>
<div class="problemBtns">
<div v-if="analysis&&judgWhether!=''&&questionIndex!=problemData.length" @click="questionIndex+=1">下一题</div>
<div v-else :class="((radio==''&&radio2==''&&checkList.length==0&&isRunning)||analysis)?'events':''" @click="submit()">提交答案</div>
<div v-else :class="((radio===''&&radio2===''&&checkList.length==0&&isRunning)||analysis)?'events':''" @click="submit()">提交答案</div>
</div>
</template>
</div>

View File

@@ -358,6 +358,13 @@
},
{
"path": "train/mockExam/examList",
"style": {
"navigationBarTitleText": "考试列表",
"navigationBarTitleTextSize": "30rpx"
}
},
{
"path": "train/mockExam/startExam",
"style": {
"navigationBarTitleText": "模拟考试",
"navigationBarTitleTextSize": "30rpx"
@@ -369,6 +376,20 @@
"navigationBarTitleText": "查看成绩",
"navigationBarTitleTextSize": "30rpx"
}
},
{
"path": "priority/helpFilter",
"style": {
"navigationBarTitleText": "筛选和帮扶",
"navigationBarTitleTextSize": "30rpx"
}
},
{
"path": "priority/helpFollow",
"style": {
"navigationBarTitleText": "跟进",
"navigationBarTitleTextSize": "30rpx"
}
}
]
},

View File

@@ -130,6 +130,12 @@
</view>
<view class="service-title">测试页面</view>
</view>
<view class="service-item press-button" @click="navToPage">
<view class="service-icon service-icon-10">
<uni-icons type="gear-filled" size="32" color="#FFFFFF"></uni-icons>
</view>
<view class="service-title">帮扶</view>
</view>
</view>
</view>
@@ -742,6 +748,9 @@ const handleLiveClick = () => {
const navToTestPage = () => {
navTo('/pages/test/homepage-test');
};
const navToPage = () =>{
navTo('/packageB/priority/helpFilter');
}
async function loadData() {
try {

View File

@@ -1,5 +1,7 @@
## 2.0.102024-06-07
- 优化 uni-app x 中,size 属性的类型
## 2.0.122025-08-26
- 优化 uni-app x size 类型问题
## 2.0.112025-08-18
- 修复 图标点击事件返回
## 2.0.92024-01-12
fix: 修复图标大小默认值错误的问题
## 2.0.82023-12-14

View File

@@ -11,7 +11,7 @@
* Icons 图标
* @description 用于展示 icon 图标
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
* @property {Number,String} size 图标大小
* @property {Number} size 图标大小
* @property {String} type 图标图案,参考示例
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标

View File

@@ -85,8 +85,8 @@
}
},
methods: {
_onClick() {
this.$emit('click')
_onClick(e) {
this.$emit('click', e)
}
}
}

View File

@@ -1,7 +1,7 @@
{
"id": "uni-icons",
"displayName": "uni-icons 图标",
"version": "2.0.10",
"version": "2.0.12",
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
"keywords": [
"uni-ui",
@@ -11,12 +11,14 @@
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.2.14"
"HBuilderX": "^3.2.14",
"uni-app": "^4.08",
"uni-app-x": "^4.61"
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
@@ -34,54 +36,74 @@
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
"type": "component-vue",
"darkmode": "x",
"i18n": "x",
"widescreen": "x"
},
"uni_modules": {
"dependencies": ["uni-scss"],
"dependencies": [
"uni-scss"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
"tcb": "x",
"aliyun": "x",
"alipay": "x"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y",
"app-uvue": "y"
"uni-app": {
"vue": {
"vue2": "",
"vue3": ""
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
"web": {
"safari": "",
"chrome": ""
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
"app": {
"vue": "",
"nvue": "-",
"android": {
"extVersion": "",
"minVersion": "29"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"钉钉": "y",
"快手": "y",
"飞书": "y",
"京东": "y"
"ios": "√",
"harmony": ""
},
"快应用": {
"华为": "y",
"联盟": "y"
"mp": {
"weixin": "",
"alipay": "",
"toutiao": "√",
"baidu": "√",
"kuaishou": "-",
"jd": "-",
"harmony": "-",
"qq": "√",
"lark": "-"
},
"Vue": {
"vue2": "y",
"vue3": "y"
"quickapp": {
"huawei": "",
"union": ""
}
},
"uni-app-x": {
"web": {
"safari": "√",
"chrome": "√"
},
"app": {
"android": {
"extVersion": "",
"minVersion": "29"
},
"ios": "√",
"harmony": "√"
},
"mp": {
"weixin": "√"
}
}
}
}

View File

@@ -0,0 +1,18 @@
## 1.1.22024-03-28
- 修复 uni-steps为竖排列时文本长度过长引起点错乱的bug
## 1.1.12021-11-22
- 修复 vue3中某些scss变量无法找到的问题
## 1.1.02021-11-19
- 优化 组件UI并提供设计资源详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-steps](https://uniapp.dcloud.io/component/uniui/uni-steps)
## 1.0.82021-05-12
- 新增 项目示例地址
## 1.0.72021-05-06
- 修复 uni-steps 横向布局时,多行文字高度不合理的 bug
## 1.0.62021-04-21
- 优化 添加依赖 uni-icons, 导入后自动下载依赖
## 1.0.52021-02-05
- 优化 组件引用关系通过uni_modules引用组件
## 1.0.42021-02-05
- 调整为uni_modules目录规范

View File

@@ -0,0 +1,280 @@
<template>
<view class="uni-steps">
<view :class="[direction==='column'?'uni-steps__column':'uni-steps__row']">
<view :class="[direction==='column'?'uni-steps__column-text-container':'uni-steps__row-text-container']">
<view v-for="(item,index) in options" :key="index"
:class="[direction==='column'?'uni-steps__column-text':'uni-steps__row-text']">
<text :style="{color:index === active?activeColor:deactiveColor}"
:class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.title}}</text>
<text :style="{color: deactiveColor}"
:class="[direction==='column'?'uni-steps__column-desc':'uni-steps__row-desc']">{{item.desc}}</text>
</view>
</view>
<view :class="[direction==='column'?'uni-steps__column-container':'uni-steps__row-container']">
<view :class="[direction==='column'?'uni-steps__column-line-item':'uni-steps__row-line-item']"
v-for="(item,index) in options" :key="index" :style="{height: direction === 'column'?heightArr[index]+'px':'14px'}">
<view
:class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--before':'uni-steps__row-line--before']"
:style="{backgroundColor:index<=active&&index!==0?activeColor:index===0?'transparent':deactiveColor}">
</view>
<view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']"
v-if="index === active">
<uni-icons :color="activeColor" :type="activeIcon" size="14" />
</view>
<view v-else :class="[direction==='column'?'uni-steps__column-circle':'uni-steps__row-circle']"
:style="{backgroundColor:index<active?activeColor:deactiveColor}" />
<view
:class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--after':'uni-steps__row-line--after']"
:style="{backgroundColor:index<active&&index!==options.length-1?activeColor:index===options.length-1?'transparent':deactiveColor}" />
</view>
</view>
</view>
</view>
</template>
<script>
/**
* Steps 步骤条
* @description 评分组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=34
* @property {Number} active 当前步骤
* @property {String} direction = [row|column] 当前步骤
* @value row 横向
* @value column 纵向
* @property {String} activeColor 选中状态的颜色
* @property {Array} options 数据源,格式为:[{title:'xxx',desc:'xxx'},{title:'xxx',desc:'xxx'}]
*/
export default {
name: 'UniSteps',
props: {
direction: {
// 排列方向 row column
type: String,
default: 'row'
},
activeColor: {
// 激活状态颜色
type: String,
default: '#2979FF'
},
deactiveColor: {
// 未激活状态颜色
type: String,
default: '#B7BDC6'
},
active: {
// 当前步骤
type: Number,
default: 0
},
activeIcon: {
// 当前步骤
type: String,
default: 'checkbox-filled'
},
options: {
type: Array,
default () {
return []
}
} // 数据
},
data() {
return {
heightArr: [],
}
},
mounted() {
//根据内容设置步骤条的长度
if (this.direction === 'column') {
let that = this;
//只能用类选择器用id选择器所获取的元素信息不准确
uni.createSelectorQuery().in(this).selectAll('.uni-steps__column-text').boundingClientRect(data => {
that.heightArr = data.map(item => item.height + 1);
}).exec()
}
},
}
</script>
<style lang="scss">
$uni-primary: #2979ff !default;
$uni-border-color: #EDEDED;
.uni-steps {
/* #ifndef APP-NVUE */
display: flex;
width: 100%;
/* #endif */
/* #ifdef APP-NVUE */
flex: 1;
/* #endif */
flex-direction: column;
}
.uni-steps__row {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
}
.uni-steps__column {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row-reverse;
}
.uni-steps__row-text-container {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: flex-end;
margin-bottom: 8px;
}
.uni-steps__column-text-container {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
flex: 1;
}
.uni-steps__row-text {
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
flex: 1;
flex-direction: column;
}
.uni-steps__column-text {
padding: 6px 0px;
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color: $uni-border-color;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
}
.uni-steps__row-title {
font-size: 14px;
line-height: 16px;
text-align: center;
}
.uni-steps__column-title {
font-size: 14px;
text-align: left;
line-height: 18px;
}
.uni-steps__row-desc {
font-size: 12px;
line-height: 14px;
text-align: center;
}
.uni-steps__column-desc {
font-size: 12px;
text-align: left;
line-height: 18px;
}
.uni-steps__row-container {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
}
.uni-steps__column-container {
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
width: 30px;
flex-direction: column;
}
.uni-steps__row-line-item {
/* #ifndef APP-NVUE */
display: inline-flex;
/* #endif */
flex-direction: row;
flex: 1;
height: 14px;
line-height: 14px;
align-items: center;
justify-content: center;
}
.uni-steps__column-line-item {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
align-items: center;
justify-content: center;
}
.uni-steps__row-line {
flex: 1;
height: 1px;
background-color: #B7BDC6;
}
.uni-steps__column-line {
width: 1px;
background-color: #B7BDC6;
}
.uni-steps__row-line--after {
transform: translateX(1px);
}
.uni-steps__column-line--after {
flex: 1;
transform: translate(0px, 1px);
}
.uni-steps__row-line--before {
transform: translateX(-1px);
}
.uni-steps__column-line--before {
height: 6px;
transform: translate(0px, -13px);
}
.uni-steps__row-circle {
width: 5px;
height: 5px;
border-radius: 50%;
background-color: #B7BDC6;
margin: 0px 3px;
}
.uni-steps__column-circle {
width: 5px;
height: 5px;
border-radius: 50%;
background-color: #B7BDC6;
margin: 4px 0px 5px 0px;
}
.uni-steps__row-check {
margin: 0px 6px;
}
.uni-steps__column-check {
height: 14px;
line-height: 14px;
margin: 2px 0px;
}
</style>

View File

@@ -0,0 +1,87 @@
{
"id": "uni-steps",
"displayName": "uni-steps 步骤条",
"version": "1.1.2",
"description": "步骤条组件,提供横向和纵向两种布局格式。",
"keywords": [
"uni-ui",
"uniui",
"步骤条",
"时间轴"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [
"uni-scss",
"uni-icons"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

View File

@@ -0,0 +1,13 @@
## Steps 步骤条
> **组件名uni-steps**
> 代码块: `uSteps`
步骤条,常用于显示进度
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-steps)
#### 如使用过程中有任何问题或者您对uni-ui有一些好的建议欢迎加入 uni-ui 交流群871950839