修改完善
This commit is contained in:
parent
1a3572800f
commit
de22dd70ff
11
api/train.js
11
api/train.js
|
|
@ -59,3 +59,14 @@ export const bannerList = (query) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 记录列表
|
||||||
|
export const recordList = (query) => {
|
||||||
|
return apiResquest({
|
||||||
|
url: 'v1/record.list',
|
||||||
|
method: 'get',
|
||||||
|
query: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@
|
||||||
<view>
|
<view>
|
||||||
<u-sticky>
|
<u-sticky>
|
||||||
<view style="position: relative;">
|
<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 class="search-input">
|
||||||
<view style="width: 90%;margin: 0 auto;">
|
<view style="width: 90%;margin: 0 auto;">
|
||||||
<u-search @search='search' searchIconColor='#e6e6e6' placeholderColor='#e6e6e6' color='#FFFFFF'
|
<u-search @search='search' searchIconColor='#e6e6e6' placeholderColor='#e6e6e6' color='#FFFFFF'
|
||||||
|
|
@ -58,7 +59,7 @@
|
||||||
queryParams: {
|
queryParams: {
|
||||||
asset_name: "",
|
asset_name: "",
|
||||||
org_id: getApp().globalData.org_id,
|
org_id: getApp().globalData.org_id,
|
||||||
type: 1,
|
type: 3,
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
},
|
},
|
||||||
|
|
@ -66,22 +67,27 @@
|
||||||
assetList: [],
|
assetList: [],
|
||||||
|
|
||||||
tabsList: [{
|
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',
|
img: '/static/img/demo/zhaopin.png',
|
||||||
imgSelect: '/static/img/demo/zhaopin-select.png',
|
imgSelect: '/static/img/demo/zhaopin-select.png',
|
||||||
title: '招聘',
|
title: '招聘',
|
||||||
type: 1
|
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: {},
|
userInfo: {},
|
||||||
|
|
@ -136,7 +142,7 @@
|
||||||
getBannerList() {
|
getBannerList() {
|
||||||
bannerList({
|
bannerList({
|
||||||
position: 'home',
|
position: 'home',
|
||||||
org_id:getApp().globalData.org_id
|
org_id: getApp().globalData.org_id
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.swiperList = res.data
|
this.swiperList = res.data
|
||||||
})
|
})
|
||||||
|
|
@ -184,20 +190,41 @@
|
||||||
url: '/pages/news/news-topic-cate?type=' + this.queryParams.type
|
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) {
|
getPdfInfo(item) {
|
||||||
// pdf文档
|
var that = this
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载文档中..'
|
title: '加载文档中..'
|
||||||
})
|
})
|
||||||
assetInfo({
|
assetInfo({
|
||||||
id: item.asset_id
|
id: item.asset_id
|
||||||
}).then(res => {
|
}).then(Response => {
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: res.data.pdf_url,
|
url: Response.data.pdf_url,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
uni.openDocument({
|
uni.openDocument({
|
||||||
filePath: res.tempFilePath,
|
filePath: res.tempFilePath,
|
||||||
fileType: 'pdf',
|
fileType: that.getFileType(Response.data.pdf_url),
|
||||||
showMenu: true,
|
showMenu: true,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
|
@ -217,15 +244,21 @@
|
||||||
goTopicDetail(item) {
|
goTopicDetail(item) {
|
||||||
switch (this.queryParams.type) {
|
switch (this.queryParams.type) {
|
||||||
case 1:
|
case 1:
|
||||||
|
// 招聘
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/home/detail?assets_id=' + item.asset_id
|
url: '/pages/home/detail?assets_id=' + item.asset_id
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
// 职业
|
||||||
|
this.getPdfInfo(item)
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
// 创业
|
||||||
this.getPdfInfo(item)
|
this.getPdfInfo(item)
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
// 课程
|
// 适应
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/news/course?assets_id=' + item.asset_id
|
url: '/pages/news/course?assets_id=' + item.asset_id
|
||||||
})
|
})
|
||||||
|
|
@ -271,7 +304,7 @@
|
||||||
height: 180rpx;
|
height: 180rpx;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
width: 80%;
|
width: 82%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
// border: solid 1px red;
|
// border: solid 1px red;
|
||||||
|
|
@ -284,12 +317,12 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.images {
|
.images {
|
||||||
width: 65rpx;
|
width: 60rpx;
|
||||||
height: 65rpx;
|
height: 60rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text1 {
|
.text1 {
|
||||||
font-size: 28rpx;
|
font-size: 26rpx;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
@ -297,14 +330,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
width: 20%;
|
width: 18%;
|
||||||
// border:solid 1px blue;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.images1 {
|
.images1 {
|
||||||
width: 60rpx;
|
width: 55rpx;
|
||||||
height: 60rpx;
|
height: 55rpx;
|
||||||
|
padding-right: 10rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@
|
||||||
import {
|
import {
|
||||||
groupList,
|
groupList,
|
||||||
assetList,
|
assetList,
|
||||||
assetInfo
|
assetInfo,
|
||||||
|
recordList
|
||||||
} from '@/api/train.js'
|
} from '@/api/train.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -59,17 +60,24 @@
|
||||||
// groupList: [],
|
// groupList: [],
|
||||||
assetList: [],
|
assetList: [],
|
||||||
typeList: [{
|
typeList: [{
|
||||||
type: 1,
|
type: 3,
|
||||||
name: '招聘'
|
name: '适应'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 2,
|
type: 2,
|
||||||
name: '技能'
|
name: '职业'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 4,
|
||||||
name: '课程'
|
name: '创业'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
type: 1,
|
||||||
|
name: '招聘'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
count: 0,
|
count: 0,
|
||||||
status: 'loadmore',
|
status: 'loadmore',
|
||||||
|
|
@ -107,7 +115,7 @@
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中...'
|
title: '加载中...'
|
||||||
})
|
})
|
||||||
var res = await assetList(that.queryParams)
|
var res = await recordList(that.queryParams)
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if (res.data.length < that.queryParams.limit) {
|
if (res.data.length < that.queryParams.limit) {
|
||||||
|
|
@ -125,20 +133,39 @@
|
||||||
uni.hideLoading()
|
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) {
|
getPdfInfo(item) {
|
||||||
// pdf文档
|
var that = this
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载文档中..'
|
title: '加载文档中..'
|
||||||
})
|
})
|
||||||
assetInfo({
|
assetInfo({
|
||||||
id: item.asset_id
|
id: item.asset_id
|
||||||
}).then(res => {
|
}).then(Response => {
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: res.data.pdf_url,
|
url: Response.data.pdf_url,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
uni.openDocument({
|
uni.openDocument({
|
||||||
filePath: res.tempFilePath,
|
filePath: res.tempFilePath,
|
||||||
fileType: 'pdf',
|
fileType: that.getFileType(Response.data.pdf_url),
|
||||||
showMenu: true,
|
showMenu: true,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
|
@ -166,6 +193,10 @@
|
||||||
case 2:
|
case 2:
|
||||||
this.getPdfInfo(item)
|
this.getPdfInfo(item)
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
// 创业
|
||||||
|
this.getPdfInfo(item)
|
||||||
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
// 课程
|
// 课程
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
<!-- 广告位 -->
|
<!-- 广告位 -->
|
||||||
<view class="wrap-cards">
|
<view v-if="swiperList.length>0" class="wrap-cards">
|
||||||
<!-- <image class="adv-img rounded-20" src="../../static/img/demo/winter1.jpeg" mode="aspectFill"></image> -->
|
|
||||||
<u-swiper :list="swiperList" keyName="src" interval='10000' circular height="180rpx"
|
<u-swiper :list="swiperList" keyName="src" interval='10000' circular height="180rpx"
|
||||||
bgColor="#ffffff"></u-swiper>
|
bgColor="#ffffff"></u-swiper>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -88,17 +87,6 @@
|
||||||
icon: 'iconshezhi1',
|
icon: 'iconshezhi1',
|
||||||
name: '修改资料',
|
name: '修改资料',
|
||||||
url: 'set'
|
url: 'set'
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'iconshenhe',
|
|
||||||
name: '役士兵职业技能培训申请表',
|
|
||||||
url: 'file2'
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'iconshenhe',
|
|
||||||
name: '退役士兵教育培训承训机构申请表',
|
|
||||||
url: 'file1'
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
|
|
@ -111,7 +99,6 @@
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getUserInfo()
|
this.getUserInfo()
|
||||||
this.getFileGet()
|
|
||||||
},
|
},
|
||||||
// 监听导航栏按钮点击
|
// 监听导航栏按钮点击
|
||||||
onNavigationBarButtonTap() {
|
onNavigationBarButtonTap() {
|
||||||
|
|
@ -127,13 +114,7 @@
|
||||||
this.swiperList = res.data
|
this.swiperList = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getFileGet() {
|
|
||||||
fileGet().then(res => {
|
|
||||||
this.flieList = res.data
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getUserInfo() {
|
getUserInfo() {
|
||||||
userInfo().then(res => {
|
userInfo().then(res => {
|
||||||
this.userInfo = res.data
|
this.userInfo = res.data
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<!-- 新鲜事页/话题分类 -->
|
<!-- 新鲜事页/话题分类 -->
|
||||||
<view class="news-topic-cate">
|
<view class="news-topic-cate">
|
||||||
<u-navbar placeholder>
|
<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;">
|
<view slot="center" style="margin-right: 100rpx;">
|
||||||
<u-search v-model="queryParams.asset_name" placeholder="搜索您想要的内容" @search='search'
|
<u-search v-model="queryParams.asset_name" placeholder="搜索您想要的内容" @search='search'
|
||||||
:showAction="false"></u-search>
|
:showAction="false"></u-search>
|
||||||
|
|
@ -118,20 +118,39 @@
|
||||||
uni.hideLoading()
|
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) {
|
getPdfInfo(item) {
|
||||||
// pdf文档
|
var that = this
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载文档中..'
|
title: '加载文档中..'
|
||||||
})
|
})
|
||||||
assetInfo({
|
assetInfo({
|
||||||
id: item.asset_id
|
id: item.asset_id
|
||||||
}).then(res => {
|
}).then(Response => {
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: res.data.pdf_url,
|
url: Response.data.pdf_url,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
uni.openDocument({
|
uni.openDocument({
|
||||||
filePath: res.tempFilePath,
|
filePath: res.tempFilePath,
|
||||||
fileType: 'pdf',
|
fileType: that.getFileType(Response.data.pdf_url),
|
||||||
showMenu: true,
|
showMenu: true,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
|
@ -147,9 +166,9 @@
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
goTopicDetail(item) {
|
goTopicDetail(item) {
|
||||||
console.log(item,'item');
|
console.log(item, 'item');
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 1:
|
case 1:
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
@ -157,6 +176,11 @@
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
// 职业
|
||||||
|
this.getPdfInfo(item)
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
// 创业
|
||||||
this.getPdfInfo(item)
|
this.getPdfInfo(item)
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 702 B |
Binary file not shown.
|
After Width: | Height: | Size: 718 B |
Loading…
Reference in New Issue