1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
| <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> -->
|
|
| <view class="">
| <my-issue @submit="submitInfo" :score="score" :textareaShow="isEdit?false:true" :headTitleValue="title" />
| </view>
|
| </template>
|
| <script>
| import {
| addTenementComment
| } from "@/api/grid/grid.js"
|
| import myIssue from "@/components/myIssue/myIssue.vue"
| export default {
| components: {
| myIssue
| },
| data() {
| return {
| content: "",
| id: "",
| title: "评分",
| isEdit: false,
| score: 0
| }
| },
| 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(val) {
| let data = val;
| data.score = data.score
| 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: "提交成功!"
| })
| uni.$emit("refreshComment")
| setTimeout(() => {
| uni.navigateBack();
| }, 1000)
| }
| })
| }
| }
| }
| </script>
|
| <style>
| page {
| background-color: #f5f5f5;
| }
|
| .container {
| padding: 30rpx 30rpx 0;
| }
|
| .content {
| margin-bottom: 50rpx;
| }
|
| .submit-btn {
| width: 100%;
| height: 80rpx;
| line-height: 80rpx;
| border: none;
| border-radius: 40rpx;
|
| }
| </style>
|
|