Browse Source

社区留言

dev
396316021 1 year ago
parent
commit
6be59416be
  1. 13
      api/other.js
  2. 5
      pages.json
  3. 46
      pages/Feed/components/leave.scss
  4. 134
      pages/Feed/index.vue
  5. 186
      pages/Feed/leave.vue
  6. 15
      pages/Index/components/UserPage/index.vue

13
api/other.js

@ -198,3 +198,16 @@ export function bannerDetail(data) {
data
});
}
/**
* 社区留言列表
* @param {Object} data
*/
export function feedList(data) {
return request({
url: `${host}/common/up-feekback-list`,
method: "get",
data
});
}

5
pages.json

@ -251,6 +251,11 @@
"style" : {
"navigationBarTitleText" : "自动文章"
}
},{
"path" : "pages/Feed/leave",
"style" : {
"navigationBarTitleText" : "社区留言板"
}
}
],
"globalStyle" : {

46
pages/Feed/components/leave.scss

@ -0,0 +1,46 @@
.body-background{
background: {
color:#F5F5F6;
};
height:100vh;
}
.app-wallpaper{
padding:16rpx 26rpx;
.leave-tab{
background-color: #fff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
padding-bottom:15rpx;
border-bottom:2rpx solid #f5f5f6;
}
.leave-advisor-tab{
background-color: #fff;
border-radius: 20rpx;
padding-bottom:15rpx;
border-bottom:2rpx solid #f5f5f6;
margin-bottom:16rpx;
}
.leave-content{
.leave-item{
margin-bottom:8rpx;
background-color:#fff;
padding:0 30rpx;
.icon{
flex: 0 0 64rpx;
}
.body{
padding:0 18rpx;
}
}
.ask{
padding:18rpx 0;
border-bottom: 2rpx solid #f5f5f6;
}
.answer{
padding:24rpx 0;
}
.ask{
padding:30rpx 0 22rpx 0;
}
}
}

134
pages/Feed/index.vue

@ -41,6 +41,36 @@
}"
></u-textarea>
</u-form-item>
<u-form-item
label="街道"
prop="connect"
borderBottom
:custom-style="{padding:'34rpx 0'}"
>
<u-text
:text="shows.street_name || '请选择街道'"
:custom-style="{paddingRight:'28rpx'}"
size="30rpx"
align="right"
suffix-icon="arrow-right"
@click="openStreetPicker"
></u-text>
</u-form-item>
<u-form-item
label="社区"
prop="connect"
borderBottom
:custom-style="{padding:'34rpx 0'}"
>
<u-text
:text="shows.community_name || '请选择社区'"
:custom-style="{paddingRight:'28rpx'}"
size="30rpx"
align="right"
suffix-icon="arrow-right"
@click="openCommunityPicker"
></u-text>
</u-form-item>
<u-form-item
label="联系方式"
prop="connect"
@ -73,12 +103,30 @@
></u-upload>
</u-form-item>
</u-form>
<view class="bottom-btn border-box">
<u-button
type="primary"
text="保存"
shape="circle"
:custom-style="{
<view class="row">
<view class="col-6" style="padding:0 15rpx">
<u-button
type="default"
text="我的留言"
shape="circle"
:custom-style="{
color:'#020b18',
fontSize:'36',
fontWeight:'400',
marginTop:'48rpx',
height:'80rpx',
border:'2rpx solid #020b18'
}"
@click="api.navTo('/pages/Feed/leave')"
></u-button>
</view>
<view class="col-6" style="padding:0 15rpx">
<u-button
type="primary"
text="保存"
shape="circle"
:custom-style="{
color:'#020B18',
backgroundColor:'#FF9545',
border:'none',
@ -87,10 +135,29 @@
marginTop:'48rpx',
height:'80rpx'
}"
@click="submit"
@click="submit"
></u-button>
></u-button>
</view>
</view>
<!-- <view class="bottom-btn border-box">-->
<!-- <u-button-->
<!-- type="primary"-->
<!-- text="保存"-->
<!-- shape="circle"-->
<!-- :custom-style="{-->
<!-- color:'#020B18',-->
<!-- backgroundColor:'#FF9545',-->
<!-- border:'none',-->
<!-- fontSize:'36',-->
<!-- fontWeight:'400',-->
<!-- marginTop:'48rpx',-->
<!-- height:'80rpx'-->
<!-- }"-->
<!-- @click="submit"-->
<!-- ></u-button>-->
<!-- </view>-->
</u-col>
</u-row>
<view class="footer-content">
@ -104,6 +171,16 @@
<view class="foot-url">1256896@qq.com <text @click="copyContent()">复制</text></view>
</view>
</view>
<uv-picker
ref="street"
:columns="[streetList]"
keyName="name"
@confirm="selectStreet"></uv-picker>
<uv-picker
ref="community"
:columns="[communityList]"
keyName="name"
@confirm="selectCommunity"></uv-picker>
</template>
<script>
@ -114,6 +191,8 @@ import MzSubsection from '@/components/MzSubsection/Index.vue';
import api from '@/utils/functions.js';
import {feedback} from "@/api/feed";
import {userDetail, userEdit} from "@/api/user";
import {streetList} from "../../api/shop";
import {getCommonStreet} from "../../api/other";
export default {
components: {
@ -130,9 +209,15 @@ export default {
isTop: false,
fileList:[],
model:{
street_id:'',
community_id:'',
connect:'',
remark:'',
file:[]
path:[],
},
shows:{
street_name:'',
community_name:'',
},
rules:{
'connect': {
@ -148,6 +233,8 @@ export default {
trigger: ['blur', 'change']
},
},
streetList:[],
communityList:[],
}
},
onLoad() {
@ -162,9 +249,9 @@ export default {
submit(){
let file = [];
this.fileList.forEach(item => {
file.push(item.url)
file.push({url:item.url})
});
this.model.file = file.join();
this.model.path = file;
this.$refs.feedForm.validate().then(res => {
feedback(this.model).then((res) => {
if(res.code === 200){
@ -226,6 +313,26 @@ export default {
}
})
},
getConfig(){
getCommonStreet({}).then(res => {
this.streetList = res.data
});
},
selectStreet(e){
this.model.street_id = e.value[0].id;
this.shows.street_name = e.value[0].name;
this.communityList = e.value[0].children;
},
selectCommunity(e){
this.model.community_id = e.value[0].id;
this.shows.community_name = e.value[0].name;
},
openStreetPicker(){
this.$refs.street.open();
},
openCommunityPicker(){
this.$refs.community.open();
},
},
onPageScroll(res) {
if (res.scrollTop <= 20) {
@ -236,7 +343,10 @@ export default {
},
created() {
}
},
mounted() {
this.getConfig();
},
}
</script>

186
pages/Feed/leave.vue

@ -0,0 +1,186 @@
<template>
<view class="body-background"></view>
<u-navbar
:title="title"
:auto-back="true"
left-icon-size="40rpx"
:safe-area-inset-top="true"
:placeholder="true"
bgColor="#ffffff"
></u-navbar>
<view class="app-wallpaper">
<mz-sticky type="sticky">
<view class="leave-tab">
<u-tabs
:list="listItem"
u-sticky
lineWidth="40"
lineHeight="4"
:inactiveStyle="{color:'#AFB5BE'}"
:activeStyle="{color:'#F47210'}"
lineColor="#F47210"
:custom-style="{margin:'auto',width:'100%'}"
:scrollable="false"
:current="current"
@change="tabsChange"
></u-tabs>
</view>
</mz-sticky>
<view class="leave-content">
<view class="leave-item" v-for="item in lists">
<view class="ask row">
<view class="icon">
<u-text text="建议:" size="32" color="#178AF2" line-height="50rpx" custom-style="white-space:nowrap;"></u-text>
</view>
<view class="body col">
<view class="name">
<u-text line-height="50" :text="item.street + ' ' + item.community" size="32" color="#020b18"></u-text>
</view>
<view class="content">
<u-text line-height="50" :text="item.remark" size="28" color="#020b18"></u-text>
</view>
<view class="" v-if="item.path?.length > 0">
<u-album multipleSize="170rpx" space="16rpx" :urls="item.path" key-name="url" custom-style="border-radius:8rpx;"></u-album>
</view>
</view>
</view>
<view class="answer row" v-if="item.status === 2">
<view class="row">
<u-text text="结果答复" size="32" color="#0EAF4E" line-height="50rpx"></u-text>
</view>
</view>
<view class="row" style="padding-bottom:30rpx;">
<view class="icon">
<u-text text="占位:" size="32" color="transparent" line-height="50rpx" custom-style="white-space:nowrap;"></u-text>
</view>
<view class="body col">
<view class="content">
<!-- 状态1=未回答,2=已回答-->
<u-text v-if="item.status === 2" line-height="50" size="28" color="#020b18" :text="item.reply"></u-text>
<view class="" v-if="item.status === 2 && item.reply_path?.length > 0">
<u-album multipleSize="170rpx" space="16rpx" :urls="item.reply_path" key-name="url" custom-style="border-radius:8rpx;"></u-album>
</view>
</view>
</view>
</view>
</view>
</view>
<u-loadmore :custom-style="{display:'flex'}" :status="status" fontSize="28"
marginBottom="30" marginTop="30" @loadmore="getUserLeave()"/>
</view>
</template>
<script>
import {
imghost
} from '@/config/host.js'
import MzSubsection from '@/components/MzSubsection/Index.vue';
import api from '@/utils/functions.js';
import {goodsOrder, orderLogistics, roomOrder, tabCount} from "@/api/user";
import {userLeave} from "@/api/other";
import {goodsList} from "@/api/shop";
import {feedList} from "../../api/other";
export default {
components: {
MzSubsection
},
data() {
return {
userInfo:{},
listItem:[
{name:'全部建议',id:''},
{name:'已回复',id:2},
{name:'未回复',id:1},
],
listAdvisor:[
{name:'我的提问',id:1},
{name:'提问我的',id:2},
],
tabCheck:'room',
title: '社区留言板',
loading: true,
staticImage: {
bg: imghost + '/BG.png',
newIcon: imghost + '/new-icon.png',
shopThumb: imghost + '/new-1.png',
ask:imghost+ '/ask.png',
answer:imghost+ '/answer.png',
},
pages:{
page:1,
limit:10,
status:'',
},
lists:[],
status:'loadmore',
current:0,
}
},
onLoad() {
},
onReady() {
},
computed: {
api() {
return api
}
},
methods: {
tabsAdvisorChange(e){
this.pages.user_type = e.id;
this.getUserLeave(true);
},
tabsChange(e){
this.tabCheck = e.id
this.pages.status = e.id
this.getUserLeave(true);
},
getUserLeave(clear = false){
if (clear) {
this.status = 'loadmore'
this.pages.page = 1;
// this.pages.status = '';
this.lists = [];
}
if (this.status === 'nomore') {
return false;
}
feedList(this.pages).then(res => {
this.lists.push.apply(this.lists, res.data);
if (res.data.length === 0) {
this.status = 'nomore'
}
})
this.pages.page++;
},
},
onReachBottom() {
this.getUserLeave();
},
onPageScroll(res) {
},
mounted() {
this.getUserLeave();
this.userInfo = uni.getStorageSync('user');
},
created() {
}
}
</script>
<style lang="scss">
@import './components/leave.scss';
::v-deep .u-tabs__wrapper__nav__line{
left:24rpx;
}
</style>

15
pages/Index/components/UserPage/index.vue

@ -225,11 +225,24 @@
</template>
</u-cell>
<!-- <u-cell-->
<!-- :border="false"-->
<!-- :rightIconStyle="{fontSize:'28rpx'}"-->
<!-- :isLink="true"-->
<!-- title="意见箱/意见栏"-->
<!-- @click="navTo('/pages/Feed/index',true)"-->
<!-- >-->
<!-- <template #icon>-->
<!-- <view class="cell-icon" :style="{marginRight:'56rpx'}">-->
<!-- <u-image :src="staticImage.userFeed" :lazy-load="true" width="48" height="48" mode="widthFix"></u-image>-->
<!-- </view>-->
<!-- </template>-->
<!-- </u-cell>-->
<u-cell
:border="false"
:rightIconStyle="{fontSize:'28rpx'}"
:isLink="true"
title="意见箱/意见栏"
title="社区留言板"
@click="navTo('/pages/Feed/index',true)"
>
<template #icon>

Loading…
Cancel
Save