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',
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);
// 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置
const config = {
dev : {
baseUrl : 'http://www.gcosc.fun:82',
baseUrl : 'http://h5.xzaiyp.top',
},
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="top">
<view class=" profilePicture">
<image :src="headinfo.headImage" mode=""></image>
</view>
<view class="UniversalWall">
<view class="dynamic">
瑶都万能墙
{{headinfo.name}}
</view>
<view class="dynamics">
13542动态<text>|</text>23212江华人
{{headinfo.num}}动态<text>|</text>{{headinfo.userNum}}江华人
</view>
</view>
@ -39,22 +39,25 @@
</view>
<view class="LabelOptions">
<uv-tabs :list="list"
<uv-tabs :list="tabs"
:activeStyle="{color : '#000', fontWeight : 900}"
lineColor="#00f"
lineHeight="8rpx"
lineWidth="50rpx"
keyName="title"
@click="tabsClick"></uv-tabs>
</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="headPortraitimg">
<!-- <image :src="item" mode=""></image> -->
</view>
<view class="YaoduUniversalWall">
<view class="heide">
<view class="username text-ellipsis">
瑶都万能墙
</view>
<view class="inde">
男性
@ -72,39 +75,31 @@
<view class="Times">
<view class="TimeMonth">
10-08
</view>
<view class="Month">
12:34发布
<!-- 10-08 -->
{{ item.createTime }}发布
</view>
<!-- <view class="Month">
12:34
</view> -->
</view>
</view>
</view>
<view class="dynamics">
漫时光蛋糕店私人蛋糕订制
漫时光蛋糕店私人蛋糕订制
漫时光蛋糕店私人蛋糕订制
漫时光蛋糕店私人蛋糕订制
漫时光蛋糕店私人蛋糕订制
</view>
<view class="">
<view class="dynamics"
v-html="$utils.stringFormatHtml(item.title)">
</view>
<view class="Artworkimages">
<view class="wrokimg"
: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 class="bottom">
<view class="browse">
6789浏览
{{ item.isBrowse }}浏览
</view>
<view class="browse">
231条评论
{{ item.isComment }}条评论
</view>
<view class="Leavingamessage">
<uv-icon size="30rpx" name="chat"></uv-icon>
@ -164,35 +159,18 @@
},
data() {
return {
list: [
{
name: '圈子动态',
},
{
name: '二手集市',
},
{
name: '游戏组局'
},
{
name: '求租求购'
},
{
name: '婚恋交友'
},
{
name: '美食'
},
{
name: '文化'
},
{
name: '财经'
},
{
name: '手工'
},
tabs: [
// {
// name: '',
// },
// {
// name: '',
// },
// {
// name: ''
// },
],
headinfo: {},
menu : [
{
name : '租房',
@ -224,8 +202,14 @@
// path : '/pages_order/recruit/addRecruit',
// },
],
mixinsListApi : 'getPostPage',
}
},
onShow() {
this.getCategory()
this.getIndexHeaderInfo()
this.getData()
},
computed: {},
methods: {
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>
@ -272,8 +285,9 @@
.profilePicture {
width: 100rpx;
height: 100rpx;
background-color: greenyellow;
border-radius: 15rpx;
image{
border-radius: 20rpx;
}
}
.UniversalWall {


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

@ -25,7 +25,7 @@
default : 'auto'
},
api : {
default : 'employeeQueryJobList'
default : 'getJobPage'
}
},
data() {
@ -35,44 +35,11 @@
pageSize: 10,
},
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: {
getData(){
if(uni.getStorageSync('token')){
this.queryParams.token = uni.getStorageSync('token')
}
this.$api(this.api, this.queryParams, res => {
if(res.code == 200){
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="address">
<!-- <text>2.5km | 楚河汉区</text> -->
{{ item.workAddress }}
{{ item.userId }}
</view>
<view class="time">
<!-- 09月23日 1620 -->


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

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


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

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


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

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


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

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


Loading…
Cancel
Save