Details.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. <template>
  2. <div class="bg">
  3. <div class="base-bg">
  4. <div class="list-wrap">
  5. <div class="list">
  6. <div class="list-tit moren">{{ peo.name }}简介</div>
  7. <div class="serch-wrapper">
  8. <div class="search-left">
  9. <img src="../../assets/img/flower-black.png" alt="" style="width: 26px;height: 18px;" />
  10. <div class="moren">悼念数: {{mournNum || 0}}</div>
  11. </div>
  12. </div>
  13. <div class="user-info">
  14. <div class="user-img">
  15. <img :src="peo.image" alt="" />
  16. </div>
  17. <div class="user-base">
  18. <div class="base-item">
  19. <div class="base-item-name">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</div>
  20. <div class="base-val">&nbsp;&nbsp;{{peo.name || ''}}</div>
  21. </div>
  22. <div class="base-item">
  23. <div class="base-item-name">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</div>
  24. <div class="base-val">&nbsp;&nbsp;{{peo.gender}}</div>
  25. </div>
  26. <div class="base-item">
  27. <div class="base-item-name">籍&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;贯</div>
  28. <div class="base-val">&nbsp;&nbsp;{{peo.book}}</div>
  29. </div>
  30. <div class="base-item">
  31. <div class="base-item-name">捐献项目</div>
  32. <div class="base-val">&nbsp;&nbsp;{{peo.project}}</div>
  33. </div>
  34. <div class="base-item" v-if="!peo.fatal">
  35. <div class="base-item-name">享&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;年</div>
  36. <div class="base-val">&nbsp;&nbsp;{{peo.age}}</div>
  37. </div>
  38. <div class="base-item" v-if="peo.fatal">
  39. <div class="base-item-name">出生日期</div>
  40. <div class="base-val">&nbsp;&nbsp;{{peo.fatal}}</div>
  41. </div>
  42. <div class="base-item">
  43. <div class="base-item-name">捐献日期</div>
  44. <div class="base-val">&nbsp;&nbsp;{{peo.time_text | showTime}}</div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="online">
  49. <div class="online-tit">
  50. <img src="../../assets/img/online-tit.png" alt="" />
  51. <div class="tit-tit moren">在线悼念</div>
  52. </div>
  53. <div class="online-tb">
  54. <div class="tb-item">
  55. <img src="../../assets/img/online00.png" alt="" class="tb-item-logo" />
  56. <div class="tb-item-tit hand" @click="mournGive(1)">献花:{{ peo.flower }}</div>
  57. </div>
  58. <div class="tb-item">
  59. <img src="../../assets/img/online01.png" alt="" class="tb-item-logo" />
  60. <div class="tb-item-tit hand" @click="mournGive(2)">点烛:{{ peo.candle }}</div>
  61. </div>
  62. <div class="tb-item">
  63. <img src="../../assets/img/online02.png" alt="" class="tb-item-logo" />
  64. <div class="tb-item-tit hand" @click="mournGive(3)">上香:{{ peo.scented }}</div>
  65. </div>
  66. <div class="tb-item">
  67. <img src="../../assets/img/online03.png" alt="" class="tb-item-logo" />
  68. <div class="tb-item-tit hand" @click="mournGive(4)">祈祷:{{ peo.pray }}</div>
  69. </div>
  70. </div>
  71. </div>
  72. <div style="display: flex;justify-content: center;align-items: center;height: 200px;width: 100%;">
  73. <img src="../../assets/img/blackk.png" alt="" style="width: 137px;height: 36px;" class="hand" @click="goBlack"/>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <!-- <page-bottom :backgroundBg="'#fff'" :textcolor="'#031A2A'"></page-bottom> -->
  79. </div>
  80. </template>
  81. <script>
  82. import {
  83. Message
  84. } from 'element-ui'
  85. import PageBottom from "../../components/pageBottom/PageBottom.vue";
  86. import {
  87. getMournList,
  88. getMournDetail,
  89. mournGive,
  90. getPeoNum
  91. } from "../../request/api.js";
  92. export default {
  93. data() {
  94. return {
  95. list: 10,
  96. page: 1,
  97. limit: 20,
  98. total: 100,
  99. keyword: "",
  100. loaded: false,
  101. peo: {
  102. name: "",
  103. hua: 0,
  104. lazhu: 0,
  105. xioang: 0,
  106. qi: 0,
  107. },
  108. mournNum: '',
  109. };
  110. },
  111. filters: {
  112. showTime(val) {
  113. let str = ''
  114. if (val) {
  115. str = val.split(' ')[0]
  116. }
  117. return str
  118. }
  119. },
  120. components: {
  121. PageBottom,
  122. },
  123. mounted() {
  124. this.getMournDetail()
  125. // this.getPeoNum()
  126. },
  127. methods: {
  128. goBlack() {
  129. this.$router.back();
  130. },
  131. // 获取个人掉念数
  132. getPeoNum() {
  133. getPeoNum({
  134. id: this.$route.query.id
  135. }).then(res => {
  136. console.log(res)
  137. this.mournNum = res.data
  138. })
  139. },
  140. //个人祭拜
  141. mournGive(id) {
  142. let obj = this
  143. if (obj.loaded) {
  144. return Message.error('请勿频繁操作')
  145. }
  146. obj.loaded = true
  147. mournGive({
  148. id: this.$route.query.id,
  149. type: id
  150. }).then(res => {
  151. if (id == 1) {
  152. obj.peo.flower++
  153. } else if (id == 2) {
  154. obj.peo.candle++
  155. } else if (id == 3) {
  156. obj.peo.scented++
  157. } else if (id == 4) {
  158. obj.peo.pray++
  159. }
  160. obj.mournNum++
  161. obj.loaded = false
  162. })
  163. },
  164. // 获取个人悼念总数
  165. getMournDetail() {
  166. // console.log(this.$route.query.id)
  167. let obj = this
  168. getMournDetail({
  169. id: this.$route.query.id,
  170. }).then((res) => {
  171. console.log(res);
  172. obj.peo = res.data.data
  173. obj.mournNum = res.data.count
  174. });
  175. },
  176. goHome() {
  177. this.$router.push("/home");
  178. },
  179. // 页码改变触发
  180. currentChange(e) {
  181. this.page = e;
  182. // console.log()
  183. this.list = e;
  184. this.getList();
  185. },
  186. // 获取捐献列表
  187. getList() {},
  188. // 在线悼念
  189. goDaonian() {
  190. this.$router.push("/mourn/detail?id=10");
  191. },
  192. },
  193. computed: {
  194. boxHeight() {
  195. console.log(Math.round(this.list / 4), "Math.round(this.list/4)");
  196. return Math.round(this.list / 4);
  197. },
  198. },
  199. };
  200. </script>
  201. <style lang="scss" scoped>
  202. div {
  203. box-sizing: border-box;
  204. }
  205. .bg {
  206. background: #dbe2ee;
  207. width: 100%;
  208. overflow: hidden;
  209. }
  210. .base-bg {
  211. width: 100%;
  212. height: 100%;
  213. min-width: 1920px;
  214. background-image: url('../../assets/img/mourn-bg.png');
  215. // position: ;
  216. background-size: 100% 100%;
  217. background-repeat: no-repeat;
  218. position: absolute;
  219. top: 0;
  220. bottom: 0;
  221. right: 0;
  222. left: 0;
  223. margin: auto;
  224. }
  225. .list-wrap {
  226. position: absolute;
  227. top: 0;
  228. left: 0;
  229. right: 0;
  230. bottom: 0;
  231. height: 975px;
  232. width: 1082px;
  233. // min-height: 1845px;
  234. // height: auto;
  235. background: #ffffff;
  236. margin: auto;
  237. // margin-top: -508px;
  238. padding: 18px 13px;
  239. .list {
  240. width: 100%;
  241. // min-height: 1845px;
  242. padding-bottom: 100px;
  243. // height: 100%;
  244. // min-height: 100%;
  245. height: 937px;
  246. border: 8px solid #006061;
  247. position: relative;
  248. display: flex;
  249. flex-wrap: wrap;
  250. justify-content: flex-start;
  251. align-content: flex-start;
  252. padding-top: 62px;
  253. .list-tit {
  254. width: 258px;
  255. height: 52px;
  256. line-height: 52px;
  257. background: #006061;
  258. text-align: center;
  259. font-size: 19px;
  260. font-family: PingFang SC;
  261. font-weight: bold;
  262. color: #ffffff;
  263. position: absolute;
  264. top: -8px;
  265. left: -8px;
  266. }
  267. .list-item {
  268. text-align: center;
  269. width: 203px;
  270. height: 278px;
  271. // margin-bottom: 40px;
  272. margin: 40px 20px;
  273. .item-logo {
  274. width: 203px;
  275. height: 203px;
  276. position: relative;
  277. .logo-pepo {
  278. width: 160px;
  279. height: 160px;
  280. border-radius: 50%;
  281. position: absolute;
  282. top: 0;
  283. left: 0;
  284. bottom: 0;
  285. right: 0;
  286. margin: auto;
  287. }
  288. .logo-hq {
  289. width: 203px;
  290. height: 203px;
  291. position: absolute;
  292. top: 0;
  293. left: 0;
  294. }
  295. // background-image: url(../../assets/img/hq.png);
  296. }
  297. .item-name {
  298. padding: 13px 0;
  299. font-size: 21px;
  300. font-family: PingFang SC;
  301. font-weight: 500;
  302. color: #071b2a;
  303. }
  304. .item-btn {
  305. width: 97px;
  306. line-height: 29px;
  307. background: #006061;
  308. border-radius: 5px;
  309. font-size: 15px;
  310. font-family: PingFang SC;
  311. font-weight: bold;
  312. color: #ffffff;
  313. margin: auto;
  314. }
  315. }
  316. }
  317. .user-info {
  318. padding: 101px 0 96px 205px;
  319. width: 100%;
  320. display: flex;
  321. .user-img {
  322. width: 163px;
  323. height: 163px;
  324. img {
  325. width: 163px;
  326. height: 163px;
  327. }
  328. }
  329. .user-base {
  330. margin-left: 40px;
  331. width: 546px;
  332. display: flex;
  333. // flex-direction: ;
  334. flex-wrap: wrap;
  335. align-content: center;
  336. .base-item {
  337. width: 50%;
  338. flex-shrink: 0;
  339. // flex-grow: 0;
  340. border-bottom: 1px dashed rgba(23, 18, 21, 0.21);
  341. display: flex;
  342. line-height: 32px;
  343. height: 32px;
  344. font-size: 19px;
  345. font-family: PingFang SC;
  346. font-weight: 500;
  347. color: #0b1c29;
  348. line-height: 31px;
  349. .base-item-name {
  350. &::after {
  351. content: ":";
  352. }
  353. }
  354. }
  355. }
  356. }
  357. .online {
  358. width: 100%;
  359. .online-tit {
  360. position: relative;
  361. width: 566px;
  362. height: 70px;
  363. margin: auto;
  364. img {
  365. widows: 566px;
  366. height: 70px;
  367. }
  368. .tit-tit {
  369. widows: 566px;
  370. height: 70px;
  371. line-height: 65px;
  372. position: absolute;
  373. top: 0;
  374. left: 0;
  375. right: 0;
  376. bottom: 0;
  377. margin: auto;
  378. text-align: center;
  379. font-size: 24px;
  380. font-family: PingFang SC;
  381. font-weight: bold;
  382. color: #ffffff;
  383. }
  384. }
  385. .online-tb {
  386. width: 645px;
  387. height: 180px;
  388. // margin: auto;
  389. margin: 47px auto 0;
  390. display: flex;
  391. justify-content: space-between;
  392. .tb-item {
  393. width: 132px;
  394. height: 180px;
  395. position: relative;
  396. .tb-item-logo {
  397. width: 132px;
  398. height: 180px;
  399. }
  400. .tb-item-tit {
  401. font-size: 16px;
  402. font-family: PingFang SC;
  403. font-weight: 500;
  404. color: #ffffff;
  405. line-height: 27px;
  406. line-height: 40px;
  407. position: absolute;
  408. bottom: 0;
  409. text-align: center;
  410. width: 132px;
  411. }
  412. }
  413. }
  414. }
  415. }
  416. .serch-wrapper {
  417. position: absolute;
  418. top: 0;
  419. right: 0;
  420. display: flex;
  421. height: 33px;
  422. position: absolute;
  423. top: 5px;
  424. right: 10px;
  425. .search-left {
  426. display: flex;
  427. align-items: center;
  428. height: 33px;
  429. font-size: 15px;
  430. font-family: PingFang SC;
  431. font-weight: bold;
  432. color: #031a2a;
  433. margin-right: 10px;
  434. }
  435. }
  436. .page-wrap {
  437. position: absolute;
  438. bottom: 30px;
  439. display: flex;
  440. width: 100%;
  441. justify-content: center;
  442. }
  443. .top-btn {
  444. width: 100%;
  445. min-width: 1800px;
  446. height: 40px;
  447. background: rgba($color: #ffff, $alpha: 0.85);
  448. position: absolute;
  449. // opacity: 0.85;
  450. display: flex;
  451. // justify-content: ;
  452. align-items: center;
  453. text-align: center;
  454. font-size: 13px;
  455. font-family: PingFang SC;
  456. font-weight: bold;
  457. color: #031a2a;
  458. .top-item {
  459. width: 50%;
  460. img {
  461. width: 15px;
  462. height: 15px;
  463. // margin-left: 6px;
  464. }
  465. }
  466. }
  467. </style>