踩坑计

2019-11-01  本文已影响0人  星空里的尘埃

微信小程序踩坑

  1. textarea中placeholder设置行高(无效)

    场景: ui设计稿中placeholder过长,且换行

    处理: 借助bindinput这个来处理,点击时隐藏
    <text class='text'>施工描述:</text>
    <text class='detail-placeholder' hidden='{{isHidePlaceholder}}'>施工情况详细描述,如此次完成水电改造等施工细节,系统将传达给业主</text>
    <textarea class='area' name='desc' bindinput='getTextareaInput'></textarea></pre>

  2. 上传视频在真机上面没有返回视频的封面图,在开发工具上面有返回视频封面图。

    上传视频采用7牛,在7牛上找相关缩略图

  3. 微信小程序vedio视频全屏无法遮挡textarea

    因为textarea是原生组件,所以层级是最高的,其余组件设置z-index也是不起作用的。

    https://segmentfault.com/a/1190000019497280?utm_source=tag-newest

  4. 微信小程序神坑:本地存储图片不能超过10M!!!navigateTo跳转不能超过9次

    慎用,页面栈累计多之后,导致页面上点击事件不可用

  5. textarea在苹果手机中的大Bug

    ios下会有padding ,安卓上显示正常

    https://blog.csdn.net/weixin_33699914/article/details/88731379

  6. 勿在 scroll-view、swiper、picker-view、movable-view 中使用 video 组件(微信官方意见,一个页面最多放置3个video组件,有类似需求,提前对产品申明优化体验)</pre>

h5 开发踩坑记录

  1. 回退处理

    created() {
         this.changeHeader()
    }
    methods: {
      changeHeader (){
                let that = this
                // 回退
                that.$bridge.callNative('UI_onBackClick', '000', function (res) {
                    if (res) {
                        that.endCall = true
                    }
                })
                that.$bridge.registWebNew('JS_onBackClick', function (data, nativeCallBack) {
                    nativeCallBack(1)
                })
                if (!that.endCall) {
                    setTimeout(function () {
                        that.changeHeader()
                    }, 200)
                }
            }            
    }
    
  2. 获取手机号处理

    created(){
         this.getHasPhone()
         this.changeHeader()
    }
    methods: {
         getHasPhone () {
                    if (!this.endCall) {
                        setTimeout(() => {
                            this.getHasPhone()
                            this.getAppStatus()
                        }, 200)
                    }
                },
          getAppStatus () {
                    this.$bridge.callNative('base_userData', {}, res => {
                        if (res) {
                            this.$cookies.set('token', res)
                            getInfo().then(res => {
                                if (res.data.error_code === 0) {
                                    this.phone = res.data.data.info.phone
                                    this.endCall = true
                                }
                            })
                        }
                    })
          }
    }
    
    

上一篇 下一篇

猜你喜欢

热点阅读