• 选择商品属性弹框从底部弹出动画效果


    以上就是我们选择商品时,会出现一个动画效果模态弹框,相关代码的实现如下:

    视图层的代码:

    1. <!-- 底部弹出规格选择 -->
    2. <view class="animation" wx:if="{{showView}}">
    3. <!-- 内容框 -->
    4. <view class="animation_content">
    5. <!-- 上部分 -->
    6. <view class="animation_content_top">
    7. <view class="pic">
    8. <image src="{{goods_detail.points_goods_image}}" mode="aspectFit"></image>
    9. </view>
    10. <view class="store_name">
    11. <view style="margin-bottom: 10px;">{{goods_detail.points_goods_name}}</view>
    12. <view style="color: red;">帮豆{{goods_detail.points_goods_points}} + <text style="font-size: 25rpx;">现金:{{goods_detail.points_goods_buyprice}}</text></view>
    13. </view>
    14. <view class="close_kucun">
    15. <icon class="iconfont icon-close c-c6" bindtap='off'></icon>
    16. <view style="font-size: 27rpx;color: #999;">库存:{{goods_detail.points_goods_storage}}</view>
    17. </view>
    18. </view>
    19. <!-- 下部分 -->
    20. <view class="animation_content_bottom">
    21. <view style="width: 20%;">购买数量</view>
    22. <view class="nums">
    23. <button bindtap="cut"> - </button>
    24. <view>{{num}}</view>
    25. <button bindtap="addition"> + </button>
    26. </view>
    27. <view>
    28. </view>
    29. </view>
    30. <!-- 立即兑换 -->
    31. <button style="background: #fe244b;color: #fff;font-size: 28rpx;" bindtap="buyNow">立即兑换</button>
    32. </view>
    33. </view>

    css相关的样式

    1. /* 底部弹框动画 */
    2. .animation{background: rgba(0,0,0,.5);position: fixed;width: 100%;top: 0;right: 0;animation: animation 1s ease;height: 100%;z-index: 3;}
    3. @keyframes animation{
    4. 0%{position: fixed;width: 100%;top:500rpx;right: 0;}
    5. 100% {position: fixed;width: 100%;bottom:0;right: 0;height: 100%;}
    6. }
    7. .animation_content{
    8. display: block;
    9. position: absolute;
    10. bottom:0 ;
    11. z-index: 4;
    12. width: 100%;
    13. background: #ffff;
    14. }
    15. .animation_content_top{
    16. padding: 18px 10px;
    17. box-sizing: border-box;
    18. border-bottom: 1rpx solid #999;
    19. display: flex;
    20. justify-content: space-between;
    21. margin-bottom: 85px;
    22. }
    23. .store_name{margin-left: 30%;font-size: 27rpx;}
    24. .close_kucun{display: flex;flex-direction: column;align-items: flex-end;}
    25. .close_kucun icon{margin-top: -18px;margin-bottom: 18px;}
    26. .animation_content_top .pic{width: 95px;height: 95px;border-radius: 10px;position: absolute;top: -25px;}
    27. .pic image{width: 100%;height: 100%;border-radius: 10px;}
    28. .animation_content_bottom {
    29. border-top: 1rpx solid #9999;
    30. padding: 10px;
    31. display: flex;
    32. justify-content: space-between;
    33. color: #999;
    34. font-size: 28rpx;
    35. font-weight: 400;
    36. }
    37. .animation_content_bottom .nums{width: 20%;display: flex;align-items: flex-end;margin-left: 50%;}
    38. .animation_content_bottom button{width: 40rpx;height: 40rpx;line-height: 40rpx;}
    39. .bottom_duihuan{background: #fe244b;color: #fff;font-size: 30rpx;position: fixed;width: 100%;bottom: 0;left: 0;right: 0;height: 80rpx;line-height: 80rpx;}

  • 相关阅读:
    面试官:“同学,你做的这几个项目都不错。但怎么问QPS你就胡说呢?”
    java集合,栈
    面试:HTTP 的长连接和短连接
    CICD(1)——pipeline语法(1)
    一些简单却精妙的算法
    Java Web入门之JSP的基本语法解析及实战(超详细 附源码)
    鸿蒙:自定义组件、自定义函数、自定义样式
    【LeetCode刷题-树】--1367.二叉树中的链表
    神经网络有哪些基本功能,常见的神经网络有哪些
    v-bind指令:设置元素的属性
  • 原文地址:https://blog.csdn.net/weixin_51614564/article/details/125485887