<span>和<div>标签的隐藏和显示切换

<div class="axb">
    <span id="tipStep1" class="fl" >第一步显示</span>
    <span id="tipStep2" class="fl" style="display:none">第二部显示</span><!-- 第一步先是隐藏的 -->
</div>
<div id="axbStep2" class="bottom" style="display:none;margin-top:60px;"></div>
<a class="btn confirm" οnclick="registStep2();">下一步</a>

function axbStep2(){
var userPhone = $("#userPhone").val();
if(userPhone==""){
$("#checkPhoneMsg").html("请输入手机号码");
$("#checkPhoneMsg").css("color","orange");
return ;
}
//验证都通过
if(checkphone){
checkSMSCodeJs();
}
if(checkphone && checkCaptcha()){
$("#registStep1").hide(); //切换效果
$("#registStep2").show(); //
$("#tipStep1").hide();
$("#tipStep2").show();

}
}

 

转载于:https://www.cnblogs.com/taiguyiba/p/6627730.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
<template> <div> <router-view /> <div class="title">购物车</div> <div class="shop_goods" v-for="(item, index) in shopcarList" :key="index"> <van-checkbox v-model="item.isChecked"></van-checkbox> <van-card :title="item.name" :thumb="item.img"> <template #price> <span>¥{{ item.price }}</span> </template> <template #num> <p class="count"> <span @click="del(index)">-</span> <span>{{ item.num }}</span> <span @click="add(index)">+</span> </p> </template> </van-card> </div> <div class="shopcar_total"> <van-submit-bar :price="priceTotal" @submit="onSubmit"> <template #button> <span class="total"> 去结算 </span> </template> <van-checkbox v-model="isAllChecked">全选</van-checkbox> </van-submit-bar> </div> </div> </template> <script> export default { data() { return { stepper: 1, shopcarList: [], }; }, methods: { onSubmit() { console.log(111); }, add(index) { // console.log(index); this.$set( this.shopcarList[index], this.shopcarList[index].num, this.shopcarList[index].num++ ); }, del(index) { if (this.shopcarList[index].num == 1) { this.$toast("不能再减了"); } else { this.$set( this.shopcarList[index], this.shopcarList[index].num, this.shopcarList[index].num-- ); } }, }, created() { this.shopcarList = JSON.parse(localStorage.getItem("shopcar")) || []; console.log(this.shopcarList); }, computed: { isAllChecked: { set(val) { this.shopcarList.forEach((ele) => { ele.isChecked = val; }); }, get() { return this.shopcarList.every((ele) => { return ele.isChecked == true; }); }, }, priceTotal() { let sum = 0; let newPrice = this.shopcarList.filter((ele) => { return ele.isChecked == true; }); sum = newPrice.reduce((pre, current) => { return (pre += current.price * current.num); }, 0); return sum * 100; }, }, }; </script>这个页面怎么优化
06-02

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值