index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  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;" @click="navto('/pages/index/love2')">
  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-line2 flex">
  28. <image src="../../static/donate/in-line5.png" mode="" class="line-qr"></image>
  29. </view>
  30. <image src="../../static/donate/in-tit3.png" mode="" class="in-tit in-tit1"></image>
  31. <view class="in-contribute">
  32. <image src="../../static/donate/in-money.png" mode="" class="in-tit in-money"></image>
  33. <view class="in-info flex" v-for="item in info">
  34. <view class="name flex">
  35. <view class="" v-for="itemt in item.tit">
  36. {{itemt}}
  37. </view>
  38. </view>
  39. <view class="" style="padding-right: 10rpx;">
  40. :
  41. </view>
  42. <view class="val ">
  43. {{item.val}}
  44. </view>
  45. </view>
  46. <image src="../../static/donate/in-art.png" mode="" class="in-tit in-money"></image>
  47. <view class="in-info flex" v-for="item in infos">
  48. <view class="name flex">
  49. <view class="" v-for="itemt in item.tit">
  50. {{itemt}}
  51. </view>
  52. </view>
  53. <view class="" style="padding-right: 10rpx;">
  54. :
  55. </view>
  56. <view class="val " v-html="item.val">
  57. <!-- {{}} -->
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import {
  66. loadIndexs,
  67. bannerlist,
  68. getListAED,
  69. getDistance,
  70. getListMechanism,
  71. getdis,
  72. tocall
  73. } from '@/api/index.js';
  74. import {
  75. saveUrl,
  76. interceptor
  77. } from '@/utils/loginUtils.js';
  78. import {
  79. mapState,
  80. mapMutations
  81. } from 'vuex';
  82. import {
  83. userinfo
  84. } from '@/api/user.js';
  85. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  86. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  87. import empty from '@/components/empty';
  88. import {
  89. getLoca
  90. } from '@/utils/wxAuthorized.js';
  91. import {
  92. getcomAddress,
  93. loveList
  94. } from '@/api/index.js';
  95. import topTitle from '../../components/top-title/top-title.vue';
  96. import store from '@/store/index.js';
  97. export default {
  98. components: {
  99. uniPopup,
  100. uniLoadMore,
  101. topTitle,
  102. empty
  103. },
  104. filters: {
  105. getTime(val) {
  106. let date = new Date(val * 1000);
  107. let Y = date.getFullYear();
  108. let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
  109. let D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
  110. return Y + '/' + M + '/' + D;
  111. },
  112. },
  113. data() {
  114. return {
  115. info: [
  116. {
  117. tit: '开户名',
  118. val: '黄石市红十字会'
  119. },
  120. {
  121. tit: '银行账户',
  122. val: '567765132978'
  123. },
  124. {
  125. tit: '开户行',
  126. val: '中国银行黄石分行营业部'
  127. },
  128. ],
  129. infos: [
  130. {
  131. tit: '负责人',
  132. val: '陈博文'
  133. },
  134. {
  135. tit: '咨询电话',
  136. val: '0714-6221833'
  137. },
  138. {
  139. tit: '地址',
  140. val: '湖北省黄石市桂林南路10号'
  141. },
  142. ],
  143. carouselList: [], //轮播
  144. loveList: [],
  145. loadingType: 'more',
  146. page: 1,
  147. limit: 30,
  148. timer: '',
  149. };
  150. },
  151. onShow() {
  152. saveUrl();
  153. console.log(11, this);
  154. if (!this.hasLogin) {
  155. // 登录拦截
  156. interceptor();
  157. }
  158. },
  159. onLoad() {
  160. uni.hideTabBar()
  161. saveUrl();
  162. this.getLoveList()
  163. },
  164. computed: {
  165. ...mapState('user', ['userInfo', 'baseURL', 'hasLogin'])
  166. },
  167. // 下拉加载
  168. methods: {
  169. goto() {
  170. this.navto('/pages/applic/contribution')
  171. },
  172. gundong() {
  173. let obj = this;
  174. console.log('zhe')
  175. if (obj.timer) {
  176. clearTimeout(obj.timer)
  177. }
  178. try{
  179. obj.timer = setTimeout(() => {
  180. obj.loveList.push(obj.loveList.shift());
  181. console.log(obj.loveList)
  182. obj.gundong();
  183. }, 2000);
  184. }catch(e){
  185. console.log(e)
  186. }
  187. },
  188. navto(url) {
  189. uni.navigateTo({
  190. url,
  191. fail() {
  192. uni.switchTab({
  193. url
  194. })
  195. }
  196. })
  197. },
  198. // 获取爱心榜数据
  199. getLoveList() {
  200. let obj = this
  201. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  202. return
  203. }
  204. obj.loadingType = 'loading'
  205. loveList({
  206. page: obj.page,
  207. limit: obj.limit
  208. }).then(({
  209. data
  210. }) => {
  211. obj.loveList = obj.loveList.concat(data.data)
  212. obj.gundong()
  213. })
  214. }
  215. }
  216. };
  217. </script>
  218. <style lang="scss" scoped>
  219. .content {
  220. position: relative;
  221. }
  222. .bg-img {
  223. position: absolute;
  224. top: 0;
  225. left: 0;
  226. width: 750rpx;
  227. height: 2323rpx;
  228. image {
  229. width: 100%;
  230. height: 100%;
  231. }
  232. }
  233. .over-content {
  234. position: relative;
  235. top: 669rpx;
  236. }
  237. .item-wrapper {
  238. width: 636rpx;
  239. margin: 0 auto 76rpx;
  240. border: 1px solid #C9101B;
  241. // background: #fff;
  242. border-radius: 10px;
  243. position: relative;
  244. .item-tit {
  245. width: 199rpx;
  246. height: 55rpx;
  247. background: linear-gradient(0, #C9101B, #F24D33);
  248. border-radius: 10rpx;
  249. text-align: center;
  250. line-height: 55rpx;
  251. font-size: 34rpx;
  252. font-family: PingFang SC;
  253. font-weight: 500;
  254. color: #FFFFFF;
  255. position: absolute;
  256. top: -28rpx;
  257. left: 64rpx;
  258. }
  259. .item-info {
  260. font-size: 32rpx;
  261. font-family: PingFang SC;
  262. font-weight: 500;
  263. color: #ed4530;
  264. line-height: 49rpx;
  265. // background: linear-gradient(0deg, #C9101B 0%, #F24D33 99.267578125%);
  266. // -webkit-background-clip: text;
  267. // -webkit-text-fill-color: transparent;
  268. width: 100%;
  269. }
  270. .item-btn {
  271. justify-content: center;
  272. align-items: center;
  273. height: 72rpx;
  274. position: absolute;
  275. bottom: 50rpx;
  276. width: 568rpx;
  277. .xcb {
  278. width: 80rpx;
  279. height: 50rpx;
  280. }
  281. .item-btn-btn {
  282. width: 303rpx;
  283. height: 72rpx;
  284. margin: 0 10rpx;
  285. background: linear-gradient(0deg, #C9101B, #F24D33);
  286. border-radius: 36rpx;
  287. line-height: 72rpx;
  288. text-align: center;
  289. font-size: 34rpx;
  290. font-family: PingFang SC;
  291. font-weight: 500;
  292. color: #FFFFFF;
  293. }
  294. }
  295. .tab-wrap {
  296. padding: 53rpx 40rpx 28rpx 33rpx;
  297. height: 410rpx;
  298. .tab-item {
  299. line-height: 45rpx;
  300. height: 45rpx;
  301. align-items: center;
  302. justify-content: space-between;
  303. font-size: 30rpx;
  304. font-family: PingFang SC;
  305. font-weight: bold;
  306. color: #ed4530;
  307. }
  308. }
  309. }
  310. .in-bg {
  311. background-image: url('../../static/donate/in-bg.png');
  312. width: 750rpx;
  313. height: 2750rpx;
  314. background-size: 100% 100%;
  315. padding-top: 135rpx;
  316. .in-tit {
  317. display: block;
  318. }
  319. .in-tit0 {
  320. width: 556rpx;
  321. height: 100rpx;
  322. margin:0 auto 70rpx;
  323. }
  324. .in-tit1 {
  325. width: 489rpx;
  326. height: 115rpx;
  327. margin: auto;
  328. }
  329. .tip {
  330. width: 302rpx;
  331. height: 37rpx;
  332. margin:30rpx auto 38rpx;
  333. }
  334. .in-love {
  335. width: 656rpx;
  336. height: 403rpx;
  337. overflow: hidden;
  338. background-image: url('../../static/donate/in-love.png');
  339. background-size: 100% 100%;
  340. margin: 0 auto 56rpx;
  341. padding: 110rpx 27rpx 20rpx;
  342. }
  343. .line-donate {
  344. width: 717rpx;
  345. height: 361rpx;
  346. background-image: url('../../static/donate/in-ent.png');
  347. background-size: 100% 100%;
  348. margin:-30rpx auto 0;
  349. padding-top: 171rpx;
  350. .btn {
  351. height: 150rpx;
  352. width: 150rpx;
  353. margin: auto;
  354. border-radius: 50%;
  355. }
  356. }
  357. .in-line {
  358. width: 656rpx;
  359. height: 390rpx;
  360. background-image: url('../../static/donate/in-line.png');
  361. background-size: 100% 100%;
  362. margin:21rpx auto 51rpx;
  363. justify-content: space-between;
  364. padding: 27rpx 22rpx;
  365. .line-qr {
  366. width: 272rpx;
  367. height: 272rpx;
  368. background-color: #fff;
  369. }
  370. }
  371. .in-line2 {
  372. width: 656rpx;
  373. height: 390rpx;
  374. background-image: url('../../static/donate/in-line3.png');
  375. background-size: 100% 100%;
  376. margin:21rpx auto 51rpx;
  377. justify-content: center;
  378. padding: 27rpx 22rpx;
  379. .line-qr {
  380. display: block;
  381. width: 272rpx;
  382. height: 272rpx;
  383. // background-image: url('../../static/donate/line-ewm.jpg');
  384. // // background-color: #fff;
  385. // background-size: 100% 100%;
  386. }
  387. }
  388. .in-contribute {
  389. width: 656rpx;
  390. // height: 527rpx;
  391. background-color: rgba(255, 255, 255, 0.63);
  392. margin:15rpx auto;
  393. border: 1px solid #f07568;
  394. padding: 40rpx 0 40rpx 40rpx;
  395. .in-money {
  396. width: 231rpx;
  397. height: 32rpx;
  398. margin:20rpx auto;
  399. }
  400. }
  401. .in-info {
  402. font-size: 30rpx;
  403. font-weight: 500;
  404. color: #333333;
  405. padding: 10rpx 6rpx;
  406. font-weight: bold;
  407. line-height: 1.5;
  408. .name {
  409. width:130rpx;
  410. justify-content: space-between;
  411. // &::after {
  412. // content: ':';
  413. // }
  414. }
  415. .val {
  416. // padding-left: 10rpx;
  417. // &::before {
  418. // content: ':';
  419. // padding-right: 10rpx;
  420. // }
  421. }
  422. .copy {
  423. }
  424. }
  425. }
  426. .tab-item {
  427. line-height: 45rpx;
  428. height: 45rpx;
  429. align-items: center;
  430. justify-content: space-between;
  431. font-size: 30rpx;
  432. font-weight: bold;
  433. color: #ed4530;
  434. }
  435. </style>