Browse Source

上传

master
前端-胡立永 5 months ago
parent
commit
3f6a8867d6
7 changed files with 286 additions and 42 deletions
  1. +5
    -5
      api/api.js
  2. +211
    -0
      components/list/scenicSpot - 副本.vue
  3. +2
    -20
      components/list/scenicSpot.vue
  4. +52
    -7
      pages/index/index.vue
  5. +4
    -4
      pages_order/service/newsList.vue
  6. BIN
      static/image/home/g8a.png
  7. +12
    -6
      store/store.js

+ 5
- 5
api/api.js View File

@ -11,11 +11,11 @@ const config = {
// limit : 1000
// },
// getConfig: {
// url: '/api/getConfig',
// method: 'GET',
// limit: 500
// },
getConfig: {
url: '/info/queryConfigList',
method: 'GET',
limit: 500
},
// 微信登录接口


+ 211
- 0
components/list/scenicSpot - 副本.vue View File

@ -0,0 +1,211 @@
<template>
<scroll-view
scroll-y="true"
:style="{height: height}"
@scrolltolower="loadMoreData">
<view class="videoList">
<view class="video-item" v-for="(item, index) in spotListWord" :key="index"
>
<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>
</view>
</scroll-view>
</template>
<script>
import { mapState } from 'vuex'
export default {
props : {
height : {
default : 'auto'
},
roleId : {
}
},
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10,
},
total : 0,
list : [],
}
},
computed : {
...mapState(['spotList']),
spotListWord(){
return this.spotList.filter(n => n.categoryId == 0)
},
},
methods: {
showVideo(item, current){
// this.$utils.hanldePreview
// uni.previewMedia({
// current : item.videoContent
// })
this.$utils.navigateTo(`/pages_order/service/articleDetail?id=${item.id}&type=Inheritance`)
return
let sources = []
this.list.forEach(n => {
sources.push({
url : n.travelVideo.videoContent,
type : 'video'
})
})
wx.previewMedia({
sources, //
current, //
// url: url // url
})
},
queryVideoList(){
if(this.roleId){
this.queryParams.roleInfoId = this.roleId
}
if(uni.getStorageSync('token')){
this.queryParams.token = uni.getStorageSync('token')
}
this.$api('queryVedioById', this.queryParams, res => {
if(res.code == 200){
this.list = res.result
// this.total = res.result.total
}
})
},
loadMoreData(){
if(this.queryParams.pageSize <= this.list.length){
this.queryParams.pageSize += 10
this.queryVideoList()
}
},
addThumpup(videoId){
this.$api('addThumpup', {
videoId
}, res => {
if(res.code == 200){
this.queryVideoList()
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
}
}
</script>
<style scoped lang="scss">
.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;
.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>

+ 2
- 20
components/list/scenicSpot.vue View File

@ -14,18 +14,6 @@
<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>
</view>
@ -131,20 +119,18 @@
flex-wrap: wrap;
margin-right: 20rpx;
.video-item {
background-color: #fff;
position: relative;
width: calc(50% - 20rpx);
width: calc(25% - 20rpx);
margin-left: 20rpx;
margin-top: 20rpx;
.image {
position: relative;
width: 100%;
height: 420rpx;
overflow: hidden;
image {
width: 100%;
height: 420rpx;
height: 120rpx;
border-radius: 30rpx;
}
@ -166,10 +152,6 @@
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;


+ 52
- 7
pages/index/index.vue View File

@ -24,7 +24,7 @@
<view class="content">
<view class="grid">
<uv-grid :border="false"
:col="4">
:col="5">
<uv-grid-item
v-for="(item,index) in baseList"
@click="$utils.navigateTo(item.path)"
@ -35,9 +35,18 @@
</uv-grid>
</view>
<view class="index_box">
<image :src="config_new_image" class="image" mode="aspectFill"></image>
<view class="index_box_grid"
@click="$utils.navigateTo('/pages_order/service/carefree')">
<text class="text">无忧服务</text>
<image class="icon" src="/static/image/home/g8a.png" mode="aspectFill"></image>
</view>
</view>
<view class="video-title">
<!-- 视频中的景徳镇 -->
景徳镇的景点
精彩推荐
</view>
<scenicSpot ref="videoList"/>
@ -118,11 +127,11 @@
title : '我要帮助',
path : '/pages_order/service/help',
},
{
icon : '/static/image/home/g8.png',
title : '无忧服务',
path : '/pages_order/service/carefree',
},
// {
// icon : '/static/image/home/g8.png',
// title : '',
// path : '/pages_order/service/carefree',
// },
{
icon : '/static/image/home/g6.png',
title : '申遗新闻',
@ -142,8 +151,14 @@
],
productList: [],
keyword : '',
config_new_image : '',
}
},
onLoad() {
uni.$on('getConfig', state => {
this.config_new_image = state.configList.config_new_image
})
},
computed : {
},
onPullDownRefresh(){
@ -227,6 +242,36 @@
}
}
.index_box{
display: flex;
padding: 30rpx;
gap: 30rpx;
align-items: center;
.image{
height: 200rpx;
width: 450rpx;
border-radius: 10rpx;
}
.index_box_grid{
width: 200rpx;
height: 200rpx;
background-color: $uni-color;
border-radius: 10rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 16rpx;
.text{
color: #fff;
}
.icon{
width: 100rpx;
height: 100rpx;
}
}
}
.video-title{
padding: 20rpx 30rpx;
background-color: $uni-color;


+ 4
- 4
pages_order/service/newsList.vue View File

@ -10,7 +10,7 @@
keyName="imageContent"></uv-swiper>
</view>
<view class="middle-box">
<!-- <view class="middle-box">
<view class="middle-img">
<view
:key="index"
@ -26,7 +26,7 @@
{{ item.name }}
</view>
</view>
</view>
</view> -->
<view class="apply-list">
<uv-list @scrolltolower="scrolltolower">
@ -89,14 +89,14 @@
},
onLoad(args) {
this.keyword = args.keyword
this.queryNewsTypeList()
this.queryArticleListByType()
},
methods: {
queryArticleListByType(){
let query = {
...this.queryParams,
categoryId : this.articleType
// categoryId : this.articleType
}
if(this.articleType == -1){


BIN
static/image/home/g8a.png View File

Before After
Width: 77  |  Height: 77  |  Size: 873 B

+ 12
- 6
store/store.js View File

@ -9,7 +9,7 @@ import Position from '@/utils/position.js'
//Vuex.Store 构造器选项
const store = new Vuex.Store({
state: {
configList: [], //配置列表
configList: {}, //配置列表
position : {//定位信息
latitude : 0,
longitude : 0,
@ -81,11 +81,17 @@ const store = new Vuex.Store({
mutations: {
// 初始化配置
initConfig(state){
// api('getConfig', res => {
// if(res.code == 200){
// state.configList = res.result
// }
// })
api('getConfig', res => {
if(res.code == 200){
res.result.forEach(n => {
state.configList[n.paramCode] = n.paramValueText ||
n.paramValueTextarea ||
n.paramValueImage
// state.configList[n.keyName + '_keyValue'] = n.keyValue
})
uni.$emit('getConfig', state)
}
})
let config = ['getPrivacyPolicy', 'getUserAgreement']
config.forEach(k => {


Loading…
Cancel
Save