为了账号安全,请及时绑定邮箱和手机立即绑定

vue2.0实现银行卡类型种类的选择

标签:
JavaScript

功能效果:vue2.0实现银行卡类型种类的选择
图片.png

参考代码如下:

<template>
    <div class="app">
      <header>
      </header>
        <div class="details">   
            <div @click="memberRank">
                <span>卡类型</span>

                <span>{{name}}</span>
                <i class="el-icon-arrow-right"></i>
            </div>
        </div>

          <mt-actionsheet :actions="actions2" v-model="sheetVisible2" cancel-text="">

          </mt-actionsheet>
    </div>
</template>
<script>

export default {
  data() {
    return {

      actions2: [],  //底部弹出提示框
      sheetVisible2: false,//透明遮罩背景
      name: "普卡"//默认数值
    };
  },
  computed: {

  },
  components: {

  },
  methods: {
    // 点击显示会员等级
    memberRank() {
      this.sheetVisible2 = true;
    },

    //赋值到框里
    commonCard() {
      this.name = "普卡";
    },
    silverCard() {
      this.name = "银卡";
    },
    goldCard() {
      this.name = "金卡";
    },

  },
  mounted() {//移动但底部弹出选项
    this.actions2 = [
      {
        name: "普卡",
        method: this.commonCard
      },
      {
        name: "银卡",
        method: this.silverCard
      },
      {
        name: "金卡",
        method: this.goldCard
      }
    ];
  }
};
</script>
<style scoped>

header {
  height: 1.5rem;
  width: 100%;
  background-image: linear-gradient(-134deg, #f62241 0%, #f62241 100%);
  position: relative;
}

.details {
  background: white;
  margin-top: 0.3rem;
  height: auto;
}

.details div span:nth-child(2):not(.phoneNum) {
  position: absolute;
  left: 4rem;
}
.details div {
  clear: both;
  border-bottom: 0.025rem solid rgba(0, 0, 0, 0.02);
  height: 1.5rem;
  line-height: 1.5rem;
  font-size: 0.48rem;
  color: rgba(0, 0, 0, 0.7);
  margin-left: 0.5rem;
}
</style>
点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
Web前端工程师
手记
粉丝
1.4万
获赞与收藏
118

关注作者,订阅最新文章

阅读免费教程

  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消