index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. <template>
  2. <view class="content">
  3. <view class="in-bg">
  4. <image src="../../static/donate/in-tit.png" mode="" class="in-tit in-tit0"></image>
  5. <image src="../../static/donate/in-tit1.png" mode="" class="in-tit in-tit1"></image>
  6. <view class="line-donate">
  7. <view class="btn" @click="goto()">
  8. </view>
  9. </view>
  10. <image src="../../static/donate/in-tip.png" mode="" class="in-tit tip"></image>
  11. <view class="in-love" style="padding-bottom: 20rpx;">
  12. <view class="empty"
  13. style="width: 100%;height: 100%;text-align: center;line-height: 220rpx;font-size: 32rpx;color: #ed4530;"
  14. v-if="loveList.length == 0">
  15. 暂无捐款数据
  16. </view>
  17. <view class="" style="height: 260rpx;overflow: hidden;">
  18. <view class="tab-item flex" v-for="(item,index) in loveList" v-if="loveList.length > 0">
  19. <view class="tab-item-name clamp" style="width: 200rpx;">{{item.name || '佚名'}}</view>
  20. <view class="tab-item-time clamp" style="width: 180rpx;text-align: center;">
  21. {{item.paytime | getTime}}</view>
  22. <view class="tab-item-num clamp" style="width: 180rpx;text-align: right;">¥{{item.amount }}</view>
  23. </view>
  24. </view>
  25. </view>
  26. <image src="../../static/donate/in-tit2.png" mode="" class="in-tit in-tit1"></image>
  27. <!-- <view class="in-line flex">
  28. <view class="line-qr">
  29. </view>
  30. <view class="line-qr">
  31. </view>
  32. </view> -->
  33. <view class="in-line2 flex">
  34. <!-- <view class="line-qr">
  35. </view> -->
  36. <image src="../../static/donate/in-line5.png" mode="" class="line-qr"></image>
  37. </view>
  38. <image src="../../static/donate/in-tit3.png" mode="" class="in-tit in-tit1"></image>
  39. <view class="in-contribute">
  40. <image src="../../static/donate/in-money.png" mode="" class="in-tit in-money"></image>
  41. <view class="in-info flex" v-for="item in info">
  42. <view class="name flex">
  43. <view class="" v-for="itemt in item.tit">
  44. {{itemt}}
  45. </view>
  46. </view>
  47. <view class="" style="padding-right: 10rpx;">
  48. :
  49. </view>
  50. <view class="val ">
  51. {{item.val}}
  52. </view>
  53. </view>
  54. <image src="../../static/donate/in-art.png" mode="" class="in-tit in-money"></image>
  55. <view class="in-info flex" v-for="item in infos">
  56. <view class="name flex">
  57. <view class="" v-for="itemt in item.tit">
  58. {{itemt}}
  59. </view>
  60. </view>
  61. <view class="" style="padding-right: 10rpx;">
  62. :
  63. </view>
  64. <view class="val " v-html="item.val">
  65. <!-- {{}} -->
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <!-- <view class="bg-img">
  71. <image src="../../static/img/ctbt.png" mode=""></image>
  72. </view> -->
  73. <!-- <view class="over-content">
  74. <view class="item-wrapper" style="height: 318rpx;padding: 70rpx 34rpx 0;">
  75. <view class="item-tit">
  76. 线上捐款
  77. </view>
  78. <view class="item-info">
  79. 孝感市红十字会现已开通线上捐款通道 ,点击下方按钮可直接进行线上捐款。
  80. </view>
  81. <view class="item-btn flex">
  82. <image src="../../static/img/wings-left.png" mode="" class="xcb"></image>
  83. <view class="item-btn-btn" @click="goto()">
  84. 立即捐款
  85. </view>
  86. <image src="../../static/img/wings-right.png" mode="" class="xcb"></image>
  87. </view>
  88. </view>
  89. <view class="item-wrapper" style="height: 259rpx;padding: 60rpx 34rpx;">
  90. <view class="item-tit">
  91. 银行转账
  92. </view>
  93. <view class="item-info">
  94. <view class="">户名:孝感市红十字会</view>
  95. <view class="">银行账户:42001688608050002590</view>
  96. <view class="">开户行:建行孝感直属支行</view>
  97. </view>
  98. </view>
  99. <view class="item-wrapper" style="height: 259rpx;padding: 40rpx 34rpx;">
  100. <view class="item-tit">
  101. 线下捐赠
  102. </view>
  103. <view class="item-info">
  104. <view class="">咨询电话:捐款 0712-2875087</view>
  105. <view class="" style="padding-left: 160rpx;">捐物 0712-2851023</view>
  106. <view class="">地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址:孝感市城站路75号</view>
  107. </view>
  108. </view>
  109. <view class="item-wrapper" style="height: 410rpx;">
  110. <view class="item-tit">
  111. 爱心榜
  112. </view>
  113. <scroll-view class="tab-wrap">
  114. <view class="empty"
  115. style="width: 100%;height: 100%;text-align: center;line-height: 220rpx;font-size: 32rpx;color: #ed4530;"
  116. v-if="loveList.length == 0">
  117. 暂无捐款数据
  118. </view>
  119. <view class="tab-item flex" v-for="item in loveList" v-if="loveList.length > 0">
  120. <view class="tab-item-name clamp" style="width: 200rpx;">{{item.donate_er || '佚名'}}</view>
  121. <view class="tab-item-time clamp" style="width: 180rpx;text-align: center;">
  122. {{item.pay_time | getTime}}</view>
  123. <view class="tab-item-num clamp" style="width: 180rpx;text-align: right;">¥{{item.money}}</view>
  124. </view>
  125. </scroll-view>
  126. </view>
  127. </view> -->
  128. </view>
  129. </template>
  130. <script>
  131. import {
  132. loadIndexs,
  133. bannerlist,
  134. getListAED,
  135. getDistance,
  136. getListMechanism,
  137. getdis,
  138. tocall
  139. } from '@/api/index.js';
  140. import {
  141. saveUrl,
  142. interceptor
  143. } from '@/utils/loginUtils.js';
  144. import {
  145. mapState,
  146. mapMutations
  147. } from 'vuex';
  148. import {
  149. userinfo
  150. } from '@/api/user.js';
  151. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  152. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  153. import empty from '@/components/empty';
  154. import {
  155. getLoca
  156. } from '@/utils/wxAuthorized.js';
  157. import {
  158. getcomAddress,
  159. loveList
  160. } from '@/api/index.js';
  161. import topTitle from '../../components/top-title/top-title.vue';
  162. // import { getInfo,getWxconfig } from '@/api/wx.js'
  163. import store from '@/store/index.js';
  164. export default {
  165. components: {
  166. uniPopup,
  167. uniLoadMore,
  168. topTitle,
  169. empty
  170. },
  171. filters: {
  172. getTime(val) {
  173. let date = new Date(val * 1000);
  174. let Y = date.getFullYear();
  175. let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
  176. let D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
  177. return Y + '/' + M + '/' + D;
  178. },
  179. },
  180. data() {
  181. return {
  182. info: [
  183. {
  184. tit: '开户名',
  185. val: '黄石市红十字会'
  186. },
  187. {
  188. tit: '银行账户',
  189. val: '567765132978'
  190. },
  191. {
  192. tit: '开户行',
  193. val: '中国银行黄石分行营业部'
  194. },
  195. ],
  196. infos: [
  197. {
  198. tit: '负责人',
  199. val: '陈博文'
  200. },
  201. {
  202. tit: '咨询电话',
  203. val: '0714-6221833'
  204. },
  205. {
  206. tit: '地址',
  207. val: '黄石市桂林南路10号黄石市<br>红十字会'
  208. },
  209. ],
  210. carouselList: [], //轮播
  211. // loveList: [
  212. // {
  213. // donate_er: '测试',
  214. // pay_time: 123456,
  215. // money: 12
  216. // },
  217. // {
  218. // donate_er: '测试',
  219. // pay_time: 123456,
  220. // money: 12
  221. // },
  222. // {
  223. // donate_er: '测试',
  224. // pay_time: 123456,
  225. // money: 12
  226. // },
  227. // {
  228. // donate_er: '测试',
  229. // pay_time: 123456,
  230. // money: 12
  231. // },
  232. // {
  233. // donate_er: '测试',
  234. // pay_time: 123456,
  235. // money: 12
  236. // },
  237. // {
  238. // donate_er: '测试',
  239. // pay_time: 123456,
  240. // money: 12
  241. // }
  242. // ], //
  243. loveList: [],
  244. loadingType: 'more',
  245. page: 1,
  246. limit: 30,
  247. timer: '',
  248. };
  249. },
  250. onShow() {
  251. saveUrl();
  252. console.log(11, this);
  253. if (!this.hasLogin) {
  254. // 登录拦截
  255. interceptor();
  256. }
  257. },
  258. onLoad() {
  259. uni.hideTabBar()
  260. saveUrl();
  261. this.getLoveList()
  262. },
  263. computed: {
  264. ...mapState('user', ['userInfo', 'baseURL', 'hasLogin'])
  265. },
  266. // 下拉加载
  267. methods: {
  268. goto() {
  269. // uni.showModal({
  270. // title: '提示',
  271. // content: '在线捐款渠道正在建设中'
  272. // })
  273. this.navto('/pages/applic/contribution')
  274. },
  275. gundong() {
  276. let obj = this;
  277. console.log('zhe')
  278. if (obj.timer) {
  279. clearTimeout(obj.timer)
  280. }
  281. try{
  282. obj.timer = setTimeout(() => {
  283. obj.loveList.push(obj.loveList.shift());
  284. console.log(obj.loveList)
  285. obj.gundong();
  286. }, 2000);
  287. }catch(e){
  288. //TODO handle the exception
  289. console.log(e)
  290. }
  291. },
  292. navto(url) {
  293. uni.navigateTo({
  294. url,
  295. fail() {
  296. uni.switchTab({
  297. url
  298. })
  299. }
  300. })
  301. },
  302. // 获取爱心榜数据
  303. getLoveList() {
  304. let obj = this
  305. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  306. return
  307. }
  308. obj.loadingType = 'loading'
  309. loveList({
  310. page: obj.page,
  311. limit: obj.limit
  312. }).then(({
  313. data
  314. }) => {
  315. obj.loveList = obj.loveList.concat(data.data)
  316. obj.gundong()
  317. // obj.page++
  318. // if(data.list.length == obj.limit) {
  319. // obj.loadingType = 'more'
  320. // }else {
  321. // obj.loadingType = 'noMore'
  322. // }
  323. })
  324. }
  325. }
  326. };
  327. </script>
  328. <style lang="scss" scoped>
  329. .content {
  330. position: relative;
  331. }
  332. .bg-img {
  333. position: absolute;
  334. top: 0;
  335. left: 0;
  336. width: 750rpx;
  337. height: 2323rpx;
  338. image {
  339. width: 100%;
  340. height: 100%;
  341. }
  342. }
  343. .over-content {
  344. position: relative;
  345. top: 669rpx;
  346. }
  347. .item-wrapper {
  348. width: 636rpx;
  349. margin: 0 auto 76rpx;
  350. border: 1px solid #C9101B;
  351. // background: #fff;
  352. border-radius: 10px;
  353. position: relative;
  354. .item-tit {
  355. width: 199rpx;
  356. height: 55rpx;
  357. background: linear-gradient(0, #C9101B, #F24D33);
  358. border-radius: 10rpx;
  359. text-align: center;
  360. line-height: 55rpx;
  361. font-size: 34rpx;
  362. font-family: PingFang SC;
  363. font-weight: 500;
  364. color: #FFFFFF;
  365. position: absolute;
  366. top: -28rpx;
  367. left: 64rpx;
  368. }
  369. .item-info {
  370. font-size: 32rpx;
  371. font-family: PingFang SC;
  372. font-weight: 500;
  373. color: #ed4530;
  374. line-height: 49rpx;
  375. // background: linear-gradient(0deg, #C9101B 0%, #F24D33 99.267578125%);
  376. // -webkit-background-clip: text;
  377. // -webkit-text-fill-color: transparent;
  378. width: 100%;
  379. }
  380. .item-btn {
  381. justify-content: center;
  382. align-items: center;
  383. height: 72rpx;
  384. position: absolute;
  385. bottom: 50rpx;
  386. width: 568rpx;
  387. .xcb {
  388. width: 80rpx;
  389. height: 50rpx;
  390. }
  391. .item-btn-btn {
  392. width: 303rpx;
  393. height: 72rpx;
  394. margin: 0 10rpx;
  395. background: linear-gradient(0deg, #C9101B, #F24D33);
  396. border-radius: 36rpx;
  397. line-height: 72rpx;
  398. text-align: center;
  399. font-size: 34rpx;
  400. font-family: PingFang SC;
  401. font-weight: 500;
  402. color: #FFFFFF;
  403. }
  404. }
  405. .tab-wrap {
  406. padding: 53rpx 40rpx 28rpx 33rpx;
  407. height: 410rpx;
  408. .tab-item {
  409. line-height: 45rpx;
  410. height: 45rpx;
  411. align-items: center;
  412. justify-content: space-between;
  413. font-size: 30rpx;
  414. font-family: PingFang SC;
  415. font-weight: bold;
  416. color: #ed4530;
  417. }
  418. }
  419. }
  420. .in-bg {
  421. background-image: url('../../static/donate/in-bg.png');
  422. width: 750rpx;
  423. height: 2750rpx;
  424. background-size: 100% 100%;
  425. padding-top: 135rpx;
  426. .in-tit {
  427. display: block;
  428. }
  429. .in-tit0 {
  430. width: 556rpx;
  431. height: 100rpx;
  432. margin:0 auto 70rpx;
  433. }
  434. .in-tit1 {
  435. width: 489rpx;
  436. height: 115rpx;
  437. margin: auto;
  438. }
  439. .tip {
  440. width: 302rpx;
  441. height: 37rpx;
  442. margin:30rpx auto 38rpx;
  443. }
  444. .in-love {
  445. width: 656rpx;
  446. height: 403rpx;
  447. overflow: hidden;
  448. background-image: url('../../static/donate/in-love.png');
  449. background-size: 100% 100%;
  450. margin: 0 auto 56rpx;
  451. padding: 110rpx 27rpx 20rpx;
  452. }
  453. .line-donate {
  454. width: 717rpx;
  455. height: 361rpx;
  456. background-image: url('../../static/donate/in-ent.png');
  457. background-size: 100% 100%;
  458. margin:-30rpx auto 0;
  459. padding-top: 171rpx;
  460. .btn {
  461. height: 150rpx;
  462. width: 150rpx;
  463. margin: auto;
  464. border-radius: 50%;
  465. }
  466. }
  467. .in-line {
  468. width: 656rpx;
  469. height: 390rpx;
  470. background-image: url('../../static/donate/in-line.png');
  471. background-size: 100% 100%;
  472. margin:21rpx auto 51rpx;
  473. justify-content: space-between;
  474. padding: 27rpx 22rpx;
  475. .line-qr {
  476. width: 272rpx;
  477. height: 272rpx;
  478. background-color: #fff;
  479. }
  480. }
  481. .in-line2 {
  482. width: 656rpx;
  483. height: 390rpx;
  484. background-image: url('../../static/donate/in-line3.png');
  485. background-size: 100% 100%;
  486. margin:21rpx auto 51rpx;
  487. justify-content: center;
  488. padding: 27rpx 22rpx;
  489. .line-qr {
  490. display: block;
  491. width: 272rpx;
  492. height: 272rpx;
  493. // background-image: url('../../static/donate/line-ewm.jpg');
  494. // // background-color: #fff;
  495. // background-size: 100% 100%;
  496. }
  497. }
  498. .in-contribute {
  499. width: 656rpx;
  500. // height: 527rpx;
  501. background-color: rgba(255, 255, 255, 0.63);
  502. margin:15rpx auto;
  503. border: 1px solid #f07568;
  504. padding: 40rpx 0 40rpx 40rpx;
  505. .in-money {
  506. width: 231rpx;
  507. height: 32rpx;
  508. margin:20rpx auto;
  509. }
  510. }
  511. .in-info {
  512. font-size: 30rpx;
  513. font-weight: 500;
  514. color: #333333;
  515. padding: 10rpx 6rpx;
  516. font-weight: bold;
  517. line-height: 1.5;
  518. .name {
  519. width:130rpx;
  520. justify-content: space-between;
  521. // &::after {
  522. // content: ':';
  523. // }
  524. }
  525. .val {
  526. // padding-left: 10rpx;
  527. // &::before {
  528. // content: ':';
  529. // padding-right: 10rpx;
  530. // }
  531. }
  532. .copy {
  533. }
  534. }
  535. }
  536. .tab-item {
  537. line-height: 45rpx;
  538. height: 45rpx;
  539. align-items: center;
  540. justify-content: space-between;
  541. font-size: 30rpx;
  542. font-weight: bold;
  543. color: #ed4530;
  544. }
  545. </style>