收藏
回答

为什么已经发布正常运行的小程序突然出错了,是小程序的系统修改了吗?

已经发布二年一直都在使用的小程序,只能显示第一段,后续的段落都不能显示,也没有任何提示的错误,分页显示的功能出错了,没有任何提示。应该就是小程序系统出错了,请检查一下。发现问题的手机是IPHONE12PROMAX,IOS版本26.3,相关的程序如下:

 observeAll() {

        if (no_observer)

            return

        let that = this

        this._observer = wx.createIntersectionObserver(this, {

            observeAll: true,

            thresholds: [0, 0.5, 1],

            initialRatio: 0,

            selectAll: true,

            nativeMode: true // 添加此配置项

        }).relativeTo('.scroll-view').observe('.ball , .b1all', (res) => {

            console.log('26-0 res', res);

            console.log('26-1 firstToView,',firstToView);

            console.log('26-2',)

            console.log('27',res.dataset.row);

            if (firstToView) { //第一次进来,显示首个页面 不用滚动,直接退出

                firstToView = false

                return

            }

            let row = res.dataset.row

            console.log('28', row, rowStart, rowBottom, wordsSentece.length - 1)

            if (res.intersectionRatio > 0) {

                switch (row) {

                    case 0: //首行出现,往前挪

                        moveDown()

                        break;

                    case (viewLines - 1):

                        moveUp()

                        break;

                    default:

                        break

                }

            }

        function moveDown() {

            let newStart = rowStart - delta

            let newBottom = rowBottom - delta

            if (rowStart < 10) {

                newStart = 0

                newBottom = rowBottom - rowStart

            }

            rowStart = newStart

            rowBottom = newBottom

            that.data.TheEnd = ''

            that.setDataView()

        }

        function moveUp() {

            let newStart = rowStart + delta

            let newBottom = rowBottom + delta

            if (newBottom >= (wordsSentece.length - 1)) {

                newBottom = wordsSentece.length - 1

                newStart = rowStart + (wordsSentece.length - 1) - rowBottom

                that.data.TheEnd = '--The End--'

            } else

                that.data.TheEnd = ''

            rowStart = newStart

            rowBottom = newBottom

            that.setDataView()

        }

    },

 setDataView() {

        let that = this

        let sentnces = []

        let viewwordColor = []

        for (let i = rowStart; i <= rowBottom; i++) {

            sentnces.push(wordsSentece[i])

            viewwordColor.push(wordColor[i])

        }

        this.setData({

            sentnces, // 、、正文 sentnces,每行的前面都添加了行的编号

            wordColor: viewwordColor, // 生词的颜色

            TheEnd: that.data.TheEnd,

        })

    },

回答关注问题邀请回答
收藏

2 个回答

  • 社区技术运营专员--Asher
    社区技术运营专员--Asher
    2天前

    请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    2天前
    有用
    回复 1
    • WH
      WH
      2天前
      小程序在2024年7月20日发布的,一直正常运行,现在分段显示文字的功能不能用了,应该相关wx.createIntersectionObserver的操作系统出问题了,请检查,好吗?我的手机是13823535535,方便电话沟通吗?
      2天前
      回复
  • 智能回答 智能回答 本次回答由AI生成
    星期日 18:03
    有用
    回复 1
    • WH
      WH
      2天前
      腾讯服务现在这么差劲了吗?屁智能回复糊弄,没有人工吗?
      2天前
      回复
登录 后发表内容