修改完善

This commit is contained in:
张文涛 2024-10-30 23:21:23 +08:00
parent 1a3572800f
commit de22dd70ff
7 changed files with 146 additions and 66 deletions

View File

@ -59,3 +59,14 @@ export const bannerList = (query) => {
})
}
// 记录列表
export const recordList = (query) => {
return apiResquest({
url: 'v1/record.list',
method: 'get',
query: query
})
}

View File

@ -2,7 +2,8 @@
<view>
<u-sticky>
<view style="position: relative;">
<u-swiper :list="swiperList" keyName="src" interval='10000' circular height="470rpx" bgColor="#ffffff"></u-swiper>
<u-swiper :list="swiperList" keyName="src" interval='10000' circular height="470rpx"
bgColor="#ffffff"></u-swiper>
<view class="search-input">
<view style="width: 90%;margin: 0 auto;">
<u-search @search='search' searchIconColor='#e6e6e6' placeholderColor='#e6e6e6' color='#FFFFFF'
@ -58,7 +59,7 @@
queryParams: {
asset_name: "",
org_id: getApp().globalData.org_id,
type: 1,
type: 3,
page: 1,
limit: 10,
},
@ -66,22 +67,27 @@
assetList: [],
tabsList: [{
img: '/static/img/demo/kecheng.png',
imgSelect: '/static/img/demo/kecheng-select.png',
title: '适应',
type: 3
}, {
img: '/static/img/demo/chuangye.png',
imgSelect: '/static/img/demo/chuangye-select.png',
title: '职业',
type: 2
},
{
img: '/static/img/demo/jineng.png',
imgSelect: '/static/img/demo/jineng-select.png',
title: '创业',
type: 4
},
{
img: '/static/img/demo/zhaopin.png',
imgSelect: '/static/img/demo/zhaopin-select.png',
title: '招聘',
type: 1
},
{
img: '/static/img/demo/jineng.png',
imgSelect: '/static/img/demo/jineng-select.png',
title: '技能',
type: 2
},
{
img: '/static/img/demo/kecheng.png',
imgSelect: '/static/img/demo/kecheng-select.png',
title: '课程',
type: 3
}
],
userInfo: {},
@ -136,7 +142,7 @@
getBannerList() {
bannerList({
position: 'home',
org_id:getApp().globalData.org_id
org_id: getApp().globalData.org_id
}).then(res => {
this.swiperList = res.data
})
@ -184,20 +190,41 @@
url: '/pages/news/news-topic-cate?type=' + this.queryParams.type
})
},
getFileType(url) {
// URL
const fileName = url.split('/').pop();
//
const fileExtension = fileName.split('.').pop().toLowerCase();
//
const fileTypes = {
'doc': 'doc',
'xls': 'xls',
'ppt': 'ppt',
'pdf': 'pdf',
'docx': 'docx',
'xlsx': 'xlsx',
'pptx': 'pptx'
};
// 'unknown'
return fileTypes[fileExtension] || 'unknown';
},
getPdfInfo(item) {
// pdf
var that = this
uni.showLoading({
title: '加载文档中..'
})
assetInfo({
id: item.asset_id
}).then(res => {
}).then(Response => {
uni.downloadFile({
url: res.data.pdf_url,
url: Response.data.pdf_url,
success: function(res) {
uni.openDocument({
filePath: res.tempFilePath,
fileType: 'pdf',
fileType: that.getFileType(Response.data.pdf_url),
showMenu: true,
success: function(res) {
uni.hideLoading()
@ -217,15 +244,21 @@
goTopicDetail(item) {
switch (this.queryParams.type) {
case 1:
//
uni.navigateTo({
url: '/pages/home/detail?assets_id=' + item.asset_id
})
break;
case 2:
//
this.getPdfInfo(item)
break;
case 4:
//
this.getPdfInfo(item)
break;
case 3:
//
//
uni.navigateTo({
url: '/pages/news/course?assets_id=' + item.asset_id
})
@ -271,7 +304,7 @@
height: 180rpx;
.left {
width: 80%;
width: 82%;
display: flex;
align-items: center;
// border: solid 1px red;
@ -284,12 +317,12 @@
align-items: center;
.images {
width: 65rpx;
height: 65rpx;
width: 60rpx;
height: 60rpx;
}
.text1 {
font-size: 28rpx;
font-size: 26rpx;
color: #000000;
margin-top: 10rpx;
}
@ -297,14 +330,14 @@
}
.right {
width: 20%;
// border:solid 1px blue;
width: 18%;
display: flex;
justify-content: center;
.images1 {
width: 60rpx;
height: 60rpx;
width: 55rpx;
height: 55rpx;
padding-right: 10rpx;
}
}
}

View File

@ -35,7 +35,8 @@
import {
groupList,
assetList,
assetInfo
assetInfo,
recordList
} from '@/api/train.js'
export default {
components: {
@ -59,17 +60,24 @@
// groupList: [],
assetList: [],
typeList: [{
type: 1,
name: '招聘'
type: 3,
name: '适应'
},
{
type: 2,
name: '技能'
name: '职业'
},
{
type: 3,
name: '课程'
type: 4,
name: '创业'
},
{
type: 1,
name: '招聘'
}
],
count: 0,
status: 'loadmore',
@ -107,7 +115,7 @@
uni.showLoading({
title: '加载中...'
})
var res = await assetList(that.queryParams)
var res = await recordList(that.queryParams)
uni.hideLoading()
if (res.code == 0) {
if (res.data.length < that.queryParams.limit) {
@ -125,20 +133,39 @@
uni.hideLoading()
}
},
getFileType(url) {
// URL
const fileName = url.split('/').pop();
//
const fileExtension = fileName.split('.').pop().toLowerCase();
//
const fileTypes = {
'doc': 'doc',
'xls': 'xls',
'ppt': 'ppt',
'pdf': 'pdf',
'docx': 'docx',
'xlsx': 'xlsx',
'pptx': 'pptx'
};
// 'unknown'
return fileTypes[fileExtension] || 'unknown';
},
getPdfInfo(item) {
// pdf
var that = this
uni.showLoading({
title: '加载文档中..'
})
assetInfo({
id: item.asset_id
}).then(res => {
}).then(Response => {
uni.downloadFile({
url: res.data.pdf_url,
url: Response.data.pdf_url,
success: function(res) {
uni.openDocument({
filePath: res.tempFilePath,
fileType: 'pdf',
fileType: that.getFileType(Response.data.pdf_url),
showMenu: true,
success: function(res) {
uni.hideLoading()
@ -166,6 +193,10 @@
case 2:
this.getPdfInfo(item)
break;
case 4:
//
this.getPdfInfo(item)
break;
case 3:
//
uni.navigateTo({

View File

@ -26,8 +26,7 @@
</view>
</view> -->
<!-- 广告位 -->
<view class="wrap-cards">
<!-- <image class="adv-img rounded-20" src="../../static/img/demo/winter1.jpeg" mode="aspectFill"></image> -->
<view v-if="swiperList.length>0" class="wrap-cards">
<u-swiper :list="swiperList" keyName="src" interval='10000' circular height="180rpx"
bgColor="#ffffff"></u-swiper>
</view>
@ -88,17 +87,6 @@
icon: 'iconshezhi1',
name: '修改资料',
url: 'set'
},
{
icon: 'iconshenhe',
name: '役士兵职业技能培训申请表',
url: 'file2'
},
{
icon: 'iconshenhe',
name: '退役士兵教育培训承训机构申请表',
url: 'file1'
}
],
userInfo: {},
@ -111,7 +99,6 @@
},
onShow() {
this.getUserInfo()
this.getFileGet()
},
//
onNavigationBarButtonTap() {
@ -127,13 +114,7 @@
this.swiperList = res.data
})
},
getFileGet() {
fileGet().then(res => {
this.flieList = res.data
})
},
getUserInfo() {
userInfo().then(res => {
this.userInfo = res.data

View File

@ -2,7 +2,7 @@
<!-- 新鲜事页/话题分类 -->
<view class="news-topic-cate">
<u-navbar placeholder>
<u-icon slot="left" @click="nav" name="arrow-left" color="#000000" size="22"></u-icon>
<u-icon slot="left" @click="nav" name="arrow-left" color="#000000" size="22"></u-icon>
<view slot="center" style="margin-right: 100rpx;">
<u-search v-model="queryParams.asset_name" placeholder="搜索您想要的内容" @search='search'
:showAction="false"></u-search>
@ -118,20 +118,39 @@
uni.hideLoading()
}
},
getFileType(url) {
// URL
const fileName = url.split('/').pop();
//
const fileExtension = fileName.split('.').pop().toLowerCase();
//
const fileTypes = {
'doc': 'doc',
'xls': 'xls',
'ppt': 'ppt',
'pdf': 'pdf',
'docx': 'docx',
'xlsx': 'xlsx',
'pptx': 'pptx'
};
// 'unknown'
return fileTypes[fileExtension] || 'unknown';
},
getPdfInfo(item) {
// pdf
var that = this
uni.showLoading({
title: '加载文档中..'
})
assetInfo({
id: item.asset_id
}).then(res => {
}).then(Response => {
uni.downloadFile({
url: res.data.pdf_url,
url: Response.data.pdf_url,
success: function(res) {
uni.openDocument({
filePath: res.tempFilePath,
fileType: 'pdf',
fileType: that.getFileType(Response.data.pdf_url),
showMenu: true,
success: function(res) {
uni.hideLoading()
@ -147,9 +166,9 @@
});
})
},
goTopicDetail(item) {
console.log(item,'item');
console.log(item, 'item');
switch (item.type) {
case 1:
uni.navigateTo({
@ -157,6 +176,11 @@
})
break;
case 2:
//
this.getPdfInfo(item)
break;
case 4:
//
this.getPdfInfo(item)
break;
case 3:

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B