dingxin 6 years ago
parent
commit
364fc4bd66

+ 1
- 0
CODE/smart-community/property-api/src/main/resources/mapper/TpAnnouncementMapper.xml View File

21
           AND announcement_title like concat('%',#{record.announcementTitle,jdbcType=VARCHAR},'%')
21
           AND announcement_title like concat('%',#{record.announcementTitle,jdbcType=VARCHAR},'%')
22
         </if>
22
         </if>
23
           AND community_id = #{record.communityId,jdbcType=INTEGER}
23
           AND community_id = #{record.communityId,jdbcType=INTEGER}
24
+          order by create_date desc
24
       </where>
25
       </where>
25
   </select>
26
   </select>
26
   <select id="getById" resultType="com.community.huiju.model.TpAnnouncement">
27
   <select id="getById" resultType="com.community.huiju.model.TpAnnouncement">

+ 2
- 0
VUECODE/smart-property-manage/src/api/announcement.js View File

30
 }
30
 }
31
 // 根据id查询公告
31
 // 根据id查询公告
32
 export function announcementById(data) {
32
 export function announcementById(data) {
33
+  console.log(123)
34
+  console.log(data)
33
   return request({
35
   return request({
34
     url: '/announcementById',
36
     url: '/announcementById',
35
     method: 'post',
37
     method: 'post',

+ 1
- 1
VUECODE/smart-property-manage/src/router/index.js View File

158
         hidden: true,
158
         hidden: true,
159
         meta: { title: '活动报名人', icon: 'table' }
159
         meta: { title: '活动报名人', icon: 'table' }
160
       },
160
       },
161
-      {     
161
+      {
162
         path: '/announcement',
162
         path: '/announcement',
163
         component: () => import('@/views/social/announcement/details'),
163
         component: () => import('@/views/social/announcement/details'),
164
         name: 'contentParticulars-details',
164
         name: 'contentParticulars-details',

+ 47
- 33
VUECODE/smart-property-manage/src/views/social/announcement/details.vue View File

1
 <template>
1
 <template>
2
   <div id="root">
2
   <div id="root">
3
-    <span class="activityTile">{{ ruleForm.activityTitle }}</span>
4
-    <img :src="ruleForm.activityCarouselImg" width="700" height="500">
3
+    <img :src="ruleForm.announcementCarouselImg" width="500" height="500">
4
+    <span class="activityTile">{{ ruleForm.announcementTitle }}</span>
5
     <div class="activityContext">
5
     <div class="activityContext">
6
-      {{ ruleForm.activityContent }}
6
+      {{ ruleForm.announcementContent }}
7
     </div>
7
     </div>
8
-    <div class="activityContextImg">
9
-       <img v-for="item in ruleForm.contentImg" :src="item" width="700" height="500" >
8
+    <div>
9
+        <template v-for="site in ruleForm.contentImg">
10
+               <img :src="site.url" width="500" height="500" > 
11
+        </template>
12
+     
13
+        <!-- <img :src="item" width="500" height="500" > -->
10
     </div>
14
     </div>
11
-    <div class="progress">
15
+    <!-- <div class="progress">
12
       <div class="text-progress">
16
       <div class="text-progress">
13
         <span class="people-number">已报名人数 {{ ruleForm.signUpCount }}</span>
17
         <span class="people-number">已报名人数 {{ ruleForm.signUpCount }}</span>
14
         <div class="outer-layer"/>
18
         <div class="outer-layer"/>
17
       <div class="circular"/>
21
       <div class="circular"/>
18
       <div class="people-limit">限制{{ ruleForm.signUpMax }}人</div>
22
       <div class="people-limit">限制{{ ruleForm.signUpMax }}人</div>
19
       <el-button type="primary" style="float: left;">查看报名名单</el-button>
23
       <el-button type="primary" style="float: left;">查看报名名单</el-button>
20
-    </div>
21
-    <span>报名截止时间:{{ formatDate(ruleForm.registrationEndTime) }}</span>
24
+    </div> -->
25
+    <!-- <span>报名截止时间:{{ formatDate(ruleForm.registrationEndTime) }}</span> -->
22
     <div class="bom-button">
26
     <div class="bom-button">
23
-      <el-button type="primary" style="width: 100px;" @click="ediActivity">修改</el-button>
27
+      <el-button type="primary" style="width: 150px;" @click="ediActivity">修改</el-button>
24
     </div>
28
     </div>
25
   </div>
29
   </div>
26
 </template>
30
 </template>
33
       asOfdate: '2018/10/10 23:59:59',
37
       asOfdate: '2018/10/10 23:59:59',
34
       ruleForm: {
38
       ruleForm: {
35
         id: '',
39
         id: '',
36
-        activityTitle: '',
37
-        activityCarouselImg: '', // 轮播图
38
-        activityContent: '', // 活动内容详细
39
-        contentImg: [], // 活动内容配图
40
+        announcementTitle: '',
41
+        announcementCarouselImg: '', // 轮播图
42
+        announcementContent: '', // 内容详细
43
+        contentImg: [], // 内容配图
40
         signUpCount: '', // 报名人数统计
44
         signUpCount: '', // 报名人数统计
41
-        signUpMax: '', //  活动人数上限
42
         registrationEndTime: '', // 报名活动结束时间
45
         registrationEndTime: '', // 报名活动结束时间
43
         sort: 1, // 权重
46
         sort: 1, // 权重
44
         status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
47
         status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
47
   },
50
   },
48
   mounted() {
51
   mounted() {
49
     this.getById(this.$route.params.id)
52
     this.getById(this.$route.params.id)
50
-    console.log("this.$route.params.id",this.$route.params.id)
53
+    console.log("id",this.id)
51
   },
54
   },
52
   methods: {
55
   methods: {
53
     getById(id) { // 根据ID获取活动信息
56
     getById(id) { // 根据ID获取活动信息
54
     console.log(123)
57
     console.log(123)
55
     console.log(id)
58
     console.log(id)
56
-      this.$store.dispatch('ActivityById', id).then((res) => {
57
-        const resData = res.data
58
-        this.ruleForm = resData.info
59
-        this.ruleForm.contentImg = resData.contentImg
59
+       this.ruleForm.id=this.$route.params.id
60
+      this.$store.dispatch('AnnouncementById', this.ruleForm).then((res) => {
61
+      const resData = res.data
62
+      this.ruleForm.announcementTitle=resData.tpAnnouncement.announcementTitle// 标题
63
+      this.ruleForm.announcementContent=resData.tpAnnouncement.announcementContent// 内容
64
+      this.ruleForm.announcementCarouselImg=resData.tpAnnouncement.announcementCarouselImg // 轮播图
65
+      this.sort=resData.tpAnnouncement.sort// 权重
66
+        //多张图片进行遍历
67
+        for (let i = 0; i <=resData.studentList.length; i++) {
68
+        //  this.ruleForm.contentImg.push({ url: resData.studentList[i].imageUrl })
69
+        
70
+        console.log("sssss:",resData.studentList.imageUrl[i])
71
+        }
60
       })
72
       })
73
+
74
+      console.log(this.ruleForm.contentImg)
61
     },
75
     },
62
     formatDate(val) {
76
     formatDate(val) {
63
       var value = new Date(val)
77
       var value = new Date(val)
81
 #root {
95
 #root {
82
   display: flex;
96
   display: flex;
83
   flex-flow: column;
97
   flex-flow: column;
84
-  width: 700px;
98
+  width: 500px;
85
   margin-top: 50px;
99
   margin-top: 50px;
86
   margin-left: auto;
100
   margin-left: auto;
87
   margin-right: auto;
101
   margin-right: auto;
97
   font-size: 20px;
111
   font-size: 20px;
98
   justify-items: center;
112
   justify-items: center;
99
 }
113
 }
100
-.progress {
114
+/* .progress {
101
   display: flex;
115
   display: flex;
102
   justify-content: space-between;
116
   justify-content: space-between;
103
   margin-top: 20px;
117
   margin-top: 20px;
104
   margin-bottom: 20px;
118
   margin-bottom: 20px;
105
-}
106
-.text-progress {
119
+} */
120
+/* .text-progress {
107
   width: 500px;
121
   width: 500px;
108
   float: left;
122
   float: left;
109
   align-content: center;
123
   align-content: center;
110
   position: absolute;
124
   position: absolute;
111
   margin-top: 12px;
125
   margin-top: 12px;
112
-}
113
-.people-number {
126
+} */
127
+/* .people-number {
114
   position: relative;
128
   position: relative;
115
   margin-left: 180px;
129
   margin-left: 180px;
116
-}
117
-.outer-layer {
130
+} */
131
+/* .outer-layer {
118
   background-color: gainsboro;
132
   background-color: gainsboro;
119
   height: 3px;
133
   height: 3px;
120
   width: 450px;
134
   width: 450px;
121
   margin-top: -10px;
135
   margin-top: -10px;
122
   position: relative;
136
   position: relative;
123
-}
137
+} */
124
 .inner-layer {
138
 .inner-layer {
125
   background-color: aquamarine;
139
   background-color: aquamarine;
126
   height: 6px;
140
   height: 6px;
128
   position: relative;
142
   position: relative;
129
   margin-top: -4px;
143
   margin-top: -4px;
130
 }
144
 }
131
-.circular {
145
+/* .circular {
132
   border: 1px #001528 solid;
146
   border: 1px #001528 solid;
133
   border-radius: 10px;
147
   border-radius: 10px;
134
   /*background-color: chartreuse;*/
148
   /*background-color: chartreuse;*/
135
-  width: 20px;
149
+ /* width: 20px;
136
   height: 20px;
150
   height: 20px;
137
   position: relative;
151
   position: relative;
138
   margin-left: 452px;
152
   margin-left: 452px;
139
   margin-top: 11px;
153
   margin-top: 11px;
140
   float: left;
154
   float: left;
141
-}
142
-.people-limit {
155
+} */
156
+/* .people-limit {
143
   margin-top: 13px;
157
   margin-top: 13px;
144
-}
158
+} */
145
 .bom-button{
159
 .bom-button{
146
   display: flex;
160
   display: flex;
147
   justify-content: center;
161
   justify-content: center;