博主信息
博文 49
粉丝 0
评论 4
访问量 51366
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
仿抖音微信小程序制作
过儿的博客
原创
2173人浏览过

index.wxml

实例

<!--index.wxml-->
<!-- 顶部导航 -->
<view class="header">
   <view class='header_l'>
    <icon type='search'></icon>
   </view>
    <view class='header_c'>
     <text space="emsp" decode='true' style="font-size:31rpx;">  推荐  </text>
     <text  space="emsp" decode='true' style="font-size:19rpx;">  |  </text>
     <text  space="emsp" decode='true' style="font-size:25rpx;">  河北</text>
    </view>
     <view class='header_r'>
       <image src='../../img/scan.png'></image>
       <image src='../../img/live.png'></image>
     </view>
</view>
<!-- 滑块视图容器 vertical纵向 autoplay不自动切换 indicator-dots不显示面板 -->
<swiper vertical='true' autoplay='' indicator-dots="" style='height:{{widowHeight}}px;'>
  <!-- <swiper-item>每个单元滑动容器 -->
  <swiper-item>
    <view class='right'>
      <view>
      <image src='https://img.php.cn/upload/avatar/000/126/153/5b592fa41732b439.jpg' class='avatar'></image>
      <image src='../../img/follow.png' style='width:30rpx;height:30rpx;'></image>
      </view>
      <view>
        <image src="../../img/love.png" class='r_img'></image>
        <view class='text'>1888</view>
          <image src="../../img/forwa.png" class='r_img'></image>
        <view class='text'>1888</view>
          <image src="../../img/com.png" class='r_img'></image>
        <view class='text'>1888</view>
      </view>
    </view>
  </swiper-item>
</swiper>

运行实例 »

点击 "运行实例" 按钮查看在线实例

index.js文件

实例

//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
   widowHeight:0,   //屏幕可使用高度
  pace:1,     //  屏幕的滚动速度
  posLeft2:0,  //屏幕滚动方法三中left值
  marginLeft:30 //水平滚动方法三中两条文本之间的距离
  },
  onLoad:function () {
    this.setData({ //setData函数用于将数据从逻辑层发送到视图层,同时改变对应的this.data的值(同步)
      widowHeight:wx.getSystemInfoSync().windowHeight//获取屏幕可使用高度
    })
  }
})

运行实例 »

点击 "运行实例" 按钮查看在线实例

index.wxss文件

实例

/**index.wxss**/
.header{
  position: fixed;
  top: 30rpx;
  left: 20rpx;
  z-index: 999;
}
.header_c{
  position: fixed;
  left: 260rpx;
  top:30rpx;
}
.header_r{
  position: fixed;
  right: 30rpx;
  top: 30rpx;
}
.header_r image{
  width:40rpx;
  height: 40rpx;
  margin-left: 25rpx; 
}
.right{
  position: fixed;
  right: 20rpx;
  bottom: 50rpx;
  width: 100rpx;
  text-align: center;
  z-index: 999;
}
.avatar{
  width: 80rpx;
  height: 80rpx;
} 
.r_img{
  width:50rpx;
  height: 50rpx;
  margin-top:30px;
}
.text{
  font-size: 20rpx;
}

运行实例 »

点击 "运行实例" 按钮查看在线实例

app.json文件

实例

{
  "pages":[
    "pages/index/index",
    "pages/logs/logs",
    "pages/index/follow",
    "pages/index/msg",
    "pages/index/me"
  ],
  "window":{
    "backgroundTextStyle":"light",
    "navigationBarBackgroundColor": "#fff",
    "navigationBarTitleText": "抖音",
    "navigationBarTextStyle":"black"
  },
  "tabBar":{
    "backgroundColor":"#000",
    "color":"#ccc",
    "selectedColor":"#fff",
    "list":[ {
      "pagePath":"pages/index/index",
      "text":"首页"
      },
      {
        "pagePath": "pages/index/follow",
        "text": "关注"
      },
      {
        "pagePath": "pages/index/msg",
        "text": "+"
      },
      {
        "pagePath": "pages/index/msg",
        "text": "消息"
      },
      {
        "pagePath": "pages/index/me",
        "text": "我"
      }
    ]
  }
}

运行实例 »

点击 "运行实例" 按钮查看在线实例

QQ图片20190117120816.png

批改状态:合格

老师批语:
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学