玩转福鼎
This commit is contained in:
parent
ab567f4b35
commit
3d0194e754
|
|
@ -16,7 +16,7 @@ const install = (Vue, vm) => {
|
|||
// },
|
||||
// });
|
||||
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: 'https://fd.ccttiot.com/prod-api',
|
||||
loadingText: '努力加载中~',
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<u-navbar title=" " :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37'
|
||||
title-size='36' height='36' id="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>
|
||||
|
|
|
|||
338
page_user/sousuo/index.vue
Normal file
338
page_user/sousuo/index.vue
Normal 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>
|
||||
39
page_user/sousuo/sousuocont.vue
Normal file
39
page_user/sousuo/sousuocont.vue
Normal 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>
|
||||
14
pages.json
14
pages.json
|
|
@ -76,6 +76,20 @@
|
|||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
"path": "sousuo/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "上传",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
"path": "sousuo/sousuocont",
|
||||
"style": {
|
||||
"navigationBarTitleText": "上传",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
"path": "daolan",
|
||||
"style": {
|
||||
|
|
|
|||
|
|
@ -10,15 +10,15 @@
|
|||
<image style="width: 100%;height: 100%;border-radius: 50%;" src="https://api.ccttiot.com/21zwLDYqBJaa6b68ccc6ea37c67c785fa46193ba46c2.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
<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>
|
||||
</view> --> <!-- 导览 -->
|
||||
</view> <!-- 导览 -->
|
||||
<view class="icon" @click="btnpage(2)">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ujtaJ9yoGaSoU2y7d8o0" mode="">
|
||||
</image> <!-- 攻略 -->
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
<image style="width: 100%;height: 100%;border-radius: 50%;" src="https://api.ccttiot.com/21zwLDYqBJaa6b68ccc6ea37c67c785fa46193ba46c2.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -75,10 +75,10 @@
|
|||
:scroll-with-animation="true"
|
||||
show-scrollbar="false">
|
||||
<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>
|
||||
</view> --><!-- 导览 -->
|
||||
</view><!-- 导览 -->
|
||||
<view class="icon" @click="btnpage(2)">
|
||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ujtaJ9yoGaSoU2y7d8o0" mode="">
|
||||
</image> <!-- 攻略 -->
|
||||
|
|
@ -306,6 +306,7 @@
|
|||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getinfo()
|
||||
this.gethome()
|
||||
this.getlunbo()
|
||||
this.addRandomData()
|
||||
|
|
@ -413,6 +414,42 @@
|
|||
}
|
||||
},
|
||||
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(){
|
||||
this.$u.get(`/app/home`).then(res =>{
|
||||
|
|
|
|||
|
|
@ -469,8 +469,9 @@
|
|||
} else {
|
||||
console.error('WebSocket重连次数已达上限,停止重连')
|
||||
uni.showToast({
|
||||
title: '网络连接异常',
|
||||
icon: 'none'
|
||||
title: '建立连接异常',
|
||||
icon: 'none',
|
||||
duration:3000
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user