微信小程序项目_秋泊优选72

67、意见反馈_自定义图片组件

新建自定义组件
在这里插入图片描述
意见反馈页面引入组价
pages\feedback\index.json

{
  "usingComponents": {
    "Tabs":"../../components/Tabs/Tabs",
    "UpImg":"../../components/UpImg/UpImg"
  },
  "navigationBarTitleText": "意见反馈"
}

自定义组件 标签和样式
components\UpImg\UpImg.wxml

<view class="up_img_wrap">
    <image src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1752617175,1775401708&fm=26&gp=0.jpg"></image>
    <icon type="clear" size="23">
    </icon>
</view>

components\UpImg\UpImg.wxss

.up_img_wrap{
    width: 90rpx;
    height: 90rpx;
    /*相对定位*/
    position: relative;
}

.up_img_wrap image{
    width: 100%;
    height: 100%;
    border-radius: 15rpx;
}

.up_img_wrap icon{
    position: absolute;
    top:-23rpx;
    right: -23rpx;
}

pages\feedback\index.less

page{
    background-color:#eeeeee;
}

.fb_main {
    padding: 20rpx;
    color:#666;

    .fb_title {
  
    }
  
    .fb_tips {
      /*伸缩盒子*/
      display: flex;
      /*换行属性*/
      flex-wrap: wrap; 
      text {
        width:30%;
        padding:10rpx;
        text-align: center;
        background-color:#fff;
        margin: 20rpx 10rpx;
      }
    }
  
    .fb_content {
      background-color:#fff;
      margin-top:20rpx;
      textarea {
        padding:10rpx;
      }
  
      .fb_tool {
        /*伸缩盒子*/
        display: flex;
        /*换行属性*/
        flex-wrap: wrap; 
        padding-bottom:30rpx;
        button{
          margin:0;
          width: 90rpx;
          height: 90rpx;
          font-size: 60rpx;
          padding: 0;
          /*伸缩盒子*/
          display: flex;
          /*水平居中*/
          justify-content: center;
          /*垂直居中*/
          align-items: center;
          margin-left: 20rpx;
          margin-top:20rpx;
          color:#ccc;
        }
        .up_img_item{
          margin-left: 20rpx;
          margin-top:20rpx;
        }
  
      }
    }
  
    .form_btn_wrap {
      margin-top: 20rpx;
      display: flex;
      /*从右向左对齐*/
      justify-content: flex-end;
      button{
        margin: 0;
        background-color: #66ccff;
        width: 30%;
      }
    }
  }

pages\feedback\index.wxml

        <view class="fb_content">
            <textarea placeholder="请描述一下您的问题"></textarea>
            <view class="fb_tool">
                <button>+</button> 
                <view class="up_img_item"><UpImg></UpImg></view>
                <view class="up_img_item"><UpImg></UpImg></view>
                <view class="up_img_item"><UpImg></UpImg></view>
            </view>
        </view>

在这里插入图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值