Browse Source

上传

master
前端-胡立永 5 months ago
parent
commit
d788679878
9 changed files with 539 additions and 87 deletions
  1. +20
    -0
      api/api.js
  2. +138
    -0
      components/list/newsItem.vue
  3. +45
    -23
      components/list/scenicSpot.vue
  4. +23
    -45
      components/list/videoList.vue
  5. +1
    -1
      config.js
  6. +14
    -1
      pages.json
  7. +37
    -17
      pages/index/index.vue
  8. +59
    -0
      pages_order/service/newsDetail.vue
  9. +202
    -0
      pages_order/service/newsList.vue

+ 20
- 0
api/api.js View File

@ -334,6 +334,26 @@ const config = {
method: 'GET',
showLoading: true,
},
// 2025-2-18
// 申遗新闻-获取新闻分类列表
queryNewsTypeList: {
url: '/info/queryNewsTypeList',
method: 'GET',
},
// 申遗新闻-根据分类获取新闻列表
queryNewsByType: {
url: '/info/queryNewsByType',
method: 'GET',
},
// 根据id获取新闻详情
queryNewsById: {
url: '/info/queryNewsById',
method: 'GET',
},
}


+ 138
- 0
components/list/newsItem.vue View File

@ -0,0 +1,138 @@
<template>
<view class="item"
>
<view class="image" @click="showVideo(item, index)">
<image :src="item.spotImage && item.spotImage.split(',')[0]" mode="aspectFill">
</image>
</view>
<view class="bottom">
<view class="headImage">
{{ item.spotName }}
</view>
<view class="like">
<view class="">
查看详情
</view>
<view class=""
style="margin-top: 10rpx;">
<uv-icon size="26rpx"
name="arrow-right"></uv-icon>
</view>
</view>
</view>
</view>
</template>
<script>
import { mapState } from 'vuex'
export default {
props : {
item : {
default : {}
},
},
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10,
},
total : 0,
list : [],
}
},
computed : {
...mapState(['spotList']),
spotListWord(){
return this.spotList.filter(n => n.categoryId == 0)
},
},
methods: {
navigateTo(item){
this.$utils.navigateTo(`/pages_order/service/?id=${item.id}&type=Inheritance`)
},
}
}
</script>
<style scoped lang="scss">
.item {
background-color: #fff;
position: relative;
width: calc(50% - 20rpx);
margin-left: 20rpx;
margin-top: 20rpx;
.image {
position: relative;
width: 100%;
height: 420rpx;
overflow: hidden;
image {
width: 100%;
height: 420rpx;
border-radius: 30rpx;
}
.icon {
position: absolute;
right: 30rpx;
top: 30rpx;
width: 60rpx;
height: 60rpx;
background-color: #ffffffaa;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
}
.bottom {
font-size: 30rpx;
display: flex;
justify-content: space-between;
position: absolute;
bottom: 0;
left: 0;
background-color: #ffffffaa;
width: calc(100% - 40rpx);
padding: 30rpx;
font-weight: 900;
align-items: center;
.headImage {
display: flex;
align-items: center;
image {
width: 50rpx;
height: 50rpx;
border-radius: 50%;
margin-right: 6rpx;
}
}
.like {
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 22rpx;
}
}
}
.showVideo{
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 1000%;
video{
// width: 100%;
// height: 100%;
}
}
</style>

components/list/videoList - 副本.vue → components/list/scenicSpot.vue View File

@ -4,27 +4,27 @@
:style="{height: height}"
@scrolltolower="loadMoreData">
<view class="videoList">
<view class="video-item" v-for="(item, index) in list" :key="index"
<view class="video-item" v-for="(item, index) in spotListWord" :key="index"
>
<view class="image" @click="showVideo(item, index)">
<image :src="item.travelVideo.videoImage" mode="aspectFill">
<image :src="item.spotImage && item.spotImage.split(',')[0]" mode="aspectFill">
</image>
<view class="icon">
<uv-icon size="35rpx" name="play-right-fill">
</uv-icon>
</view>
</view>
<view class="bottom">
<view class="headImage">
<!-- <image src="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img" mode="aspectFill">
</image> -->
{{ item.travelVideo.videoTitle }}
{{ item.spotName }}
</view>
<view class="like"
@click="addThumpup(item.travelVideo.id)">
<uv-icon size="45rpx" color="#FF4340" v-if="item.thumpupFlag" name="heart-fill"></uv-icon>
<uv-icon size="45rpx" v-else name="heart"></uv-icon>
{{ item.travelVideo.videoThumpup }}
<view class="like">
<view class="">
查看详情
</view>
<view class=""
style="margin-top: 10rpx;">
<uv-icon size="26rpx"
name="arrow-right"></uv-icon>
</view>
</view>
</view>
</view>
@ -33,7 +33,7 @@
</template>
<script>
import index from '../../uni_modules/uv-ui-tools'
import { mapState } from 'vuex'
export default {
props : {
height : {
@ -52,6 +52,12 @@ import index from '../../uni_modules/uv-ui-tools'
list : [],
}
},
computed : {
...mapState(['spotList']),
spotListWord(){
return this.spotList.filter(n => n.categoryId == 0)
},
},
methods: {
showVideo(item, current){
// this.$utils.hanldePreview
@ -60,6 +66,10 @@ import index from '../../uni_modules/uv-ui-tools'
// current : item.videoContent
// })
this.$utils.navigateTo(`/pages_order/service/articleDetail?id=${item.id}&type=Inheritance`)
return
let sources = []
this.list.forEach(n => {
@ -119,21 +129,23 @@ import index from '../../uni_modules/uv-ui-tools'
.videoList {
display: flex;
flex-wrap: wrap;
margin-right: 20rpx;
.video-item {
margin: 20rpx;
width: 335rpx;
background-color: #fff;
position: relative;
width: calc(50% - 20rpx);
margin-left: 20rpx;
margin-top: 20rpx;
.image {
position: relative;
width: 100%;
height: 420rpx;
border-radius: 30rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
height: 420rpx;
border-radius: 30rpx;
}
.icon {
@ -151,10 +163,17 @@ import index from '../../uni_modules/uv-ui-tools'
}
.bottom {
padding: 10rpx 0;
font-size: 22rpx;
font-size: 30rpx;
display: flex;
justify-content: space-between;
position: absolute;
bottom: 0;
left: 0;
background-color: #ffffffaa;
width: calc(100% - 40rpx);
padding: 30rpx;
font-weight: 900;
align-items: center;
.headImage {
display: flex;
@ -171,6 +190,9 @@ import index from '../../uni_modules/uv-ui-tools'
.like {
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 22rpx;
}
}
}

+ 23
- 45
components/list/videoList.vue View File

@ -4,27 +4,27 @@
:style="{height: height}"
@scrolltolower="loadMoreData">
<view class="videoList">
<view class="video-item" v-for="(item, index) in spotListWord" :key="index"
<view class="video-item" v-for="(item, index) in list" :key="index"
>
<view class="image" @click="showVideo(item, index)">
<image :src="item.spotImage && item.spotImage.split(',')[0]" mode="aspectFill">
<image :src="item.travelVideo.videoImage" mode="aspectFill">
</image>
<view class="icon">
<uv-icon size="35rpx" name="play-right-fill">
</uv-icon>
</view>
</view>
<view class="bottom">
<view class="headImage">
{{ item.spotName }}
<!-- <image src="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img" mode="aspectFill">
</image> -->
{{ item.travelVideo.videoTitle }}
</view>
<view class="like">
<view class="">
查看详情
</view>
<view class=""
style="margin-top: 10rpx;">
<uv-icon size="26rpx"
name="arrow-right"></uv-icon>
</view>
<view class="like"
@click="addThumpup(item.travelVideo.id)">
<uv-icon size="45rpx" color="#FF4340" v-if="item.thumpupFlag" name="heart-fill"></uv-icon>
<uv-icon size="45rpx" v-else name="heart"></uv-icon>
{{ item.travelVideo.videoThumpup }}
</view>
</view>
</view>
@ -33,7 +33,7 @@
</template>
<script>
import { mapState } from 'vuex'
import index from '../../uni_modules/uv-ui-tools'
export default {
props : {
height : {
@ -52,12 +52,6 @@
list : [],
}
},
computed : {
...mapState(['spotList']),
spotListWord(){
return this.spotList.filter(n => n.categoryId == 0)
},
},
methods: {
showVideo(item, current){
// this.$utils.hanldePreview
@ -66,10 +60,6 @@
// current : item.videoContent
// })
this.$utils.navigateTo(`/pages_order/service/articleDetail?id=${item.id}&type=Inheritance`)
return
let sources = []
this.list.forEach(n => {
@ -129,23 +119,21 @@
.videoList {
display: flex;
flex-wrap: wrap;
margin-right: 20rpx;
.video-item {
background-color: #fff;
position: relative;
width: calc(50% - 20rpx);
margin-left: 20rpx;
margin-top: 20rpx;
margin: 20rpx;
width: 335rpx;
.image {
position: relative;
width: 100%;
height: 420rpx;
border-radius: 30rpx;
overflow: hidden;
image {
width: 100%;
height: 420rpx;
border-radius: 30rpx;
height: 100%;
}
.icon {
@ -163,17 +151,10 @@
}
.bottom {
font-size: 30rpx;
padding: 10rpx 0;
font-size: 22rpx;
display: flex;
justify-content: space-between;
position: absolute;
bottom: 0;
left: 0;
background-color: #ffffffaa;
width: calc(100% - 40rpx);
padding: 30rpx;
font-weight: 900;
align-items: center;
.headImage {
display: flex;
@ -190,9 +171,6 @@
.like {
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 22rpx;
}
}
}


+ 1
- 1
config.js View File

@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
const type = 'prod2'
const type = 'prod'
// 环境配置


+ 14
- 1
pages.json View File

@ -27,7 +27,8 @@
},
"subPackages": [{
"root": "pages_order",
"pages": [{
"pages": [
{
"path": "order/orderDetail",
"style": {
"enablePullDownRefresh" : true
@ -66,6 +67,18 @@
"enablePullDownRefresh" : true
}
},
{
"path": "service/newsList",
"style": {
"enablePullDownRefresh" : true
}
},
{
"path": "service/newsDetail",
"style": {
"enablePullDownRefresh" : true
}
},
{
"path": "service/tellList",
"style": {


+ 37
- 17
pages/index/index.vue View File

@ -24,7 +24,7 @@
<view class="content">
<view class="grid">
<uv-grid :border="false"
:col="5">
:col="4">
<uv-grid-item
v-for="(item,index) in baseList"
@click="$utils.navigateTo(item.path)"
@ -40,7 +40,15 @@
景徳镇的景点
</view>
<videoList ref="videoList"/>
<scenicSpot ref="videoList"/>
<!-- <view class="list">
<newsItem
v-for="(item, index) in 10"
:key="index"
:item="item"
/>
</view> -->
</view>
@ -53,11 +61,13 @@
<script>
import PrivacyAgreementPoup from '@/components/config/PrivacyAgreementPoup.vue'
import videoList from '@/components/list/videoList.vue'
import scenicSpot from '@/components/list/scenicSpot.vue'
import newsItem from '@/components/list/newsItem.vue'
export default {
components : {
PrivacyAgreementPoup,
videoList,
scenicSpot,
newsItem,
},
data() {
return {
@ -97,11 +107,7 @@
// title : '',
// path : '/pages_order/service/experience',
// },
{
icon : '/static/image/home/g8.png',
title : '无忧服务',
path : '/pages_order/service/carefree',
},
{
icon : '/static/image/home/g9.png',
title : '文创好物',
@ -112,18 +118,28 @@
title : '我要帮助',
path : '/pages_order/service/help',
},
],
bannerList: [
{
url: 'https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img',
},
{
url: 'https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img',
},
icon : '/static/image/home/g8.png',
title : '无忧服务',
path : '/pages_order/service/carefree',
},
{
url: 'https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img',
icon : '/static/image/home/g6.png',
title : '申遗新闻',
path : '/pages_order/service/newsList',
},
],
bannerList: [
// {
// url: 'https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img',
// },
// {
// url: 'https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img',
// },
// {
// url: 'https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img',
// },
],
productList: [],
keyword : '',
}
@ -222,6 +238,10 @@
width: fit-content;
border-radius: 20rpx;
}
.list{
display: flex;
flex-wrap: wrap;
}
}
}


+ 59
- 0
pages_order/service/newsDetail.vue View File

@ -0,0 +1,59 @@
<template>
<!-- 0文化遗产详情1申遗历程详情2非遗体验详情 三合一 -->
<view class="page">
<navbar title="新闻详情" leftClick @leftClick="$utils.navigateBack" />
<view class=""
style="padding: 20rpx;">
<uv-parse :content="detail.newsContent"></uv-parse>
</view>
</view>
</template>
<script>
export default {
components : {
},
data() {
return {
detail : {},
id : 0,
type : '',
dict : {},
collectonFlag : false,
}
},
onLoad(args) {
this.id = args.id
},
onShow() {
this.queryArticleById()
},
onPullDownRefresh(){
this.queryArticleById()
},
methods: {
queryArticleById(){
let data = {
newsId : this.id,
}
// if(uni.getStorageSync('token')){
// data.token = uni.getStorageSync('token')
// }
this.$api('queryNewsById', data, res => {
uni.stopPullDownRefresh()
if(res.code == 200){
this.detail = res.result
}
})
},
}
}
</script>
<style scoped lang="scss">
.page{
}
</style>

+ 202
- 0
pages_order/service/newsList.vue View File

@ -0,0 +1,202 @@
<template>
<!-- 申遗新闻 -->
<view class="apply">
<navbar title="申遗新闻" leftClick @leftClick="$utils.navigateBack" />
<view class="top-img">
<uv-swiper
:list="banner.course"
indicator
height="420rpx"
keyName="imageContent"></uv-swiper>
</view>
<view class="middle-box">
<view class="middle-img">
<view
:key="index"
:class="{act : item.id == articleType}"
v-for="(item, index) in category">
<image src="../static/applyRelic/2.png" mode="aspectFill" />
</view>
</view>
<view class="middle-font">
<view @click="selectMiddle(item.id)"
:key="index"
v-for="(item, index) in category">
{{ item.name }}
</view>
</view>
</view>
<view class="apply-list">
<uv-list @scrolltolower="scrolltolower">
<uv-list-item
:title="item.newsTitle"
:note="$dayjs(item.createTime).format('YYYY-MM-DD')"
:border="true"
v-for="(item,index) in list"
:key="index"
:clickable="true"
@click="toUrl(item)"
>
<template #footer>
<uv-image :src="item.newsImage &&
item.newsImage.split(',')[0]" radius="10rpx" width="240rpx"
height="160rpx" />
</template>
</uv-list-item>
</uv-list>
</view>
<uv-empty
v-if="total == 0"
text="没有找到你需要的哦!"
textSize="30rpx"
iconSize="200rpx"
icon="list"></uv-empty>
<tabber />
</view>
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10,
},
total : 0,
list : [],
articleType : -1,
keyword : '',
category : [],
}
},
computed : {
...mapState(['banner']),
},
onShow() {
this.queryArticleListByType()
},
onReachBottom() {
this.loadMoreData()
},
onPullDownRefresh(){
this.queryArticleListByType()
},
onLoad(args) {
this.keyword = args.keyword
this.queryNewsTypeList()
},
methods: {
queryArticleListByType(){
let query = {
...this.queryParams,
categoryId : this.articleType
}
if(this.articleType == -1){
return
}
if(this.keyword){
query.articleTitle = this.keyword
}
this.$api('queryNewsByType', query, res => {
uni.stopPullDownRefresh()
if(res.code == 200){
this.list = res.result.records
this.total = res.result.total
}
})
},
queryNewsTypeList(){
this.$api('queryNewsTypeList', {
pageNo : 1,
pageSize : 9999999,
}, res => {
if(res.code == 200){
this.category = res.result.records
this.selectMiddle(this.category[0].id)
}
})
},
loadMoreData(){
if(this.queryParams.pageSize < this.total){
this.queryParams.pageSize += 10
this.queryArticleListByType()
}
},
toUrl(item){
console.log(item);
this.$utils.navigateTo(`/pages_order/service/newsDetail?id=${item.id}`)
},
selectMiddle(id){
this.articleType = id
this.queryArticleListByType()
},
}
}
</script>
<style scoped lang="scss">
.apply {
.top-img {
}
.middle-box {
display: flex;
position: relative;
height: 220rpx;
align-items: center;
justify-content: space-around;
background-color: #fff;
.middle-img {
display: flex;
align-items: center;
justify-content: space-around;
width: 100%;
view {
width: 160rpx;
height: 160rpx;
border-radius: 50%;
image {
width: 100%;
height: 100%;
}
}
}
.act{
box-shadow: 0 0 18rpx 14rpx #ff000042;
}
.middle-font {
position: absolute;
display: flex;
width: 100%;
justify-content: space-around;
view {
width: 60rpx;
color: #FFFDF6;
font-weight: 600;
}
}
}
.apply-list {
width: 94%;
margin-left: 3%;
/deep/ .uv-list-item{
background-color: #FFFDF6 !important;
}
}
}
</style>

Loading…
Cancel
Save