首页 > 编程语言 >微信小程序 swiper scroll 应用

微信小程序 swiper scroll 应用

时间:2023-04-25 16:23:33浏览次数:31  
标签:flex color 微信 height width margin scroll swiper

swiper

演示视图

演示视图

wxml

<!-- 中部上游信息 -->
  <swiper class="swiper" autoplay circular previous-margin="20rpx" next-margin="60rpx">
    <swiper-item wx:for="{{upstreamList}}" wx:key="id">
      <view class="swiper_item" style="background: url(../../images/upstream_bg0.png) no-repeat center center;background-size: 100% 100%;">
        <view class="center_row">
          <van-icon name="wap-home" size="20px" style="margin-top: 25rpx;" />
          <text class="title">上游管理</text>
        </view>
        <view class="center_clo">
          <text class="title">贵州闽达钢铁有限公司</text>
          <text style="color: #ffffff;">关联时间:2023-04-20 10:35:40</text>
        </view>
      </view>
    </swiper-item>
  </swiper>

css

/* 中部上游信息 */
.swiper{
  z-index: 1;
  width: 100%;
  /* background-color: #FFFFFF; */
  height: 360rpx;
}
.swiper_item{
  border-radius: 20rpx;
  width: 650rpx;
  height: 300rpx;
}
.center_row{
  display: flex;
  justify-content: flex-start;
  align-items: center;
  color: #ffffff;
  margin-left: 30rpx;
  margin-top: 50rpx;
}
.title{
  color: #ffffff;
  font-weight: bold;
  font-size: 36rpx;
  margin-top: 30rpx;
}
.center_clo{
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  color: #ffffff;
  margin-left: 30rpx;
  margin-top: 20rpx;
}

scroll

视图

视图

wxml

<!-- 计划明细 -->
    <view class="scroll_box" wx:for="{{2}}">
      <scroll-view scroll-x >
        <view class="item_list">
          <text class="normal_plan">品名</text>
          <text class="normal">三级螺纹钢</text>
        </view>
        <view class="item_list">
          <text class="normal_plan">材质</text>
          <text class="normal">HRB400</text>
        </view>
        <view class="item_list">
          <text class="normal_plan">规格</text>
          <text class="normal">20*9</text>
        </view>
        <view class="item_list">
          <text class="normal_plan">数量</text> 
          <text class="normal">20件</text>
        </view>
        <view class="item_list">
          <text class="normal_plan">单价</text>
          <text class="normal">500元</text>
        </view>
        <view class="item_list">
          <text class="normal_plan">重量</text>
          <text class="normal">100吨</text>
        </view>
      </scroll-view>
    </view>

css

.scroll_box{
  width: 100%;
  height: 120rpx;
  overflow: hidden;
  background: #fff;
  white-space: nowrap;
  margin-top: 20rpx;
  }
  .scroll_box scroll-view{
    height: 100%;
    width: auto;
    overflow:hidden;
  }
  .item_list{
  width: 180rpx;
  height: 60rpx;
  margin-right: 10rpx;
  display: inline-block;
  /* background-color: #F5F5F5; */
  line-height: 60rpx;
  text-align: center;
  }

标签:flex,color,微信,height,width,margin,scroll,swiper
From: https://www.cnblogs.com/depressiom/p/17352955.html

相关文章

  • ShareSDK 微信平台注册指南
    注册微信平台账号登录微信开放平台网址微信开放平台网址: https://open.weixin.qq.com/开发者认证1.进入账号中心,进行开发者企业认证2.认证成功后如截图所示注意:开发者企业认证和安卓端需要提交的软著公司需一致,否则需提供软著授权协议证明创建应用填写基本信息按照要求填入填入......
  • 手写签名-微信小程序
    index.wxml<canvastype="2d"id="canvas"bindtouchmove="move"bindtouchstart="start"binderror="error"style="width:{{width}}px;height:{{height}}px;"></canvas><viewclass="b......
  • 微信公众号使用隐藏页判断登录
    <scripttype="text/javascript">   $(document).ready(function(){      document.getElementById("over").style.display="block";      document.getElementById("layout").style.display="block";      //判断......
  • 解决企业微信在线文档里的代码复制后不能执行的问题
    【问题】某日帮同事改了个SQL,自己能执行,因为懒得另存为,就直接丢到企业微信发了。企业微信提示因为超长生成了在线文档。同事复制后,执行一直报错,类似下面的情况:【报错】 【能执行】【原因】既然语法正确,那么就把文档下载下来瞅瞅。以下是WPS的检查方法,word检查方法类似。......
  • 微信小程序 + App = ?
    为了让开发者可以一次编码,就能够编译为 小程序、Android、iOS 应用,实现所谓的 多端开发,去年微信推出了Donut(多纳)开发平台(目前是Beta版),核心包括:1、开发者可将小程序构建成可独立运行的移动应用;2、也可以将小程序构建成运行于原生应用中的业务模块从图中可以看出......
  • 记录在vue3项目中使用wangeditor富文本编译器以及微信小程序中的渲染
    首先,管理后台中的使用npminstallwangeditor//f封装成了组件,以下是组件中的内容<template>  <divstyle="border:1pxsolid#ccc;maxwidth:600px">   <!--工具栏-->   <Toolbar    style="border-bottom:1pxsolid#ccc"    :......
  • 一统天下 flutter - widget Sliver: SliverGrid - 网格(需要在 CustomScrollView 中使
    源码https://github.com/webabcd/flutter_demo作者webabcd一统天下flutter-widgetSliver:SliverGrid-网格(需要在CustomScrollView中使用)示例如下:lib\widget\sliver\sliver_grid.dart/**SliverGrid-网格(需要在CustomScrollView中使用)*/import'dart:......
  • 一统天下 flutter - widget Sliver: SliverAppBar/FlexibleSpaceBar - 可展开/收缩的
    源码https://github.com/webabcd/flutter_demo作者webabcd一统天下flutter-widgetSliver:SliverAppBar/FlexibleSpaceBar-可展开/收缩的标题栏(需要在CustomScrollView中使用)示例如下:lib\widget\sliver\sliver_app_bar.dart/**SliverAppBar/FlexibleSpaceBar......
  • 一统天下 flutter - widget Sliver: NestedScrollView - 为可滚动组件提供 sliver 效
    源码https://github.com/webabcd/flutter_demo作者webabcd一统天下flutter-widgetSliver:NestedScrollView-为可滚动组件提供sliver效果示例如下:lib\widget\sliver\nested_scroll_view.dart/**NestedScrollView-为可滚动组件提供sliver效果*/import......
  • 微信小程序开发页面下拉刷新和scrollview
    问题背景本文主要介绍微信小程序开发过程实现页面下拉刷新以及scrollview组件实现下拉刷新,以及二者的关系。问题分析微信小程序开发过程,如果要实现页面刷新以及scrollerview下拉刷新,步骤如下:(1)页面独立配置在对应页面的json文件中配置属性:"enablePullDownRefresh":true(2)项目......