| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- <template>
- <view class="content">
- <!-- 轮播 -->
- <view class="carousel-section">
- <swiper class="carousel" :autoplay="true" :interval="3000" :duration="1000">
- <swiper-item v-for="item in carouselList" :key="item.id">
- <image :src="baseURL + item.image"></image>
- </swiper-item>
- </swiper>
- </view>
- <!-- 分类 -->
- <view class="cate-section flex">
- <view class="cate-item flex" @click="navTo('/pages/index/aixin')">
- <view class="img-wrapper flex">
- <image src="../../static/index/index_icon_1.png" mode="" class="img"></image>
- </view>
- <view class="item-title clamp2">爱心捐款</view>
- </view>
- <view class="cate-item flex" @click="navTo('/pages/form/applicationForm')" >
- <view class="img-wrapper flex">
- <image src="../../static/index/index_icon_2.png" mode="" class="img" style="width: 110rpx;"></image>
- </view>
- <view class="item-title clamp2">遗体器官捐献</view>
- </view>
- <view class="cate-item flex" @click="navTo('/pages/applic/appliSystem')">
- <view class="img-wrapper flex">
- <image src="../../static/index/index_icon_3.png" mode="" class="img"></image>
- </view>
- <view class="item-title clamp2">造血干细胞捐献</view>
- </view>
- <view class="cate-item flex" @click="navTo('/pages/applic/info?id=337')">
- <view class="img-wrapper flex">
- <image src="../../static/index/index_icon_4.png" mode="" class="img"></image>
- </view>
- <view class="item-title clamp2">志愿者报名</view>
- </view>
- <view class="cate-item flex" @click="navTo('/pages/applic/info?id=337')">
- <view class="img-wrapper flex">
- <image src="../../static/index/index_icon_5.png" mode="" class="img"></image>
- </view>
- <view class="item-title clamp2">会员登记</view>
- </view>
- <view class="cate-item flex" @click="navTo('/pages/train/index')">
- <view class="img-wrapper flex">
- <image src="../../static/index/index_icon_6.png" mode="" class="img"></image>
- </view>
- <view class="item-title clamp2">普及培训报名</view>
- </view>
- <!-- <view class="cate-item flex" @click="tohelpActi3">
- <view class="img-wrapper flex">
- <image src="../../static/index/index08.png" mode="" class="img"></image>
- </view>
- <view class="item-title">AED智能系统</view>
- <image src="../../static/index/in8.png" mode=""></image>
- </view> -->
- <view class="cate-item flex" @click="navTo('/pages/applic/itemred')">
- <view class="img-wrapper flex">
- <image src="../../static/index/index_icon_7.png" mode="" class="img"></image>
- </view>
- <view class="item-title clamp2">红十字会基层组织</view>
- </view>
- <view class="cate-item flex" @click="navTo('/pages/applic/aid')">
- <view class="img-wrapper flex">
- <image src="../../static/index/index_icon_8.png" mode="" class="img"></image>
- </view>
- <view class="item-title clamp2">救护站智能系统</view>
- </view>
- <view class="cate-item flex" @click="navTo('/pages/applic/location')">
- <view class="img-wrapper flex">
- <image src="../../static/index/index_icon_9.png" mode="" class="img"></image>
- </view>
- <view class="item-title clamp2">救在身边</view>
- </view>
- <view class="cate-item flex" @click="navTo('/pages/share/card')">
- <view class="img-wrapper flex">
- <image src="../../static/index/index_icon_10.png" mode="" class="img"></image>
- </view>
- <view class="item-title clamp2">电子名片</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- loadIndexs
- } from '@/api/index.js';
- import {
- saveUrl,
- interceptor
- } from '@/utils/loginUtils.js';
- import {
- mapState,
- mapMutations
- } from 'vuex';
- export default {
- data() {
- return {
- carouselList: [], //轮播
- };
- },
- onShow() {
- saveUrl();
- // let token = uni.getStorageSync('token');
- console.log(11, this);
- if (!this.hasLogin) {
- // 登录拦截
- // interceptor();
- uni.showModal({
- title: '登录',
- content: '您未登录,是否马上登陆?',
- success: e => {
- if (e.confirm) {
- interceptor();
- }
- },
- fail: e => {
- console.log(e);
- }
- });
- } else {
- // this.loadData();
- }
- },
- onLoad() {
- this.loadIndex()
- saveUrl();
- },
- computed: {
- ...mapState('user', [ 'hasLogin']),
- ...mapState(['baseURL']),
- },
- // 下拉加载
- // onReachBottom() {
- // this.loadData();
- // },
- methods: {
- loadIndex() {
- loadIndexs({}).then(({
- data
- }) => {
- console.log(data, 'index')
- this.carouselList = data.banner; //轮播图
- });
- },
- tohelpActi3() {
- uni.navigateTo({
- url: '../applic/aed'
- })
- },
- navTo(url) {
- uni.navigateTo({
- url
- });
- }
- }
- };
- </script>
- <style lang="scss">
- a {
- text-decoration: none;
- color: #5f5f5f;
- }
- .content {
- // line-height: 1;
- background-color: #ffabab;
- // padding-bottom: 60rpx;
- }
- .content {
- background-color: #f8f6f9;
- height: 100%;
- /* 头部 轮播图 */
- .carousel-section {
- // padding-top: 10px;
- overflow: hidden;
- // background-color: #fff;
- .carousel {
- width: 744rpx;
- height: 470rpx;
- margin: 0 auto;
- border-radius: 20rpx;
- overflow: hidden;
- .carousel-item {
- width: 100%;
- height: 100%;
- // padding-left: 30rpx;
- // padding-right: 30rpx;
- overflow: hidden;
- }
- image {
- width: 100%;
- height: 470rpx;
- border-radius: 20rpx;
- }
- }
- }
- // 分类
- .cate-section {
- justify-content: space-between;
- flex-wrap: wrap;
- background-color: #f8f6f9;
- padding: 20rpx 30rpx 20rpx;
- height: 100%;
- font-family: PingFang SC;
- .cate-item {
- width: 335rpx;
- min-height: 190rpx;
- background: #FFFFFF;
- box-shadow: 0 0 20rpx 0 rgba(50, 50, 52, 0.06);
- border-radius: 20rpx;
- flex-direction: column;
- text-align: center;
- align-items: center;
- justify-content: center;
- margin-bottom: 20rpx;
- .img-wrapper {
- padding-top: 20rpx;
- .img {
- width: 102rpx;
- height: 102rpx;
- }
- }
- .item-title {
- margin-top: 6rpx;
- font-weight: bold;
- height:2rem;
- }
- }
- }
- }
- </style>
|