小程序页面布局和绝对定位和button分享问题

本文介绍了一种在前端开发中实现自定义UI风格的分享组件的方法,详细讲解了如何利用button组件并设置其样式来达到预期的效果。此外,还讨论了如何确保分享时携带必要的参数,以便接收方能够正确显示内容。

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

  <view class="dibu">
  <input  value='{{inputVal}}' bindinput='inputTyping' class="wz" bindinput='inputTyping' placeholder="请输入私信内容" placeholder-style='color:#bdbdbd;line-height:68rpx;margin-left:30rpx;font-size:30rpx;' />
  <view bindtap="blurfocus" class="fasong">发送</view>
  </view>




.dibu{
position:fixed;
bottom:2px;
float:left;
border:2px solid #f5f5f5;
width:99%;
height:70rpx;
background:white;
}

.wz{
    /* border:1px solid red; */
height:68rpx;
font-size:46rpx;
width:630rpx;
float:left;
border:1px solid #8EE5EE;
border-radius:10rpx;
}
.fasong{
    float:right;
height:70rpx;
margin-right:7rpx;
width:90rpx;
line-height:66rpx;
text-align:center;
border-radius:10rpx;
font-size:28rpx;
background:#8EE5EE;

}

分享必须用button,但要自定义button(style="border:0;" plain="true"  open-type="share")


<view class="viewh" wx:if="{{sharpicture==4}}">
    <view class="tp"><image class="tpimg" src="../../static/images/yqxg.png"/></view>
    <view class="imgtxt">你粗糙纹理好过<text style="font-size:60rpx;">{{facedata.defaultdata.wenli}}%</text>的人
    </view>
    <button class="share" style="border:0;" plain="true"  open-type="share">
   <image  src="../../static/images/share.png"/></button>
</view>

分享必须带好参数,不然别人不到 都是空白或页面不存在

 onShareAppMessage: function (ops) {
        console.log('分享了');

        if (ops.from === 'button') {
            // 来自页面内转发按钮
            console.log(ops.target)
        }
        return {
            title: '哈哈哈',
            path: '/pages/facialEvaluate/facialEvaluate?faceFourdataId=' + this.data.faceFourdataId +'&userId='+this.data.userId,
           //path:'',
            success: function (res) {
                // 转发成功
                console.log("转发成功:" + JSON.stringify(res));
            },
            fail: function (res) {
                // 转发失败
                console.log("转发失败:" + JSON.stringify(res));
            }
        }

    },

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值