school-circle.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023
  1. <template>
  2. <view class="school-circle iPhone-bottom box-border-box">
  3. <view class="circle-add flex-direction align-items-center flex-justify-center" @click="add()">
  4. <image class="ft-img mb-12" src="/pages-school/static/ft.png" mode=""></image>
  5. <view class="fs-24 fc-f fw-b">
  6. 发帖
  7. </view>
  8. </view>
  9. <view class="bg-box"></view>
  10. <Nav :leftShow='false' :customNav='true' :bgckgroundBox='bgckgroundBox'>
  11. <template>
  12. <view slot="custom" class="align-items-center flex-justify-center navCustom">
  13. <view class="align-items-center nav-left" @click="toBack()">
  14. <uni-icons type="left" size="20"></uni-icons>
  15. <!-- <view class="fs-34">
  16. 返回
  17. </view> -->
  18. </view>
  19. <view class="nav-title w-390 text-overflow-ellipsis-one text-align-center fs-36 fw-400">
  20. {{schoolData.school_name}}
  21. </view>
  22. </view>
  23. </template>
  24. </Nav>
  25. <view class="top-box">
  26. <view class="plr-30 mb-12 box-border-box">
  27. <uni-swiper-dot :info="bannerList" mode="dot" :dotsStyles="dotStyle" :current="current">
  28. <swiper class="swiper" @change="change" :autoplay='true' :circular='true' interval="4000">
  29. <swiper-item v-for="(item,i) in bannerList" :key="i">
  30. <image class="swiper-item" :src="item.image" mode="" @click="bannerClock(item)">
  31. </image>
  32. </swiper-item>
  33. </swiper>
  34. </uni-swiper-dot>
  35. </view>
  36. <view class="plr-30 box-border-box">
  37. <view class="ts-box align-items-center box-border-box plr-12">
  38. <image class="tz-img" src="/pages-school/static/tz.png" mode=""></image>
  39. <view class="fs-24 fw-400 fc-0">{{alumni_str}}</view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="select-box" :style="[{'top': BarH + 'px'}]">
  44. <scroll-view class="nav-box view-nowrap box-border-box bgc-f" scroll-x="true">
  45. <view class="nav-item" @click="selectTopicId(item.id)" v-for="(item,i) in classList" :key="i">
  46. <image class="nav-icon" :src="item.image" mode=""></image>
  47. <view class="fs-24" :class="fromData.topic_id==item.id?'fw-600 fw-400':''">{{item.name}}</view>
  48. </view>
  49. </scroll-view>
  50. <view class="flex-justify-space align-items-center type-box box-border-box">
  51. <view class="display-flex">
  52. <view @click="selectOrderBuy(1)" class="box-1" :class="fromData.orderBy == 1?'box-s':''">最新</view>
  53. <view @click="selectOrderBuy(2)" class="box-1" :class="fromData.orderBy == 2?'box-s':''">最热<text
  54. class="ml-8" :class="fromData.orderBy == 2?'fc-F6ABAC':''">↑</text></view>
  55. <view @click="selectOrderBuy(3)" class="box-1" :class="fromData.orderBy == 3?'box-s':''">评论<text
  56. class="ml-8" :class="fromData.orderBy == 3?'fc-F6ABAC':''">↑</text></view>
  57. </view>
  58. <view class="box-2 fs-24 fc-F6ABAC" @click="toSelectSchool()">逛其他学校<text class="ml-8 fc-FB4845">></text>
  59. </view>
  60. </view>
  61. </view>
  62. <view v-if="list.length === 0" class="scroll-view-css">
  63. <EnBlank :customSrc='true'>
  64. <template v-slot:blankImg>
  65. <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
  66. </template>
  67. </EnBlank>
  68. </view>
  69. <!-- <scroll-view v-else scroll-y="true" class="scroll-view-css pl-24 pr-24 box-border-box bgc-F5F4F9" @scrolltolower="scrolltolower"> -->
  70. <view class="box-border-box bgc-f">
  71. <view class="card-box box-border-box bgc-f" v-for="(item,i) in list" :key="i" @click.stop="toDet(item)">
  72. <view class="align-items-center mb-32">
  73. <image class="card-head flex-shrink0" :src="item.head_img" mode="scaleToFill"></image>
  74. <view class="">
  75. <view class="w-400 fs-28 fw-b mb-16">{{item.nickname}}</view>
  76. <view class="fs-24 fc-a">{{item.created_date}}</view>
  77. </view>
  78. </view>
  79. <view class="flex-1">
  80. <view class="card-2 fs-30 mb-16">
  81. {{item.content}}
  82. </view>
  83. <view class="card-3 flex-wrap-wrap mb-32" style="width: 560rpx;">
  84. <image class="card-3-img" :src="item" v-for="(item,i) in item.image" mode="aspectFill"></image>
  85. </view>
  86. <view class="align-items-center mb-40">
  87. <view class="label-box mr-14 b-rad-200 bgc-EDF6FF fc-4495FD fs-24">
  88. {{item.school_name}}
  89. </view>
  90. <view class="label-box b-rad-200 bgc-FCEDED fc-FC4642 fs-24">
  91. {{item.topic_name}}
  92. </view>
  93. </view>
  94. <view class="card-5 align-items-center flex-justify-end">
  95. <view class="align-items-center mr-50" @click.stop="handUp(1,item)">
  96. <uni-icons type="hand-up" size="22" :color="item.is_like==1?'#FD5C02':'#999'"></uni-icons>
  97. <view class="fs-24 " :class="item.is_like==1?'fc-FD5C02':'fc-9'">{{item.like}}</view>
  98. </view>
  99. <view class="align-items-center mr-50">
  100. <image class="info-img" src="@/static/img/school/info.png" mode=""></image>
  101. <view class="fs-24 fc-9">{{item.remark}}</view>
  102. </view>
  103. <image @click.stop="openRepot(item)" class="info-img" src="@/static/img/school/dian.png"
  104. mode=""></image>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <!-- </scroll-view> -->
  110. <uni-popup ref="popup" type="bottom">
  111. <view class="pop-box pop-h-30 box-border-box p-24">
  112. <view class="head-pop flex-justify-space align-items-center mb-24">
  113. <uni-icons @click.stop="closePop(1)" type="closeempty" size="24"></uni-icons>
  114. <view class="fs-36 fc-0 fw-600">请输入举报内容</view>
  115. <view class="fs-28 fw-600 fc-41ABF5" @click.stop="closePop(2)">确定</view>
  116. </view>
  117. <view class="scroll-view-css">
  118. <textarea style="height: 100%;" v-model="reportData.content" class=" fs-24" :maxlength='50'
  119. placeholder='请输入举报内容'></textarea>
  120. </view>
  121. <!-- <view class="b-bottom text-align-center fs-32 fw-600 fc-f">确认举报</view> -->
  122. </view>
  123. </uni-popup>
  124. <uni-popup ref="popmsg" type="bottom">
  125. <view class="pop-box pop-msg box-border-box p-24">
  126. <!-- 输入框 -->
  127. <view class="pop-input" v-if="isShowIpnut">
  128. <view class="head-pop flex-justify-space align-items-center mb-24 box-border-box p-24">
  129. <view class="fs-28 fw-600 fc-41ABF5"></view>
  130. <view class="fs-36 fc-0 fw-600">评论</view>
  131. <uni-icons @click.stop="closeInput()" type="closeempty" size="24"></uni-icons>
  132. </view>
  133. <view class="scroll-view-css">
  134. <view class="bgc-f box-border-box p-32">
  135. <view class="fs-34 fw-600 mb-20">评论</view>
  136. <textarea v-model="msgData.content" maxlength="100" class=" fs-24"
  137. placeholder='友善评论,文明发言'></textarea>
  138. </view>
  139. </view>
  140. <view class="box-border-box p-24">
  141. <view class="save-box" @click.stop="save()">评论</view>
  142. </view>
  143. </view>
  144. <view class="head-pop flex-justify-space align-items-center mb-24">
  145. <view class=""></view>
  146. <view class="align-items-center">
  147. <view class="fs-36 fc-0 fw-600 mr-4">
  148. 评论
  149. </view>
  150. <view class="fs-24 fc-9">
  151. ({{remarkData.list.length}})
  152. </view>
  153. </view>
  154. <uni-icons @click.stop="closeMsg()" type="closeempty" size="24"></uni-icons>
  155. </view>
  156. <view v-if="remarkData.list.length === 0" class="scroll-view-css">
  157. <EnBlank :customSrc='true'>
  158. <template v-slot:blankImg>
  159. <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
  160. </template>
  161. </EnBlank>
  162. </view>
  163. <view v-else class="scroll-view-css box-border-box plr-24">
  164. <view class="list-box flex-justify-space" v-for="(item,i) in remarkData.list" :key="i">
  165. <image class="list-box-img" :src="item.head_img" mode="scaleToFill"></image>
  166. <view class="flex-1 p-b-20">
  167. <view class=" flex-justify-space">
  168. <view class=" b-b-F9F9F9 mr-20">
  169. <view class="fs-28 fw-400 fc-9 mb-8 align-items-center">
  170. {{item.nickname}}
  171. <span v-if="item.is_author == 1"
  172. class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
  173. <span v-if="item.is_self == 1" class="fs-28 fc-6 ml-10">我</span>
  174. </view>
  175. <view class="fs-30 fw-400 mb-8" @click.stop="openInput(1,item)">
  176. {{item.content}}
  177. </view>
  178. <view class="display-flex mb-8">
  179. <view class="fs-24 fw-400 fc-9 mr-6">{{item.created_date}}</view>
  180. <uni-icons v-if="item.is_self == 1" @click="delInfo(item)" type="trash"
  181. size="16"></uni-icons>
  182. </view>
  183. </view>
  184. <view class="display-flex" @click.stop="handUp(2,item)">
  185. <uni-icons class="mr-8" type="hand-up" size="20"
  186. :color="item.is_like==1?'#FD5C02':'#999'"></uni-icons>
  187. <view class="fs-24 fw-400 mt-5" :class="item.is_like==1?'fc-FD5C02':'fc-9'">
  188. {{item.like}}
  189. </view>
  190. </view>
  191. </view>
  192. <view v-if="item.isOpen" class="fs-24 fc-6 text-align-center mb-12"
  193. @click="openReply(1,item)">展开更多评论</view>
  194. <!-- 回复 -->
  195. <view class="mb-16" v-if="item.replyList.length > 0">
  196. <view class="list-box flex-justify-space" v-for="(info,index) in item.replyList"
  197. :key="index">
  198. <image class="list-box-img" :src="info.head_img" mode="scaleToFill"></image>
  199. <view class="flex-1">
  200. <view class=" flex-justify-space">
  201. <view class=" b-b-F9F9F9 mr-20">
  202. <view class="fs-28 fw-400 fc-9 mb-8 align-items-center">
  203. {{info.nickname}}
  204. <span v-if="info.is_author == 1"
  205. class='only-box text-align-center fs-24 fc-41ABF5 ml-10'>作者</span>
  206. <span v-if="info.is_self == 1" class="fs-28 fc-6 ml-10">我</span>
  207. </view>
  208. <view class="fs-30 fw-400 mb-8" @click.stop="openInput(2,info)">
  209. {{info.content}}
  210. </view>
  211. <view class="display-flex mb-8">
  212. <view class="fs-24 fw-400 fc-9 mr-6">{{info.created_date}}</view>
  213. <uni-icons class="fs-24" v-if="info.is_self == 1"
  214. @click="delInfo(item)" type="trash"></uni-icons>
  215. </view>
  216. </view>
  217. <view class="display-flex" @click.stop="handUp(2,info)">
  218. <uni-icons type="hand-up" size="20"
  219. :color="info.is_like==1?'#FD5C02':'#999'"></uni-icons>
  220. <view class="fs-24 fw-400 mt-5"
  221. :class="info.is_like==1?'fc-FD5C02':'fc-9'">{{info.like}}</view>
  222. </view>
  223. </view>
  224. </view>
  225. </view>
  226. <view v-if="item.replyList.length < item.count"
  227. class="fs-24 fc-6 text-align-center mb-12" @click="openReply(2,item)">展开更多评论</view>
  228. </view>
  229. </view>
  230. </view>
  231. <view v-if="remarkData.list.length < remarkData.total" class="text-align-center fs-26"
  232. @click="scrolltolowerList">加载更多评论</view>
  233. </view>
  234. <view class="input-box text-align-left fs-28 fc-9 box-border-box plr-24" @click.stop="openInput(0,'')">
  235. 友善评论,文明发言</view>
  236. </view>
  237. </uni-popup>
  238. </view>
  239. </template>
  240. <script>
  241. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  242. import {
  243. getAlumniList,
  244. setAlumniLike,
  245. getRemarkList,
  246. alumniReport,
  247. setCreateRemark,
  248. setRemarkLike,
  249. delRemark,
  250. alumniBanner
  251. } from '@/api/alumni.js';
  252. import {
  253. getCommonText
  254. } from '@/api/common.js'
  255. import {
  256. getTopic
  257. } from '@/api/category.js';
  258. import tools from '@/service/tools';
  259. export default {
  260. components: {
  261. EnBlank
  262. },
  263. data() {
  264. return {
  265. bgckgroundBox: '',
  266. BarH: 0,
  267. bannerList: [],
  268. dotStyle: {
  269. width: 6,
  270. bottom: 6,
  271. backgroundColor: 'rgba(51, 51, 51,0.3)',
  272. border: '1px rgba(0,0,0,0) solid',
  273. color: '#fff',
  274. selectedBackgroundColor: 'rgba(79, 179, 239,0.9)',
  275. selectedBorder: '1px rgba(0,0,0,0) solid'
  276. },
  277. current: 0,
  278. isShowIpnut: false,
  279. classList: [],
  280. total: 0,
  281. list: [],
  282. fromData: {
  283. topic_id: 0,
  284. orderBy: 1, //1最新 2最热 3最多评论
  285. school_id: '',
  286. page: 1,
  287. },
  288. isAJAX: false,
  289. schoolData: {
  290. school_name: '',
  291. },
  292. // 举报
  293. reportData: {
  294. news_id: '',
  295. content: '',
  296. },
  297. // 一级评论
  298. remarkData: {
  299. remark_id: '',
  300. news_id: '',
  301. total: 0,
  302. list: [],
  303. page: 1,
  304. },
  305. // 发起评论
  306. msgData: {
  307. news_id: '',
  308. remark_id: '',
  309. content: '',
  310. reply_id: '',
  311. },
  312. // 回复评论
  313. replyData: {
  314. page: 1,
  315. },
  316. isAjax: false,
  317. alumni_str: '' // 校友圈提示
  318. }
  319. },
  320. onShow() {
  321. uni.$once('operateType', type => {
  322. if (type) {
  323. let circleSchoolId = uni.getStorageSync('circleSchoolId');
  324. let schoolName = uni.getStorageSync('school_name');
  325. let circleSchoolName = uni.getStorageSync('circleSchoolName');
  326. this.schoolData.school_name = circleSchoolId ? circleSchoolName : schoolName;
  327. this.classList = [];
  328. this.getTopic();
  329. this.list = [];
  330. this.fromData.page = 1;
  331. this.getList();
  332. this.getCommonText()
  333. }
  334. })
  335. },
  336. onPageScroll(e) {
  337. if (e.scrollTop > 1) {
  338. this.bgckgroundBox = '#fff';
  339. } else {
  340. this.bgckgroundBox = 'transparent';
  341. }
  342. },
  343. created() {
  344. uni.getSystemInfo({
  345. success: (e) => {
  346. let statusBarH = e.statusBarHeight + 10
  347. let custom = 0;
  348. custom = wx.getMenuButtonBoundingClientRect()
  349. let customBarH = custom.height;
  350. this.BarH = statusBarH + customBarH;
  351. }
  352. })
  353. },
  354. mounted() {
  355. uni.$on('circleDataUp', (data) => {
  356. console.log(data, '*********************');
  357. this.list.forEach((v, k) => {
  358. if (v.news_id == data.news_id) {
  359. v.like = data.like
  360. v.remark = data.remark
  361. v.heat = data.heat
  362. v.is_like = data.is_like
  363. }
  364. })
  365. this.$forceUpdate()
  366. })
  367. let circleSchoolId = uni.getStorageSync('circleSchoolId');
  368. let schoolName = uni.getStorageSync('school_name');
  369. let circleSchoolName = uni.getStorageSync('circleSchoolName');
  370. this.schoolData.school_name = circleSchoolId ? circleSchoolName : schoolName;
  371. this.classList = [];
  372. this.getTopic();
  373. this.list = [];
  374. this.fromData.page = 1;
  375. this.getList();
  376. this.alumniBanner()
  377. this.getCommonText()
  378. },
  379. methods: {
  380. bannerClock(item) {},
  381. alumniBanner() {
  382. alumniBanner().then((res) => {
  383. if (res.code === 1) {
  384. this.bannerList = res.data
  385. }
  386. })
  387. },
  388. change(e) {
  389. this.current = e.detail.current
  390. },
  391. getCommonText() {
  392. getCommonText().then((res) => {
  393. if (res.code == 1) {
  394. this.alumni_str = res.data.alumni_str
  395. }
  396. })
  397. },
  398. toBack() {
  399. tools.leftClick()
  400. },
  401. toSelectSchool() {
  402. // uni.navigateTo({
  403. // url: '/pages-address/select-school?type=2'
  404. // })
  405. },
  406. getTopic() {
  407. getTopic().then((res) => {
  408. if (res.code === 1) {
  409. this.classList = res.data;
  410. this.classList.unshift({
  411. image: require('@/static/img/school/icon.png'),
  412. name: '全部贴子',
  413. id: 0
  414. });
  415. }
  416. })
  417. },
  418. selectOrderBuy(type) {
  419. if (this.fromData.orderBy != type) {
  420. this.fromData.orderBy = type;
  421. this.list = [];
  422. this.fromData.page = 1;
  423. this.getList();
  424. }
  425. },
  426. selectTopicId(id) {
  427. if (this.fromData.topic_id != id) {
  428. this.fromData.topic_id = id;
  429. this.list = [];
  430. this.fromData.page = 1;
  431. this.getList();
  432. }
  433. },
  434. getList() {
  435. let circleSchoolId = uni.getStorageSync('circleSchoolId');
  436. let school_id = uni.getStorageSync('school_id');
  437. this.fromData.alumni_school_id = circleSchoolId ? circleSchoolId : school_id
  438. if (this.isAjax) {
  439. return
  440. }
  441. this.isAjax = true
  442. getAlumniList(this.fromData).then((res) => {
  443. if (res.code === 1) {
  444. this.list = [...this.list, ...res.data.items];
  445. this.total = res.data.total;
  446. }
  447. this.isAjax = false
  448. })
  449. },
  450. scrolltolower() {
  451. if (this.list.length < this.total) {
  452. this.fromData.page += 1;
  453. this.getList();
  454. }
  455. },
  456. // 点赞
  457. handUp(type, item) {
  458. if (this.isAJAX) {
  459. return
  460. }
  461. this.isAJAX = true;
  462. let is_like = item.is_like == 1 ? 0 : 1;
  463. if (type == 1) {
  464. // 点赞贴子
  465. setAlumniLike({
  466. news_id: item.news_id,
  467. is_like: is_like
  468. }).then((res) => {
  469. this.handUpFun(res, item, is_like)
  470. })
  471. } else {
  472. // 点赞评论
  473. setRemarkLike({
  474. news_id: item.news_id,
  475. is_like: is_like,
  476. remark_id: item.id
  477. }).then((res) => {
  478. this.handUpFun(res, item, is_like)
  479. })
  480. }
  481. },
  482. // 点赞公共回复
  483. handUpFun(res, item, is_like) {
  484. if (res.code === 1) {
  485. item.is_like = is_like;
  486. if (is_like == 0) {
  487. item.like -= 1
  488. } else {
  489. item.like += 1
  490. }
  491. this.isAJAX = false;
  492. tools.success(res.msg, 1000);
  493. } else {
  494. this.isAJAX = false;
  495. tools.error(res.msg, 1000);
  496. }
  497. },
  498. // 获取回复列表
  499. openReply(type, item) {
  500. // type 1获取其他 2加载更多
  501. if (this.isAJAX) {
  502. return
  503. }
  504. this.isAJAX = true;
  505. if (type == 1) {
  506. item.replyList = [];
  507. this.replyData.page = 1;
  508. } else {
  509. this.replyData.page += 1;
  510. }
  511. getRemarkList({
  512. news_id: item.news_id,
  513. remark_id: item.id,
  514. page: this.replyData.page
  515. }).then((res) => {
  516. if (res.code === 1) {
  517. this.isAJAX = false;
  518. item.replyList = [...item.replyList, ...res.data.items];
  519. item.isOpen = false;
  520. } else {
  521. this.isAJAX = false;
  522. tools.error(res.msg)
  523. }
  524. })
  525. },
  526. // 打开评论
  527. openMsg(item) {
  528. this.remarkData.news_id = item.news_id;
  529. this.msgData.news_id = item.news_id;
  530. this.remarkData.remark_id = 0;
  531. this.getMsg();
  532. },
  533. // 获取评论
  534. getMsg() {
  535. if (this.isAJAX) {
  536. return
  537. }
  538. this.isAJAX = true;
  539. getRemarkList({
  540. news_id: this.remarkData.news_id,
  541. remark_id: this.remarkData.remark_id,
  542. page: this.remarkData.page
  543. }).then((res) => {
  544. if (res.code === 1) {
  545. this.isAJAX = false;
  546. this.remarkData.list = [...this.remarkData.list, ...res.data.items];
  547. this.remarkData.total = res.data.total;
  548. this.remarkData.list.forEach((v) => {
  549. v.replyList = [];
  550. if (v.count > 0) {
  551. v.isOpen = true;
  552. }
  553. })
  554. this.$refs.popmsg.open();
  555. } else {
  556. this.isAJAX = false;
  557. tools.error(res.msg)
  558. }
  559. })
  560. },
  561. // 加载更多评论
  562. scrolltolowerList() {
  563. if (this.remarkData.list.length < this.remarkData.total) {
  564. this.remarkData.page += 1;
  565. this.getMsg();
  566. }
  567. },
  568. // 关闭评论
  569. closeMsg() {
  570. this.$refs.popmsg.close();
  571. this.remarkData.list = [];
  572. this.remarkData.page = 1;
  573. this.msgData.news_id = '';
  574. this.remarkData.remark_id = '';
  575. },
  576. openInput(type, item) {
  577. if (type == 0) {
  578. this.msgData.remark_id = 0;
  579. } else if (type == 1) {
  580. this.msgData.remark_id = item.id;
  581. this.msgData.reply_id = item.m_id;
  582. } else {
  583. this.msgData.remark_id = item.remark_id;
  584. this.msgData.reply_id = item.m_id;
  585. }
  586. this.isShowIpnut = true;
  587. },
  588. closeInput() {
  589. this.isShowIpnut = false;
  590. this.msgData.remark_id = '';
  591. this.msgData.content = '';
  592. this.msgData.reply_id = '';
  593. },
  594. save() {
  595. if (this.isAJAX) {
  596. return
  597. }
  598. this.isAJAX = true;
  599. setCreateRemark(this.msgData).then((res) => {
  600. if (res.code == 1) {
  601. tools.success('评论成功', 1000)
  602. setTimeout(() => {
  603. this.isAJAX = false;
  604. this.closeInput()
  605. if (this.msgData.remark_id == 0) {
  606. this.remarkData.list = [];
  607. this.remarkData.page = 1;
  608. this.getMsg();
  609. this.list = [];
  610. this.fromData.page = 1;
  611. this.getList();
  612. } else {
  613. this.remarkData.list = [];
  614. this.remarkData.page = 1;
  615. this.getMsg();
  616. }
  617. }, 1500)
  618. } else {
  619. this.isAJAX = false;
  620. tools.error(res.msg)
  621. }
  622. })
  623. },
  624. delInfo(item) {
  625. if (this.isAJAX) {
  626. return
  627. }
  628. this.isAJAX = true;
  629. delRemark({
  630. remark_id: item.id
  631. }).then((res) => {
  632. if (res.code === 1) {
  633. tools.success('删除成功', 1000)
  634. setTimeout(() => {
  635. this.isAJAX = false;
  636. this.remarkData.list = [];
  637. this.remarkData.page = 1;
  638. this.getMsg();
  639. this.list = [];
  640. this.fromData.page = 1;
  641. this.getList();
  642. }, 1500)
  643. } else {
  644. this.isAJAX = false;
  645. tools.error(res.msg)
  646. }
  647. })
  648. },
  649. // 添加贴子
  650. add() {
  651. uni.navigateTo({
  652. url: "/pages-school/add-circle"
  653. })
  654. },
  655. // 打开举报
  656. openRepot(item) {
  657. this.reportData.news_id = item.news_id;
  658. this.$refs.popup.open();
  659. },
  660. // 举报
  661. closePop(type) {
  662. if (type === 1) {
  663. this.reportData.news_id = '';
  664. this.reportData.content = '';
  665. this.$refs.popup.close();
  666. } else {
  667. if (this.isAJAX) {
  668. return
  669. }
  670. this.isAJAX = true;
  671. alumniReport(this.reportData).then((res) => {
  672. if (res.code === 1) {
  673. tools.success(res.msg, 1000)
  674. setTimeout(() => {
  675. this.isAJAX = false;
  676. this.closePop(1);
  677. }, 1000)
  678. } else {
  679. tools.error(res.msg);
  680. this.isAJAX = false;;
  681. }
  682. })
  683. }
  684. },
  685. toDet(item) {
  686. uni.navigateTo({
  687. url: "/pages-school/circle-info?news_id=" + item.news_id
  688. })
  689. },
  690. },
  691. }
  692. </script>
  693. <style>
  694. body {
  695. background: linear-gradient(to bottom, #F5F4F9, #fff padding-bottom: env(safe-area-inset-bottom));
  696. }
  697. </style>
  698. <style scoped lang="scss">
  699. .select-box{
  700. position: sticky;
  701. left: 0;
  702. z-index: 10;
  703. }
  704. .swiper {
  705. width: 100%;
  706. height: 260rpx;
  707. border-radius: 20rpx;
  708. }
  709. .swiper-item {
  710. width: 100%;
  711. height: 260rpx;
  712. border-radius: 20rpx;
  713. }
  714. .card-2 {
  715. word-wrap: break-word;
  716. }
  717. .navCustom {
  718. position: relative;
  719. width: 100%;
  720. }
  721. .nav-left {
  722. position: absolute;
  723. left: 0;
  724. }
  725. .nav-title {
  726. // position: absolute;
  727. // left: 50%;
  728. // top: 20rpx;
  729. }
  730. .label-box {
  731. padding: 0 18rpx;
  732. height: 48rpx;
  733. line-height: 48rpx;
  734. }
  735. .wz {
  736. width: 32rpx;
  737. height: 32rpx;
  738. }
  739. .input-box {
  740. width: 100%;
  741. height: 80rpx;
  742. background: #F2F2F2;
  743. border-radius: 200rpx;
  744. line-height: 80rpx;
  745. }
  746. .b-bottom {
  747. width: 100%;
  748. height: 88rpx;
  749. line-height: 88rpx;
  750. background: linear-gradient(105deg, #57CAFF 0%, #41ABF5 100%);
  751. border-radius: 200rpx;
  752. }
  753. .school-circle {
  754. // padding-left: 24rpx;
  755. // padding-right: 24rpx;
  756. position: relative;
  757. .pop-h-20 {
  758. height: 18vh !important;
  759. }
  760. .pop-h-30 {
  761. height: 30vh !important;
  762. }
  763. .pop-box {
  764. width: 100%;
  765. height: 60vh;
  766. background-color: #fff;
  767. border-radius: 24rpx 24rpx 0rpx 0rpx;
  768. display: flex;
  769. flex-direction: column;
  770. .item-box {
  771. width: 100%;
  772. height: 92rpx;
  773. border-radius: 200rpx;
  774. line-height: 92rpx;
  775. text-align: center;
  776. margin-bottom: 24rpx;
  777. }
  778. }
  779. .pop-msg {
  780. height: 80vh;
  781. position: relative;
  782. .pop-input {
  783. position: absolute;
  784. width: 100%;
  785. height: 80vh;
  786. background-color: #fff;
  787. bottom: 0;
  788. left: 0;
  789. border-top: 1rpx solid #ccc;
  790. border-radius: 20rpx 20rpx 0 0;
  791. display: flex;
  792. flex-direction: column;
  793. .save-box {
  794. text-align: center;
  795. line-height: 88rpx;
  796. font-weight: 600;
  797. font-size: 32rpx;
  798. color: #FFFFFF;
  799. width: 100%;
  800. height: 80rpx;
  801. border-radius: 200rpx;
  802. background: linear-gradient(105deg, #57CAFF 0%, #41ABF5 100%);
  803. }
  804. }
  805. .head-pop {
  806. padding-bottom: 34rpx !important;
  807. border-bottom: 1rpx solid #F2F2F2;
  808. }
  809. .list-box {
  810. .list-box-img {
  811. width: 80rpx;
  812. height: 80rpx;
  813. border-radius: 50%;
  814. margin-right: 16rpx;
  815. }
  816. .only-box {
  817. padding: 4rpx 16rpx;
  818. background: rgba(65, 171, 245, 0.1);
  819. border-radius: 8rpx 8rpx 8rpx 8rpx;
  820. }
  821. .msg-img {
  822. width: 144rpx;
  823. height: 144rpx;
  824. border-radius: 12rpx;
  825. margin-right: 5rpx;
  826. margin-bottom: 5rpx;
  827. }
  828. .msg-img:nth-child(3n) {
  829. margin-right: 0rpx;
  830. }
  831. .msg-img-1 {
  832. width: 100rpx !important;
  833. height: 100rpx !important;
  834. }
  835. }
  836. }
  837. .ft-img {
  838. width: 30rpx;
  839. height: 32rpx;
  840. }
  841. .circle-add {
  842. background: linear-gradient(0deg, #55A7FF, #1561F6);
  843. border-radius: 50%;
  844. width: 100rpx;
  845. height: 100rpx;
  846. position: fixed;
  847. right: 38rpx;
  848. bottom: 126rpx;
  849. z-index: 2;
  850. }
  851. .w-400 {
  852. width: 400rpx;
  853. }
  854. .bg-box {
  855. width: 100%;
  856. height: 260rpx;
  857. filter: blur(80rpx);
  858. background: linear-gradient(to right, #E8E5F5, #E8EBF9, #D9EBFA);
  859. position: absolute;
  860. top: 0;
  861. left: 0;
  862. z-index: -1;
  863. }
  864. .ts-box {
  865. padding-bottom: 20rpx;
  866. border-bottom: 1rpx solid #efefef;
  867. }
  868. .tz-img {
  869. width: 48rpx;
  870. height: 48rpx;
  871. margin-right: 14rpx;
  872. }
  873. .nav-box {
  874. width: 100%;
  875. padding: 27rpx 50rpx 47rpx;
  876. .nav-item {
  877. margin-right: 48rpx;
  878. width: 90rpx;
  879. display: inline-block;
  880. // height: auto;
  881. position: relative;
  882. .nav-icon {
  883. width: 90rpx;
  884. height: 90rpx;
  885. margin: 0 auto 24rpx;
  886. }
  887. }
  888. .nav-item:last-child {
  889. margin: 0;
  890. }
  891. }
  892. .type-box {
  893. padding: 25rpx 30rpx;
  894. background: #F2F3F7;
  895. .box-s {
  896. font-weight: 600 !important;
  897. color: #F6ABAC;
  898. box-sizing: border-box;
  899. border: 1rpx solid #F6ABAC;
  900. }
  901. .box-1 {
  902. padding: 9rpx 19rpx;
  903. margin-right: 48rpx;
  904. border-radius: 20rpx;
  905. font-size: 24rpx;
  906. font-weight: 400;
  907. box-sizing: border-box;
  908. }
  909. }
  910. .card-box {
  911. width: 100%;
  912. min-height: 100rpx;
  913. padding: 30rpx 30rpx 50rpx;
  914. border-bottom: 1rpx solid #EEEEEE;
  915. .card-head {
  916. width: 90rpx;
  917. height: 90rpx;
  918. border-radius: 50%;
  919. margin-right: 20rpx;
  920. }
  921. .hot-img {
  922. width: 40rpx;
  923. height: 40rpx;
  924. margin-left: auto;
  925. }
  926. .card-3 {
  927. .card-3-img {
  928. width: 182rpx;
  929. height: 182rpx;
  930. border-radius: 12rpx;
  931. margin-right: 6rpx;
  932. margin-bottom: 6rpx;
  933. }
  934. .card-3-img:nth-child(3n) {
  935. margin-right: 0rpx;
  936. }
  937. }
  938. .card-4 {
  939. view {
  940. padding: 4rpx 16rpx;
  941. background: #F2F2F2;
  942. border-radius: 200rpx;
  943. font-size: 24rpx;
  944. color: #999;
  945. margin-right: 20rpx;
  946. margin-bottom: 10rpx;
  947. }
  948. }
  949. .card-5 {
  950. .info-img {
  951. width: 40rpx;
  952. height: 40rpx;
  953. margin-right: 8rpx;
  954. }
  955. }
  956. }
  957. }
  958. </style>