玩转福鼎

This commit is contained in:
吴鹏 2025-11-11 09:37:46 +08:00
parent ab567f4b35
commit 3d0194e754
7 changed files with 439 additions and 10 deletions

View File

@ -16,7 +16,7 @@ const install = (Vue, vm) => {
// }, // },
// }); // });
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
// baseUrl: 'http://192.168.1.12:4601', // baseUrl: 'http://192.168.1.5:4601',
// baseUrl: 'http://192.168.2.75:4601', // baseUrl: 'http://192.168.2.75:4601',
baseUrl: 'https://fd.ccttiot.com/prod-api', baseUrl: 'https://fd.ccttiot.com/prod-api',
loadingText: '努力加载中~', loadingText: '努力加载中~',

View File

@ -3,7 +3,7 @@
<u-navbar title=" " :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37' <u-navbar title=" " :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37'
title-size='36' height='36' id="navbar"> title-size='36' height='36' id="navbar">
</u-navbar> </u-navbar>
<web-view src="https://ele.ccttiot.com/guide?id=1"></web-view> <web-view src="https://fd.ccttiot.com/guide?id=1"></web-view>
</view> </view>

338
page_user/sousuo/index.vue Normal file
View File

@ -0,0 +1,338 @@
<template>
<view class="page">
<u-navbar title="搜索" :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37'
title-size='36' height='46' id="navbar">
</u-navbar>
<!-- 搜索区域 -->
<view class="search-container">
<view class="" style="display: flex;justify-content: space-between;">
<view class="search-box">
<view class="search-icon">
<u-icon name="search" color="#999" size="28"></u-icon>
</view>
<input
type="text"
v-model="searchKeyword"
placeholder="请输入搜索内容"
placeholder-style="color:#999"
class="search-input"
@confirm="handleSearch"
>
<view
class="clear-icon"
v-if="searchKeyword"
@click="clearSearch"
>
<u-icon name="close-circle" color="#999" size="24"></u-icon>
</view>
</view>
<view class="search-btn" @click="handleSearch">搜索</view>
</view>
<view class="tablist">
<view :class="tabindex == item.type ? 'active' : ''" v-for="(item,index) in tablist" :key="index" @click="btntab(item)">
{{item.name}}
</view>
</view>
</view>
<!-- 搜索内容区域 -->
<scroll-view class="content" @scrolltolower="handqixing" scroll-y refresher-enabled @refresherrefresh="onRefresh" :refresher-triggered="isRefreshing" refresher-default-style="black">
<view class="list" v-for="(item,index) in shujulist" :key="index" @click="btnitem(item)">
<view class="lt">
<image v-if="tabindex == 5" :src="item.picture ? item.picture[0] : ''" mode="aspectFill"></image>
<image v-if="tabindex == 2" :src="item.photo ? item.photo.split(',')[0] : ''" mode="aspectFill"></image>
<image v-if="tabindex == 3" :src="item.imageUrl ? item.imageUrl.split(',')[0] : ''" mode="aspectFill"></image>
<image v-if="tabindex == 1 || tabindex == 4" :src="item.picture ? item.picture.split(',')[0] : ''" mode="aspectFill"></image>
</view>
<view class="rt">
<view class="top">
<view class="ltwz" v-if="tabindex == 5">
{{item.nickName}}
</view>
<view class="ltwz" v-if="tabindex == 4">
{{item.title}}
</view>
<view class="ltwz" v-if="tabindex == 1 || tabindex == 2 || tabindex == 3">
{{item.name}}
</view>
<view class="rtwz">
详情 <u-icon name="arrow-right" color="#1EC28B" size="28"></u-icon>
</view>
</view>
<view class="jianjie" v-if="tabindex == 5">
{{item.content.length > 30 ? item.content.slice(0,60) + '...' : item.content}}
</view>
<view class="jianjie" v-if="item.description != null">
{{item.description.length > 30 ? item.description.slice(0,60) + '...' : item.description}}
</view>
</view>
</view>
<view class="" style="width: 100%;margin-top: 20rpx;text-align: center;color: #999;">
当前没有更多数据了...
</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
bgc: {
backgroundColor: "#fff",
},
searchKeyword: '', //
tablist:[{name:'景区',type:1},{name:'攻略',type:2},{name:'美食',type:3},{name:'文化',type:4},{name:'动态',type:5},],
tabindex:1,
isRefreshing:false,
pageNum:1,
total:0,
shujulist:[]
}
},
onLoad() {
this.getlist()
},
methods: {
//
btnitem(item){
console.log(item)
if(this.tabindex == 1){ //1
uni.navigateTo({
url:'/page_fenbao/remenxq?id=' + item.id
})
}else if(this.tabindex == 2){ //2
uni.navigateTo({
url:'/page_fenbao/gonglue/gongluexq?id=' + item.id
})
}else if(this.tabindex == 3){ //3
uni.navigateTo({
url:'/page_user/meishi/meishixq?id=' + item.id
})
}else if(this.tabindex == 4){ //4
uni.navigateTo({
url:'/page_user/wenhua/wenhuaxq?id=' + item.id
})
}else if(this.tabindex == 5){ //5
uni.navigateTo({
url:'/page_fenbao/guangchang/dongtaixq?id=' + item.id
})
}
},
//
handleSearch() {
this.pageNum = 1
this.getlist()
},
//
handqixing() {
this.getlist()
console.log('加载更多')
},
//
onRefresh() {
this.isRefreshing = true
this.pageNum = 1
setTimeout(() => {
this.getlist()
this.isRefreshing = false
}, 100)
},
// tab
btntab(item){
this.tabindex = item.type
this.pageNum = 1
this.getlist()
},
//
clearSearch() {
this.searchKeyword = ''
this.searchResult = []
},
//
getlist(){
if(this.tabindex == 1){ //1
this.$u.get(`/app/scenicArea/list?pageNum=${this.pageNum}&pageSize=20&keyword=${this.searchKeyword}`).then(res =>{
if(res.code == 200){
this.total = res.total
if(this.pageNum == 1){
this.shujulist = res.rows
this.pageNum++
}else{
this.shujulist = this.shujulist.concat(res.rows)
his.pageNum++
}
}
})
}else if(this.tabindex == 2){ //2
this.$u.get(`/app/strategy/list?pageNum=${this.pageNum}&pageSize=20&keyword=${this.searchKeyword}`).then(res =>{
if(res.code == 200){
this.total = res.total
if(this.pageNum == 1){
this.shujulist = res.rows
this.pageNum++
}else{
this.shujulist = this.shujulist.concat(res.rows)
this.pageNum++
}
}
})
}else if(this.tabindex == 3){ //3
this.$u.get(`/app/dish/list?pageNum=${this.pageNum}&pageSize=20&keyword=${this.searchKeyword}`).then(res =>{
if(res.code == 200){
this.total = res.total
if(this.pageNum == 1){
this.shujulist = res.rows
this.pageNum++
}else{
this.shujulist = this.shujulist.concat(res.rows)
this.pageNum++
}
}
})
}else if(this.tabindex == 4){ //4
this.$u.get(`/app/article/list?pageNum=${this.pageNum}&pageSize=20&keyword=${this.searchKeyword}&type=3`).then(res =>{
if(res.code == 200){
this.total = res.total
if(this.pageNum == 1){
this.shujulist = res.rows
this.pageNum++
}else{
this.shujulist = this.shujulist.concat(res.rows)
this.pageNum++
}
}
})
}else if(this.tabindex == 5){ //5
this.$u.get(`/app/feed/list?pageNum=${this.pageNum}&pageSize=20&keyword=${this.searchKeyword}`).then(res =>{
if(res.code == 200){
this.total = res.total
if(this.pageNum == 1){
this.shujulist = res.rows
this.pageNum++
}else{
this.shujulist = this.shujulist.concat(res.rows)
this.pageNum++
}
}
})
}
}
}
}
</script>
<style lang="scss">
.active{
border-bottom: 3px solid #1EC28B;
font-weight: 600 !important;
font-size: 30rpx !important;
color: #000 !important;
}
page {
background: #f5f5f5;
overflow: hidden;
}
//
.search-container {
padding: 20rpx 30rpx;
background: #fff;
border-bottom: 1px solid #f1f1f1;
padding-bottom: 0;
.tablist{
display: flex;
justify-content: space-between;
padding: 0 20rpx;
box-sizing: border-box;
margin-top: 30rpx;
view{
color: #666;
font-size: 28rpx;
padding-bottom: 10rpx;
}
}
.search-box {
flex: 1;
display: flex;
align-items: center;
background: #f5f5f5;
border-radius: 60rpx;
padding: 14rpx 24rpx;
.search-icon {
margin-right: 16rpx;
}
.search-input {
flex: 1;
font-size: 28rpx;
color: #333;
height: 40rpx;
line-height: 40rpx;
}
.clear-icon {
margin-left: 16rpx;
display: flex;
align-items: center;
}
}
.search-btn {
width: 120rpx;
height: 68rpx;
line-height: 68rpx;
text-align: center;
font-size: 28rpx;
color: #262B37;
font-weight: 500;
margin-left: 20rpx;
background-color: #1EC28B;
border-radius: 10rpx;
color: #fff;
}
}
//
.content {
height: 77vh;
padding-bottom: 30rpx;
overflow: scroll;
.list{
width: 700rpx;
height: 230rpx;
background-color: #fff;
margin: auto;
margin-top: 10rpx;
border-radius: 10rpx;
display: flex;
padding: 20rpx;
box-sizing: border-box;
overflow: hidden;
.lt{
width: 180rpx;
height: 180rpx;
margin-right: 20rpx;
image{
width: 180rpx;
height: 180rpx;
border-radius: 10rpx;
}
}
.rt{
.top{
display: flex;
justify-content: space-between;
width: 460rpx;
.ltwz{
font-size: 30rpx;
font-weight: 600;
}
.rtwz{
color: #1EC28B;
}
}
.jianjie{
color: #999;
margin-top: 10rpx;
}
}
}
}
</style>

