Browse Source

上传

master
前端-胡立永 8 months ago
parent
commit
0dfb5d82a7
7 changed files with 262 additions and 71 deletions
  1. +118
    -24
      api/api.js
  2. +49
    -20
      components/list/videoList.vue
  3. +2
    -2
      config.js
  4. +16
    -7
      pages/index/index.vue
  5. +33
    -9
      pages_order/service/applyRelic.vue
  6. +14
    -2
      pages_order/service/reservationDetail.vue
  7. +30
    -7
      pages_order/service/situation.vue

+ 118
- 24
api/api.js View File

@ -6,57 +6,151 @@ const config = {
// auth : false, showLoading : true, loadingTitle : '加载中...',
// limit : 1000
// },
getConfig : {url : '/api/getConfig', method : 'GET', limit : 500},
// getConfig: {
// url: '/api/getConfig',
// method: 'GET',
// limit: 500
// },
// 微信登录接口
wxLogin: {
url: '/login/login',
method: 'POST',
limit : 500,
showLoading : true,
method: 'POST',
limit: 500,
showLoading: true,
},
// 修改个人信息接口
updateInfo: {
url: '/info/updateInfo',
method: 'POST',
auth: true,
limit : 500,
showLoading : true,
auth: true,
limit: 500,
showLoading: true,
},
//隐私政策
getPrivacyPolicy: {
url: '/login/getPrivacyPolicy',
method: 'GET',
},
//用户协议
getUserAgreement: {
url: '/login/getUserAgreement',
method: 'GET',
},
/**
* 首页相关接口
*/
// 添加建议
addAdvice: {
url: '/info/addAdvice',
method: 'POST',
limit: 500,
showLoading: true,
},
// 添加志愿者
addVolunteer: {
url: '/info/addVolunteer',
method: 'POST',
limit: 500,
showLoading: true,
},
// 获取景区列表
queryAreaList: {
url: '/info/queryAreaList',
method: 'GET',
showLoading: true,
},
// 根据id获取文章详情
queryArticleById: {
url: '/info/queryArticleById',
method: 'GET',
showLoading: true,
},
// 获取文章列表
queryArticleList: {
url: '/info/queryArticleList',
method: 'GET',
showLoading: true,
},
// 根据分类获取文章列表
queryArticleListByType: {
url: '/info/queryArticleListByType',
method: 'GET',
showLoading: true,
},
// 获取banner图列表
queryBannerList: {
url: '/info/queryBannerList',
method: 'GET',
showLoading: true,
},
// 根据角色Id获取角色信息详情
queryRoleInfoById: {
url: '/info/queryRoleInfoById',
method: 'GET',
showLoading: true,
},
// 根据角色类型获取角色信息列表-讲解员-达人-摄影师
queryRoleInfoList: {
url: '/info/queryRoleInfoList',
method: 'GET',
showLoading: true,
},
// 根据景区id获取该景区下的地点列表:景点-厕所-美食店铺-民宿
querySpotList: {
url: '/info/querySpotList',
method: 'GET',
showLoading: true,
},
// 根据角色id获取视频列表
queryVedioBySpot: {
url: '/info/queryVedioBySpot',
method: 'GET',
showLoading: true,
},
// 获取视频列表
queryVideoList: {
url: '/info/queryVideoList',
method: 'GET',
showLoading: true,
},
}
export function api(key, data, callback, loadingTitle){
export function api(key, data, callback, loadingTitle) {
let req = config[key]
if (!req) {
console.error('无效key' + key);
return
}
if(typeof callback == 'string'){
if (typeof callback == 'string') {
loadingTitle = callback
}
if(typeof data == 'function'){
if (typeof data == 'function') {
callback = data
data = {}
}
// 接口限流
if(req.limit){
if (req.limit) {
let storageKey = 'limit:' + req.url
let storage = uni.getStorageSync(storageKey)
if(storage && new Date().getTime() - parseInt(storage) < req.limit){
if (storage && new Date().getTime() - parseInt(storage) < req.limit) {
return
}
uni.setStorageSync(storageKey, new Date().getTime())
}
//必须登录
if (req.auth) {
if (!uni.getStorageSync('token')) {
@ -67,9 +161,9 @@ export function api(key, data, callback, loadingTitle){
return
}
}
http.http(req.url, data, callback, req.method,
loadingTitle || req.showLoading, loadingTitle || req.loadingTitle)
http.http(req.url, data, callback, req.method,
loadingTitle || req.showLoading, loadingTitle || req.loadingTitle)
}


+ 49
- 20
components/list/videoList.vue View File

@ -1,41 +1,70 @@
<template>
<view class="videoList">
<view class="video-item" v-for="(item, index) in 10" :key="index"
@click="showVideo(item)">
<view class="image">
<image src="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img" 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">
<scroll-view
scroll-y="true"
:style="{height: height}"
@scrolltolower="loadMoreData">
<view class="videoList">
<view class="video-item" v-for="(item, index) in list" :key="index"
@click="showVideo(item)">
<view class="image">
<image :src="item.videoImage" mode="aspectFill">
</image>
爱旅行的小张
<view class="icon">
<uv-icon size="35rpx" name="play-right-fill">
</uv-icon>
</view>
</view>
<view class="like">
<uv-icon size="45rpx" v-if="false" name="heart"></uv-icon>
<uv-icon size="45rpx" color="#FF4340" v-else name="heart-fill"></uv-icon>
300
<view class="bottom">
<view class="headImage">
<!-- <image src="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img" mode="aspectFill">
</image> -->
{{ item.videoTitle }}
</view>
<view class="like">
<uv-icon size="45rpx" v-if="false" name="heart"></uv-icon>
<uv-icon size="45rpx" color="#FF4340" v-else name="heart-fill"></uv-icon>
{{ item.videoThumpup }}
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</template>
<script>
export default {
props : {
height : {
default : 'auto'
}
},
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10,
},
total : 0,
list : [],
}
},
methods: {
showVideo(item){
this.$utils.hanldePreview
},
queryVideoList(){
this.$api('queryVideoList', this.queryParams, res => {
if(res.code == 200){
this.list = res.result
}
})
},
loadMoreData(){
if(this.queryParams.pageSize < this.total){
this.queryParams.pageSize += 10
this.queryVideoList()
}
},
}
}
</script>


+ 2
- 2
config.js View File

@ -13,10 +13,10 @@ const type = 'dev'
// 环境配置
const config = {
dev : {
baseUrl : 'http://www.gcosc.fun:82',
baseUrl : 'http://8.138.162.67:8001/travel-api/api',
},
prod : {
baseUrl : 'http://xxx.xxx.xxx/xxx',
baseUrl : 'http://8.138.162.67:8001/travel-api/api',
}
}


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

@ -40,7 +40,7 @@
<view class="video-title">
视频中的景徳镇
</view>
<videoList/>
<videoList ref="videoList"/>
</view>
@ -61,11 +61,6 @@
},
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10,
title: ''
},
baseList : [
{
icon : '/static/image/home/g1.png',
@ -135,8 +130,22 @@
},
computed : {
},
onShow() {
this.$refs.videoList.queryVideoList()
this.queryBannerList()
},
//
onReachBottom() {
this.$refs.videoList.loadMoreData()
},
methods: {
queryBannerList(){
this.$api('queryBannerList', res => {
if(res.code == 200){
this.bannerList = res.result
}
})
},
}
}
</script>


+ 33
- 9
pages_order/service/applyRelic.vue View File

@ -1,7 +1,7 @@
<template>
<!-- 请遗迹 -->
<!-- 遗历程 -->
<view class="apply">
<navbar title="申请遗迹" leftClick @leftClick="$utils.navigateBack" />
<navbar title="申遗历程" leftClick @leftClick="$utils.navigateBack" />
<view class="top-img">
<image src="../static/applyRelic/jdz.png" mode="aspectFill" style="width: 100%; height: 100%;"></image>
</view>
@ -20,7 +20,7 @@
</view>
<view class="middle-font">
<view>
历程
历程
</view>
<view>
申遗缘由
@ -34,13 +34,14 @@
<view class="apply-list">
<uv-list @scrolltolower="scrolltolower">
<uv-list-item
title="景德镇:保护文化遗产,复兴千年瓷都"
note="2024-09-01"
:title="item.articleTitle"
:note="$dayjs(item.createTime).format('YYYY-MM-DD')"
border="true"
v-for="(item,index) in 10" :key="index"
v-for="(item,index) in list"
:key="index"
>
<template #footer>
<uv-image src="https://cdn.uviewui.com/uview/album/1.jpg" radius="10rpx" width="240rpx"
<uv-image :src="item.articleImage" radius="10rpx" width="240rpx"
height="160rpx" />
</template>
</uv-list-item>
@ -54,11 +55,34 @@
export default {
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10,
},
total : 0,
list : [],
}
},
onShow() {
this.queryArticleList()
},
onReachBottom() {
this.loadMoreData()
},
methods: {
queryArticleList(){
this.$api('queryArticleList', res => {
if(res.code == 200){
this.list = res.result
}
})
},
loadMoreData(){
if(this.queryParams.pageSize < this.total){
this.queryParams.pageSize += 10
this.queryArticleList()
}
},
}
}
</script>


