程序中页面布局和绝对定位与按钮代码的剖析

why 132 2024-08-07

本篇文章给大家带来的内容是关于小程序中页面布局和绝对定位以及按钮代码,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。

小程序中页面布局和绝对定位与按钮代码的剖析

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

  <view class="dibu">

  <input  value=&#39;{{inputVal}}&#39; bindinput=&#39;inputTyping&#39; class="wz" bindinput=&#39;inputTyping&#39; placeholder="请输入私信内容" placeholder-style=&#39;color:#bdbdbd;line-height:68rpx;margin-left:30rpx;font-size:30rpx;&#39; />

  <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(&#39;分享了&#39;);

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

    },

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:微信小程序内 app.json 配置的相关代码深度解析
下一篇:微信小程序中带参数返回上一页的三种方法汇总
相关文章

 发表评论

暂时没有评论,来抢沙发吧~