task#15348,列表接口获取更换

This commit is contained in:
2024-10-08 16:30:04 +08:00
parent 75e014562f
commit 31d3bcf071
4 changed files with 92 additions and 62 deletions

View File

@ -162,14 +162,32 @@ export function notifyInvoiceDetail(data){
data
})
}
// /supplier/supplierTrainingMaterials/pageList 获取培训材料列表
export function pageList(data){
// 获取培训材料列表
/*export function pageList(data){
return request({
url:'/supplierAppV2/dispatchApp/user/supplierTrainingMaterialsPageList',
method:'POST',
contentType:'application/json',
data
})
}*/
//获取普通材料
export function getNormalList(key) {
return request({
url: '/supplier/supplierTraining/normalList',
method: 'GET',
params:key
});
}
//获取培训材料
export function getTrainingList(key) {
return request({
url: '/supplier/supplierTraining/trainingList',
method: 'GET',
params:key
});
}
//用户操作权限
export function userOperationPermissions(){

View File

@ -58,19 +58,15 @@
.common{
margin: 0 15px ;
}
.time{
color: rgba(0,0,0,0.7);
}
.imgWrap{
@include wh(100%,200px);
position: relative;
img{
@include wh(100%,100%);
}
/* .name{
position: absolute;
left: 30px;
bottom: 30px;
@include fontWeightSize(bold,14px);
color: #FFFFFF;
}*/
}
.left{
color: red;

View File

@ -11,7 +11,7 @@
>
<template slot="title">
<div v-show="!show">文档资料</div>
<van-field v-model="keyword" placeholder="请输入关键词" v-show="show" @input="getList"/>
<van-field v-model="keyword" placeholder="请输入关键词" v-show="show" @input="getNormalList"/>
</template>
<template slot="right">
<div class="rightWrap" @click="show = !show">
@ -50,30 +50,31 @@
<script>
import {myMixins} from "@/utils/myMixins"
import {pageList} from "@/api/mine";
import {getNormalList} from "@/api/mine";
export default {
name: "docmentList",
mixins:[myMixins],
data(){
return{
tabArr: [{name: '车型技术参数', status: 1}, {name: '中道服务规范', status: 2},{name: '中道小课堂', status: 3}, {name: '新手入列', status: 4},],
tabArr: [{name: '车型技术参数', status: 1}, {name: '中道服务规范', status:2},{name: '中道小课堂', status: 3}, {name: '新手入列', status: 4},],
activeIndex: 0,
pageList:[],
pageNum:1,
pageSize:10,
totalList:[],
/* pageNum:1,
pageSize:10,*/
keyword:'',
trainingType:1,
// trainingType:1,
isLoading:false,
show:false,
showEmpty:false
}
},
mounted() {
this.getList()
this.getNormalList()
},
methods:{
onRefresh() {
this.getList()
this.getNormalList()
setTimeout(() => {
this.$toast('刷新成功');
this.isLoading = false;
@ -81,32 +82,39 @@ export default {
},
async changeTab(index) {
this.activeIndex = index
this.pageNum = 1
this.pageList = [];
if(this.activeIndex === 0){
this.trainingType =1
}else{
this.trainingType=2
}
await this.getList()
await this.getNormalList()
},
async getList(){
let res= await pageList({
pageNum:this.pageNum,
pageSize:this.pageSize,
docType:2,
trainingType:this.trainingType,
keyword:this.keyword || ''
async getNormalList(){
let res= await getNormalList({
type:2,
id:33041,
text:this.keyword || '',
})
this.pageList=res.data;
if(res.data.length === 0){
this.totalList=[]
this.pageList=[]
this.totalList=res.data.list
let result=[]
if(this.activeIndex === 0){
result=this.totalList?.filter(q => q.title === '车型技术参数');
}else if(this.activeIndex === 1){
result=this.totalList?.filter(q => q.title === '中道服务规范');
}else if(this.activeIndex === 2){
result=this.totalList?.filter(q => q.title === '中道小课堂');
}else if(this.activeIndex === 3){
result=this.totalList?.filter(q => q.title === '新手入列');
}
if(result){
this.pageList=result[0].materials
}
if(this.pageList?.length === 0){
this.showEmpty = true
}else {
this.showEmpty = false
} },
}
},
initShow(){
this.keyword= '',
this.getList()
this.getNormalList()
}
}
}

View File

@ -11,7 +11,7 @@
>
<template slot="title">
<div v-show="!show">培训文档</div>
<van-field v-model="keyword" placeholder="请输入关键词" v-show="show" @input="getList"/>
<van-field v-model="keyword" placeholder="请输入关键词" v-show="show" @input="getTrainingList"/>
</template>
<template slot="right">
<div class="rightWrap" @click="show = !show">
@ -31,16 +31,15 @@
<van-pull-refresh v-model="isLoading" @refresh="onRefresh" style="min-height:85vh">
<div class="itemWrap" v-for="(item,index) in pageList" :key="index" @click="goH5Detail(item)">
<div class="info flexBetween common">
<!-- item.mustRead===1-->
<div class="title">{{ item.name }}<span class="read">必读</span></div>
<div class="title">{{ item.name }}<span v-if="item.mustRead===1" class="read">必读</span></div>
<div class="time">{{ item.updateTime }}</div>
</div>
<div class="imgWrap">
<img :src="item.themePicture">
</div>
<div class="num common">{{ item.synopsis }}</div>
<div style="text-align: right" v-if="item.docType?.label !== '普通材料'">
<span style="color: red;font-size: 14px;margin-right: 8px">{{ item.listShowButton==null ? '已处理' : '未处理' }}</span>
<div style="text-align: right" >
<span style="color: red;font-size: 14px;margin-right: 8px">{{ item.alreadyRead===1 ? '已处理' : '未处理' }}</span>
</div>
</div>
</van-pull-refresh>
@ -53,7 +52,7 @@
<script>
import {myMixins} from "@/utils/myMixins"
import {pageList} from "@/api/mine"
import {getTrainingList} from "@/api/mine"
export default {
name: "trainDocment",
computed: {
@ -61,11 +60,12 @@ export default {
mixins:[myMixins],
data(){
return{
tabArr: [{name: '车型技术参数', status: 1}, {name: '中道服务规范', status: 2},{name: '中道小课堂', status: 3}],
tabArr: [{name: '车型技术参数', status: 1}, {name: '中道服务规范', status:2},{name: '中道小课堂', status: 3}],
activeIndex: 0,
pageNum:1,
pageSize:10,
pageList:[],
totalList:[],
keyword:'',
show:false,
showEmpty:false,
@ -73,11 +73,14 @@ export default {
}
},
mounted() {
this.getList();
const urlParams = new URLSearchParams(window.location.search);
const supplierId = urlParams.get('supplierId');
this.$toast(supplierId);
this.getTrainingList();
},
methods:{
onRefresh() {
this.getList()
this.getTrainingList()
setTimeout(() => {
this.$toast('刷新成功');
this.isLoading = false;
@ -85,24 +88,29 @@ export default {
},
async changeTab(index) {
this.activeIndex = index
this.pageNum = 1
this.pageList = [];
if(this.activeIndex === 0){
this.trainingType =1
}else{
this.trainingType=2
}
await this.getList()
await this.getTrainingList()
},
async getList(){
let res= await pageList({
pageNum:this.pageNum,
pageSize:this.pageSize,
docType:1,
keyword:this.keyword || ''
async getTrainingList(){
let res= await getTrainingList({
type:2,
id:33041,
text:this.keyword || '',
})
this.pageList=res.data;
if(res.data.length === 0){
this.totalList=[]
this.pageList=[]
this.totalList=res.data.list
let result=[]
if(this.activeIndex === 0){
result=this.totalList?.filter(q => q.title === '车型技术参数');
}else if(this.activeIndex === 1){
result=this.totalList?.filter(q => q.title === '中道服务规范');
}else if(this.activeIndex === 2){
result=this.totalList?.filter(q => q.title === '中道小课堂');
}
if(result){
this.pageList=result[0].materials
}
if(this.pageList?.length === 0){
this.showEmpty = true
}else {
this.showEmpty = false
@ -110,7 +118,7 @@ export default {
},
initShow(){
this.keyword= '',
this.getList()
this.getTrainingList()
}
}
}