Browse Source

获取分类,获取首页头部信息,根据分类获取动态帖子列表带分页接口

master
Bobi 4 months ago
parent
commit
5667780986
9 changed files with 127 additions and 98 deletions
  1. +30
    -0
      api/api.js
  2. +3
    -3
      config.js
  3. +69
    -55
      pages/index/index.vue
  4. +2
    -35
      pages_order/components/list/workList/index.vue
  5. +1
    -1
      pages_order/components/list/workList/workItem.vue
  6. +2
    -2
      pages_order/recruit/recruitDetail.vue
  7. +3
    -0
      pages_order/recruit/recruitList.vue
  8. +2
    -0
      pages_order/renting/rentingDetail.vue
  9. +15
    -2
      pages_order/renting/rentingList.vue

+ 30
- 0
api/api.js View File

@ -39,6 +39,36 @@ const config = {
url: '/login/getUserAgreement', url: '/login/getUserAgreement',
method: 'GET', method: 'GET',
}, },
// 不需要登录的接口
//获取分类
getClassInfo: {
url: '/api/city/getClassInfo',
method: 'GET',
},
//获取首页头部信息
getIndexHeaderInfo: {
url: '/api/city/getIndexHeaderInfo',
method: 'GET',
},
//获取工作信息列表
getJobPage: {
url: '/api/city/getJobPage',
method: 'GET',
},
//根据分类获取租房信息列表
getRentPage: {
url: '/api/city/getRentPage',
method: 'GET',
},
//根据分类获取动态帖子列表带分页
getPostPage: {
url: '/api/city/getPostPage',
method: 'GET',
},
} }


+ 3
- 3
config.js View File

@ -7,16 +7,16 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI); Vue.use(uvUI);
// 当前环境 // 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置 // 环境配置
const config = { const config = {
dev : { dev : {
baseUrl : 'http://www.gcosc.fun:82',
baseUrl : 'http://h5.xzaiyp.top',
}, },
prod : { prod : {
baseUrl : 'http://xxx.xxx.xxx/xxx',
baseUrl : 'https://admin.hhlm1688.com',
} }
} }


+ 69
- 55
pages/index/index.vue View File

