From 29dd94060e1ab443ece53177fd1bf13d4390744d Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Sat, 06 Jan 2024 17:59:00 +0800
Subject: [PATCH] 编写物业评价功能
---
api/grid/grid.js | 33 +++
static/icon/st_star_active.png | 0
components/myIssue/myIssue.vue | 242 ++++++++++++++++++++++++
subPackage/grid/comment.vue | 93 ++++++---
subPackage/house/member/index.vue | 18 +
static/icon/st_star.png | 0
common/setting.js | 4
subPackage/house/family/index.vue | 64 +----
subPackage/grid/tenement.vue | 104 +++++++--
subPackage/house/member/householdLabel.vue | 6
10 files changed, 451 insertions(+), 113 deletions(-)
diff --git a/api/grid/grid.js b/api/grid/grid.js
index 6171903..f174dbe 100644
--- a/api/grid/grid.js
+++ b/api/grid/grid.js
@@ -32,3 +32,36 @@
}
})
}
+
+
+
+
+export const getTenementComment = (params) => {
+ return http.request({
+ url: 'blade-propertyCompanyComment/propertyCompanyComment/page',
+ method: 'GET',
+ params: {
+ ...params
+ }
+ })
+}
+
+//物业公司评价
+export const addTenementComment = (params) => {
+ return http.request({
+ url: 'blade-propertyCompanyComment/propertyCompanyComment/saveOrUpdate',
+ method: 'POST',
+ data: params
+ })
+}
+
+//获取自己的评价
+export const getSelfCommentInfo = (params) => {
+ return http.request({
+ url: 'blade-propertyCompanyScore/propertyCompanyScore/detail',
+ method: 'GET',
+ params: {
+ ...params
+ }
+ })
+}
\ No newline at end of file
diff --git a/common/setting.js b/common/setting.js
index 4b5b17f..1e0c515 100644
--- a/common/setting.js
+++ b/common/setting.js
@@ -9,9 +9,9 @@
// 版本号
version: '2.0.0',
// 开发环境接口Url
- // devUrl: 'http://z4042833u6.wicp.vip',
+ devUrl: 'http://z4042833u6.wicp.vip',
// devUrl: 'http://192.168.0.106:9528',
- devUrl: 'https://srgdjczzxtpt.com:2080/api',
+ // devUrl: 'https://srgdjczzxtpt.com:2080/api',
// devUrl: 'https://kt39592615.goho.co',
minioBaseUrl: "https://srgdjczzxtpt.com:2080/gminio/jczz/",
// minioBaseUrl:"http://192.168.0.103:9528/",
diff --git a/components/myIssue/myIssue.vue b/components/myIssue/myIssue.vue
new file mode 100644
index 0000000..13cef04
--- /dev/null
+++ b/components/myIssue/myIssue.vue
@@ -0,0 +1,242 @@
+<template>
+ <view class='issue'>
+ <view class="issue-head">
+ <!-- <slot name="headPic"></slot>
+ <image v-if="headPicShow" :src="headPicValue" class="issue-head-pic" mode=""></image> -->
+ <text v-if="headTitleShow" class="issue-head-title">{{headTitleValue.slice(0,5)}}</text>
+
+ <view class="issue-head-star-box" v-if="starsShow">
+ <image v-for="(item,index) in starsMax" :key="index" :src="(index+1)>formatScore?starDefault:starActive"
+ mode="" @click="setScore(index+1)"></image>
+ </view>
+ </view>
+ <textarea v-if="textareaShow" @blur="blur" v-model="infoReceive.content" :placeholder="textareaPlaceholder" />
+ <view class="issue-btn-box">
+ <button v-if="submitShow" class="submit-btn bgc-main c-ff" @click="doSubmit">{{submitText}}</button>
+ <slot name="submit"></slot>
+ </view>
+ </view>
+</template>
+<script>
+ export default {
+ props: {
+ headPicShow: { //图片
+ type: [String, Boolean],
+ default: true,
+ },
+ // headPicValue: {
+ // type: String,
+ // default: require('@/static/icon/st_pic.png')
+ // },
+
+ headTitleShow: { //标题
+ type: [String, Boolean],
+ default: true,
+ },
+ headTitleValue: {
+ type: String,
+ default: "物业评分"
+ },
+
+ starsShow: {
+ type: [String, Boolean],
+ default: true,
+ },
+ starsMax: { // 星星最大个数
+ type: [String, Number],
+ default: 5,
+ },
+ starDefault: { //未选中
+ type: String,
+ default: '/static/icon/st_star.png',
+ },
+ starActive: {
+ type: String,
+ default: '/static/icon/st_star_active.png',
+ },
+ score: { //默认分数
+ type: [Number, String],
+ default: 0
+ },
+ starsDisabled: { //是否禁用star
+ type: [Boolean],
+ default: false
+ },
+
+ textareaShow: { // 多行文本显示
+ type: [String, Boolean],
+ default: true,
+ },
+ textareaPlaceholder: {
+ type: [String],
+ default: "说点什么..."
+ },
+
+
+ submitShow: { // 发布按钮
+ type: [String, Boolean],
+ default: true,
+ },
+ submitText: {
+ type: String,
+ default: "发布",
+ },
+
+ // infoReceive: { // 获取值
+ // type: Object,
+ // default: function() {
+ // return {
+ // score: 0,
+ // content: ""
+ // }
+ // }
+ // }
+ },
+ data() {
+ return {
+ infoReceive: {
+ score: 0,
+ content: ""
+ }
+ }
+
+ },
+
+ watch: {
+ score(newVal, oldVal) {
+ this.infoReceive.score = newVal;
+ }
+ },
+
+ computed: {
+ formatScore() {
+ return this.infoReceive.score
+ }
+ },
+ methods: {
+ /**
+ * @name 设置分数
+ */
+ setScore(score) {
+ if (this.starsDisabled !== false) return
+ console.log(score)
+ this.infoReceive.score = score
+ this.$emit("scoreChange", score)
+ },
+
+ /**
+ * @name 获取textarea内容
+ */
+
+ blur(e) {
+ this.infoReceive.content = e.detail.value
+ },
+
+ /**
+ * @name 提交
+ */
+ doSubmit() {
+ this.$emit('submit', this.infoReceive)
+ }
+ },
+ created() {
+ this.infoReceive.score = this.score
+ }
+ }
+</script>
+<style lang='scss'>
+ $backgroundC: #f9f9f9;
+ $borderColor: #f5f5f5;
+ $white: #ffffff;
+ $fontSize: 28upx;
+
+ .issue {
+ background-color: $backgroundC;
+
+ &-head {
+ background-color: $white;
+ height: 100upx;
+ border-top: 1upx solid $borderColor;
+ border-bottom: 1upx solid $borderColor;
+ padding: 0 25upx;
+
+ &-pic {
+ width: 70upx;
+ height: 70upx;
+ border-radius: 50%;
+ vertical-align: middle;
+ margin-right: 17upx;
+ }
+
+ &-title {
+ line-height: 100upx;
+ font-size: 30upx;
+ vertical-align: middle;
+ margin-right: 35upx;
+ }
+
+ &-star-box {
+ display: inline-block;
+
+ image {
+ width: 32upx;
+ height: 32upx;
+ vertical-align: middle;
+ margin-right: 14upx;
+ }
+
+ /* image.active {
+ animation: star_move ease-in 1 1s, star_rotate ease 1.5s infinite 1s;
+ } */
+ }
+ }
+
+ textarea {
+ width: 100%;
+ height: 420upx;
+ background-color: $white;
+ font-size: $fontSize;
+ color: #898989;
+ padding: 24upx;
+ box-sizing: border-box;
+ line-height: 40upx
+ }
+
+ &-btn-box {
+ padding: 54upx 30upx;
+
+ button {
+ width: 100%;
+ height: 80upx;
+ border-radius: 80upx;
+ font-size: $fontSize;
+ /* background-color: #3682FF; */
+ line-height: 80upx
+ }
+ }
+ }
+
+ @keyframes star_move {
+ from {
+ width: 50upx;
+ height: 50upx;
+ transform: rotate(180deg)
+ }
+
+ to {
+ width: 32upx;
+ height: 32upx;
+ transform: rotate(0)
+ }
+ }
+
+ @keyframes star_rotate {
+ 0% {
+ transform: rotateY(360deg)
+ }
+
+ 100% {
+ transform: rotateY(180deg)
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/static/icon/st_star.png b/static/icon/st_star.png
new file mode 100644
index 0000000..83609f9
--- /dev/null
+++ b/static/icon/st_star.png
Binary files differ
diff --git a/static/icon/st_star_active.png b/static/icon/st_star_active.png
new file mode 100644
index 0000000..c18bb8a
--- /dev/null
+++ b/static/icon/st_star_active.png
Binary files differ
diff --git a/subPackage/grid/comment.vue b/subPackage/grid/comment.vue
index dd9fcb6..e39975f 100644
--- a/subPackage/grid/comment.vue
+++ b/subPackage/grid/comment.vue
@@ -1,39 +1,64 @@
<template>
- <view class="container">
- <view class="content">
- <u-textarea v-model="content" placeholder="请输入内容" ></u-textarea>
- </view>
- <button class="submit-btn bgc-main c-ff f-30" @click="submitInfo">提交</button>
+ <!-- <view class="container">
+ <view class="content">
+ <u-textarea v-model="content" placeholder="请输入内容"></u-textarea>
+ </view>
+ <button class="submit-btn bgc-main c-ff f-30" @click="submitInfo">提交</button>
+ </view> -->
+
+
+ <view class="">
+ <my-issue @submit="submitInfo" :score="score" :textareaShow="isEdit?false:true" :headTitleValue="title" />
</view>
+
</template>
<script>
- import { addComment} from "@/api/article/article.js"
- export default{
- data(){
+ import {
+ addTenementComment
+ } from "@/api/grid/grid.js"
+
+ import myIssue from "@/components/myIssue/myIssue.vue"
+ export default {
+ components: {
+ myIssue
+ },
+ data() {
return {
- content:"",
- articleId:""
+ content: "",
+ id: "",
+ title: "",
+ isEdit: false,
+ score: 0
}
},
- onLoad(option){
- this.articleId = option.id;
+ onLoad(option) {
+ this.id = option.id;
+ this.title = option.title;
+ if (option.data) {
+ let data = JSON.parse(option.data);
+ this.score = data.score;
+ this.isEdit = true;
+
+ }
},
- methods:{
- submitInfo(){
- if(!this.content)return
- addComment({
- content:this.content,
- articleId:this.articleId
- }).then(res=>{
- if(res.code == 200){
+ methods: {
+ submitInfo(val) {
+ let data = val;
+ data.propertyCompanyid = this.id;
+ data.createUser = uni.getStorageSync("userInfo").user_id;
+ if (this.isEdit) {
+ delete data.content;
+ }
+ addTenementComment(data).then(res => {
+ if (res.code == 200) {
uni.showToast({
- title:"提交成功!"
+ title: "提交成功!"
})
uni.$emit("refreshComment")
- setTimeout(()=>{
+ setTimeout(() => {
uni.navigateBack();
- },1000)
+ }, 1000)
}
})
}
@@ -42,18 +67,20 @@
</script>
<style>
- .container{
- padding:30rpx 30rpx 0;
+ .container {
+ padding: 30rpx 30rpx 0;
}
- .content{
- margin-bottom:50rpx;
+
+ .content {
+ margin-bottom: 50rpx;
}
- .submit-btn{
- width:100%;
- height:80rpx;
- line-height:80rpx;
- border:none;
+
+ .submit-btn {
+ width: 100%;
+ height: 80rpx;
+ line-height: 80rpx;
+ border: none;
border-radius: 40rpx;
-
+
}
</style>
\ No newline at end of file
diff --git a/subPackage/grid/tenement.vue b/subPackage/grid/tenement.vue
index de5e20f..cbff3d4 100644
--- a/subPackage/grid/tenement.vue
+++ b/subPackage/grid/tenement.vue
@@ -1,12 +1,12 @@
<template>
<view class="container">
<view class="hander flex ">
- <u-avatar size="70" src="/static/icon/blue_floor.png"></u-avatar>
+ <u-avatar size="70" src="/static/icon/blue_floor.png"></u-avatar>
<view class="flex f-d-c ml-20">
<text class="f-30 fw mb-30">{{detailInfo.name}}</text>
<view class="flex a-i-c">
<text class="c-99 f-28">{{detailInfo.principalPhone}}</text>
- <view class="call-tag f-22 c-main ml-20" @click="callPhone(detailInfo.principalPhone)">
+ <view class="call-tag f-22 c-main ml-20" @click="callPhone(detailInfo.principalPhone)">
拨打电话
</view>
</view>
@@ -23,28 +23,28 @@
</view>
<view class="mb-30">
<caption-row title="人员信息" />
- <view class="person-list bgc-ff mt-20" >
- <view class="person-list-item flex j-c-s-b a-i-c" v-for="(item,index) in detailInfo.districtUserVOS">
+ <view class="person-list bgc-ff mt-20">
+ <view class="person-list-item flex j-c-s-b a-i-c" v-for="(item,index) in detailInfo.districtUserVOS">
<view class="flex a-i-c">
<u-avatar size="40"></u-avatar>
<text class="ml-10 mr-10">{{item.name}}</text>
<text class="f-26 c-99"></text>
</view>
- <view class="flex a-i-c" v-if="item.phone">
- <u-icon name="phone-fill" color="#017BFC"></u-icon>
- <text class="f-26 c-99" @click="callPhone(item.phone)">{{item.phone}}</text>
+ <view class="flex a-i-c" v-if="item.phone">
+ <u-icon name="phone-fill" color="#017BFC"></u-icon>
+ <text class="f-26 c-99" @click="callPhone(item.phone)">{{item.phone}}</text>
</view>
</view>
</view>
</view>
- <view class="" v-if="false">
+ <view class="comment" v-if="commentList.length">
<caption-row title="留言" />
<view class="comment-list bgc-ff mt-20">
<view class="comment-item flex " v-for="(item,index) in commentList" :key="index">
<u-avatar size="45" src="/static/icon/user-01.png"></u-avatar>
<view class="comment-item-content">
<view class="flex j-c-s-b a-i-c mb-20">
- <text class="f-28 c-99">{{item.name}}</text>
+ <text class="f-28 c-99">{{item.realName || "微信用户"}}</text>
<text class="c-99 f-24">{{item.createTime}}</text>
</view>
<view class="f-30">
@@ -55,6 +55,11 @@
</view>
</view>
+ <view class="footer" v-if="!scoreInfo.score">
+ <u-search searchIcon='edit-pen' :animation="true" placeholder="写留言" disabled
+ @click="navToComment"></u-search>
+ </view>
+ <footer-btn v-if="scoreInfo.score" text="修改评分" @submit="navToScore" />
</view>
@@ -64,7 +69,9 @@
<script>
import captionRow from "@/components/caption/caption.vue"
import {
- getTenementDetail
+ getTenementDetail,
+ getTenementComment,
+ getSelfCommentInfo
} from "@/api/grid/grid.js"
export default {
components: {
@@ -73,15 +80,34 @@
data() {
return {
commentList: [],
- detailInfo: {}
+ detailInfo: {},
+ id: "",
+ scoreInfo: {}
}
},
onLoad(option) {
+ this.id = option.id;
this.getDetailInfo(option.id)
+
+ uni.$on("refreshComment", () => {
+ this.getCommentList()
+ this.getScroe();
+ })
+
},
methods: {
+
+ getScroe() {
+ getSelfCommentInfo({
+ propertyCompanyId: this.id
+ }).then(res => {
+ this.scoreInfo = res.data;
+ })
+ },
+
+
getDetailInfo(id) {
getTenementDetail({
@@ -90,22 +116,41 @@
console.log(res)
this.detailInfo = res.data;
this.$nextTick(() => {
- this.$refs.uReadMore.init();
- })
+ this.$refs.uReadMore.init();
+ })
+ this.getScroe();
+ this.getCommentList()
})
},
-
- callPhone(phone){
+
+ getCommentList() {
+ getTenementComment({
+ isRec: 1,
+ page: 1,
+ size: 10,
+ propertyCompanyId: this.id
+ }).then(res => {
+ console.log(res)
+ this.commentList = res.data.records
+ })
+ },
+
+ callPhone(phone) {
uni.makePhoneCall({
- phoneNumber:phone
+ phoneNumber: phone
})
},
-
+
navToComment() {
uni.navigateTo({
- url: `comment?id=${this.params.id}`
+ url: `comment?id=${this.detailInfo.id}&title=${this.detailInfo.name}`
})
- }
+ },
+ // navToScore() {
+ // uni.navigateTo({
+ // url: `comment?id=${this.detailInfo.id}&title=${this.detailInfo.name}&data=${JSON.stringify(this.scroeInfo)}`
+ // })
+ // }
}
}
</script>
@@ -118,12 +163,14 @@
.container {
padding: 0 30rpx;
}
- .hander{
- padding:30rpx 0;
- .call-tag{
- padding:3rpx 8rpx;
+
+ .hander {
+ padding: 30rpx 0;
+
+ .call-tag {
+ padding: 3rpx 8rpx;
background-color: #017BFC;
- color: rgb(236,244,255);
+ color: rgb(236, 244, 255);
border-radius: 20rpx;
}
}
@@ -136,11 +183,15 @@
.person-list {
padding: 0 10rpx;
border-radius: 10rpx;
-
+
.person-list-item {
padding: 20rpx 0;
border-bottom: 1px solid #f5f5f5;
}
+ }
+
+ .comment {
+ padding-bottom: 120rpx;
}
.comment-list {
@@ -149,7 +200,8 @@
.comment-item {
width: 100%;
- padding: 20rpx 0;
+ padding: 20rpx;
+ box-sizing: border-box;
}
.comment-item-content {
diff --git a/subPackage/house/family/index.vue b/subPackage/house/family/index.vue
index 0198792..8d242b4 100644
--- a/subPackage/house/family/index.vue
+++ b/subPackage/house/family/index.vue
@@ -35,8 +35,6 @@
</image>
</view>
</view>
-
-
</block>
<view class="search-box mt-20 around-p-20 flex a-i-c j-c-c bgc-ff" v-if="buildingList.length">
@@ -113,54 +111,32 @@
</view>
</u-collapse-item>
-
<u-collapse-item class="sp-list" v-if="shopType == 1" style="border: none;" title="商铺"
:icon="'/static/icon/group.png'">
- <!-- <view slot="title" class="flex">
- <u-icon name="/static/icon/group.png" size="16"></u-icon>
- <view style="margin-left: 17rpx;">商铺</view>
- </view> -->
<view class="sp-list-box">
<view class="house-list-box flex" v-for="(item, index) in shopList" :name="index"
:key="index" @click="pushShopPage" :data-code="item.addressCode"
:data-type="item.addressType">
- <view class="l">
- <u-icon name="/static/icon/store.png" width="15" height="18"></u-icon>
- </view>
- <view class="r nowrap-ellipsis-hidden">
- {{item.floor}}
- </view>
+ <image class="store-icon" src="/static/icon/store.png" mode="aspectFill"></image>
+ <view class="r nowrap-ellipsis-hidden">{{item.floor}}</view>
</view>
</view>
</u-collapse-item>
-
<u-collapse-item class="sp-list" v-if="shopType == 2" style="border: none;" :title="item.unitName"
:icon="'/static/icon/group.png'" v-for="(item, index) in shopList">
- <!-- <view slot="title" class="flex">
- <u-icon name="/static/icon/group.png" size="16"></u-icon>
- <view style="margin-left: 17rpx;">商铺</view>
- </view> -->
<view class="sp-list-box">
<view class="house-list-box flex" v-for="(i,k) in item.children" :key="k"
@click="pushShopPage" :data-code="i.addressCode" :data-type="i.addressType">
- <view class="l">
- <u-icon name="/static/icon/store.png" width="15" height="18"></u-icon>
- </view>
- <view class="r nowrap-ellipsis-hidden">
- {{i.floor}}
- </view>
+ <image class="store-icon" src="/static/icon/store.png" mode="aspectFill"></image>
+ <view class="r nowrap-ellipsis-hidden">{{i.floor}}</view>
</view>
</view>
</u-collapse-item>
-
-
</u-collapse>
-
<u-divider text="已经到底了"></u-divider>
</view>
</view>
- <!-- <u-toast ref="uToast"></u-toast> -->
</view>
</template>
@@ -195,10 +171,12 @@
neiName: "", //居委会名称
unitName: "", //单元名称
houseData: {},
- shopType: "" //商铺类型 1 自建房商铺 2 企业商铺
+ shopType: "", //商铺类型 1 自建房商铺 2 企业商铺
+ startTime: ""
}
},
onLoad(e) {
+
const {
id,
housingName,
@@ -237,22 +215,14 @@
this.curSelectSite = uni.getStorageSync('siteInfo')
},
mounted() {
+ this.startTime = new Date();
this.getBuildingList()
},
methods: {
async getBuildingList() {
- // 记录开始时间
- const startTime = new Date();
- // this.$refs.uToast.show({
- // type: 'loading',
- // message: '正在加载',
- // duration: 9999999
- // })
-
uni.showLoading({
title: "正在加载"
})
-
this.isShowBuild = false
this.isShowShop = false
const param = {
@@ -273,7 +243,6 @@
if (aoiList.length) {
this.isShowBuild = true
// 正常展示户室数据
-
if (this.unitName) { //扫单元码进入过滤其它单元
this.buildingList = aoiList.filter(e => e.unitName == this.unitName);
} else {
@@ -294,15 +263,13 @@
this.shopList = shopList || []
}
this.$nextTick(() => {
- // this.$refs.uToast.isShow = false
uni.hideLoading();
+ const endTime = new Date();
+ // 计算执行时间(以毫秒为单位)
+ const executionTime = endTime - this.startTime;
+ // 输出执行时间
+ console.log(`代码执行时间:${executionTime} 毫秒`);
})
- // 记录结束时间
- const endTime = new Date();
- // 计算执行时间(以毫秒为单位)
- const executionTime = endTime - startTime;
- // 输出执行时间
- console.log(`代码执行时间:${executionTime} 毫秒`);
}
},
pushPage(e) {
@@ -549,4 +516,9 @@
border-radius: 4rpx;
margin-bottom: 5rpx;
}
+
+ .store-icon {
+ width: 28rpx;
+ height: 28rpx;
+ }
</style>
\ No newline at end of file
diff --git a/subPackage/house/member/householdLabel.vue b/subPackage/house/member/householdLabel.vue
index 68d4394..8fd2342 100644
--- a/subPackage/house/member/householdLabel.vue
+++ b/subPackage/house/member/householdLabel.vue
@@ -88,7 +88,8 @@
labelList: [{
name: '撤销',
disabled: false,
- color: '#EBEDF0'
+ // color: '#EBEDF0'
+ color: '#999'
},
{
name: '绿',
@@ -238,7 +239,6 @@
color,
name
} = this.currentColorInfo
- console.log()
let res = null
if (name === '撤销') {
if (this.number == 1) {
@@ -312,7 +312,7 @@
}
},
- //更新上个页面数据
+ //更新上个页面标签数据
updatePrePageData() {
let pages = getCurrentPages();
let prePage = pages[pages.length - 2];
diff --git a/subPackage/house/member/index.vue b/subPackage/house/member/index.vue
index 03881f8..978b335 100644
--- a/subPackage/house/member/index.vue
+++ b/subPackage/house/member/index.vue
@@ -530,9 +530,10 @@
onShow() {
console.log(this.form);
- // if (this.id) {
- // this.getHouseholdInfo()
- // }
+ if (this.id) {
+ // this.getHouseholdInfo()
+ this.getHoldLabel();
+ }
},
methods: {
@@ -673,6 +674,17 @@
}
})
},
+
+ getHoldLabel() {
+ getHouseholdDetail({
+ id: this.id
+ }).then(res => {
+ if (res.code == 200) {
+ this.$set(this.form, "householdLabelList", res.data.householdLabelList)
+ }
+ })
+ },
+
// 显示选择弹框
showSelectBus(title, key) {
this.selectBusList = this.dataList[key]
--
Gitblit v1.9.3