Browse Source

旅游向导

lchao 1 year ago
parent
commit
759e622891

+ 17 - 0
api/travelGuide/travelGuide.js

@@ -0,0 +1,17 @@
+import request from '@/utils/request'
+
+//旅游向导列表
+export function list(query) {
+  return request({
+    url: '/high/server/travelGuideList',
+    method: 'get',
+	params:query
+  })
+}
+//旅游向导详情
+export function getDetails(id) {
+  return request({
+    url: '/high/server/travelGuideDetails/' + id,
+    method: 'get',
+  })
+}

+ 18 - 0
pages.json

@@ -336,6 +336,24 @@
 			}
 			}
 		},
 		},
 		{
 		{
+			"path": "pages/travelGuide/travelGuide",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "旅游向导"
+			}
+		},
+		{
+			"path": "pages/travelGuideDetails/travelGuideDetails",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "旅游向导详情"
+			}
+		},
+		{
 			"path" : "pages/topic/topic",
 			"path" : "pages/topic/topic",
 			"style": {
 			"style": {
 				"usingComponents": {},
 				"usingComponents": {},

+ 9 - 1
pages/index/index.vue

@@ -101,7 +101,7 @@
 			<view class="gpfwNav">
 			<view class="gpfwNav">
 				<ul>
 				<ul>
 					<li>
 					<li>
-						<view class="lvxd"><em class="iconfont icon-jurassic_nav"></em></view>
+						<view class="lvxd"><em class="iconfont icon-jurassic_nav" @tap="golyxd"></em></view>
 						<span>旅游向导</span>
 						<span>旅游向导</span>
 					</li>
 					</li>
 					<li>
 					<li>
@@ -499,6 +499,14 @@
 					url: '/pages/knowledge/knowledge'
 					url: '/pages/knowledge/knowledge'
 				});
 				});
 			},
 			},