View File

@ -0,0 +1,39 @@
<template>
<view class="page">
<u-navbar title="标题" :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37'
title-size='36' height='46' id="navbar">
</u-navbar>
</view>
</template>
<script>
export default {
data() {
return {
bgc: {
backgroundColor: "#fff",
},
}
},
onLoad(option) {
console.log(option);
},
methods: {
}
}
</script>
<style lang="scss">
::v-deep .u-icon__icon,
::v-deep .u-title{
padding-bottom: 22rpx !important;
}
page {
background: #fff;
}
</style>

View File

@ -76,6 +76,20 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},{
"path": "sousuo/index",
"style": {
"navigationBarTitleText": "上传",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},{
"path": "sousuo/sousuocont",
"style": {
"navigationBarTitleText": "上传",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},{ },{
"path": "daolan", "path": "daolan",
"style": { "style": {

View File

@ -10,15 +10,15 @@
<image style="width: 100%;height: 100%;border-radius: 50%;" src="https://api.ccttiot.com/21zwLDYqBJaa6b68ccc6ea37c67c785fa46193ba46c2.png" mode="aspectFill"></image> <image style="width: 100%;height: 100%;border-radius: 50%;" src="https://api.ccttiot.com/21zwLDYqBJaa6b68ccc6ea37c67c785fa46193ba46c2.png" mode="aspectFill"></image>
</view> </view>
<view class="shuru"> <view class="shuru">
<input type="text" placeholder="搜索景区、酒店" /> <input type="text" placeholder="搜索景区、酒店" disabled="true" @click="btnsousuo"/>
<image src="https://api.ccttiot.com/smartmeter/img/static/uAO3fdmrrHTzqbVx9hYd" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uAO3fdmrrHTzqbVx9hYd" mode=""></image>
</view> </view>
</view> </view>
<view class="fenlei" style="height: 360rpx;padding-top: 100rpx;gap: 16rpx;"> <view class="fenlei" style="height: 360rpx;padding-top: 100rpx;gap: 16rpx;">
<!-- <view class="icon" @click="btnpage(1)"> <view class="icon" @click="btnpage(1)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uNvp27XBB0SGRJdwBatm" mode=""> <image src="https://api.ccttiot.com/smartmeter/img/static/uNvp27XBB0SGRJdwBatm" mode="">
</image> </image>
</view> --> <!-- 导览 --> </view> <!-- 导览 -->
<view class="icon" @click="btnpage(2)"> <view class="icon" @click="btnpage(2)">
<image src="https://api.ccttiot.com/smartmeter/img/static/ujtaJ9yoGaSoU2y7d8o0" mode=""> <image src="https://api.ccttiot.com/smartmeter/img/static/ujtaJ9yoGaSoU2y7d8o0" mode="">
</image> <!-- 攻略 --> </image> <!-- 攻略 -->
@ -58,7 +58,7 @@
<image style="width: 100%;height: 100%;border-radius: 50%;" src="https://api.ccttiot.com/21zwLDYqBJaa6b68ccc6ea37c67c785fa46193ba46c2.png" mode="aspectFill"></image> <image style="width: 100%;height: 100%;border-radius: 50%;" src="https://api.ccttiot.com/21zwLDYqBJaa6b68ccc6ea37c67c785fa46193ba46c2.png" mode="aspectFill"></image>
</view> </view>
<view class="shuru"> <view class="shuru">
<input type="text" placeholder="搜索景区、酒店" /> <input type="text" placeholder="搜索景区、酒店" disabled="true" @click="btnsousuo"/>
<image src="https://api.ccttiot.com/smartmeter/img/static/uAO3fdmrrHTzqbVx9hYd" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uAO3fdmrrHTzqbVx9hYd" mode=""></image>
</view> </view>
</view> </view>
@ -75,10 +75,10 @@
:scroll-with-animation="true" :scroll-with-animation="true"
show-scrollbar="false"> show-scrollbar="false">
<view class="fenlei"> <view class="fenlei">
<!-- <view class="icon" @click="btnpage(1)"> <view class="icon" @click="btnpage(1)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uNvp27XBB0SGRJdwBatm" mode=""> <image src="https://api.ccttiot.com/smartmeter/img/static/uNvp27XBB0SGRJdwBatm" mode="">
</image> </image>
</view> --><!-- 导览 --> </view><!-- 导览 -->
<view class="icon" @click="btnpage(2)"> <view class="icon" @click="btnpage(2)">
<image src="https://api.ccttiot.com/smartmeter/img/static/ujtaJ9yoGaSoU2y7d8o0" mode=""> <image src="https://api.ccttiot.com/smartmeter/img/static/ujtaJ9yoGaSoU2y7d8o0" mode="">
</image> <!-- 攻略 --> </image> <!-- 攻略 -->
@ -306,6 +306,7 @@
} }
}, },
onLoad() { onLoad() {
this.getinfo()
this.gethome() this.gethome()
this.getlunbo() this.getlunbo()
this.addRandomData() this.addRandomData()
@ -413,6 +414,42 @@
} }
}, },
methods: { methods: {
//
btnsousuo(){
uni.navigateTo({
url:'/page_user/sousuo/index'
})
},
//
getinfo(){
this.$u.get("/getInfo").then(res =>{
if(res.code == 200){
}else if(res.code == 401){
this.getlogo()
}
})
},
//
getlogo(){
let taht = this
wx.login({
success(res) {
if (res.code) {
let data = {
loginCode: res.code,
appId:taht.$store.state.appid
}
taht.$u.post('/wxLogin', data).then(res => {
if (res.code == 200) {
uni.setStorageSync('token', res.token)
taht.getinfo()
}
})
}
},
})
},
// //
gethome(){ gethome(){
this.$u.get(`/app/home`).then(res =>{ this.$u.get(`/app/home`).then(res =>{

View File

@ -469,8 +469,9 @@
} else { } else {
console.error('WebSocket重连次数已达上限停止重连') console.error('WebSocket重连次数已达上限停止重连')
uni.showToast({ uni.showToast({
title: '网络连接异常', title: '建立连接异常',
icon: 'none' icon: 'none',
duration:3000
}) })
} }
}, },