zoukankan      html  css  js  c++  java
  • 微信小程序制作下来菜单

    wxml:

    <view class="phone_one" bindtap="clickPerson">
    <view class="phone_personal">{{firstPerson}}</view>
    <image src="../../image/v6.png" class="personal_image {{selectArea ? 'rotateRight' :''}}"></image>
    </view>
    <view class="person_box">
    <view class="phone_select" hidden="{{selectPerson}}">
    <view class="select_one" bindtap="mySelect" data-me="请选择">请选择</view>
    <view class="select_one" bindtap="mySelect" data-me="微信支付">微信支付</view>
    </view>
    </view>

    wxss:

    .phone_one{
    display: flex;
    position: relative;
    justify-content: space-between;
    150rpx;
    height:100rpx;
    margin:0 auto;
    float: right;
    text-align: right;
    }
    .person_box{
    position: relative;
    }
    .phone_select{
    margin-top:100rpx;
    right: 0;
    z-index: 100;
    position: absolute;
    }
    .select_one{
    text-align: center;
    background-color:rgb(239, 239, 239);
    326rpx;
    height:100rpx;
    line-height:100rpx;
    margin:0 5%;
    border-bottom:2rpx solid rgb(255, 255, 255);
    }
    .personal_image{
    z-index: 100;
    position: absolute;
    right:2.5%;
    34rpx;
    height: 20rpx;
    margin:40rpx 20rpx 40rpx 0;
    transition: All 0.4s ease;
    -webkit-transition: All 0.4s ease;
    }
    .rotateRight{
    transform: rotate(180deg);
    }

    JS:

    Page({
    data: {
    selectPerson: true,
    firstPerson: '个人',
    selectArea: false,
    },
    //点击选择类型
    clickPerson: function () {
    var selectPerson = this.data.selectPerson;
    if (selectPerson == true) {
    this.setData({
    selectArea: true,
    selectPerson: false,
    })
    } else {
    this.setData({
    selectArea: false,
    selectPerson: true,
    })
    }
    },
    //点击切换
    mySelect: function (e) {
    this.setData({
    firstPerson: e.target.dataset.me,
    selectPerson: true,
    selectArea: false,
    })
    },

    })

  • 相关阅读:
    转载、收藏
    AndroidStudio 问题收集
    android4.4 添加快捷开关(以截屏为例)
    打开USB调试功能
    关于Http通信
    【原创】JMS生产者和消费者【PTP同步接收消息】
    【学习】JMS通信模式
    【原创】Unable to read TLD "META-INF/c.tld" from JAR file 解决方法
    【原创】websphere部署war包报错
    【转载】tom的RUNSTATS测试工具
  • 原文地址:https://www.cnblogs.com/seven077/p/7210827.html
Copyright © 2011-2022 走看看