第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

微信小程序 模板學(xué)習(xí)(靜態(tài)效果)

標(biāo)簽:
小程序

初学,很多方法都是网上找的。这里记录一下方便自己以后学习。

小白小白一个。我写的应该是模板,不是组件。截图上的字改不了了

https://img1.sycdn.imooc.com//5c6bd1cf0001573d04000441.jpg

https://img1.sycdn.imooc.com//5c6bd22e00017d4107800721.jpg

https://img1.sycdn.imooc.com//5c6bd2f700013c1707960486.jpg

https://img1.sycdn.imooc.com//5c6bd27e0001713e05760315.jpg

https://img1.sycdn.imooc.com//5c6bd2b30001babc07560279.jpg



错误的记录

 Setting data field "cityLists" to undefined is invalid.

将数据字段“cityLists”设置为undefined是无效的。

https://img1.sycdn.imooc.com//5c6cc12b00017b6c08790805.jpg

https://img1.sycdn.imooc.com//5c6cc0a40001334a11080323.jpg


菜单的吸顶功能

把菜单固定在顶部

https://img1.sycdn.imooc.com//5c6cf3820001188b13380318.jpg

https://img1.sycdn.imooc.com//5c6cf3c8000140ab03990347.jpg

/**  * 生命周期函数--监听页面显示  */
onShow: function () {
var that = this;
var query = wx.createSelectorQuery(); //创建节点查询器 query
     query.select('#hotfixed').boundingClientRect();  //选择id的节点,获取节点的位置信息
     query.exec(function (res) {
      // console.log(res[0].top);
     that.setData({menuTop: res[0].top}
    )}
)},
/** * 监听滚动事件 */
onPageScroll: function (e) {
// console.log(e);
var that = this;
//当页面滚动距离scrollTop > menuTop某元素距离文档顶部的距离时,某元素固定定位
if (e.scrollTop > that.data.menuTop){
that.setData({menuFixed: true})
}else { 
that.setData({menuFixed: false})}
},


导航条菜单左右滑动

<view class="{{menuFixed  ? 'c-hot-fixed':'' }}" id="hotfixed"> 
    <view class='c-hotcity'>
      <text>热门入住地</text>
    </view> 
    <view class='c-hotcity-name'>  
        <scroll-view scroll-x="true" scroll-with-animation='true' scroll-left='{{swiperNav.x}}' class='c-hot-scrollview' bindtap="swiperNav"> 
            <text wx:for="{{swiperNav.area}}" wx:key="{{index}}" data-i='{{index}}' class="{{swiperNav.i==index ? 'viewactive' :''}} c-hot-text">{{item.name}}</text>
        </scroll-view>            
    </view>        
</view>
data: {swiperNav: 
{ i: 0,
  x: 0, 
  area: [
  {id: 1,v: 0,name: "春熙路商圈"},
  {id: 2,v: 1,name: "合江亭"},
  {id: 3,v: 2,name: "九眼桥"},
  {id: 4,v: 3,name: "天府广场"},
  {id: 5,v: 4,name: "锦里武侯祠"},
  {id: 6,v: 5,name: "环球中心"},
  {id: 7,v: 6,name: "银泰城"},
  ]},
  cityLists: [],
  menuTop: '',
  menuFixed: false
  },
  // 导航条加激活状态
  swiperNav: function (e) {
  console.log(e);
  let that = this;// 获取可视窗口宽度
  let w = wx.getSystemInfoSync().windowWidth;// 获取菜单个数
  let leng = that.data.swiperNav.area.length;// 获取被点击的下标
  let i = e.target.dataset.i;
  var disX = (i - 2) * w / leng;
  if (i != that.data.swiperNav.i) {
  that.setData({
  'swiperNav.i': i
  })
  }
  that.setData({
  'swiperNav.x': disX
  })
  },
css3超过两行显示省略号
.cs{
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    }


點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺(jué)得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫(xiě)下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開(kāi)微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消