1.17(发现,广场

This commit is contained in:
Hong
2024-01-17 19:41:55 +08:00
parent 2e6da228b8
commit 59f38fae17
6 changed files with 185 additions and 50 deletions

22
api/discover/discover.js Normal file
View File

@@ -0,0 +1,22 @@
import request from '@/utils/request'
/**
* 发现,广场列表
*/
export function getPlazaList(params) {
return request({
url: '/api/front/community/note/discover/list',
method: 'get',
params
})
}
/**
* 发现,广场列表
*/
export function plazaNoteAdd(data) {
return request({
url: '/api/front/community/note/add',
method: 'post',
data
})
}

View File

@@ -118,11 +118,11 @@ export const indexTabList = [{
type:'true'
}, {
name: '关注',
value: 2,
value: 3,
type:'true'
}, {
name: '转租',
value: 3,
value: 2,
type:'true'
}, {
name: '此地',

View File

@@ -4,7 +4,7 @@ import { HMAC } from './hmac.js'
import { SHA1 } from './sha1.js'
// 下面这3个信息必填
const url = 'https://jimte.oss-cn-hangzhou.aliyuncs.com/'
const url = 'https://qicheoss.oss-cn-shanghai.aliyuncs.com/'
const OSSAccessKeyId = 'LTAI5tFZzfAMHw3WJNQtrhBZ'
const OssAccesskeySercet= 'rqZUht8RhrAfxDltWeGs1Yzpqzmu8W';
let date = new Date();

View File

@@ -468,7 +468,8 @@
}, {
"path" : "pages/index/post",
"style" : {
"navigationBarTitleText" : ""
"navigationBarTitleText" : "",
"navigationStyle": "custom"
}
}, {
"path" : "pages/welfare/rightsInterests/rightsInterests",

View File

@@ -1,5 +1,5 @@
<template>
<view class="content">
<view class="content">
<view class="navbar-box fixed-top bg-white">
<!-- #ifdef MP-WEIXIN -->
<view :style="{height: `${$u.sys().statusBarHeight}px;`}" />
@@ -17,17 +17,18 @@
<view class="search-box flex align-center">
<!-- #ifdef APP -->
<image src="@/static/images/app/icon/search.png" mode=""></image>
<!-- #endif -->
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<image :src="`${config.aliyunOssUrl}/static/images/app/icon/search.png`" mode=""></image>
<!-- #endif -->
<text>搜索</text>
</view>
<u-icon name="plus" size="22" @click="$tab.navigateTo('./post')" />
<u-icon name="plus" size="22" @click="$tab.navigateTo(`./post?type=${actTabType}`)" />
</view>
<!-- tab蓝 -->
<view class="tab-box">
<u-tabs inactiveStyle="color:#666;" :scrollable="false" :current="current" lineColor="#13AFA8" lineWidth="32" :list="indexTabList"></u-tabs>
<u-tabs inactiveStyle="color:#666;" :scrollable="false" :current="current" lineColor="#13AFA8"
lineWidth="32" :list="indexTabList" @click="tabClick"></u-tabs>
</view>
</view>
<view class="">
@@ -39,22 +40,23 @@
<!-- #endif -->
</view>
<view style="height: 200rpx;" />
<view class="swiper-box">
<u-swiper keyName="image" :list="brannerList" height="560rpx" @change="brannerChange" @click="brannerClick"></u-swiper>
<u-swiper keyName="image" :list="brannerList" height="560rpx" @change="brannerChange"
@click="brannerClick"></u-swiper>
</view>
<view class="list-box">
<z-paging use-page-scroll>
<view class="user-item border-bottom border-eee">
<z-paging use-page-scroll ref="paging" v-model="dataList" @query="queryList()">
<view class="user-item border-bottom border-eee" v-for="(item,index) in dataList" :key="index">
<view class="user-info flex align-center justify-between">
<view class="left flex align-center">
<image src="" mode=""></image>
<image :src="item.authorAvatar" mode=""></image>
<view class="">
<view class="f-28 c666">
nickName
{{item.authorName}}
</view>
<view class="f-24 c666">
IP 杭州 1天前
IP 杭州 {{item.diffDays}}天前
</view>
</view>
</view>
@@ -68,12 +70,14 @@
</view>
</view>
<view class="content-title line-two">
路上的风景拉萨解放拉萨解放拉萨弗兰克是 的首发式地方啊手动阀撒打发会卡死东海防空收到回复快速导航反抗精神的发
{{item.content}}
</view>
<view class="image-list-box" :class="[]">
<image class="image-one" src="" mode=""></image>
<image class="image-two" src="" mode=""></image>
<image class="image-three" src="" mode=""></image>
<view class="image-list-box flex-wrap flex">
<view v-for="(itemImage,index) in item.image">
<image v-show="item.image.length==1" class="image-one" :src="itemImage" mode=""></image>
<image v-show="item.image.length==2" class="image-two" :src="itemImage" mode=""></image>
<image v-show="item.image.length>2" class="image-three" :src="itemImage" mode=""></image>
</view>
</view>
<view class="faceback-box flex align-center justify-end">
<view class="faceback-box-item flex align-center">
@@ -81,60 +85,108 @@
<image src="@/static/images/app/mine/share.png" mode="heightFix"></image>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<image :src="`${config.aliyunOssUrl}/static/images/app/mine/share.png`" mode="heightFix"></image>
<image :src="`${config.aliyunOssUrl}/static/images/app/mine/share.png`" mode="heightFix">
</image>
<!-- #endif -->
165
{{item.shareNum}}
</view>
<view class="faceback-box-item flex align-center">
<!-- #ifdef APP -->
<image src="@/static/images/app/mine/information.png" mode="heightFix"></image>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<image :src="`${config.aliyunOssUrl}/static/images/app/mine/information.png`" mode="heightFix"></image>
<image :src="`${config.aliyunOssUrl}/static/images/app/mine/information.png`"
mode="heightFix"></image>
<!-- #endif -->
165
{{item.replyNum}}
</view>
<view class="faceback-box-item flex align-center">
<!-- #ifdef APP -->
<image src="@/static/images/app/mine/like.png" mode="heightFix"></image>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<image :src="`${config.aliyunOssUrl}/static/images/app/mine/like.png`" mode="heightFix"></image>
<image :src="`${config.aliyunOssUrl}/static/images/app/mine/like.png`" mode="heightFix">
</image>
<!-- #endif -->
165
{{item.likeNum}}
</view>
</view>
</view>
</z-paging>
</view>
</view>
</view>
</template>
<script>
import { indexTabList } from '@/data/tabsData'
import { brannerList } from '@/api/system/config'
export default {
import {
indexTabList
} from '@/data/tabsData'
import {
brannerList
} from '@/api/system/config'
import {
getPlazaList
} from "@/api/discover/discover.js"
import {
data
} from '../../uni_modules/uview-ui/libs/mixin/mixin'
export default {
data() {
return {
current: 0,
config: getApp().globalData.config,
indexTabList,
brannerList: []
brannerList: [],
//当前tab
actTabType: 1,
dataList: []
}
},
onShow() {
onShow() {
this.init()
},
methods: {
//tab
tabClick(e) {
console.log(e);
this.actTabType = e.value
},
// 初始化
init() {
this.getBrannerList()
this.getPlazaListFn()
},
// 获取轮播图
getBrannerList() {
brannerList({type: 6}).then(res => {
brannerList({
type: 6
}).then(res => {
this.brannerList = res.data.list
})
},
queryList(pageNo, pageSize) {
// 此处请求仅为演示,请替换为自己项目中的请求
let obj = {
page: pageNo,
limit: pageSize,
}
getPlazaList(obj).then(res => {
res.data.list.forEach(item => {
item.image = item.image.split(",")
const date1 = new Date();
const date2 = new Date(item.createTime);
// 计算相差的毫秒数
const diffTime = Math.abs(date2 - date1);
// 将毫秒数转换为天数
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
item.diffDays = diffDays
})
this.$refs.paging.complete(res.data.list);
})
},
//获取广场列表
getPlazaListFn() {
},
// 点击轮播图
brannerClick(e) {
@@ -143,7 +195,7 @@
},
brannerChange() {},
}
}
}
</script>
<style lang="scss">
@@ -155,6 +207,7 @@
width: 550rpx;
// #endif
height: 88rpx;
.messgage-icon {
.num {
top: -8rpx;
@@ -166,12 +219,14 @@
text-align: center;
line-height: 32rpx;
}
image {
margin-left: 12rpx;
width: 48rpx;
height: 48rpx;
}
}
.search-box {
margin: 0 20rpx;
padding: 0 24rpx;
@@ -179,23 +234,29 @@
height: 64rpx;
background: #F5F5F5;
border-radius: 32rpx;
image {
width: 30rpx;
height: 30rpx;
}
}
}
.tab-box {
width: 750rpx;
}
}
.swiper-box {
padding: 0 32rpx;
}
.list-box {
padding: 0 32rpx;
.user-item {
padding-top: 48rpx;
.user-info {
.left {
image {
@@ -206,6 +267,7 @@
background-color: red;
}
}
.image-box {
image {
width: 32rpx;
@@ -213,6 +275,7 @@
}
}
}
.content-title {
margin-top: 16rpx;
height: 86rpx;
@@ -222,34 +285,42 @@
color: #111111;
line-height: 43rpx;
}
.image-list-box {
width: 100%;
margin-top: 24rpx;
.image-one {
width: 686rpx;
height: 386rpx;
border-radius: 8rpx;
background-color: red;
}
.image-two {
width: 330rpx;
height: 206rpx;
box-shadow: 0rpx 0rpx 4rpx 0rpx rgba(0,0,0,0.09);
box-shadow: 0rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.09);
border-radius: 8rpx;
background-color: red;
}
.image-three {
width: 218rpx;
height: 218rpx;
box-shadow: 0rpx 0rpx 4rpx 0rpx rgba(0,0,0,0.09);
box-shadow: 0rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.09);
border-radius: 8rpx;
background-color: red;
}
}
.faceback-box {
padding: 34rpx 0;
.faceback-box-item {
margin-left: 48rpx;
}
image {
margin: 0 16rpx;
height: 30rpx;
@@ -258,4 +329,4 @@
}
}
}
</style>
</style>

View File

@@ -13,7 +13,8 @@
</view>
发帖子
<view class="btn abs nav-item">
<u-button :customStyle="{margin: 0, width: '144rpx', height: '56rpx'}" color="#13AFA8" >发布</u-button>
<u-button @click="issueFn" :customStyle="{margin: 0, width: '144rpx', height: '56rpx'}"
color="#13AFA8">发布</u-button>
</view>
</view>
</view>
@@ -28,12 +29,14 @@
<view class="" style="height: 88rpx;" />
</view>
<view class="textarea-box">
<u-textarea border="none" placeholder="请输入你的内容"></u-textarea>
<u-textarea border="none" v-model="content" placeholder="请输入你的内容"></u-textarea>
</view>
<view class="upload-image-box flex-wrap align-center">
<view class="upload-image-item rel" :style="{marginRight: index%3==2 ? '0' : '24rpx'}" v-for="(item,index) in picList" :key="index">
<view class="upload-image-box flex-wrap align-center">
<view class="upload-image-item rel" :style="{marginRight: index%3==2 ? '0' : '24rpx'}"
v-for="(item,index) in picList" :key="index">
<image class="upload-image" :src="item" mode=""></image>
<image class="clear abs" src="@/static/images/app/serve/realname_clea.png" @click="DelPic('faultImage')" mode=""></image>
<image class="clear abs" src="@/static/images/app/serve/realname_clea.png" @click="DelPic('faultImage')"
mode=""></image>
</view>
<view class="upload-image-item" @click="getImage">
<image class="upload-image" src="@/static/images/app/serve/realname_upload.png" mode=""></image>
@@ -43,28 +46,57 @@
</template>
<script>
import {
plazaNoteAdd
} from "@/api/discover/discover.js"
export default {
data() {
return {
picList: []
picList: [],
content: '',
//分类id
categoryId:1,
};
},
methods: {
//发布
issueFn() {
console.log(this.content, '文本');
console.log(this.picList, '图片');
uni.showLoading({
title: '发布中...'
});
plazaNoteAdd({
content:this.content,
image:this.picList.join(','),
replyStatus:1,
type:1,
categoryId:this.categoryId
}).then(res=>{
console.log('发布成功');
uni.hideLoading();
uni.navigateBack()
})
},
//传图片
getImage() {
this.$util.uploadImageOne({
count: 1,
count: 9,
sizeType: ['original'],
sourceType:['album', 'camera'],
dir:'crmebimage/public/product/'
},null,res=>{
this.picList.push(res)
sourceType: ['album', 'camera'],
dir: 'crmebimage/public/product/'
}, null, res => {
this.picList.push(res.data)
uni.hideLoading();
});
},
DelPic(index) {
this.picList.splice(index,1)
this.picList.splice(index, 1)
},
},
onLoad(options) {
console.log(options);
this.categoryId=options.type
}
}
</script>
@@ -72,39 +104,48 @@
<style lang="scss">
.navbar-box {
border-bottom: 1rpx solid #eee;
.navbar-title {
width: 750rpx;
line-height: 88rpx;
.back {
left: 24rpx;
}
.btn {
right: 24rpx;
}
.nav-item {
top: 50%;
transform: translateY(-50%);
}
}
}
.textarea-box {
padding: 48rpx;
width: 750rpx;
height: 434rpx;
}
.upload-image-box {
padding: 0 48rpx;
width: 750rpx;
.upload-image-item {
margin-bottom: 24rpx;
width: 202rpx;
height: 202rpx;
}
.upload-image {
width: 202rpx;
height: 202rpx;
border-radius: 8rpx;
}
.clear {
top: -16rpx;
right: -16rpx;
@@ -112,4 +153,4 @@
height: 32rpx;
}
}
</style>
</style>