school-circle.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <template>
  2. <view class="school-circle iPhone-bottom flex-common-css box-border-box ">
  3. <image class="circle-add" src="@/static/img/school/add.png" mode="" @click="add()"></image>
  4. <view class="bg-box"></view>
  5. <Nav :leftShow='false' :customNav='true' bgckgroundBox='transparent'>
  6. <template>
  7. <view slot="custom" class="align-items-center">
  8. <uni-icons type="left" size="20" @click="toBack()"></uni-icons>
  9. <view class="w-390 text-overflow-ellipsis-one fs-36 fw-400">{{schoolData.school_name}}</view>
  10. </view>
  11. </template>
  12. </Nav>
  13. <view class="ts-box mt-24 align-items-center box-border-box plr-12 mb-20">
  14. <image src="@/static/img/school/ts.png" mode=""></image>
  15. <view class="fs-26 fw-400 fc-FB3D03">警惕骗钱骗色,保护自身安全,不轻信陌生人</view>
  16. </view>
  17. <view class="nav-box display-flex box-border-box mb-20">
  18. <view class="nav-item view-nowrap" @click="selectTopicId(item.id)"
  19. :class="fromData.topic_id == item.id?'h130':''" v-for="(item,i) in classList" :key="i">
  20. <image v-if="item.id == 0" class="nav-icon" src="@/static/img/school/icon.png" mode=""></image>
  21. <image v-else class="nav-icon" :src="item.image" mode=""></image>
  22. <view class="fs-24 plr-24 " :class="fromData.topic_id==item.id?'fw-600 fc-41ABF5':''">{{item.name}}</view>
  23. <image v-if="fromData.topic_id == item.id" class="nav-bg" src="@/static/img/school/bg.png" mode=""></image>
  24. </view>
  25. </view>
  26. <view class="flex-justify-space type-box mb-24">
  27. <view class="display-flex">
  28. <view @click="selectOrderBuy(1)" class="box-1" :class="fromData.orderBy == 1?'box-s':''">最新</view>
  29. <view @click="selectOrderBuy(2)" class="box-1" :class="fromData.orderBy == 2?'box-s':''">最热</view>
  30. <view @click="selectOrderBuy(3)" class="box-1" :class="fromData.orderBy == 3?'box-s':''">评论最多</view>
  31. </view>
  32. <view class="box-2 fs-24 fc-41ABF5" @click="toSelectSchool()">逛其他学校</view>
  33. </view>
  34. <view v-if="list.length === 0" class="scroll-view-css">
  35. <EnBlank :customSrc='true'>
  36. <template v-slot:blankImg>
  37. <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
  38. </template>
  39. </EnBlank>
  40. </view>
  41. <scroll-view v-else scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
  42. <view class="card-box box-border-box p-24 bgc-f flex-justify-space" v-for="(item,i) in list" :key="i" @click.stop="toDet(item)">
  43. <image class="card-head" :src="item.head_img" mode="scaleToFill"></image>
  44. <view class="flex-1">
  45. <view class="card-1 flex-justify-space mb-16">
  46. <view class="">
  47. <view class="w-400 fs-28 fw-600 mb-8">{{item.nickname}}</view>
  48. <view class="fs-24 fc-9">{{item.created_date}}</view>
  49. </view>
  50. <view class="">
  51. <image @click.stop="openRepot(item)" class="dian-img" src="@/static/img/school/dian.png" mode=""></image>
  52. <view class="align-items-center">
  53. <image class="hot-img" src="@/static/img/school/hot.png" mode=""></image>
  54. <view class="fs-26 fw-400 fc-9">{{item.heat}}</view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="card-2 fs-30 fw-400 mb-16">
  59. {{item.content}}
  60. </view>
  61. <view class="card-3 flex-wrap-wrap mb-32">
  62. <image class="card-3-img" :src="item" v-for="(item,i) in item.image" mode="scaleToFill"></image>
  63. </view>
  64. <view class="card-4 flex-wrap-wrap mb-40">
  65. <view class="">{{item.school_name}}</view>
  66. <view class="">{{item.topic_name}}</view>
  67. </view>
  68. <view class="card-5 flex-justify-space">
  69. <view class="align-items-center" @click.stop="share()">
  70. <image src="@/static/img/school/fx.png" mode=""></image>
  71. <view class="fs-24 fc-9">分享</view>
  72. </view>
  73. <view class="align-items-center" @click.stop="handUp(item)">
  74. <uni-icons type="hand-up" size="22" :color="item.is_like==1?'#FD5C02':'#999'"></uni-icons>
  75. <view class="fs-24 " :class="item.is_like==1?'fc-FD5C02':'fc-9'">{{item.like}}</view>
  76. </view>
  77. <view class="align-items-center" @click.stop="openMsg(item)">
  78. <image src="@/static/img/school/info.png" mode=""></image>
  79. <view class="fs-24 fc-9">{{item.remark}}</view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </scroll-view>
  85. <uni-popup ref="popshare" type="bottom">
  86. <view class="pop-box pop-h-20 box-border-box p-24">
  87. <view @click.stop="shareSelect(0)" class="b-bottom text-align-center fs-32 fw-600 fc-f mb-20">分享到群聊</view>
  88. <view @click.stop="shareSelect(1)" class="b-bottom text-align-center fs-32 fw-600 fc-f">分享到朋友圈</view>
  89. </view>
  90. </uni-popup>
  91. <uni-popup ref="popup" type="bottom">
  92. <view class="pop-box pop-h-30 box-border-box p-24">
  93. <view class="head-pop flex-justify-space align-items-center mb-24">
  94. <uni-icons @click.stop="closePop(1)" type="closeempty" size="24"></uni-icons>
  95. <view class="fs-36 fc-0 fw-600">请输入举报内容</view>
  96. <view class="fs-28 fw-600 fc-41ABF5">确定</view>
  97. </view>
  98. <view class="scroll-view-css">
  99. <textarea style="height: 100%;" v-model="reportData.content" class=" fs-24" :maxlength='50' placeholder='请输入举报内容'></textarea>
  100. </view>
  101. <view @click.stop="closePop(2)" class="b-bottom text-align-center fs-32 fw-600 fc-f">确认举报</view>
  102. </view>
  103. </uni-popup>
  104. <uni-popup ref="popmsg" type="bottom">
  105. <view class="pop-box pop-msg box-border-box p-24">
  106. <!-- 输入框 -->
  107. <view class="pop-input" v-if="isShowIpnut">
  108. <view class="head-pop flex-justify-space align-items-center mb-24 box-border-box p-24">
  109. <uni-icons @click.stop="closeInput()" type="closeempty" size="24"></uni-icons>
  110. <view class="fs-36 fc-0 fw-600">评论</view>
  111. <view class="fs-28 fw-600 fc-41ABF5" @click.stop="save">确定</view>
  112. </view>
  113. <view class="scroll-view-css">
  114. <view class="bgc-f box-border-box p-32">
  115. <view class="fs-34 fw-600 mb-20">评论</view>
  116. <textarea class=" fs-24" placeholder='友善评论,文明发言'></textarea>
  117. </view>
  118. </view>
  119. </view>
  120. <view class="head-pop flex-justify-space align-items-center mb-24">
  121. <view class=""></view>
  122. <view class="fs-36 fc-0 fw-600">评论(4)</view>
  123. <uni-icons @click.stop="closeMsg()" type="closeempty" size="24"></uni-icons>
  124. </view>
  125. <view class="scroll-view-css box-border-box plr-24">
  126. <view class="list-box flex-justify-space" v-for="(item,i) in remarkData.list" :key="i">
  127. <image class="list-box-img" :src="item.head_img" mode="scaleToFill"></image>
  128. <view class="flex-1">
  129. <view class=" flex-justify-space">
  130. <view class="p-b-20 b-b-F9F9F9 mr-20">
  131. <view class="fs-28 fw-400 fc-9 mb-8">
  132. {{item.nickname}} <span v-if="is_author == 1" class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
  133. </view>
  134. <view class="fs-30 fw-400 mb-8" @click.stop="openInput()">
  135. {{item.content}}
  136. </view>
  137. <view class="fs-24 fw-400 fc-9 mb-8">{{item.created_date}}</view>
  138. </view>
  139. <view class="display-flex">
  140. <uni-icons type="hand-up" size="20" :color="item.is_like==1?'#FD5C02':'#999'"></uni-icons>
  141. <view class="fs-24 fw-400 mt-5" :class="item.is_like==1?'fc-FD5C02':'fc-9'">{{item.like}}</view>
  142. </view>
  143. </view>
  144. <view class="list-box flex-justify-space" v-for="(info,index) in 1" :key="index">
  145. <image class="list-box-img" src="@/static/img/my/bg.png" mode="scaleToFill"></image>
  146. <view class="flex-1">
  147. <view class=" flex-justify-space">
  148. <view class="p-b-20 b-b-F9F9F9 mr-20">
  149. <view class="fs-28 fw-400 fc-9 mb-8">
  150. 最佳损友最佳损友 <span class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
  151. </view>
  152. <view class="fs-30 fw-400 mb-8" @click.stop="openInput()">
  153. 回关一下啊,这么近这么近这么近这么近这么近这么近
  154. </view>
  155. <view class="fs-24 fw-400 fc-9 mb-8">2021-04-17 15:53</view>
  156. </view>
  157. <view class="display-flex">
  158. <uni-icons type="hand-up" size="20" color="#999"></uni-icons>
  159. <view class="fs-24 fw-400 fc-9 mt-5">11</view>
  160. </view>
  161. </view>
  162. </view>
  163. </view>
  164. </view>
  165. </view>
  166. </view>
  167. </view>
  168. </uni-popup>
  169. </view>
  170. </template>
  171. <script>
  172. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  173. import {getAlumniList,setAlumniLike,getRemarkList,alumniReport} from '@/api/alumni.js';
  174. import {getTopic} from '@/api/category.js';
  175. import tools from '@/service/tools';
  176. export default {
  177. components:{EnBlank},
  178. data(){
  179. return{
  180. isShowIpnut:false,
  181. classList:[],
  182. total:0,
  183. list:[],
  184. fromData:{
  185. topic_id:0,
  186. orderBy:1,//1最新 2最热 3最多评论
  187. school_id:'',
  188. page:1,
  189. },
  190. isAJAX:false,
  191. remarkData:{
  192. total:0,
  193. list:[],
  194. page:1,
  195. },
  196. schoolData:{
  197. school_name:'',
  198. },
  199. reportData:{
  200. news_id:'',
  201. content:'',
  202. },
  203. }
  204. },
  205. onShow(){
  206. let circleSchoolId = uni.getStorageSync('circleSchoolId');
  207. let schoolName = uni.getStorageSync('school_name');
  208. let circleSchoolName = uni.getStorageSync('circleSchoolName');
  209. this.schoolData.school_name = circleSchoolId?circleSchoolName:schoolName;
  210. this.classList = [];
  211. this.getTopic();
  212. this.list = [];
  213. this.fromData.page = 1;
  214. this.getList();
  215. },
  216. methods:{
  217. toBack(){
  218. tools.leftClick()
  219. },
  220. toSelectSchool(){
  221. uni.navigateTo({
  222. url:'/pages-address/select-school?type=2'
  223. })
  224. },
  225. getTopic(){
  226. getTopic().then((res)=>{
  227. if(res.code === 1){
  228. this.classList = res.data;
  229. this.classList.unshift({name:'全部贴子',id:0});
  230. }
  231. })
  232. },
  233. selectOrderBuy(type){
  234. if(this.fromData.orderBy != type){
  235. this.fromData.orderBy = type;
  236. this.list = [];
  237. this.fromData.page = 1;
  238. this.getList();
  239. }
  240. },
  241. selectTopicId(id){
  242. if(this.fromData.topic_id != id){
  243. this.fromData.topic_id = id;
  244. this.list = [];
  245. this.fromData.page = 1;
  246. this.getList();
  247. }
  248. },
  249. getList(){
  250. this.fromData.school_id = uni.getStorageSync('school_id');
  251. getAlumniList(this.fromData).then((res)=>{
  252. if(res.code === 1){
  253. this.list = [...this.list,...res.data.items];
  254. this.total = res.data.total;
  255. }
  256. })
  257. },
  258. scrolltolower(){
  259. if(this.list.length < this.total){
  260. this.fromData.page += 1;
  261. this.getList();
  262. }
  263. },
  264. handUp(item){
  265. if(this.isAJAX){
  266. return
  267. }
  268. this.isAJAX = true;
  269. let is_like = item.is_like == 1?0:1;
  270. setAlumniLike({news_id:item.news_id,is_like:is_like}).then((res)=>{
  271. if(res.code === 1){
  272. item.is_like = is_like;
  273. if(is_like == 0){
  274. item.like -= 1
  275. }else{
  276. item.like += 1
  277. }
  278. this.isAJAX = false;
  279. tools.success(res.msg);
  280. }else{
  281. this.isAJAX = false;
  282. tools.error(res.msg);
  283. }
  284. })
  285. },
  286. openMsg(item){
  287. if(this.isAJAX){
  288. return
  289. }
  290. this.isAJAX = true;
  291. getRemarkList({news_id:item.news_id,remark_id:0,page:this.remarkData.page}).then((res)=>{
  292. if(res.code === 1){
  293. this.remarkData.list = [...this.remarkData.list,...res.data.items];
  294. this.remarkData.total = res.data.total;
  295. this.remarkData.list.forEach((v)=>{
  296. v.isOpne = false;
  297. })
  298. this.$refs.popmsg.open();
  299. }
  300. })
  301. },
  302. add(){
  303. uni.navigateTo({
  304. url:"/pages-school/add-circle"
  305. })
  306. },
  307. openRepot(item){
  308. this.reportData.news_id = item.news_id;
  309. this.$refs.popup.open();
  310. },
  311. closePop(type){
  312. if(type === 1){
  313. this.reportData.news_id = '';
  314. this.reportData.content = '';
  315. this.$refs.popup.close();
  316. }else{
  317. if(this.isAJAX){
  318. return
  319. }
  320. this.isAJAX = true;
  321. alumniReport(this.reportData).then((res)=>{
  322. if(res.code === 1){
  323. tools.success(res.msg)
  324. setTimeout(()=>{
  325. this.isAJAX = false;
  326. this.closePop(1);
  327. },1000)
  328. }else{
  329. tools.success(res.msg);
  330. this.isAJAX = false;;
  331. }
  332. })
  333. }
  334. },
  335. share(){
  336. this.$refs.popshare.open();
  337. },
  338. shareSelect(type){
  339. let pages = getCurrentPages();
  340. let currentPage = pages[pages.length - 1];
  341. let url = currentPage.route || currentPage.$route.path;
  342. uni.share({
  343. provider: "weixin",
  344. scene: "WXSceneTimeline",
  345. type: type,
  346. href: url,
  347. title: "君子校友",
  348. summary: "我正在使用君子校友小程序,邀请您一起体验",
  349. imageUrl: "https://sjz-school.oss-cn-chengdu.aliyuncs.com/logo.png",
  350. success:(res)=>{
  351. tools.success('分享成功')
  352. this.$refs.popshare.close();
  353. },
  354. fail:(err)=>{
  355. tools.error('分享失败')
  356. this.$refs.popshare.close();
  357. }
  358. });
  359. },
  360. toDet(item){
  361. uni.navigateTo({
  362. url:"/pages-school/circle-info?news_id=" + item.news_id
  363. })
  364. },
  365. closeMsg(){
  366. this.$refs.popmsg.close();
  367. },
  368. openInput(){
  369. this.isShowIpnut = true;
  370. },
  371. closeInput(){
  372. this.isShowIpnut = false;
  373. },
  374. save(){
  375. this.isShowIpnut = false;
  376. },
  377. },
  378. }
  379. </script>
  380. <style scoped lang="scss">
  381. .b-bottom{
  382. width: 100%;
  383. height: 88rpx;
  384. line-height: 88rpx;
  385. background: linear-gradient( 105deg, #57CAFF 0%, #41ABF5 100%);
  386. border-radius: 200rpx;
  387. }
  388. .school-circle{
  389. padding-left: 24rpx;
  390. padding-right: 24rpx;
  391. position: relative;
  392. .pop-h-20{
  393. height: 18vh !important;
  394. }
  395. .pop-h-30{
  396. height: 30vh !important;
  397. }
  398. .pop-box{
  399. width: 100%;
  400. height: 50vh;
  401. background-color: #fff;
  402. border-radius: 24rpx 24rpx 0rpx 0rpx;
  403. display: flex;
  404. flex-direction: column;
  405. .item-box{
  406. width: 100%;
  407. height: 92rpx;
  408. border-radius: 200rpx;
  409. line-height: 92rpx;
  410. text-align: center;
  411. margin-bottom: 24rpx;
  412. }
  413. }
  414. .pop-msg{
  415. height: 70vh;
  416. position: relative;
  417. .pop-input{
  418. position: absolute;
  419. width: 100%;
  420. height: 70vh;
  421. background-color: #fff;
  422. bottom: 0;
  423. left: 0;
  424. border-top: 1rpx solid #ccc;
  425. border-radius: 20rpx 20rpx 0 0;
  426. display: flex;
  427. flex-direction: column;
  428. }
  429. .head-pop{
  430. padding-bottom: 34rpx !important;
  431. border-bottom: 1rpx solid #F2F2F2;
  432. }
  433. .list-box{
  434. .list-box-img{
  435. width: 80rpx;
  436. height: 80rpx;
  437. border-radius: 50%;
  438. margin-right: 16rpx;
  439. }
  440. .only-box{
  441. padding: 4rpx 16rpx;
  442. background: rgba(65,171,245,0.1);
  443. border-radius: 8rpx 8rpx 8rpx 8rpx;
  444. }
  445. .msg-img{
  446. width: 144rpx;
  447. height: 144rpx;
  448. border-radius: 12rpx;
  449. margin-right:5rpx;
  450. margin-bottom: 5rpx;
  451. }
  452. .msg-img:nth-child(3n){
  453. margin-right: 0rpx;
  454. }
  455. .msg-img-1{
  456. width: 100rpx !important;
  457. height: 100rpx !important;
  458. }
  459. }
  460. }
  461. .circle-add{
  462. width: 88rpx;
  463. height: 88rpx;
  464. position: absolute;
  465. right: 0;
  466. bottom: 20vh;
  467. z-index: 2;
  468. }
  469. .w-400{
  470. width: 400rpx;
  471. }
  472. .bg-box{
  473. width: 100%;
  474. height: 260rpx;
  475. filter: blur(80rpx);
  476. background: linear-gradient(to right,#E1F2FD,#E0F3FA,#DBF8EF);
  477. position: absolute;
  478. top: 0;
  479. left: 0;
  480. z-index: -1;
  481. }
  482. .ts-box{
  483. width: 100%;
  484. height: 72rpx;
  485. background: linear-gradient( 180deg, #FFDBD0 0%, #FFFFFF 100%);
  486. border-radius: 16rpx;
  487. image{
  488. width: 44rpx;
  489. height: 44rpx;
  490. margin-right: 8rpx;
  491. }
  492. }
  493. .nav-box{
  494. width: 100%;
  495. overflow-x: scroll;
  496. .h130{
  497. height: 130rpx !important;
  498. }
  499. .nav-item{
  500. margin-right: 12rpx;
  501. width: 144rpx;
  502. height: 114rpx;
  503. text-align: center;
  504. border-radius: 20rpx;
  505. position: relative;
  506. .nav-icon{
  507. width: 64rpx;
  508. height: 64rpx;
  509. margin: 12rpx auto 0 auto;
  510. }
  511. .nav-bg{
  512. width: 144rpx;
  513. height: 130rpx;
  514. position: absolute;
  515. top: 0;
  516. left: 0;
  517. z-index: -1;
  518. }
  519. }
  520. }
  521. .type-box{
  522. .box-s{
  523. font-weight: 600 !important;
  524. color: #41ABF5;
  525. background: #E0F1FF !important;
  526. box-sizing: border-box;
  527. border: 1rpx solid #70C0F8;
  528. }
  529. .box-1{
  530. padding: 8rpx 32rpx;
  531. margin-right: 20rpx;
  532. background-color: #fff;
  533. border-radius: 12rpx;
  534. font-size: 24rpx;
  535. font-weight: 400;
  536. }
  537. .box-2{
  538. width: 168rpx;
  539. height: 50rpx;
  540. line-height: 50rpx;
  541. text-align: center;
  542. border-radius: 12rpx 12rpx 12rpx 12rpx;
  543. border: 1rpx solid #41ABF5;
  544. }
  545. }
  546. .card-box{
  547. width: 100%;
  548. min-height: 100rpx;
  549. border-radius: 20rpx;
  550. margin-bottom: 20rpx;
  551. .card-head{
  552. width: 80rpx;
  553. height: 80rpx;
  554. border-radius: 50%;
  555. margin-right: 16rpx;
  556. }
  557. .dian-img{
  558. width: 30rpx;
  559. height: 6rpx;
  560. margin-bottom: 24rpx;
  561. margin-left: auto;
  562. }
  563. .hot-img{
  564. width: 40rpx;
  565. height: 40rpx;
  566. margin-left: auto;
  567. }
  568. .card-3{
  569. .card-3-img{
  570. width: 182rpx;
  571. height: 182rpx;
  572. border-radius: 12rpx;
  573. margin-right: 6rpx;
  574. margin-bottom: 6rpx;
  575. }
  576. .card-3-img:nth-child(3n){
  577. margin-right: 0rpx;
  578. }
  579. }
  580. .card-4{
  581. view{
  582. padding: 4rpx 16rpx;
  583. background: #F2F2F2;
  584. border-radius: 200rpx;
  585. font-size: 24rpx;
  586. color: #999;
  587. margin-right: 20rpx;
  588. margin-bottom: 10rpx;
  589. }
  590. }
  591. .card-5{
  592. image{
  593. width: 40rpx;
  594. height: 40rpx;
  595. margin-right: 8rpx;
  596. }
  597. }
  598. }
  599. }
  600. </style>