detail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. <template>
  2. <view class="content">
  3. <view class="top-bg">
  4. <image src="../../static/img/mourn-bg.png" mode="widthFix"></image>
  5. </view>
  6. <view class="list-wrap">
  7. <view class="list flex">
  8. <view class="list-tit">
  9. {{peo.name}}简介
  10. </view>
  11. <!-- <view class="search-wrap">
  12. <input type="text" value="" placeholder="请输入捐赠者" placeholder-class="search-placeholder" />
  13. <image src="../../static/icon/search.png" mode=""></image>
  14. </view> -->
  15. <view class="mourn-mun">
  16. <image src="../../static/icon/blackf.png" mode="widthFix"></image>
  17. 悼念总数:{{mournNum}}
  18. </view>
  19. <!-- 捐赠人信息 start -->
  20. <view class="user-info">
  21. <view class="user-img">
  22. <image :src="'https://cnqadmin.igxys.com' + peo.image" mode=""></image>
  23. <image src="../../static/img/huak.png" alt="" />
  24. </view>
  25. <view class="user-base">
  26. <view class="base-item">
  27. <view class="base-item-name">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</view>
  28. <view class="base-val">&nbsp;&nbsp;{{peo.name || ''}}</view>
  29. </view>
  30. <view class="base-item">
  31. <view class="base-item-name">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</view>
  32. <view class="base-val">&nbsp;&nbsp;{{peo.gender_text}}</view>
  33. </view>
  34. <view class="base-item">
  35. <view class="base-item-name">享&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;年</view>
  36. <view class="base-val">&nbsp;&nbsp;{{peo.age == 0 ? '暂无': peo.age}}</view>
  37. </view>
  38. <view class="base-item">
  39. <view class="base-item-name">籍&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;贯</view>
  40. <view class="base-val">&nbsp;&nbsp;{{peo.book}}</view>
  41. </view>
  42. <view class="base-item">
  43. <view class="base-item-name">捐献项目</view>
  44. <view class="base-val">&nbsp;&nbsp;{{peo.project}}</view>
  45. </view>
  46. <view class="base-item">
  47. <view class="base-item-name">捐献日期</view>
  48. <view class="base-val">&nbsp;&nbsp;{{peo.time_text.split(' ')[0] }}</view>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 捐赠人信息 end -->
  53. <!-- 悼念行为 start -->
  54. <view class="online">
  55. <view class="" style="height: 50rpx;">
  56. </view>
  57. <view class="online-tit">
  58. <image src="../../static/img/online-tit.png" alt="" />
  59. <view class="tit-tit">在线悼念</view>
  60. </view>
  61. <view class="online-tb">
  62. <view class="tb-item">
  63. <image src="../../static/img/online00.png" alt="" class="tb-item-logo" @click="mournGive(1)"/>
  64. <view class="tb-item-tit hand" @click="mournGive(1)">献花:{{ peo.flower }}</view>
  65. </view>
  66. <view class="tb-item">
  67. <image src="../../static/img/online01.png" alt="" class="tb-item-logo" @click="mournGive(2)"/>
  68. <view class="tb-item-tit hand" @click="mournGive(2)">点烛:{{ peo.candle }}</view>
  69. </view>
  70. <view class="tb-item">
  71. <image src="../../static/img/online02.png" alt="" class="tb-item-logo" @click="mournGive(3)"/>
  72. <view class="tb-item-tit hand" @click="mournGive(3)">上香:{{ peo.scented }}</view>
  73. </view>
  74. <view class="tb-item">
  75. <image src="../../static/img/online03.png" alt="" class="tb-item-logo" @click="mournGive(4)"/>
  76. <view class="tb-item-tit hand" @click="mournGive(4)">祈祷:{{ peo.pray }}</view>
  77. </view>
  78. </view>
  79. <view class="btm-img">
  80. <image src="../../static/img/mourn-btm.png" mode=""></image>
  81. </view>
  82. </view>
  83. <!-- 悼念行为 end -->
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. import { weixindata } from '@/utils/wxAuthorized.js';
  90. import {
  91. getMournDetail,
  92. mournGive
  93. } from '@/api/mourn.js'
  94. export default {
  95. data() {
  96. return {
  97. mournNum: 0,
  98. peo: {},
  99. id: 0,
  100. loaded: false
  101. }
  102. },
  103. filters: {
  104. showTime(val) {
  105. let str = ''
  106. if (val) {
  107. str = val.split(' ')[0]
  108. }
  109. return str
  110. }
  111. },
  112. onShow() {
  113. this.getMournDetail()
  114. },
  115. onLoad(opt) {
  116. let obj = this
  117. obj.id = opt.id
  118. if (this.$store.state.isPlay) {} else {
  119. if (this.$store.state.isAllow) {
  120. uni.showModal({
  121. title: '温馨提醒',
  122. cancelText: '否',
  123. confirmText: '是',
  124. content: '是否播放背景音乐?',
  125. success: function(res) {
  126. if (res.confirm) {
  127. obj.$api.playMusic(true)
  128. } else if (res.cancel) {
  129. obj.$store.state.isAllow = false
  130. }
  131. }
  132. })
  133. }
  134. }
  135. this.IndexShare()
  136. },
  137. methods: {
  138. navto(url) {
  139. //判断是否播放音乐
  140. //
  141. uni.navigateTo({
  142. url: url
  143. })
  144. },
  145. //个人祭拜
  146. mournGive(id) {
  147. let obj = this
  148. if (obj.loaded) {
  149. obj.$api.msg('请勿频繁操作')
  150. }
  151. obj.loaded = true
  152. mournGive({
  153. id: obj.id,
  154. type: id
  155. }).then(res => {
  156. if (id == 1) {
  157. obj.peo.flower++
  158. } else if (id == 2) {
  159. obj.peo.candle++
  160. } else if (id == 3) {
  161. obj.peo.scented++
  162. } else if (id == 4) {
  163. obj.peo.pray++
  164. }
  165. obj.mournNum++
  166. obj.loaded = false
  167. })
  168. },
  169. // 获取个人悼念情况
  170. getMournDetail() {
  171. let obj = this
  172. getMournDetail({
  173. id: obj.id,
  174. }).then((res) => {
  175. obj.peo = res.data.data
  176. obj.mournNum = res.data.count
  177. });
  178. },
  179. IndexShare() {
  180. let obj = this;
  181. let item = {
  182. link: obj.$store.state.baseURL + '/index/#/pages/mourn/detail?id=' + obj.id, // 分享链接
  183. imgUrl: obj.$store.state.baseURL +'/index/static/img/002.png',
  184. desc: '生命有限/大爱无限/器官(遗体、组织)捐献/让生命在爱中传递......',
  185. title: '在线悼念捐献者',
  186. success: console.log('分享加载成功')
  187. };
  188. console.log('分享加', item);
  189. weixindata(item);
  190. },
  191. }
  192. }
  193. </script>
  194. <style lang="scss" scoped>
  195. page {
  196. min-height: 100%;
  197. background-color: #e0e3ea;
  198. }
  199. .top-bg {
  200. width: 750rpx;
  201. image {
  202. width: 750rpx;
  203. }
  204. }
  205. .list-wrap {
  206. position: relative;
  207. width: 710rpx;
  208. margin: auto;
  209. margin-top: -300rpx;
  210. padding: 5rpx;
  211. background-color: #fff;
  212. .list {
  213. width: 100%;
  214. height: 752rpx;
  215. border: 5rpx solid #006061;
  216. position: relative;
  217. padding-top: 124rpx;
  218. flex-wrap: wrap;
  219. // align-items: flex-start;
  220. align-content: flex-start;
  221. .list-tit {
  222. // width: 314rpx;
  223. position: absolute;
  224. top: 0;
  225. display: inline-block;
  226. padding: 0 15rpx;
  227. height: 54rpx;
  228. line-height: 54rpx;
  229. font-size: 20rpx;
  230. background-color: #006061;
  231. color: #fff;
  232. }
  233. .search-wrap {
  234. width: 200rpx;
  235. height: 32rpx;
  236. // background-color: red;
  237. position: absolute;
  238. right: 10rpx;
  239. top: 16rpx;
  240. font-size: 20rpx;
  241. .search-placeholder {
  242. font-size: 20rpx;
  243. }
  244. input {
  245. display: inline-block;
  246. border-radius: 10rpx;
  247. width: 200rpx;
  248. height: 32rpx;
  249. border: 1rpx solid #999;
  250. padding: 0 10rpx;
  251. }
  252. image {
  253. display: block;
  254. position: absolute;
  255. width: 25rpx;
  256. height: 25rpx;
  257. right: 10rpx;
  258. top: 10rpx;
  259. }
  260. }
  261. .mourn-mun {
  262. position: absolute;
  263. top: 10rpx;
  264. text-align: right;
  265. display: inline-block;
  266. flex-wrap: nowrap;
  267. align-items: center;
  268. right: 10rpx;
  269. font-weight: bold;
  270. image {
  271. width: 26rpx;
  272. margin-right: 10rpx;
  273. }
  274. }
  275. .list-item {
  276. height: 245rpx;
  277. width: 25%;
  278. // text-align: center;
  279. .item-img {
  280. width: 121rpx;
  281. height: 145rpx;
  282. margin: auto;
  283. position: relative;
  284. image {
  285. width: 100%;
  286. height: 100%;
  287. position: absolute;
  288. }
  289. }
  290. .item-name {
  291. text-align: center;
  292. color: #000;
  293. font-size: 22rpx;
  294. font-weight: bold;
  295. padding-top: 20rpx;
  296. padding-bottom: 10rpx;
  297. }
  298. .item-btn {
  299. width: 92rpx;
  300. height: 30rpx;
  301. background-color: #006061;
  302. margin: auto;
  303. text-align: center;
  304. color: #fff;
  305. border-radius: 10rpx;
  306. font-size: 17rpx;
  307. line-height: 30rpx;
  308. }
  309. }
  310. }
  311. }
  312. .user-info {
  313. // padding: 101rpx 0 96rpx 205rpx;
  314. padding: 0 22rpx 0 25rpx;
  315. width: 100%;
  316. display: flex;
  317. .user-img {
  318. width: 121rpx;
  319. height: 145rpx;
  320. position: relative;
  321. image {
  322. width: 121rpx;
  323. height: 145rpx;
  324. position: absolute;
  325. }
  326. // position;
  327. }
  328. .user-base {
  329. margin-left: 40rpx;
  330. width: 546rpx;
  331. display: flex;
  332. // flex-direction: ;
  333. flex-wrap: wrap;
  334. align-content: center;
  335. .base-item {
  336. width: 50%;
  337. flex-shrink: 0;
  338. // flex-grow: 0;
  339. border-bottom: 1px dashed rgba(23, 18, 21, 0.21);
  340. display: flex;
  341. line-height: 50rpx;
  342. height: 50rpx;
  343. font-size: 19rpx;
  344. font-family: PingFang SC;
  345. font-weight: 500;
  346. color: #0b1c29;
  347. // line-height: 31rpx;
  348. .base-item-name {
  349. &::after {
  350. content: ":";
  351. }
  352. }
  353. .base-val {
  354. padding-left: 10rpx;
  355. }
  356. }
  357. }
  358. }
  359. .online {
  360. width: 100%;
  361. .online-tit {
  362. position: relative;
  363. width: 640rpx;
  364. height: 70rpx;
  365. margin: auto;
  366. image {
  367. width: 640rpx;
  368. height: 70rpx;
  369. }
  370. .tit-tit {
  371. width: 640rpx;
  372. height: 70rpx;
  373. line-height: 65rpx;
  374. position: absolute;
  375. top: 0;
  376. left: 0;
  377. right: 0;
  378. bottom: 0;
  379. margin: auto;
  380. text-align: center;
  381. font-size: 24rpx;
  382. font-family: PingFang SC;
  383. font-weight: bold;
  384. color: #ffffff;
  385. }
  386. }
  387. .online-tb {
  388. width: 645rpx;
  389. height: 180rpx;
  390. // margin: auto;
  391. margin: 47rpx auto 0;
  392. display: flex;
  393. justify-content: space-between;
  394. .tb-item {
  395. width: 132rpx;
  396. height: 180rpx;
  397. position: relative;
  398. .tb-item-logo {
  399. width: 132rpx;
  400. height: 180rpx;
  401. }
  402. .tb-item-tit {
  403. font-size: 16rpx;
  404. font-family: PingFang SC;
  405. font-weight: 500;
  406. color: #ffffff;
  407. line-height: 27rpx;
  408. line-height: 40rpx;
  409. position: absolute;
  410. bottom: 0;
  411. text-align: center;
  412. width: 132rpx;
  413. }
  414. }
  415. }
  416. }
  417. .btm-img {
  418. width: 589rpx;
  419. height: 30rpx;
  420. margin: auto;
  421. margin-top: 45rpx;
  422. image {
  423. width: 589rpx;
  424. height: 30rpx;
  425. }
  426. }
  427. </style>