donateDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. <template>
  2. <view class="detail">
  3. <view class="top">
  4. <image :src="proInfo.img" mode=""></image>
  5. <view class="title clamp">{{ proInfo.title }}</view>
  6. <view class="tip">
  7. <view class=""></view>
  8. 基本信息
  9. </view>
  10. <view class="base-info">
  11. <view class="item">
  12. <text>捐赠进度</text>
  13. <text class="status">{{ proInfo.project_progress }}%</text>
  14. </view>
  15. <view class="item">
  16. <text>创立时间</text>
  17. 2021年6月10日
  18. </view>
  19. <view class="item">
  20. <text>开始时间</text>
  21. {{ proInfo.add_time | time }}
  22. </view>
  23. <view class="item">
  24. <text>结束时间</text>
  25. {{ proInfo.end_time | time }}
  26. </view>
  27. </view>
  28. <view class="dynamic flex">
  29. <view class="left">实时动态</view>
  30. <view class="right flex">
  31. <view>捐赠时间:2021年06月10日</view>
  32. <view>
  33. 捐赠人:
  34. <text>李**</text>
  35. </view>
  36. <view class="clamp" style="width: 500rpx;">捐赠数量:帐篷[100]顶,帐篷[100]顶,帐篷[100]顶,帐篷[100]顶</view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="content">
  41. <view class="content-nav flex">
  42. <view class="nav-item" v-for="(item, index) in navList" :key="index" :class="{ active: currentIndex === index }" @click="navClick(index)">{{ item }}</view>
  43. </view>
  44. </view>
  45. <view v-if="currentIndex === 0">
  46. <view class="item-detail" ref="swiperItemOne">
  47. <view class="tip">
  48. <view class=""></view>
  49. 捐赠介绍
  50. </view>
  51. <view class="item-content" v-html="proInfo.info"></view>
  52. <view class="tip">
  53. <view class=""></view>
  54. 项目需求
  55. </view>
  56. <view class="item-needs">
  57. <view class="need-item" v-for="item in proInfo.project_donation_info">
  58. <view class="">
  59. {{ item.project_donation_id | type(typeList)}}:
  60. <text>{{ item.project_donation_num }}</text>
  61. </view>
  62. <view class="">
  63. 最低需求捐赠数:
  64. <text>{{ item.project_donation_num}}</text>
  65. </view>
  66. <view class="">
  67. 物资捐赠要求:
  68. <text>全新</text>
  69. </view>
  70. </view>
  71. <!-- <view class="need-item">
  72. <view class="">
  73. 帐篷类(帐篷):
  74. <text>500</text>
  75. </view>
  76. <view class="">
  77. 最低需求捐赠数:
  78. <text>500</text>
  79. </view>
  80. <view class="">
  81. 物资捐赠要求:
  82. <text>全新</text>
  83. </view>
  84. </view> -->
  85. </view>
  86. </view>
  87. </view>
  88. <view v-else class="feedback">
  89. <view class="feedback-nav">
  90. <view class="nav-item" :class="{ action: navCurrentIndex === 0 }" @click="lookmore(0)">全部</view>
  91. <view class="nav-item" :class="{ action: navCurrentIndex === 1 }" @click="lookmore(1)">已成功</view>
  92. <view class="nav-item nav-item-err" :class="{ action: navCurrentIndex === 2 }" @click="lookmore(2)">已失败</view>
  93. </view>
  94. <view class="feedback-content">
  95. <view class="overall" v-if="navCurrentIndex === 0">
  96. <view class="title">项目整体反馈</view>
  97. <view class="content">截止2021年6月10日,荆州市红十字会已将捐赠的消毒液1120瓶和帐篷200顶,500箱矿泉水全数发往阳光福利院。</view>
  98. </view>
  99. <view class="feedback-item">
  100. <view class="item-top">
  101. <image src="" mode=""></image>
  102. <view class="item-name-time">
  103. <view class="item-name">荆州捐赠</view>
  104. <view class="item-time">2021年06月10日 22:25:14</view>
  105. </view>
  106. </view>
  107. <view class="item-content">
  108. <text>荆州XXXX有限分公司</text>
  109. 2021年6月10日,荆州市红十字会已将贵公司捐赠的消毒液1120瓶和帐篷200顶,发往阳光福利院。
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <view class="btn-wrapper flex">
  115. <view class="btn1 btn" @click="navTo('/pages/donate/progress')">实时进展</view>
  116. <view class="btn2 btn" @click="want()">我要捐款</view>
  117. </view>
  118. <uni-popup ref="popup" type="center">
  119. <view class="type-box">
  120. <image src="../../static/img/sele.png" mode="" class="bg"></image>
  121. <view class="box-title">捐款类型</view>
  122. <view class="box-tip">请选择您的捐赠身份类型</view>
  123. <view class="box-btn" @click="chooseType(0)">
  124. <image src="" mode=""></image>
  125. <view class="btn-title">个人捐赠</view>
  126. <view class="qq" :class="{ action: jxType === 0 }"><view class="yx"></view></view>
  127. </view>
  128. <view class="box-btn" @click="chooseType(1)">
  129. <image src="" mode=""></image>
  130. <view class="">企业(团队)捐赠</view>
  131. <view class="qq" :class="{ action: jxType === 1 }"><view class="yx"></view></view>
  132. </view>
  133. <view class="qr" @click="qr()">确认</view>
  134. </view>
  135. </uni-popup>
  136. </view>
  137. </template>
  138. <script>
  139. import { getProjectInfo, createProject, getDonationInfo, getAllOrder} from '../../api/money.js';
  140. export default {
  141. data() {
  142. return {
  143. navList: ['捐赠详情', '捐赠反馈'],
  144. currentIndex: 0,
  145. swiperHeight: 0,
  146. navCurrentIndex: 0,
  147. jxType: 0,
  148. pid: 0,
  149. proInfo: {},
  150. typeList: [],//物资分类列表
  151. };
  152. },
  153. filters: {
  154. time(val) {
  155. let date = new Date(val * 1000);
  156. let Y = date.getFullYear();
  157. let M = date.getMonth();
  158. let D = date.getDate();
  159. return Y + '年' + M + '月' + D + '日';
  160. },
  161. type(val,typeList) {
  162. let str = ''
  163. let arr = typeList
  164. let len = arr.length
  165. for(let i = 0;i< len ; i++){
  166. if(arr[i].id === val) {
  167. return str = arr[i].name
  168. }
  169. }
  170. }
  171. },
  172. onLoad(opt) {
  173. this.pid = opt.id;
  174. this.loadDate(this.pid);
  175. this.getDonationInfo()
  176. this.getAllOrder()
  177. },
  178. methods: {
  179. loadDate(id) {
  180. getProjectInfo({
  181. id: id
  182. }).then(res => {
  183. let data = JSON.parse(res.msg);
  184. console.log(data, 'loaddata++++++++++');
  185. data.info = data.info.replace(/<img /g, '<img style="width:100%"');
  186. this.proInfo = data;
  187. });
  188. },
  189. navTo(url) {
  190. uni.navigateTo({
  191. url: url
  192. });
  193. },
  194. navClick(index) {
  195. this.currentIndex = index;
  196. },
  197. lookmore(index) {
  198. this.navCurrentIndex = index;
  199. },
  200. want() {
  201. this.$refs.popup.open();
  202. },
  203. chooseType(index) {
  204. this.jxType = index;
  205. },
  206. qr() {
  207. this.$refs.popup.close();
  208. this.navTo('/pages/donate/idonate?type=' + this.jxType + '&id='+this.proInfo.id);
  209. },
  210. //获取物资分类列表
  211. getDonationInfo() {
  212. getDonationInfo().then(({data} )=>{
  213. this.typeList = data
  214. console.log(this.typeList,'获取所有物资')
  215. })
  216. },
  217. getAllOrder() {
  218. getAllOrder({
  219. }).then(res => {
  220. console.log(res)
  221. })
  222. }
  223. }
  224. };
  225. </script>
  226. <style lang="scss" scoped>
  227. page {
  228. width: 100%;
  229. }
  230. .top {
  231. height: 863rpx;
  232. background-color: #fff;
  233. border-top: 1rpx solid #f6f6f6;
  234. padding-top: 33rpx;
  235. margin-bottom: 20rpx;
  236. image {
  237. display: block;
  238. width: 680rpx;
  239. height: 375rpx;
  240. border-radius: 20rpx;
  241. margin: 0 auto;
  242. // background-color: red;
  243. }
  244. .title {
  245. width: 580rpx;
  246. font-size: 32rpx;
  247. font-family: PingFang SC;
  248. font-weight: bold;
  249. color: #333333;
  250. line-height: 1;
  251. padding-top: 28rpx;
  252. padding-left: 42rpx;
  253. margin-bottom: 39rpx;
  254. }
  255. .base-info {
  256. font-size: 27rpx;
  257. font-family: PingFang SC;
  258. font-weight: 500;
  259. color: #999999;
  260. line-height: 1;
  261. display: flex;
  262. padding: 0 56rpx;
  263. flex-wrap: wrap;
  264. .item {
  265. width: 50%;
  266. padding-bottom: 40rpx;
  267. .status {
  268. color: red;
  269. font-weight: bold;
  270. }
  271. text {
  272. font-size: 26rpx;
  273. font-family: PingFang SC;
  274. font-weight: 500;
  275. color: #666666;
  276. display: inline-block;
  277. margin-right: 15rpx;
  278. }
  279. }
  280. }
  281. .dynamic {
  282. width: 666rpx;
  283. height: 111rpx;
  284. background: #efefef;
  285. border-radius: 10rpx;
  286. margin: 5rpx auto 0;
  287. .left {
  288. width: 115rpx;
  289. height: 111rpx;
  290. background: #5c93fc;
  291. border-radius: 10rpx 0px 0px 10rpx;
  292. font-size: 28rpx;
  293. font-family: PingFang SC;
  294. font-weight: 500;
  295. color: #ffffff;
  296. line-height: 34rpx;
  297. padding: 22rpx 29rpx;
  298. margin-right: 15rpx;
  299. }
  300. .right {
  301. font-size: 22rpx;
  302. font-family: PingFang SC;
  303. font-weight: 400;
  304. color: #333333;
  305. line-height: 1;
  306. padding: 12rpx 0;
  307. flex-direction: column;
  308. justify-content: space-between;
  309. text {
  310. color: red;
  311. font-weight: bold;
  312. }
  313. }
  314. }
  315. }
  316. .content {
  317. .content-nav {
  318. height: 82rpx;
  319. background: #ffffff;
  320. font-size: 30rpx;
  321. font-family: PingFang SC;
  322. font-weight: 500;
  323. color: #999999;
  324. line-height: 82rpx;
  325. justify-content: space-around;
  326. .active {
  327. border-bottom: 4rpx solid #fa7e67;
  328. color: #fa7e67;
  329. font-weight: bold;
  330. }
  331. }
  332. }
  333. .tip {
  334. margin-left: 42rpx;
  335. font-size: 30rpx;
  336. font-family: PingFang SC;
  337. font-weight: bold;
  338. color: #333333;
  339. line-height: 1;
  340. margin-bottom: 34rpx;
  341. view {
  342. display: inline-block;
  343. width: 4rpx;
  344. height: 30rpx;
  345. background: #fa7e67;
  346. border-radius: 2rpx;
  347. margin-right: 9rpx;
  348. position: relative;
  349. bottom: -2rpx;
  350. }
  351. }
  352. .btn-wrapper {
  353. .btn {
  354. width: 50%;
  355. text-align: center;
  356. height: 99rpx;
  357. line-height: 99rpx;
  358. font-size: 34rpx;
  359. font-family: PingFang SC;
  360. font-weight: 500;
  361. color: #ffffff;
  362. }
  363. .btn1 {
  364. background-color: #f7c03e;
  365. }
  366. .btn2 {
  367. background-color: #fa7e67;
  368. }
  369. }
  370. .item-detail {
  371. padding-top: 42rpx;
  372. .item-content {
  373. padding: 0 78rpx 0 48rpx;
  374. font-size: 26rpx;
  375. font-family: PingFang SC;
  376. font-weight: 500;
  377. color: #666666;
  378. line-height: 44rpx;
  379. margin-bottom: 32rpx;
  380. }
  381. .item-needs {
  382. .need-item {
  383. width: 666rpx;
  384. height: 150rpx;
  385. background: #f3f3f3;
  386. border-radius: 10rpx;
  387. margin: 0 auto;
  388. font-size: 26rpx;
  389. font-family: PingFang SC;
  390. font-weight: 500;
  391. color: #333333;
  392. margin-bottom: 10rpx;
  393. padding-top: 20rpx;
  394. padding-left: 13rpx;
  395. line-height: 1;
  396. view {
  397. margin-bottom: 15rpx;
  398. text {
  399. color: #e80000;
  400. }
  401. }
  402. }
  403. }
  404. }
  405. .feedback {
  406. padding: 25rpx 41rpx 36rpx;
  407. .feedback-nav {
  408. margin-bottom: 20rpx;
  409. .nav-item {
  410. display: inline-block;
  411. width: 100rpx;
  412. height: 55rpx;
  413. background: #fdcbc2;
  414. box-shadow: 0px 0px 10rpx 0rpx rgba(0, 0, 0, 0.1);
  415. border-radius: 10rpx;
  416. margin-right: 20rpx;
  417. text-align: center;
  418. line-height: 55rpx;
  419. font-size: 24rpx;
  420. font-family: PingFang SC;
  421. font-weight: 500;
  422. color: #ffffff;
  423. }
  424. .nav-item-err {
  425. color: #999999;
  426. background: #f1f1f0;
  427. }
  428. .action {
  429. background: #fa7e67;
  430. color: #fff;
  431. }
  432. }
  433. .feedback-content {
  434. .overall {
  435. .title {
  436. width: 667rpx;
  437. height: 75rpx;
  438. background: #fa7e67;
  439. box-shadow: 0px 0px 10rpx 0rpx rgba(0, 0, 0, 0.1);
  440. border-radius: 10rpx 10rpx 0px 0px;
  441. font-size: 28rpx;
  442. font-family: PingFang SC;
  443. font-weight: bold;
  444. color: #ffffff;
  445. line-height: 75rpx;
  446. padding-left: 17rpx;
  447. }
  448. .content {
  449. padding: 33rpx 36rpx 43rpx 30rpx;
  450. width: 667rpx;
  451. background-color: #fff;
  452. box-shadow: 0px 0px 10rpx 0px rgba(0, 0, 0, 0.1);
  453. border-radius: 0px 0px 10rpx 10rpx;
  454. font-size: 26rpx;
  455. font-family: PingFang SC;
  456. font-weight: 500;
  457. color: #999999;
  458. line-height: 42rpx;
  459. }
  460. }
  461. .feedback-item {
  462. margin: 20rpx auto;
  463. // display: flex;
  464. background-color: #fff;
  465. box-shadow: 0px 0px 10rpx 0px rgba(0, 0, 0, 0.1);
  466. border-radius: 10rpx 10rpx 10rpx;
  467. .item-top {
  468. height: 118rpx;
  469. border-radius: 10px 10px 0 0;
  470. border-bottom: 1px solid #ececec;
  471. padding: 25rpx 0 0 17rpx;
  472. display: flex;
  473. image {
  474. width: 77rpx;
  475. height: 77rpx;
  476. border-radius: 50%;
  477. background-color: red;
  478. margin-right: 12rpx;
  479. }
  480. .item-name-time {
  481. .item-name {
  482. font-size: 28rpx;
  483. font-family: PingFang SC;
  484. font-weight: bold;
  485. color: #333333;
  486. line-height: 35rpx;
  487. }
  488. .item-time {
  489. font-size: 24rpx;
  490. font-family: PingFang SC;
  491. font-weight: 500;
  492. color: #999999;
  493. line-height: 50rpx;
  494. }
  495. }
  496. }
  497. .item-content {
  498. padding: 25rpx 47rpx 40rpx 30rpx;
  499. border-radius: 0 0 10rpx 10rpx;
  500. font-size: 26rpx;
  501. font-family: PingFang SC;
  502. font-weight: 500;
  503. color: #999;
  504. line-height: 42rpx;
  505. text {
  506. color: #e80000;
  507. font-weight: bold;
  508. }
  509. }
  510. }
  511. }
  512. }
  513. .type-box {
  514. width: 542rpx;
  515. height: 575rpx;
  516. // background: linear-gradient(0deg, rgba(249, 98, 105, 0.06), rgba(255, 255, 255, 0.06));
  517. border-radius: 20rpx;
  518. background-color: #fff;
  519. position: relative;
  520. .bg {
  521. width: 100%;
  522. height: 138rpx;
  523. position: absolute;
  524. }
  525. .box-title {
  526. text-align: center;
  527. font-size: 36rpx;
  528. font-family: PingFang SC;
  529. font-weight: bold;
  530. color: #333333;
  531. line-height: 1;
  532. padding-top: 77rpx;
  533. }
  534. .box-tip {
  535. text-align: center;
  536. font-size: 24rpx;
  537. font-family: PingFang SC;
  538. font-weight: 500;
  539. color: #808080;
  540. line-height: 1;
  541. padding-top: 12rpx;
  542. margin-bottom: 43rpx;
  543. }
  544. .box-btn {
  545. margin: 0 auto;
  546. width: 460rpx;
  547. height: 95rpx;
  548. display: flex;
  549. align-items: center;
  550. border-bottom: 1px solid #f3efef;
  551. position: relative;
  552. image {
  553. height: 43rpx;
  554. width: 43rpx;
  555. background-color: red;
  556. margin-right: 15rpx;
  557. }
  558. .qq {
  559. width: 32rpx;
  560. height: 32rpx;
  561. border: 1px solid #808080;
  562. opacity: 0.5;
  563. border-radius: 50%;
  564. position: absolute;
  565. right: 0;
  566. }
  567. .action {
  568. border-color: #fa7e67;
  569. // position: relative;
  570. .yx {
  571. width: 20rpx;
  572. height: 20rpx;
  573. background: #fa7e67;
  574. // border: 1px solid #FA7E67;
  575. border-radius: 50%;
  576. position: absolute;
  577. top: 0;
  578. bottom: 0;
  579. left: 0;
  580. right: 0;
  581. margin: auto;
  582. }
  583. }
  584. }
  585. .qr {
  586. width: 460rpx;
  587. height: 71rpx;
  588. background: #fa7e67;
  589. box-shadow: 0px 16rpx 16rpx 0px rgba(250, 126, 103, 0.5);
  590. border-radius: 10rpx;
  591. font-size: 28rpx;
  592. font-family: PingFang SC;
  593. font-weight: 500;
  594. color: #ffffff;
  595. text-align: center;
  596. line-height: 71rpx;
  597. margin: 62rpx auto 0;
  598. }
  599. }
  600. </style>