国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 課堂 > 小程序 > 正文

微信小程序select下拉框實現(xiàn)效果

2020-03-21 15:56:23
字體:
來源:轉載
供稿:網(wǎng)友

微信小程序,select,下拉框

小程序中是沒有h5中的下拉 標簽的 所以要實現(xiàn)下拉功能就必須自己動手寫拉

 這里為了更清楚的顯示層級 就把源碼直接復制過來了

<view class='list-msg'>  <view class='list-msg1'>    <text>商品金額</text>    <text>¥99.00</text>  </view><!--下拉框 -->  <view class='list-msg2' bindtap='bindShowMsg'>    <text>{{tihuoWay}}</text>    <image style='height:20rpx;width:20rpx;' src='/images/down.png'></image>  </view>  <view class='list-msg1'>    <text>運費</text>    <text></text>免郵</view>  <view class='list-msg1'>    <text>實際付款</text>    <text style='color:red'>¥99.00</text>  </view><!-- 下拉需要顯示的列表 -->  <view class="select_box" wx:if="{{select}}">    <view class="select_one" bindtap="mySelect" data-name="重慶分店">重慶分店</view>    <view class="select_one" bindtap="mySelect" data-name="東莞南城分店">東莞南城分店</view>    <view class="select_one" bindtap="mySelect" data-name="東莞總店">東莞總店</view>  </view></view>

下面是js代碼

Page({   /**   * 頁面的初始數(shù)據(jù)   */  data: {    select: false,    tihuoWay: '門店自提'  },   /**   * 生命周期函數(shù)--監(jiān)聽頁面加載   */  onLoad: function (options) {   },  bindShowMsg() {     this.setData({       select:!this.data.select     })  },  mySelect(e) {    var name = e.currentTarget.dataset.name    this.setData({      tihuoWay: name,      select: false    })  },    /**   * 用戶點擊右上角分享   */  onShareAppMessage: function () {   }})
.list-msg {  padding: 0 20rpx;  background-color: #fff;  position: relative;} .list-msg1 {  height: 60rpx;  display: flex;  align-items: center;  justify-content: space-between;} .list-msg .list-msg2 {  height: 60rpx;  display: flex;  align-items: center;  justify-content: space-between;  border: 1px solid #ccc;  padding: 0 10rpx;} .select_box {  background-color: #eee;  padding: 0 10rpx;  width: 93%;  position: absolute;  top: 130rpx;  z-index: 1;  overflow: hidden;  animation: myfirst 0.5s;} @keyframes myfirst {  from {    height: 0rpx;  }   to {    height: 210rpx;  }} .select_one {  height: 60rpx;  line-height: 60rpx;  border-bottom: 1px solid #ccc;}

以上所述是小編給大家介紹的微信小程序select下拉框實現(xiàn)效果詳解整合,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對VEVB武林網(wǎng)網(wǎng)站的支持!


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 江西省| 岑溪市| 文成县| 攀枝花市| 长丰县| 凤阳县| 大宁县| 汝城县| 广平县| 石城县| 辉县市| 六盘水市| 惠东县| 玉门市| 祁连县| 华容县| 沛县| 墨玉县| 信阳市| 盖州市| 开平市| 梅河口市| 福州市| 筠连县| 刚察县| 新源县| 西贡区| 台湾省| 乐山市| 思茅市| 万载县| 正蓝旗| 湾仔区| 麻城市| 胶南市| 子洲县| 黄山市| 渝北区| 惠来县| 阳新县| 石楼县|