中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

微信小程序怎么自定義可滑動的tab切換

發布時間:2022-07-13 13:58:53 來源:億速云 閱讀:184 作者:iii 欄目:開發技術

這篇文章主要介紹了微信小程序怎么自定義可滑動的tab切換的相關知識,內容詳細易懂,操作簡單快捷,具有一定借鑒價值,相信大家閱讀完這篇微信小程序怎么自定義可滑動的tab切換文章都會有所收獲,下面我們一起來看看吧。

自定義tab切換(可滑動)

微信小程序怎么自定義可滑動的tab切換

<!--components/warn/warn.wxml-->
<view class="menu">
  <navigator wx:for="{{shouye}}" wx:key="index" bindtap="change" class="{{page==index?'font-white':'font-black'}}" data-pageid="{{index}}">{{item}}</navigator>
  <!-- <view class="order-desc">按排名升序</view> -->
</view>
<swiper current='{{page}}' bindchange="changepage">
  <swiper-item wx:for="{{shouye}}" wx:key="index">
    <view class="view1">
      <view class="table">
        <view class="tr">
          <view class="th">產品編號</view>
          <view class="th">當前庫存</view>
          <view class="th">按時間倒序</view>
        </view>
        <block wx:for="{{saleData}}" wx:key="index">
          <view class="tr bg-f3f4f4">
            <view class="td">{{item.prodCode}}</view>
            <view class="td">{{item.proName}}</view>
            <view class="td">{{item.time}}</view>
          </view>
        </block>
        <view class="all-tabledata">查看全部</view>
      </view>
    </view>
  </swiper-item>
</swiper>
// components/warn/warn.js
Component({
    /**
     * 組件的屬性列表
     */
    properties: {

    },

    /**
     * 組件的初始數據
     */
    data: {
        shouye: ['未處理', '已處理'],
        page: 0,
        saleData:[
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          },
          {
              prodCode:38749237093280,
              proName:'1000',
              time:'2021-12-12 14:00'
          }
      ]
      },

    /**
     * 組件的方法列表
     */
    methods: {
        change: function (event) {
            var a = event.currentTarget.dataset.pageid
            this.setData({
              page: a
            })
          },
          changepage: function (event) {
            console.log(event)
            var a = event.detail.current
            this.setData({
              page: a
            })
          },
    }
})
/* components/warn/warn.wxss */

scroll-view{
    width: 100%;
    height: 100%;
    display: flex;
  }
  .menu{
    /* background-color: red;
    display: flex;
    height: 60rpx;
    font-size: 40rpx;
    line-height: 70rpx;
    flex-direction: row;
    justify-content: space-around; */
    width: 100%;
    height: 10%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
  .font-white{
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #FFFFFF;
    background: #197FF0;
    font-size: 16px;
    font-family: PingFang SC;
    font-weight: 400;
    width: 200rpx;
    height: 60rpx;
    line-height: 60rpx;
    opacity: 1;
    border-radius: 34rpx;
  }
  .font-black{
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 16px;
    font-family: PingFang SC;
    font-weight: 400;
    color: #041320;
    width: 200rpx;
    height: 60rpx;
    line-height: 60rpx;
    background: #F6F6F6;
    opacity: 1;
    border-radius: 34rpx;
  }
  .view1{
    height: 100%;
    overflow-y: auto;
  }
  swiper {
    /* width: 100%; */
    height: 90%;
    overflow-y: auto;
    /* margin: 0 auto; */
  }
  /* 表格 */
  .tr{
    width: 100%;
  display: flex;
  /* justify-content: space-around;     */
}
.bg-f3f4f4{
      margin-bottom: 20rpx;
    background:rgba(28, 41, 53,0.05)
}
.tr>.th:nth-child(1),.tr>.td:nth-child(1){
    width: 40%;
    text-align: center;
}
.tr>.th:nth-child(2),.tr>.td:nth-child(2){
    width: 20%;
    text-align: center;
}
.tr>.th:nth-child(3),.tr>.td:nth-child(3){
    width: 40%;
    text-align: center;
}
.th,.td{
  font-size: 28rpx;
  font-family: PingFang SC;
  font-weight: 400;
  line-height:80rpx;
  color: #041320;
}
.all-tabledata{
  font-size: 24rpx;
  font-family: PingFang SC;
  font-weight: 400;
  height: 40rpx;
  line-height:30rpx;
  color: #187EEF;
  text-align: center;
  margin: 40rpx 0;
}

關于“微信小程序怎么自定義可滑動的tab切換”這篇文章的內容就介紹到這里,感謝各位的閱讀!相信大家對“微信小程序怎么自定義可滑動的tab切換”知識都有一定的了解,大家如果還想學習更多知識,歡迎關注億速云行業資訊頻道。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

宣城市| 始兴县| 澳门| 静宁县| 北票市| 滦南县| 新郑市| 阿巴嘎旗| 澄城县| 德州市| 紫阳县| 沂水县| 天祝| 锦屏县| 赤城县| 淄博市| 岳池县| 连山| 汾阳市| 花垣县| 昂仁县| 囊谦县| 巍山| 且末县| 堆龙德庆县| 罗山县| 吉安县| 全南县| 库车县| 咸丰县| 瑞昌市| 庆安县| 南宫市| 德令哈市| 昌邑市| 宜良县| 南澳县| 尚志市| 图片| 安阳市| 若尔盖县|