This commit is contained in:
2026-10-08 18:14:56 +08:00
parent dec4ebc773
commit 9cc1ff546c
1081 changed files with 238349 additions and 52163 deletions
+220
View File
@@ -0,0 +1,220 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/article/list">金久信学堂</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>金久信学堂详情</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="w-1200 m-a bg-white p-40">
<view class=" flex justify-between items-center">
<text class="text-50 font-bold">{{ info.name }}</text>
<view class="flex flex-col justify-center items-center">
<star @click.native="changeCollect" theme="outline" size="30" fill="#4a4a4a" strokeLinecap="square"
v-if="!hasCollect" class="pointer"/>
<star @click.native="changeCollect" theme="filled" size="30" fill="#d00243" strokeLinecap="square"
v-else class="pointer"/>
<text>{{ hasCollect ? '已收藏' : '收藏' }}</text>
</view>
</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{ info._add_time_str }}</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom" v-if="userInfo">
<span>剩余</span>
<span class="mx-15 text-main font-bold">{{ userInfo.remainArticleDownloadNum }}</span>
<span>次下载次数</span>
</view>
<view class="py-20 border-bottom flex justify-start flex-col items-start " v-if="info.files">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
附件
</view>
</view>
</view>
<view class="flex justify-start items-start flex-wrap my-25">
<view class="mt-15 mr-15" v-for="(item, index) in info.files" :key="index">
<template v-if="['doc', 'docx'].includes(item.split('.').pop())">
<file-word theme="outline" class="pointer" size="100" fill="#4a90e2" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">
<file-excel theme="outline" class="pointer" size="100" fill="#417505" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['pdf'].includes(item.split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="100" fill="#f5a623"
strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else>
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item]"/>
</template>
</view>
</view>
</view>
<view v-html="info.content" class="mt-20"></view>
</view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template>
<script>
import {FileExcel, FilePdfOne, FileWord, Star} from "@icon-park/vue";
export default {
name: "detail",
components: {FileWord, FilePdfOne, FileExcel, Star},
data() {
return {
info: {
name: '',
content: ''
},
hasCollect: false,
userInfo: null,
}
},
onLoad(option) {
if (option.id) {
this.getInfo(option.id);
this.addView(option.id)
this.getUserInfo()
}
},
onShow() {
this.getUserInfo()
},
methods: {
async getInfo(id) {
this.info = await vk.callFunction({
url: `client/article/list/pub/getDetail`,
data: {id}
});
await this.checkCollect()
},
async getUserInfo() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.userInfo = userInfo
},
addView(id) {
vk.callFunction({
url: `client/article/list/pub/addView`,
data: {id}
});
},
async openDownload(url) {
await this.getUserInfo()
if (this.userInfo.userLevel < 0) return this.$message.error('非会员,无法下载');
// else if (this.userInfo.userLevel === 0) {
const {data} = await vk.callFunction({
url: 'client/article/list/kh/check',
data: {
id: this.info._id,
}
})
if (!data) {
if (this.userInfo.remainArticleDownloadNum === 0) {
return this.$confirm(`下载次数不足,是否购买次数?`, '提示', {
cancelButtonText: '关闭',
}).then(async () => {
const {data} = await vk.callFunction({
url: 'client/order/kh/addDownloadOrder',
title: '请求中...',
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
})
} else {
this.$confirm(`将消耗1次下载次数,是否继续?`, '提示', {
cancelButtonText: '关闭',
}).then(async () => {
this.userInfo.remainArticleDownloadNum -= 1
// await this.getUserInfo()
vk.callFunction({
url: 'client/article/list/pub/addDownload',
data: {
id: this.info._id,
}
})
vk.callFunction({
url: 'client/user/kh/reduceDownloadNum',
})
vk.callFunction({
url: 'client/article/list/kh/addDownload',
data: {
id: this.info._id,
}
})
window.open(url)
})
}
} else {
window.open(url)
}
// } else {
// vk.callFunction({
// url: 'client/article/list/pub/addDownload',
// data: {
// id: this.info._id
// }
// })
// window.open(url)
// }
},
async checkCollect() {
const {data} = await vk.callFunction({
url: 'client/article/collect/kh/check',
data: {
articleId: this.info._id
},
});
this.hasCollect = data
},
changeCollect() {
this.hasCollect = !this.hasCollect
vk.callFunction({
url: 'client/article/collect/kh/changeCollect',
data: {
articleId: this.info._id
},
});
}
}
}
</script>
<style scoped lang="scss">
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid #A92924;
}
}
</style>
+212 -205
View File
@@ -1,241 +1,248 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
</view>
<view class="filter-outer">
<view class="cate">
<view class="item" :class="[activeCateIndex === 0 ? 'active' : '']"
@click="selectCate(0)">
<text class="title">{{ cateList[0].name }}</text>
<text class="remark mt-10">{{ cateList[0].remark }}</text>
</view>
<view class="item" :class="[activeCateIndex === 1 ? 'active' : '']"
@click="selectCate(1)">
<text class="title">{{ cateList[1].name }}</text>
<text class="remark mt-10">{{ cateList[1].remark }}</text>
</view>
<view class="item" :class="[activeCateIndex === -1 ? 'active' : '']"
@click="selectCate(-1)">
<text class="title">乐邦团</text>
<text class="remark mt-10">可提问一些与钢材有关的专业知识问答</text>
</view>
<view class="item" :class="[activeCateIndex === 2 ? 'active' : '']"
@click="selectCate(2)">
<text class="title">{{ cateList[2].name }}</text>
<text class="remark mt-10">{{ cateList[2].remark }}</text>
</view>
<view class="item" :class="[activeCateIndex === -2 ? 'active' : '']"
@click="selectCate(-2)">
<text class="title">金久信风向标</text>
<text class="remark mt-10">平台客户可将宝贵意见和平台需要改进的意见在此发表</text>
</view>
<view class="item mt-20" @click="toMySchool">
<text class="title text-main">我的学堂</text>
<text class="remark mt-10">我上传和下载的文档</text>
</view>
</view>
<view class="content-wrap">
<el-input @keyup.enter.native="getContentList" clearable placeholder="关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="getContentList" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
<view class="flex flex-col justify-start items-start pointer w-100p">
<view v-for="(item, index) in list" :key="index" class="content-item-wrap"
@click="openDownload(item._id, item.files[0])">
<file-word theme="outline" size="80" fill="#4a90e2" strokeLinecap="square"/>
<view class="content">
<text class="title">{{ item.name }}</text>
<view class="desc">
<text class="item">{{ item._add_time_str }}</text>
<text class="item">{{ item.viewNum }}人浏览</text>
<text class="item">{{ item.downloadNum }}次下载</text>
<text class="item">{{ item.amount === 0 ? '免费下载' : `${item.amount}元下载` }}</text>
<!-- <text class="item">{{ item._add_time_str }}</text>-->
</view>
</view>
</view>
</view>
</view>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="carousel">
<common-swiper page="article"/>
</view>
<view class="filter-outer">
<view class="cate">
<view class="item" v-for="(item, index) in cateList" :key="index" :class="[activeCateIndex === index ? 'active' : '']"
@click="selectCate(index)">
<text class="title">{{ item.name }}</text>
<text class="remark mt-10">{{ item.remark }}</text>
</view>
<!-- <view class="item" :class="[activeCateIndex === 1 ? 'active' : '']"-->
<!-- @click="selectCate(1)">-->
<!-- <text class="title">{{ cateList[1].name }}</text>-->
<!-- <text class="remark mt-10">{{ cateList[1].remark }}</text>-->
<!-- </view>-->
<!-- <view class="item" :class="[activeCateIndex === -1 ? 'active' : '']"-->
<!-- @click="selectCate(-1)">-->
<!-- <text class="title">乐邦团</text>-->
<!-- <text class="remark mt-10">可提问一些与钢材有关的专业知识问答</text>-->
<!-- </view>-->
<!-- <view class="item" :class="[activeCateIndex === 1 ? 'active' : '']"-->
<!-- @click="selectCate(1)">-->
<!-- <text class="title">{{ cateList[1].name }}</text>-->
<!-- <text class="remark mt-10">{{ cateList[1].remark }}</text>-->
<!-- </view>-->
<!-- <view class="item" :class="[activeCateIndex === -2 ? 'active' : '']"-->
<!-- @click="selectCate(-2)">-->
<!-- <text class="title">金久信风向标</text>-->
<!-- <text class="remark mt-10">平台客户可将宝贵意见和平台需要改进的意见在此发表</text>-->
<!-- </view>-->
<view class="item mt-20" @click="navTo('/pages/user/school')">
<text class="title text-main">我的学堂</text>
<text class="remark mt-10">我上传和下载的文档</text>
</view>
</view>
<view class="content-wrap">
<el-input @keyup.enter.native="getContentList()" clearable placeholder="关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="getContentList()" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
<view class="flex flex-col justify-start items-start pointer w-100p">
<view v-for="(item, index) in list" :key="index" class="content-item-wrap"
@click="navTo(`/pages/article/detail?id=${item._id}`)">
<template v-if="item.files && item.files.length > 0">
<template v-if="['doc', 'docx'].includes(item.files[0].split('.').pop())">
<file-word theme="outline" class="pointer" size="80" fill="#4a90e2" strokeLinecap="square"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.files[0].split('.').pop())">
<file-excel theme="outline" class="pointer" size="80" fill="#417505" strokeLinecap="square"/>
</template>
<template v-else-if="['pdf'].includes(item.files[0].split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="80" fill="#f5a623" strokeLinecap="square"/>
</template>
<template v-else>
<el-image :src="item.files[0]" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item.files]"/>
</template>
</template>
<view class="content">
<text class="title">{{ item.name }}</text>
<view class="desc">
<text class="item">{{ item._add_time_str }}</text>
<text class="item">{{ item.viewNum }}人浏览</text>
<text class="item">{{ item.downloadNum }}次下载</text>
<!-- <text class="item">{{ item.amount === 0 ? '免费下载' : `${item.amount}元下载` }}</text>-->
<!-- <text class="item">{{ item._add_time_str }}</text>-->
</view>
</view>
</view>
<el-pagination @current-change="getContentList" background layout="prev, pager, next"
:total="total"></el-pagination>
</view>
</view>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template>
<script>
import {FileWord} from '@icon-park/vue'
import {FilePdfOne, FileExcel, FileWord} from '@icon-park/vue'
export default {
name: "list",
components: {FileWord},
data() {
return {
cateList: [],
activeCateIndex: 0,
list: [],
keyword: null
}
},
methods: {
async getCateList() {
const {rows} = await vk.callFunction({
url: 'client/article/category/pub/getList'
})
this.cateList = rows
await this.getContentList()
},
selectCate(index) {
this.activeCateIndex = index
this.getContentList()
},
async getContentList() {
const {rows} = await vk.callFunction({
url: 'client/article/list/pub/getList',
data: {
parentId: this.cateList[this.activeCateIndex]._id,
keyword: this.keyword
}
})
this.list = rows
},
toMySchool() {
vk.navigateTo({
url: '/pages/user/school'
})
},
async openDownload(id, url) {
await vk.callFunction({
url: 'client/article/list/pub/addDownload',
data: {
id
}
})
window.open(url)
}
},
onLoad() {
this.getCateList()
name: "list",
components: {FilePdfOne, FileExcel, FileWord},
data() {
return {
cateList: [],
activeCateIndex: 0,
list: [],
total: 0,
pageSize: 10,
keyword: null
}
},
methods: {
async getCateList() {
const {rows} = await vk.callFunction({
url: 'client/article/category/pub/getList'
})
this.cateList = rows
await this.getContentList()
},
selectCate(index) {
this.activeCateIndex = index
this.getContentList()
},
async getContentList(pageIndex = 1) {
const {rows, total} = await vk.callFunction({
url: 'client/article/list/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
parentId: this.cateList[this.activeCateIndex]._id,
keyword: this.keyword
}
})
this.list = rows
this.total = total
window.scrollTo({top: 0})
},
navTo(url) {
vk.navigateTo({
url
})
},
},
onLoad() {
this.getCateList()
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
width: 1200px;
margin: 20px auto;
//padding: 20px;
//padding: 20px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
.cate {
width: 250px;
margin-right: 30px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.cate {
width: 250px;
margin-right: 30px;
.item {
width: 100%;
padding: 25px 10px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
cursor: pointer;
background-color: #FFFFFF;
.title {
font-size: 18px;
}
.remark {
color: #bbb;
}
}
.active {
background-color: #CB5050;
color: white;
.remark {
color: #F2CFCE;
}
}
}
.content-wrap {
padding: 20px;
background-color: #FFFFFF;
flex: 1;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.content-item-wrap {
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin: 30px 0;
.content {
margin-left: 25px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.item {
width: 100%;
padding: 25px 10px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
cursor: pointer;
background-color: #FFFFFF;
.title {
font-size: 18px;
}
.remark {
color: #bbb;
}
.title {
font-size: 20px;
}
.active {
background-color: #CB5050;
color: white;
.desc {
font-size: 14px;
color: #bbb;
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin-top: 10px;
.remark {
color: #F2CFCE;
}
}
}
.content-wrap {
padding: 20px;
background-color: #FFFFFF;
flex: 1;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.content-item-wrap {
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin: 30px 0;
.content {
margin-left: 25px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.title {
font-size: 20px;
}
.desc {
font-size: 14px;
color: #bbb;
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin-top: 10px;
.item {
padding: 0 10px;
border-right: 2px solid #bbb;
}
:first-child {
padding-left: 0;
}
:last-child {
border-right: none
}
}
}
.item {
padding: 0 10px;
border-right: 2px solid #bbb;
}
:first-child {
padding-left: 0;
}
:last-child {
border-right: none
}
}
}
}
}
}
</style>