@ -5,15 +5,15 @@
<view class="Headbackground"> <view class="Headbackground">
<view class="top"> <view class="top">
<view class=" profilePicture"> <view class=" profilePicture">
<image :src="headinfo.headImage" mode=""></image>
</view> </view>
<view class="UniversalWall"> <view class="UniversalWall">
<view class="dynamic"> <view class="dynamic">
瑶都万能墙
{{headinfo.name}}
</view> </view>
<view class="dynamics"> <view class="dynamics">
13542动态<text>|</text>23212江华人
{{headinfo.num}}动态<text>|</text>{{headinfo.userNum}}江华人
</view> </view>
</view> </view>
@ -39,22 +39,25 @@
</view> </view>
<view class="LabelOptions"> <view class="LabelOptions">
<uv-tabs :list="list"
<uv-tabs :list="tabs"
:activeStyle="{color : '#000', fontWeight : 900}" :activeStyle="{color : '#000', fontWeight : 900}"
lineColor="#00f" lineColor="#00f"
lineHeight="8rpx" lineHeight="8rpx"
lineWidth="50rpx" lineWidth="50rpx"
keyName="title"
@click="tabsClick"></uv-tabs> @click="tabsClick"></uv-tabs>
</view> </view>
<view class="works" :key="index" v-for="(item, index) in 10">
<view class="works" :key="index"
v-for="(item, index) in list">
<view class="box"> <view class="box">
<view class="headPortraitimg"> <view class="headPortraitimg">
<!-- <image :src="item" mode=""></image> -->
</view> </view>
<view class="YaoduUniversalWall"> <view class="YaoduUniversalWall">
<view class="heide"> <view class="heide">
<view class="username text-ellipsis"> <view class="username text-ellipsis">
瑶都万能墙
</view> </view>
<view class="inde"> <view class="inde">
男性 男性
@ -72,39 +75,31 @@
<view class="Times"> <view class="Times">
<view class="TimeMonth"> <view class="TimeMonth">
10-08
</view>
<view class="Month">
12:34发布
<!-- 10-08 -->
{{ item.createTime }}发布
</view> </view>
<!-- <view class="Month">
12:34
</view> -->
</view> </view>
</view> </view>
</view> </view>
<view class="dynamics">
漫时光蛋糕店私人蛋糕订制
漫时光蛋糕店私人蛋糕订制
漫时光蛋糕店私人蛋糕订制
漫时光蛋糕店私人蛋糕订制
漫时光蛋糕店私人蛋糕订制
</view>
<view class="">
<view class="dynamics"
v-html="$utils.stringFormatHtml(item.title)">
</view> </view>
<view class="Artworkimages"> <view class="Artworkimages">
<view class="wrokimg" <view class="wrokimg"
:key="i" :key="i"
v-for="(img, i) in 3">
<image
src="https://img2.baidu.com/it/u=731471589,1077533873&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1067"
alt="" />
v-for="(img, i) in item.image && item.image.split(',')">
<image :src="img" mode=""></image>
</view> </view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="browse"> <view class="browse">
6789浏览
{{ item.isBrowse }}浏览
</view> </view>
<view class="browse"> <view class="browse">
231条评论
{{ item.isComment }}条评论
</view> </view>
<view class="Leavingamessage"> <view class="Leavingamessage">
<uv-icon size="30rpx" name="chat"></uv-icon> <uv-icon size="30rpx" name="chat"></uv-icon>
@ -164,35 +159,18 @@
}, },
data() { data() {
return { return {
list: [
{
name: '圈子动态',
},
{
name: '二手集市',
},
{
name: '游戏组局'
},
{
name: '求租求购'
},
{
name: '婚恋交友'
},
{
name: '美食'
},
{
name: '文化'
},
{
name: '财经'
},
{
name: '手工'
},
tabs: [
// {
// name: '',
// },
// {
// name: '',
// },
// {
// name: ''
// },
], ],
headinfo: {},
menu : [ menu : [
{ {
name : '租房', name : '租房',
@ -224,8 +202,14 @@
// path : '/pages_order/recruit/addRecruit', // path : '/pages_order/recruit/addRecruit',
// }, // },
], ],
mixinsListApi : 'getPostPage',
} }
}, },
onShow() {
this.getCategory()
this.getIndexHeaderInfo()
this.getData()
},
computed: {}, computed: {},
methods: { methods: {
tabsClick(item) { tabsClick(item) {
@ -248,6 +232,35 @@
}) })
} }
}, },
//
getCategory(){
//
this.$api('getClassInfo', res => {
if(res.code == 200){
this.tabs = res.result
}
})
},
//
getIndexHeaderInfo(){
this.$api('getIndexHeaderInfo',res =>{
if(res.code == 200){
this.headinfo = res.result
}
})
},
//
// getPostPage(){
// this.$api('getPostPage', {
// pageNo : 1,
// pageSize : 10,
// },res =>{
// if(res.code == 200){
// this.postList = res.result.records
// }
// console.log(res);
// })
// }
} }
} }
</script> </script>
@ -272,8 +285,9 @@
.profilePicture { .profilePicture {
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
background-color: greenyellow;
border-radius: 15rpx;
image{
border-radius: 20rpx;
}
} }
.UniversalWall { .UniversalWall {


+ 2
- 35
pages_order/components/list/workList/index.vue View File

@ -25,7 +25,7 @@
default : 'auto' default : 'auto'
}, },
api : { api : {
default : 'employeeQueryJobList'
default : 'getJobPage'
} }
}, },
data() { data() {
@ -35,44 +35,11 @@
pageSize: 10, pageSize: 10,
}, },
total : 0, total : 0,
list : [
{
title : 'Java工程师',
salaryLow : 9000,
salaryUp : 12000,
tab : '应届生、包吃',
workAddress : '长沙',
},
{
title : 'Java工程师',
salaryLow : 9000,
salaryUp : 12000,
tab : '应届生、包吃',
workAddress : '长沙',
},
{
title : 'Java工程师',
salaryLow : 9000,
salaryUp : 12000,
tab : '应届生、包吃',
workAddress : '长沙',
},
{
title : 'Java工程师',
salaryLow : 9000,
salaryUp : 12000,
tab : '应届生、包吃',
workAddress : '长沙',
},
],
list : [],
} }
}, },
methods: { methods: {
getData(){ getData(){
if(uni.getStorageSync('token')){
this.queryParams.token = uni.getStorageSync('token')
}
this.$api(this.api, this.queryParams, res => { this.$api(this.api, this.queryParams, res => {
if(res.code == 200){ if(res.code == 200){
this.list = res.result.records || res.result this.list = res.result.records || res.result


+ 1
- 1
pages_order/components/list/workList/workItem.vue View File

@ -31,7 +31,7 @@
<view class="bottom"> <view class="bottom">
<view class="address"> <view class="address">
<!-- <text>2.5km | 楚河汉区</text> --> <!-- <text>2.5km | 楚河汉区</text> -->
{{ item.workAddress }}
{{ item.userId }}
</view> </view>
<view class="time"> <view class="time">
<!-- 09月23日 1620 --> <!-- 09月23日 1620 -->


+ 2
- 2
pages_order/recruit/recruitDetail.vue View File

@ -17,11 +17,11 @@
{{ detail.workAge }} {{ detail.workAge }}
</view> --> </view> -->
<view> <view>
<image src="../static/work/g.png" mode=""></image>
<!-- <image src="../static/work/g.png" mode=""></image> -->
{{ detail.workAge }} {{ detail.workAge }}
</view> </view>
<view> <view>
<image src="../static/work/x.png" mode=""></image>
<!-- <image src="../static/work/x.png" mode=""></image> -->
{{ detail.qulification }} {{ detail.qulification }}
</view> </view>
</view> </view>


+ 3
- 0
pages_order/recruit/recruitList.vue View File

@ -18,6 +18,9 @@
} }
}, },
onShow() {
this.$refs.workList.getData()
},
methods: { methods: {
} }


+ 2
- 0
pages_order/renting/rentingDetail.vue View File

@ -110,6 +110,7 @@
} }
}, },
onShow() { onShow() {
}, },
methods: { methods: {
@ -127,6 +128,7 @@
phoneNumber: '10086', phoneNumber: '10086',
}); });
}, },
} }
} }
</script> </script>


+ 15
- 2
pages_order/renting/rentingList.vue View File

@ -53,8 +53,8 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
@ -62,14 +62,28 @@
data() { data() {
return { return {
keyword : '', keyword : '',
queryParams : {
pageNo : 1,
pageSize : 10,
}
} }
}, },
onShow() {
this.getRentPage()
},
methods: { methods: {
clickDetail(){ clickDetail(){
uni.navigateTo({ uni.navigateTo({
url: '/pages_order/renting/rentingDetail' url: '/pages_order/renting/rentingDetail'
}) })
},
//
getRentPage(){
this.$api('getRentPage', this.queryParams,res =>{
// console.log(res);
})
} }
} }
} }
</script> </script>
@ -78,7 +92,6 @@
.container { .container {
padding: 0 30rpx; padding: 0 30rpx;
} }
.area { .area {
width: 154rpx; width: 154rpx;
line-height: 78rpx; line-height: 78rpx;


Loading…
Cancel
Save