+ 14
- 2
pages_order/service/reservationDetail.vue View File

@ -98,14 +98,15 @@
<view class="title">
讲解现场
</view>
<view class="list">
<!-- <view class="list">
<view
v-for="(item, index) in 10"
:key="index">
<image src="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img" mode="aspectFill"></image>
</view>
</view>
</view> -->
</view>
<videoList ref="videoList"/>
</view>
<tabber/>
@ -113,7 +114,11 @@
</template>
<script>
import videoList from '@/components/list/videoList.vue'
export default {
components : {
videoList,
},
data() {
return {
titles: ['遗产讲述', '达人同游', '我要跟拍'],
@ -123,6 +128,13 @@
onLoad(args) {
this.type = args.type
},
onShow() {
this.$refs.videoList.queryVideoList()
},
//
onReachBottom() {
this.$refs.videoList.loadMoreData()
},
methods: {
}


+ 30
- 7
pages_order/service/situation.vue View File

@ -27,15 +27,15 @@
</view>
<view class="situation-imgs-four">
<view
v-for="(item,index) in 4"
v-for="(item,index) in list"
:key="index">
<image src="https://cdn.uviewui.com/uview/album/1.jpg" mode="aspectFill"/>
<image :src="item.areaImage" mode="aspectFill"/>
<view class="text">
<view class="title text-ellipsis">
瓷都镇区鼎
{{ item.areaName }}
</view>
<view class="tip text-ellipsis">
盛时期瓷业生产核心区
{{ item.areaBrief }}
</view>
</view>
</view>
@ -49,11 +49,34 @@
export default {
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10,
},
total : 0,
list : [],
}
},
onShow() {
this.queryAreaList()
},
onReachBottom() {
this.loadMoreData()
},
methods: {
queryAreaList(){
this.$api('queryAreaList', res => {
if(res.code == 200){
this.list = res.result
}
})
},
loadMoreData(){
if(this.queryParams.pageSize < this.total){
this.queryParams.pageSize += 10
this.queryAreaList()
}
},
}
}
</script>
@ -125,7 +148,7 @@
left: 0;
width: 100%;
height: 100%;
background-color: #00000066;
background-color: #00000036;
color: #fff;
display: flex;
flex-direction: column;


Loading…
Cancel
Save