+			/**
+			 * 跳转旅游向导页面
+			 */
+			golyxd() {
+				uni.navigateTo({
+					url: '/pages/travelGuide/travelGuide'
+				});
+			},
 			goKnowledgeDetails(item) {
 			goKnowledgeDetails(item) {
 				let params = {
 				let params = {
 					userId: getApp().globalData.userId,
 					userId: getApp().globalData.userId,

+ 128 - 0
pages/travelGuide/travelGuide.css

@@ -0,0 +1,128 @@
+/* pages/wenda/wenda.wxss */
+.wendaFL {
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    margin: 30rpx 0 0 0;
+}
+.wendaFL li {
+    width: 48%;
+    height: 168rpx;
+    position: relative;
+}
+.cooperativeBox{
+    position: relative;
+    left: 30rpx;
+    top: 10rpx;
+    z-index: 0;
+    width: 800rpx;
+    height: 100rpx;
+}
+.cooperativeImgBox{
+    position: relative;
+    left: 0;
+    top: 0;
+    z-index: 0;
+    width: 330rpx;
+    height: 100rpx;
+}
+.cooperativeImg{
+    position: relative;
+    left: 0;
+    top: 0;
+    z-index: 0;
+    width: 100%;
+    height: 100%;
+}
+
+.lbBj {
+    position: absolute;
+    left: 0;
+    top: 0;
+    z-index: 0;
+    width: 100%;
+    height: 100%;
+}
+.wendaFL li h2 {
+    font-size: 36rpx;
+    position: absolute;
+    left: 30rpx;
+    top: 40rpx;
+    z-index: 1;
+    font-weight: bold;
+}
+.wendaFL li span {
+    font-size: 30rpx;
+    position: absolute;
+    left: 30rpx;
+    top: 88rpx;
+    z-index: 1;
+}
+.wendaFL li.sanNong {
+    color: #0d9970;
+}
+.wendaFL li.jiuYe {
+    color: #1e8fb4;
+}
+.wendaFL li.faLv {
+    color: #1e5dab;
+}
+.wendaFL li.jiuZhen {
+    color: #4a700d;
+}
+/* 列表 */
+.rnwdList {
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    margin: 20rpx 0;
+}
+.list {
+    width: 79%;
+}
+.lb {
+    background: #0d9970;
+    color: #fff;
+    font-size: 24rpx;
+    width: 12%;
+    text-align: center;
+    padding: 2rpx 0;
+    line-height: 40rpx;
+    height: 40rpx;
+    border-radius: 10rpx;
+}
+.listTitle {
+    font-size: 32rpx;
+    color: #333;
+    line-height: 40rpx;
+}
+.jlSj {
+    height: 40rpx;
+    display: flex;
+    justify-content: space-between;
+    font-size: 24rpx;
+    margin: 20rpx 0 0 0;
+}
+.jf {
+    color: #07c160;
+}
+.icon-jifen {
+    font-size: 28rpx;
+    color: #07c160;
+    margin: 0 0 0 6rpx;
+}
+.ck {
+    color: #c4c4c4;
+}
+.icon-pinglun,
+.icon-chakan,
+.icon-shoucang {
+    font-size: 28rpx;
+    margin: 0 6rpx 0 20rpx;
+    color: #c4c4c4;
+}
+.icon-xiangyoujiantou {
+    font-size: 30rpx;
+    color: #c4c4c4;
+    line-height: 60rpx;
+}

+ 110 - 0
pages/travelGuide/travelGuide.vue

@@ -0,0 +1,110 @@
+<template>
+	<!-- 旅游向导列表 -->
+	<view class="container">
+		<view class="rnwdList">
+			<view class="list" @tap="goDetails(item.id)" v-for="(item, index1) in dataSource" :key="index1">
+				<span class="listTitle">{{ item.titleName }}</span>
+
+				<view class="onePic" v-if="item.pictureList != null && item.pictureList.length == 1">
+					<image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList" :key="index2">
+					</image>
+				</view>
+				<view class="twoPic" v-if="item.pictureList != null && item.pictureList.length == 2">
+					<image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList" :key="index2">
+					</image>
+				</view>
+				<view class="threePic" v-if="item.pictureList != null && item.pictureList.length == 3">
+					<image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList" :key="index2">
+					</image>
+				</view>
+				<view class="threePic" v-if="item.pictureList != null && item.pictureList.length > 3">
+					<image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList"
+						v-if="index2 < 3" :key="index2"></image>
+				</view>
+
+				<view class="jlSj">
+					<view class="ck">
+						<span>
+							<em class="iconfont icon-chakan"></em>
+							{{ item.likeNum }}
+						</span>
+						<span>
+							<em class="iconfont icon-shoucang"></em>
+							{{ item.watchNum }}
+						</span>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		list
+	} from '@/api/liveBroadcast/liveBroadcast.js';
+	export default {
+		data() {
+			return {
+				dataSource: [],
+				// 数据总量
+				total: 0,
+				queryParams: {
+					// 当前页
+					pageNum: 1,
+					// 每页数据量
+					pageSize: 10,
+				},
+				loading: false,
+			}
+		},
+		/**
+		 * 生命周期函数--监听页面加载
+		 */
+		onLoad(options) {
+			this.getList(1)
+		},
+		onReachBottom(){
+			let pageNum = this.queryParams.pageNum
+			let pageSize = this.queryParams.pageSize
+			let total = this.total
+			if(pageNum * pageSize >= total){
+				uni.showToast({
+					title:'暂无更多数据'
+				})
+				return
+			} else {
+				this.queryParams.pageNum += 1;
+				this.getList()
+			}
+		},
+		methods: {
+			goDetails(id) {
+				uni.navigateTo({
+					url: '/pages/liveBroadcastDetails/liveBroadcastDetails?id=' + id,
+				});
+			},
+			// 分页触发
+			change(e) {
+				this.getList(e.current);
+			},
+			// 获取数据
+			getList(pageNum) {
+				let params = {
+					pageSize: this.queryParams.pageSize,
+					pageNum: pageNum,
+				}
+				list(params).then(res => {
+					if (res.code == 200) {
+						this.dataSource = [...this.dataSource,...res.rows]
+						this.total = res.total
+					}
+				})
+			},
+		}
+	}
+</script>
+
+<style>
+	@import './liveBroadcast.css';
+</style>

+ 36 - 0
pages/travelGuideDetails/travelGuideDetails.css

@@ -0,0 +1,36 @@
+.container{
+    padding: 0;
+}
+
+.cooperativeImgBox{
+    position: static;
+    left: 0;
+    top: 0;
+    z-index: 0;
+    width: 100%;
+    height: 480rpx;
+}
+.cooperativeImg{
+    position: static;
+    left: 0;
+    top: 0;
+    z-index: 0;
+    width: 100%;
+    height: 100%;
+}
+
+.itemBox {
+    width: 100%;
+    font-size: 50rpx;
+}
+.itemBox:nth-child(2n-1){
+    background: #ccc;
+}
+.itemBox:nth-child(2n){
+    background: #ddd;
+}
+
+.item{
+    /*width: 100%;*/
+    /*background-color: #57f5a1;*/
+}

+ 64 - 0
pages/travelGuideDetails/travelGuideDetails.vue

@@ -0,0 +1,64 @@
+<template>
+    <view class="container">
+        <!-- 旅游向导详情 -->
+        <view class="cooperativeImgBox">
+            <image :src="loadImgSrc('/snbj.png')" class="cooperativeImg"></image>
+        </view>
+        <view class="itemBox" v-for="(item, index) in list" :key="index">
+            <view class="item">
+                <span>
+                    {{ item.title }}:
+                </span>
+                <span>
+                    {{ item.content }}
+                </span>
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            list: [
+                {
+                    title: "名称",
+                    content: "第十三号旅游向导",
+                },
+                {
+                    title: "地址",
+                    content: "十三号街区地下研究所",
+                },
+                {
+                    title: "负责人",
+                    content: "高耀",
+                },
+                {
+                    title: "负责人电话",
+                    content: "13178945612",
+                }
+            ],
+            cooperative: {
+                name:"旅游向导1",
+                address:"旅游向导地址1",
+                chargePeople:"负责人1",
+                chargePhone:"13103215236",
+                imgUrl:"/profile/upload/2024/03/01/nacos_20240301145836A002.png"
+            }
+        }
+    }
+    /**
+     * 生命周期函数--监听页面加载
+     */,
+    onLoad(options) {
+        console.log(666)
+    },
+    methods: {
+
+    }
+};
+</script>
+<style>
+@import './details.css';
+</style>