d4d4c816603d004effcc8c640bda1db18cd7c0c7.svn-base 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. <!-- -->
  2. <template>
  3. <div>
  4. <div class="commentAll">
  5. <div style="width: 100px;height: 30px;">
  6. <span class="date-dz-left pull-left comment-time">{{'共 ' + total + ' 条评论'}}</span>
  7. </div>
  8. <div class="comment-show" v-for="(item,index) in tableData" :key="index" >
  9. <div class="comment-show-con clearfix">
  10. <div class="comment-show-con-img pull-left"><img src="../../assets/img/user_man.png" alt=""></div>
  11. <div class="comment-show-con-list pull-left clearfix">
  12. <div class="pl-text clearfix">
  13. <a href="#" class="comment-size-name">{{item.persName == null ? '匿名:':item.persName + ':'}}</a>
  14. <span class="my-pl-con">&nbsp;{{item.content}}</span>
  15. </div>
  16. <div class="date-dz">
  17. <span class="date-dz-left pull-left comment-time">{{item.evalTm}}</span>
  18. <div class="date-dz-right pull-right comment-pl-block">
  19. <a href="javascript:;" class="date-dz-z pull-left">
  20. <i class="date-dz-z-click-red"></i>{{mesType == '1' ? '同问' : mesType == '2' ?'点赞':'点赞'}}
  21. (<i class="z-num">{{item.likeNum}}</i>)
  22. </a>
  23. <span v-if="mesType == '2' ? true:false" class="pull-left date-dz-line">|</span>
  24. <a v-if="mesType == '2' ? true:false" href="javascript:;" class="date-dz-z pull-left">
  25. <i class="date-dz-z-click-blue"></i>吐槽
  26. (<i class="z-num">{{item.shitNum}}</i>)
  27. </a>
  28. <a v-if="mesType == '' ? true:false" href="javascript:;" class="date-dz-z pull-left" style="margin-left:15px;">
  29. {{item.mesType == '1'? '提问' : item.mesType == '2' ? '留言':'会务组评价'}}
  30. </a>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <div style="text-align:center;margin-top:15px;">
  37. <el-button type="text" @click="addLists">查看更多评论</el-button>
  38. <el-button type="text" @click="retractLists" v-if="retract">收起</el-button>
  39. </div>
  40. </div>
  41. <el-row>
  42. <div class="commentAll">
  43. <backFeedDetails
  44. :meetingInfoRow="meetingInfoRow"
  45. :scheId="scheId"
  46. :mesType="mesType"
  47. :orderBy="orderBy"
  48. ></backFeedDetails>
  49. </div>
  50. </el-row>
  51. </div>
  52. </template>
  53. <script>
  54. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  55. //例如:import 《组件名称》 from '《组件路径》';
  56. import backFeedDetails from "./backFeedDetails.vue"
  57. import { getFeedBackTableDataLists,deleteFeedBackData} from "../../api/meetingAPI.js";
  58. export default {
  59. //import引入的组件需要注入到对象中才能使用
  60. components: {
  61. backFeedDetails
  62. },
  63. props:['meetingInfoRow','mesType','scheId'],
  64. data() {
  65. //这里存放数据
  66. return {
  67. retract:false,
  68. tableData:[],
  69. pageNum:1,
  70. pageSize:5,
  71. total:10,
  72. pageNumTotal:0,
  73. orderBy:'LIKE_NUM desc',
  74. };
  75. },
  76. //监听属性 类似于data概念
  77. computed: {},
  78. //监控data中的数据变化
  79. watch: {
  80. mesType(n,o){
  81. if(n == '2'){
  82. this.orderBy = 'LIKE_NUM+SHIT_NUM desc';
  83. }else{
  84. this.orderBy = 'LIKE_NUM desc';
  85. }
  86. this.mesType = n;
  87. this.tableData = [];
  88. this.retractLists();
  89. this.getFeedBackTableData();
  90. },
  91. scheId(n,o){
  92. if(this.mesType == '2'){
  93. this.orderBy = 'LIKE_NUM+SHIT_NUM desc';
  94. }else{
  95. this.orderBy = 'LIKE_NUM desc';
  96. }
  97. this.scheId = n;
  98. this.tableData = [];
  99. this.retractLists();
  100. this.getFeedBackTableData();
  101. }
  102. },
  103. //方法集合
  104. methods: {
  105. getFeedBackTableData(item){
  106. var _self = this;
  107. let obj = {
  108. "meetId":_self.meetingInfoRow.id,
  109. "pageNum":_self.pageNum,
  110. "pageSize":_self.pageSize,
  111. "mesType":_self.mesType,
  112. "orderBy":_self.orderBy,
  113. "scheId":_self.scheId,
  114. // "isAnimity":_self.formInline.isAnimity,
  115. }
  116. getFeedBackTableDataLists(obj).then(response => {
  117. // _self.tableData = response.data.list;
  118. _self.total = response.data.total;
  119. let y;
  120. _self.tableData.push(...response.data.list);
  121. y = _self.total%_self.pageSize;
  122. if(y = 0){
  123. _self.pageNumTotal = parseInt(_self.total/_self.pageSize);
  124. }else{
  125. _self.pageNumTotal = Math.ceil(_self.total/_self.pageSize);
  126. }
  127. });
  128. },
  129. addLists(){
  130. this.pageNum ++;
  131. this.retract = true;
  132. if(this.pageNum > this.pageNumTotal){
  133. this.$message.info('无更多数据!');
  134. this.pageNum --;
  135. }else{
  136. this.getFeedBackTableData();
  137. }
  138. },
  139. retractLists(){
  140. this.pageNum = 1;
  141. this.retract = false;
  142. this.tableData = this.tableData.slice(0,5);
  143. }
  144. },
  145. //生命周期 - 创建完成(可以访问当前this实例)
  146. created() {
  147. },
  148. //生命周期 - 挂载完成(可以访问DOM元素)
  149. mounted() {
  150. this.getFeedBackTableData();
  151. this.mesType = '1';
  152. },
  153. beforeCreate() {}, //生命周期 - 创建之前
  154. beforeMount() {}, //生命周期 - 挂载之前
  155. beforeUpdate() {}, //生命周期 - 更新之前
  156. updated() {}, //生命周期 - 更新之后
  157. beforeDestroy() {}, //生命周期 - 销毁之前
  158. destroyed() {}, //生命周期 - 销毁完成
  159. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  160. }
  161. </script>
  162. <style lang="scss">
  163. a{text-decoration: none;}
  164. /*清除浮动*/
  165. .clearfix:before,
  166. .clearfix:after {
  167. content: " ";
  168. display: table;
  169. }
  170. .clearfix:after {
  171. clear: both;
  172. }
  173. .clearfix {
  174. zoom: 1;
  175. }
  176. /*浮动*/
  177. .pull-right {
  178. float: right !important;
  179. }
  180. .pull-left {
  181. float: left !important;
  182. }
  183. /*----------------------------------------------------------------------------------------------------------*/
  184. .content {
  185. float: left;
  186. }
  187. .flex-text-wrap,pre {
  188. margin: 0 !important;
  189. }
  190. .commentAll {
  191. padding: 20px;
  192. border: 1px solid #ededed;
  193. margin: 20px auto;
  194. }
  195. .plBtn {
  196. width: 75px;
  197. height: 36px;
  198. line-height: 36px;
  199. background-color: #339b53;
  200. text-align: center;
  201. display: block;
  202. float: right;
  203. color: #FFFFFF;
  204. font-size: 12px;
  205. border-radius: 6px;
  206. margin-right: 2px;
  207. margin-top: 20px;
  208. }
  209. .plBtn:hover {
  210. background-color: #2f904d;
  211. }
  212. /*----------评论区域 begin----------*/
  213. .comment-show {
  214. &:first-child{
  215. margin-top: 20px;
  216. border-top: 1px solid #EDEDED;
  217. }
  218. }
  219. .comment-show-con {
  220. width: 100%;
  221. border-bottom: 1px solid #EDEDED;
  222. padding: 10px 0;
  223. }
  224. .comment-show-con-img {
  225. width: 48px;
  226. height: 48px;
  227. overflow: hidden;
  228. margin-top: 5px;
  229. }
  230. .comment-show-con-list {
  231. width: 93%;
  232. margin-left: 3%;
  233. }
  234. .pl-text {
  235. width: 100%;
  236. margin-top: 7px;
  237. word-wrap: break-word;
  238. overflow: hidden;
  239. }
  240. .date-dz {
  241. width: 100%;
  242. float: left;
  243. }
  244. .hf-list-con {
  245. float: left;
  246. width: 100%;
  247. background-color: #eaeaec;
  248. margin-top: 7px;
  249. }
  250. .comment-size-name {
  251. font-size: 12px;
  252. color: #339b53;
  253. }
  254. .my-pl-con {
  255. font-size: 12px;
  256. color: #8b8b8b;
  257. width: 100%;
  258. }
  259. .date-dz-left {
  260. font-size: 12px;
  261. color: #8b8b8b;
  262. display: block;
  263. padding-top: 18px;
  264. }
  265. .comment-time, .comment-pl-block {
  266. padding-top: 7px;
  267. }
  268. .comment-pl-block {
  269. margin-top: 0;
  270. }
  271. .date-dz-right {
  272. display: block;
  273. padding-top: 6px;
  274. padding-right: 18px;
  275. position: relative;
  276. overflow: hidden;
  277. }
  278. .removeBlock {
  279. float: left;
  280. font-size: 12px;
  281. color: #8b8b8b;
  282. margin-right: 24px;
  283. display: block;
  284. opacity: 0;
  285. }
  286. .hf-con-block {
  287. display: block;
  288. }
  289. .date-dz-pl, .date-dz-line, .date-dz-z {
  290. font-size: 12px;
  291. color: #8b8b8b;
  292. }
  293. .date-dz-line {
  294. display: block;
  295. padding: 0 20px;
  296. }
  297. .date-dz-z-click-red {
  298. width: 16px;
  299. height: 16px;
  300. display: block;
  301. float: left;
  302. background-image: url(../../assets/img/good.png);
  303. background-repeat: no-repeat;
  304. margin-right: 5px;
  305. }
  306. .date-dz-z-click-blue {
  307. width: 16px;
  308. height: 16px;
  309. display: block;
  310. float: left;
  311. background-image: url(../../assets/img/shit.png);
  312. background-repeat: no-repeat;
  313. margin-right: 5px;
  314. }
  315. .z-num {
  316. font-style: normal;
  317. }
  318. .date-dz-z-click {
  319. color: #b83b44;
  320. }
  321. .red {
  322. background-position: -6px -119px !important;
  323. }
  324. .hf-pl {
  325. width: 70px;
  326. height: 30px;
  327. line-height: 30px;
  328. background-color: #339b53;
  329. text-align: center;
  330. display: block;
  331. float: right;
  332. color: #FFFFFF;
  333. font-size: 12px;
  334. border-radius: 6px;
  335. margin-right: 2px;
  336. margin-top: 20px;
  337. }
  338. .hf-con {
  339. width: 100%;
  340. margin-top: 24px;
  341. }
  342. .hf-input {
  343. font-size: 12px;
  344. }
  345. .all-pl-con {
  346. width: 96%;
  347. padding: 2% 0;
  348. float: left;
  349. margin: 0 2%;
  350. }
  351. .atName {
  352. font-size: 12px;
  353. color: #339b53;
  354. }
  355. .hfpl-text {
  356. margin-top: 0;
  357. }
  358. .date-dz:hover .removeBlock {
  359. opacity: 1;
  360. }
  361. .hf-list-con .all-pl-con {
  362. border-top: 1px solid #d9d9d9;
  363. padding-bottom: 12px;
  364. }
  365. .hf-list-con .all-pl-con:first-child {
  366. border-top: 0;
  367. }
  368. </style>