微信小程序之GoodsAction 商品导航

一、简介:

写这篇文章主要是讲解这个GoodsAction 商品导航的样式是怎么写的,让我们可以根据这个样式写出属于自己的GoodsAction 商品导航。

二、效果图:

在这里插入图片描述

三、素材图:

在这里插入图片描述在这里插入图片描述

四、代码分解:

在这里插入图片描述

让图片与文字一个在上一个在下,且让图片与文字上下左右居中布局。
wxml:

<view class="bottom_liuyan" >
  <view class="bottom_image"><image class="bottom_img" src="../../images/xiaoxi.png"></image></view>
  <view>留言</view>
</view>

wxss:

.bottom_liuyan{
  width: 45%;
  height: 100rpx;
  background-color: white;
  display: flex;
  /* 上下布局 */
  flex-direction: column;
  /* 上下居中 */
  justify-content: center;
  /* 左右居中 */
  align-items: center;
}
.bottom_image{
  width: 60%;
  height: 60%;
}
.bottom_img{
  width: 100%;
  height: 100%;
}

五、整体代码:

在这里插入图片描述

wxml:

<!-- 商品详情底部按钮 -->
<view class="bottom_kuangjia">
  <view class="bottom_left">
    <view class="bottom_liuyan" >
      <view class="bottom_image"><image class="bottom_img" src="../../images/xiaoxi.png"></image></view>
      <view>留言</view>
    </view>
    <view class="gwc" >
      <view class="bottom_image"><image class="bottom_img" src="../../images/cart1.png"></image></view>
      <view>购物车</view>
    </view>
  </view>
  <view class="bottom_right">
    <button class="add_gwc" >加入购物车</button>
    <button class="buy" >立即购买</button>
  </view>
</view>

wxss:

/* 底部按钮 */
.bottom_kuangjia{
  width: 100%;
  height: 100rpx;
  position: fixed;
  right: 0;
  bottom: 0rpx;
  display:flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
.bottom_left{
  width: 35%;

  height: 100rpx;
  display:flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
.bottom_liuyan{
  width: 45%;
  height: 100rpx;
  background-color: white;
  display: flex;
  /* 上下布局 */
  flex-direction: column;
  /* 上下居中 */
  justify-content: center;
  /* 左右居中 */
  align-items: center;
}
.bottom_image{
  width: 60%;
  height: 60%;
}
.bottom_img{
  width: 100%;
  height: 100%;
}
.gwc{
  width: 55%;
  height: 100rpx;
  display: flex;
  background-color: white;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.bottom_right{
  width:65%;
  background-color: greenyellow;
  height: 100rpx;
  display:flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
.add_gwc{
  width: 50%;
  height: 100rpx;
  background-color: rgb(255, 147, 115);
  border-radius: 0;
}
.buy{
  width: 50%;
  height: 100rpx;
  background-color: rgba(248, 32, 32, 0.918);
  border-radius: 0;
}
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Memory沙漏

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值