最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

微信小程序時(shí)間軸組件的示例代碼

 更新時(shí)間:2022年05月31日 10:35:25   作者:camellia  
這篇文章主要介紹了微信小程序時(shí)間軸組件,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

我這里的標(biāo)題是小程序的時(shí)間組件,其實(shí)我這里是將他寫成了一個(gè)頁面,當(dāng)然,如果你有需求,將其做成一個(gè)自定義組件也可以~

這玩意其實(shí)沒有什么技術(shù)難點(diǎn)就是一個(gè)小頁面,我這里就不贅述了。直接上代碼:

Remark.wxml:

<view class="listview-container margin_bottom">
  <block wx:for="{{newList}}" wx:key="index">
    <view class="playlog-item" >
      <view class="dotline">
        <!-- 豎線 -->
        <view class="line"></view>
        <!-- 圓點(diǎn) -->
        <view class="dot"></view>
        <!-- 時(shí)間戳 -->
      </view>
      <view class="content">
        <text class="course">{{item.addtime}}</text>
        <text class="chapter">{{item.content}}</text>
      </view>
    </view>
    <!-- 廣告插件 -->
    <!-- <ad unit-id="adunit-5abb45645905fc90" wx:if="{{index % 5 == 4}}"></ad> -->
  </block>
</view>

Remark.js:

//獲取應(yīng)用實(shí)例
const app = getApp();
Page({
  
  /**
   * 頁面的初始數(shù)據(jù)
   */
  data: {
    // 數(shù)據(jù)列表
    newList:[],
  },
  
  getData:function(){
    var self = this;
    console.log(self.newList);
    console.log(self.showText);
  },
  
  /**
   * 生命周期函數(shù)--監(jiān)聽頁面加載
   */
  onLoad: function (options) {
     
  },
  
  /**
   * 生命周期函數(shù)--監(jiān)聽頁面初次渲染完成
   */
  onReady: function () {
     
  },
  
  /**
   * 生命周期函數(shù)--監(jiān)聽頁面顯示
   */
  onShow: function () {
// 監(jiān)聽底部菜單變化
    if (typeof this.getTabBar === 'function' &&
      this.getTabBar()) 
    {
      this.getTabBar().setData({
        selected: 1    // 根據(jù)tab的索引值設(shè)置
      })  
    }
    var self = this;
    // 請求后臺接口獲取隨言碎語列表
    wx.request({
      // 請求連接
      url: 'xxxxxxxxxxxxxxxxxxx',
      // 請求所需要的的參數(shù)
      data: {},
      success(result){
        self.newList = result.data;
        self.setData({
          newList:self.newList,
          showText: self.showText
        })
      }
    });
     
  },
  
  /**
   * 生命周期函數(shù)--監(jiān)聽頁面隱藏
   */
  onHide: function () {
  
  },
  
  /**
   * 生命周期函數(shù)--監(jiān)聽頁面卸載
   */
  onUnload: function () {
  
  },
  
  /**
   * 頁面相關(guān)事件處理函數(shù)--監(jiān)聽用戶下拉動作
   */
  onPullDownRefresh: function () {
  
  },
  
  /**
   * 頁面上拉觸底事件的處理函數(shù)
   */
  onReachBottom: function () {
  
  },
  
  /**
   * 用戶點(diǎn)擊右上角分享
   */
  onShareAppMessage: function () {
  
  }
})

remark.json

{
  "usingComponents": {},
  "navigationBarTitleText": "時(shí)間里的-隨言碎語"
}

Remark.wxss:

/*外部容器*/
.listview-container {
  margin: 10rpx 10rpx;
  margin-bottom: 115rpx;
}
  
/*行樣式*/
.playlog-item {
  display: flex;
}
  
/*時(shí)間軸*/
.playlog-item .dotline {
  width: 35px;
  position: relative;
}
  
/*豎線*/
.playlog-item .dotline .line {
  width: 1px;
  height: 100%;
  background: #ccc;
  position: absolute;
  top: 0;
  left: 15px; 
}
  
/*圓點(diǎn)*/
.playlog-item .dotline .dot {
  width: 11px;
  height: 11px; 
  background: #30ac63;
  position: absolute; 
  top: 10px; 
  left: 10px; 
  border-radius: 50%; 
}
  
/*時(shí)間戳*/
.playlog-item .dotline .time {
  width: 100%;
  position: absolute;
  margin-top: 30px;
  z-index: 99;
  font-size: 12px;
  color: #777;
  text-align: center;
}
  
/*右側(cè)主體內(nèi)容*/
.playlog-item .content {
  width: 100%;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #ddd;
  margin: 3px 0;
}
  
/*章節(jié)部分*/
.playlog-item .content .chapter {
  font-size: 30rpx;
  line-height: 68rpx;
  color: #444;
  white-space: normal;
  padding-right: 10px;
}
  
/*課程部分*/
.playlog-item .content .course {
  font-size: 28rpx;
  line-height: 56rpx;
  color: #999;
}

最終效果:

到此這篇關(guān)于微信小程序時(shí)間軸組件的文章就介紹到這了,更多相關(guān)小程序時(shí)間軸組件內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論

塔城市| 松溪县| 明溪县| 沙坪坝区| 蕲春县| 克什克腾旗| 广丰县| 桐乡市| 乐山市| 双峰县| 阳泉市| 木兰县| 和田县| 沙坪坝区| 和硕县| 屏东市| 青浦区| 龙井市| 兴和县| 越西县| 鄂州市| 温泉县| 三门峡市| 泊头市| 通城县| 天水市| 山东省| 年辖:市辖区| 邓州市| 新兴县| 大英县| 太和县| 新巴尔虎右旗| 青神县| 象山县| 平昌县| 五原县| 酒泉市| 石台县| 满洲里市| 景东|