首页 > 小程序教程 > 微信小程序微信急救应急处理样式模板制作设计下载

微信小程序微信急救应急处理样式模板制作设计下载

上一篇 下一篇
制作好以后效果图如下:
一、wxml页面代码如下:
<view class="tutorial-container">
  <view class="tutorial-title animated {{ selectedTab === 0 ? 'fadeInRight' : 'fadeInLeft' }}">
    {{ selectedTab === 0 ? emergencyTitle : studayTitle }}
  </view>
  <view class="tabs-container" >
    <view class="tabs">
      <view
        bindtap="bindSelectedTab"
        class="{{selectedTab === 0 ? 'selected-tab' : 'tab' }}"
        data-tab="0"
      >
        应急
      </view>
      <view
        bindtap="bindSelectedTab"
        class="{{selectedTab === 1 ? 'selected-tab' : 'tab' }}"
        data-tab="1"
      >
        学习
      </view>
    </view>
    <view
      class="bar"
      style="margin-left: {{selectedTab === 0 ? '5%' : '55%'}}"
    />
  </view>
  <swiper class="swiper" current="{{selectedTab}}" bindchange="change">
    <swiper-item class="swiper-item">
      <template
        is="tutorial"
        data="{{title: '意识丧失', type: '应急', tap: tap, src: '../../assets/images/unconsciousness.svg' }}"
      />
    <template is="tutorial" data="{{ title: '烧烫伤', type: '应急', tap: tap, src: '../../assets/images/Scald.svg' }}" />
    </swiper-item>
    <swiper-item class="swiper-item">
      <template is="tutorial" data="{{ title: '意识丧失', type: '学习', tap: tap, src: '../../assets/images/unconsciousness.svg' }}" />
    </swiper-item>
  </swiper>
</view>

<template name="tutorial">
  <view bindtap="tap" class="tutorial-item" data-title="{{title}}" data-type="{{type}}" >
    <text> {{title}} </text>
    <image src="{{src}}" style="height: 50rpx; width: 50rpx" />
  </view>
</template>
 
二、wxss样式文件代码如下:
@import "../../libs/animate.wxss"
.tutorial-container {
  font-family: PingFangSC-Regular, sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.tutorial-title {
  color: #FA5834;
  height: 100rpx;
  width: 100%;
  font-size: 50rpx;
  margin-left: 50rpx;
  margin-top: 80rpx;
  margin-bottom: 80rpx;
  /*vertical-align: middle;*/
  display: flex;
  align-items: center;
  /*justify-content: center;*/
  flex-shrink: 0;
}

.tabs-container {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(178,190,193, 0.4);
  position: relative;
  left: 0;
  flex-shrink: 0;
}

.tabs {
  display: flex;
}

.tab {
  display: flex;
  flex: 1;
  height: 80rpx;
  align-items: center;
  justify-content: center;
  color: #7B9397;
}

.selected-tab {
  display: flex;
  flex: 1;
  height: 80rpx;
  align-items: center;
  justify-content: center;
  color: #FA5834;
  font-weight: 550;
}

.bar {
  width: 40%;
  background-color: #FA5834;
  height: 3px;
  position: absolute;
  bottom: -2px;
  margin-left: 5%;
  border-radius: 3px;
}

.swiper {
  /*flex: 100;*/
  height:100%;
  /*background-color: grey;*/
}
.swiper-item {
  display: flex;
  flex-direction: column;
}

.tutorial-list {
  height: 100%;
  flex: 1;
}
.tutorial-item {
  font-size: 50rpx;
  color: #23454D;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0rpx 50rpx;
  vertical-align: middle;
  height: 150rpx;
  border-bottom: 1px solid rgba(178,190,193, 0.4);
}
三、js页面代码如下:
Page({
  data: {
    selectedTab: 0,
    emergencyTitle: '应急,事不容迟。',
    studayTitle: '学习,未雨绸缪。',
    emergencyList: [

    ],
    studayList: [

    ],
  },
  bindSelectedTab(e) {
    this.setData({
      selectedTab: Number(e.target.dataset.tab),
    });
  },
  tap(e) {
    if (e.target.dataset.title === '意识丧失' && e.target.dataset.type === '应急'){
      wx.navigateTo({
        url: '../isBreath/isBreath',
      });
    }
    if (e.target.dataset.title === '烧烫伤' && e.target.dataset.type === '应急'){
      wx.navigateTo({
        url: '../burning/burning',
      });
    }
    if (e.target.dataset.title === '意识丧失' && e.target.dataset.type === '学习'){
      wx.navigateTo({
        url: '../unconsciousnessStudy/unconsciousnessStudy',
      });
    }

  },
  change(e) {
    this.setData({
      selectedTab: Number(e.detail.current),
    });
  },
});

模板简介:该模板名称为【微信小程序微信急救应急处理样式模板制作设计下载】,大小是,文档格式为.,推荐使用打开,作品中的图片,文字等数据均可修改,图片请在作品中选中图片替换即可,文字修改直接点击文字修改即可,您也可以新增或修改作品中的内容,该模板来自用户分享,如有侵权行为请联系网站客服处理。欢迎来懒人模板【小程序教程】栏目查找您需要的精美模板。

相关搜索
  • 下载密码 lanrenmb
  • 下载次数 15,915次
  • 使用软件
  • 文件格式
  • 文件大小
  • 上传时间 06-12
  • 作者 网友投稿
  • 肖像权 人物画像及字体仅供参考
栏目分类 更多 >
热门推荐 更多 >
html5 单页式简历模板 微信模板 微信公众平台 企业网站 微信素材 微信图片 自适应 微信文章 响应式
您可能会喜欢的其他模板