circle-info.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <template>
  2. <view class="circle-info-box iPhone-bottom flex-common-css box-border-box bgc-f">
  3. <view class="nav-box bgc-f">
  4. <Nav :leftShow='false' :customNav='true' bgckgroundBox='transparent'>
  5. <template>
  6. <view slot="custom" class="display-flex ">
  7. <image class="nav-img" @click="toBack()" src="@/static/img/takeout/bg-back.png" mode="scaleToFill"></image>
  8. <view class="info-nav display-flex">
  9. <image :src="obj.head_img" mode=""></image>
  10. <view class="">
  11. <view class="fs-32 fw-600 w348 text-overflow-ellipsis-one">{{obj.nickname||''}}</view>
  12. <view class="fs-24 fc-9 fw-400">{{obj.created_date||''}}</view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. </Nav>
  18. </view>
  19. <scroll-view scroll-y="true" class="scroll-view-css">
  20. <view class="scroll-view-css">
  21. <view class="box-border-box mb-26" v-if="obj.image.length > 0">
  22. <swiper class="swiper mb-32 " circular indicator-dots indicator-active-color="#4FB3EF" :autoplay="true" :interval="3000" :duration="500">
  23. <swiper-item v-for="(item,i) in obj.image" :key="i">
  24. <image class="swiper-item" :src="item" mode="aspectFill"></image>
  25. </swiper-item>
  26. </swiper>
  27. </view>
  28. <view class="box-border-box bz-box bgc-f b-b-F9F9F9 mt-24">
  29. <view class="fs-30 fw-600 mb-32">{{obj.content||''}}</view>
  30. <view class="card-4 flex-wrap-wrap">
  31. <view class="">{{obj.school_name||''}}</view>
  32. <view class="">{{obj.topic_name||''}}</view>
  33. </view>
  34. </view>
  35. <view v-if="list.length == 0" class="scroll-view-css">
  36. <EnBlank :customSrc='true'>
  37. <template v-slot:blankImg>
  38. <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
  39. </template>
  40. </EnBlank>
  41. </view>
  42. <view v-else class="pop-box pop-msg box-border-box p-24">
  43. <view class=" box-border-box plr-24">
  44. <view class="list-box flex-justify-space" v-for="(item,i) in list" :key="i">
  45. <image class="list-box-img" src="@/static/img/my/bg.png" mode="scaleToFill"></image>
  46. <view class="flex-1">
  47. <view class=" flex-justify-space">
  48. <view class="p-b-20 b-b-F9F9F9 mr-20">
  49. <view class="fs-28 fw-400 fc-9 mb-8 align-items-center">
  50. {{item.nickname}}
  51. <span v-if="item.is_author == 1" class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
  52. <view class="ml-10" v-if="item.is_self == 1" @click="delInfo(item)">
  53. <uni-icons type="trash" size="18"></uni-icons>
  54. </view>
  55. </view>
  56. <view class="fs-30 fw-400 mb-8" @click.stop="openInput(1,item)">
  57. {{item.content}}
  58. </view>
  59. <view class="fs-24 fw-400 fc-9 mb-8">{{item.created_date}}</view>
  60. </view>
  61. <view class="display-flex" @click.stop="handUp(2,item)">
  62. <uni-icons type="hand-up" size="20" :color="item.is_like==1?'#FD5C02':'#999'"></uni-icons>
  63. <view class="fs-24 fw-400 mt-5" :class="item.is_like==1?'fc-FD5C02':'fc-9'">{{item.like}}</view>
  64. </view>
  65. </view>
  66. <view v-if="item.isOpen" class="fs-24 fc-6 text-align-center mb-12" @click="openReply(1,item,i)">展开更多评论</view>
  67. <!-- <view class="list-box flex-justify-space" v-for="(info,index) in 5" :key="index">
  68. <image class="list-box-img" src="@/static/img/my/bg.png" mode="scaleToFill"></image>
  69. <view class="flex-1">
  70. <view class=" flex-justify-space">
  71. <view class="p-b-20 b-b-F9F9F9 mr-20">
  72. <view class="fs-28 fw-400 fc-9 mb-8">
  73. 最佳损友最佳损友
  74. <span v-if="info.is_author == 1" class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
  75. <view class="ml-10" v-if="info.is_self == 1" @click="delInfo(info)">
  76. <uni-icons type="trash" size="18"></uni-icons>
  77. </view>
  78. </view>
  79. <view class="fs-30 fw-400 mb-8" @click="openInput()">
  80. 回关一下啊,这么近这么近这么近这么近这么近这么近
  81. </view>
  82. <view class="fs-24 fw-400 fc-9 mb-8">2021-04-17 15:53</view>
  83. </view>
  84. <view class="display-flex">
  85. <uni-icons type="hand-up" size="20" color="#999"></uni-icons>
  86. <view class="fs-24 fw-400 fc-9 mt-5">11</view>
  87. </view>
  88. </view>
  89. </view>
  90. </view> -->
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </scroll-view>
  97. <view class="card-5 flex-justify-space box-border-box ">
  98. <view class="align-items-center"></view>
  99. <view class="align-items-center" @click.stop="handUp(1,obj)">
  100. <uni-icons type="hand-up" size="22" :color="obj.is_like==1?'#FD5C02':'#999'"></uni-icons>
  101. <view class="fs-24 " :class="obj.is_like==1?'fc-FD5C02':'fc-9'">{{obj.like}}</view>
  102. </view>
  103. <view class="align-items-center" @click.stop="openInput(0,item)">
  104. <image src="@/static/img/school/info.png" mode=""></image>
  105. <view class="fs-24 fc-9">{{obj.remark}}</view>
  106. </view>
  107. </view>
  108. <uni-popup ref="popup" type="bottom">
  109. <view class="pop-input">
  110. <view class="head-pop flex-justify-space align-items-center mb-24 box-border-box p-24">
  111. <uni-icons @click="closeInput()" type="closeempty" size="24"></uni-icons>
  112. <view class="fs-36 fc-0 fw-600">评论</view>
  113. <view class="fs-28 fw-600 fc-41ABF5" @click="save()">确定</view>
  114. </view>
  115. <view class="scroll-view-css">
  116. <view class="bgc-f box-border-box p-32">
  117. <view class="fs-34 fw-600 mb-20">评论</view>
  118. <textarea class=" fs-24" placeholder='友善评论,文明发言'></textarea>
  119. </view>
  120. </view>
  121. </view>
  122. </uni-popup>
  123. </view>
  124. </template>
  125. <script>
  126. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  127. import {alumnInfo,getRemarkList,setAlumniLike,delRemark} from '@/api/alumni.js';
  128. import tools from "@/service/tools";
  129. export default {
  130. components:{EnBlank},
  131. data(){
  132. return{
  133. id:0,
  134. news_id:'',
  135. obj:{
  136. image:[],
  137. },
  138. list:[],
  139. page:1,
  140. total:0,
  141. }
  142. },
  143. onLoad(e) {
  144. this.news_id = e.news_id;
  145. this.getInfo();
  146. this.getList();
  147. },
  148. methods:{
  149. toBack(){
  150. tools.leftClick()
  151. },
  152. getInfo(){
  153. alumnInfo({news_id:this.news_id}).then((res)=>{
  154. if(res.code === 1){
  155. this.obj = res.data;
  156. }
  157. })
  158. },
  159. getList(){
  160. getRemarkList({news_id:this.news_id,remark_id:0,page:this.page}).then((res)=>{
  161. if(res.code === 1){
  162. this.list = [...this.list,...res.data.items];
  163. this.total = res.data.total;
  164. this.list.forEach((v)=>{
  165. v.replyList = [];
  166. if(v.count > 0){
  167. v.isOpen = true;
  168. }
  169. })
  170. }
  171. })
  172. },
  173. // 点赞
  174. handUp(type,item){
  175. if(this.isAJAX){
  176. return
  177. }
  178. this.isAJAX = true;
  179. let is_like = item.is_like == 1?0:1;
  180. if(type == 1){
  181. // 点赞贴子
  182. setAlumniLike({news_id:item.news_id,is_like:is_like}).then((res)=>{
  183. this.handUpFun(res,item,is_like)
  184. })
  185. }else{
  186. // 点赞评论
  187. setRemarkLike({news_id:item.news_id,is_like:is_like,remark_id:item.id}).then((res)=>{
  188. this.handUpFun(res,item,is_like)
  189. })
  190. }
  191. },
  192. // 点赞公共回复
  193. handUpFun(res,item,is_like){
  194. if(res.code === 1){
  195. item.is_like = is_like;
  196. if(is_like == 0){
  197. item.like -= 1
  198. }else{
  199. item.like += 1
  200. }
  201. this.isAJAX = false;
  202. tools.success(res.msg);
  203. }else{
  204. this.isAJAX = false;
  205. tools.error(res.msg);
  206. }
  207. },
  208. openInput(type,item){
  209. if(type == 0){
  210. this.msgData.remark_id = 0;
  211. }else if(type == 1){
  212. this.msgData.remark_id = item.id;
  213. this.msgData.reply_id = item.m_id;
  214. }else{
  215. this.msgData.remark_id = item.remark_id;
  216. this.msgData.reply_id = item.m_id;
  217. }
  218. this.$refs.popup.open();
  219. },
  220. closeInput(){
  221. this.$refs.popup.close();
  222. },
  223. save(){
  224. this.closeInput()
  225. },
  226. delInfo(item){
  227. if(this.isAJAX){
  228. return
  229. }
  230. this.isAJAX = true;
  231. delRemark({remark_id:item.id}).then((res)=>{
  232. if(res.code === 1){
  233. tools.success('删除成功')
  234. setTimeout(()=>{
  235. this.list = [];
  236. this.page = 1;
  237. this.getList();
  238. },1500)
  239. }else{
  240. this.isAJAX = false;
  241. tools.error(res.msg)
  242. }
  243. })
  244. },
  245. },
  246. }
  247. </script>
  248. <style scoped lang="scss">
  249. .circle-info-box{
  250. .card-5{
  251. padding: 50rpx;
  252. image{
  253. width: 40rpx;
  254. height: 40rpx;
  255. margin-right: 8rpx;
  256. }
  257. }
  258. .w348{
  259. width: 348rpx;
  260. }
  261. .nav-box{
  262. z-index: 99;
  263. padding-bottom: 10rpx;
  264. .nav-img{
  265. width: 56rpx;
  266. height: 56rpx;
  267. margin-right: 30rpx;
  268. }
  269. .info-nav{
  270. image{
  271. width: 64rpx;
  272. height: 64rpx;
  273. border-radius: 50%;
  274. margin-right: 20rpx;
  275. }
  276. }
  277. }
  278. .swiper{
  279. width: 100%rpx;
  280. height: 920rpx;
  281. .swiper-item{
  282. width: 100%;
  283. height: 920rpx;
  284. background-color: skyblue;
  285. }
  286. }
  287. .bz-box{
  288. padding: 0 32rpx 20rpx 32rpx;
  289. .card-4{
  290. view{
  291. padding: 4rpx 16rpx;
  292. background: #F2F2F2;
  293. border-radius: 200rpx;
  294. font-size: 24rpx;
  295. color: #999;
  296. margin-right: 20rpx;
  297. margin-bottom: 10rpx;
  298. }
  299. }
  300. }
  301. .pop-input{
  302. z-index: 100;
  303. width: 100%;
  304. height: 70vh;
  305. background-color: #fff;
  306. bottom: 0;
  307. left: 0;
  308. border-top: 1rpx solid #ccc;
  309. border-radius: 20rpx 20rpx 0 0;
  310. display: flex;
  311. flex-direction: column;
  312. }
  313. .pop-box{
  314. width: 100%;
  315. height: 50vh;
  316. background-color: #fff;
  317. border-radius: 24rpx 24rpx 0rpx 0rpx;
  318. display: flex;
  319. flex-direction: column;
  320. .item-box{
  321. width: 100%;
  322. height: 92rpx;
  323. border-radius: 200rpx;
  324. line-height: 92rpx;
  325. text-align: center;
  326. margin-bottom: 24rpx;
  327. }
  328. }
  329. .pop-msg{
  330. // height: 70vh;
  331. .head-pop{
  332. padding-bottom: 34rpx !important;
  333. border-bottom: 1rpx solid #F2F2F2;
  334. }
  335. .list-box{
  336. .list-box-img{
  337. width: 80rpx;
  338. height: 80rpx;
  339. border-radius: 50%;
  340. margin-right: 16rpx;
  341. }
  342. .only-box{
  343. padding: 4rpx 16rpx;
  344. background: rgba(65,171,245,0.1);
  345. border-radius: 8rpx 8rpx 8rpx 8rpx;
  346. }
  347. .msg-img{
  348. width: 144rpx;
  349. height: 144rpx;
  350. border-radius: 12rpx;
  351. margin-right:5rpx;
  352. margin-bottom: 5rpx;
  353. }
  354. .msg-img:nth-child(3n){
  355. margin-right: 0rpx;
  356. }
  357. .msg-img-1{
  358. width: 100rpx !important;
  359. height: 100rpx !important;
  360. }
  361. }
  362. }
  363. }
  364. </style>