小程序页面卡片式效果

本文介绍了如何在小程序中创建卡片式页面效果,包括wxml和wxss的编写技巧,通过示例代码展示核心部分,并提供二维码供读者扫码体验实际效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

效果图

在这里插入图片描述

wxml

  <view class="backgroud-float">
    <view class="flex-row">
      <view class="title-margin">
        <image class="icon" style="width: 25px; height: 25px;" src='../../pages/img/education.png'></image>
      </view>
      <view class="title-margin">
        <text class="border-left" decode="{{true}}">子女教育</text>
      </view>
      <view class="title-margin">
        <image style="width: 16px; height: 16px;" src='../../pages/img/hint-g.png' bindtap = 'showEducationHint'></image>
      </view>
    </view>
    <view wx:if="{{showEducationView}}" class="poptip">
      <view class="explain-margin">
      (1) 纳税人年满3岁的子女接受学前教育和学历教育的相关支出,按照每个子女每月1000元(每年12000元)的标准定额扣除;
      </view>
      <view class="explain-margin">
      (2) 父母可以选择由其中一方按100%扣除,也可以选择由双方分别按50%扣除。
      </view>
    </view>
    <view class="flex-row">
      <button class="button{{oneChildFlg?'-choosed':''}}" bindtap="oneChildBtnClk">1子女
      </button>
      <button class="button{{twoChildrenFlg?'-choosed':''}}" bindtap="twoChildrenBtnClk">2子女
      </button>
      <input type="digit" class="button third" name="稿酬收入" placeholder='自定义' value='{{childNumValue}}' bindinput="childNumInput" placeholder-class="placeholder"/>
    </view>
    <!-- <view class="hintdisplay">
      <text style="width:200px;" decode="{{true}}">{{childNumDigitHint}}</text>
    </view> -->
    <view class="flex-row">
      <button class="button{{hundredPercentFlg?'-choosed':''}}" bindtap="hundredPercentBtnClk">100%扣除
      </button>
      <button class="button{{fiftyPercentFlg?'-choosed':''}}" bindtap="fiftyPercentBtnClk">50%扣除
      </button>
    </view>
    <view class="flex-row-center">
      <view class="font-left">子女教育扣除费用</view>
      <view class="font-center">{{educationDeductionValue}}</view>
      <view class="font-right">/月</view>
    </view>
  </view>

wxss

核心部分

.backgroud-float{
  /* background-color: #898989; */
  height: 80%;
  width: 80%;
  margin-left: 10%;
  box-shadow: 4px 4px 8px  rgba(0,0,0,0.5);
  margin-bottom: 20px;
}

具体效果扫码体验

在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值