滑动时找不到方法是什么原因引起的?
发布于 7 年前 作者 pingmeng 2926 次浏览 来自 问答
滑动时提示,does not have a method "" to handle event,方法都写了,methods里面也放了一份,就是找不到,有谁知道是什么原因呢,谢谢!


appointPage.js代码:
(global.webpackJsonp = global.webpackJsonp || []).push([
    ["pagesReserve/appointPage/appointPage"], {
        "17bb": function (e, t, a) {
            (function (l) {
                Object.defineProperty(t, "__esModule", {
                    value: !0
                }), t.default = void 0, a("f571");
                var o = a("3a48"),
                    e = {
                        data: function () {
                            return {
                                $imgurl: this.$imgurl,
                                baseinfo: [],
                                id: 0,
                                date_: "",
                                date: "",
                                start: "",
                                table: [],
                                NowSelect: [],
                                otherSelect: [],
                                NowSelectStr: "",
                                weekday: ["", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"],
                                index1: 0,
                                index2: 0,
                                index3: 0,
                                index4: 0,
                                index5: 0,
                                selected: [],
                                seats: [],
                                navs: [],
                                navRTop: 0,
                                navbarRInitTop: 0,
                                isFixed: false,
                                lbars: [],
                                lbarsLeft: 0,
                                lbarsInitLeft: 0,
                            };
                        },
                      touchStart1: function (e) {
                        startX = e.touches[0].pageX; // 获取触摸时的原点
                        moveFlag = true;
                      },
                      // 触摸移动事件
                      touchMove1: function (e) {
                        endX = e.touches[0].pageX; // 获取触摸时的原点
                        if (moveFlag) {
                          if (endX - startX > 50) {
                            console.log("move right");
                            this.move2right();
                            moveFlag = false;
                          }
                          if (startX - endX > 50) {
                            console.log("move left");
                            this.move2left();
                            moveFlag = false;
                          }
                        }

                      },
                      // 触摸结束事件
                      touchEnd1: function (e) {
                        moveFlag = true; // 回复滑动事件

                      },
                        onPullDownRefresh: function () {
                            this.proTable(), this.getSelected(), l.stopPullDownRefresh();
                        },                        
                        onLoad: function (e) {
                            var t = this,
                                a = e.id,
                                n = e.tableid;
                            if (t.tableid = n, t.id = a, e.appoint_date) {
                                var r = new Date(e.appoint_date).getDay();
                                r = e.appoint_date + " (" + t.weekday[r] + ")";
                            }
                            var i = e.startdate ? e.startdate : o.getDates(1)[0].year + "-" + o.getDates(1)[0].month + "-" + o.getDates(1)[0].day;
                            t.start = e.startdate ? e.startdate : i, t.date_ = e.appoint_date ? e.appoint_date : i,
                                t.date = e.appoint_date ? r : i + " (" + o.getDates(parseInt(e.afterdays) + 1)[parseInt(e.afterdays)].week + ")",
                                e.NowSelectStr && (t.NowSelectStr = e.NowSelectStr), this._baseMin(this), t.proTable(),
                                t.getSelected();
                                t.fixedY('.seat_label');
                        },
                        methods: {
                            proTable: function () {
                                var o = this;
                                l.request({
                                    url: o.$baseurl + "doPageproTable",
                                    data: {
                                        tableid: o.tableid,
                                        uniacid: o.$uniacid
                                    },
                                    success: function (e) {
                                        var t = e.data.data;
                                        if (o.table = t, "" != o.NowSelectStr) {
                                            for (var a = o.NowSelectStr.split(","), n = [], r = [], i = 0; i < a.length; i++) n = a[i].split("a"),
                                                r[i] = {}, r[i].row = t.rowstr[parseInt(n[0]) - 1], r[i].column = t.columnstr[parseInt(n[1]) - 1];
                                            o.selected = r, o.NowSelect = a;
                                        }
                                        l.setNavigationBarTitle({
                                            title: e.data.data.name
                                        });
                                    },
                                    fail: function (e) {}
                                });
                            },
                            selectThis: function (e) {
                                var t = this,
                                    a = e.currentTarget.dataset.num,
                                    n = t.NowSelect;
                                n.push(a);
                                for (var r = [], i = [], o = 0; o < n.length; o++) r = n[o].split("a"), i[o] = {},
                                    i[o].row = t.table.rowstr[parseInt(r[0]) - 1], i[o].column = t.table.columnstr[parseInt(r[1]) - 1];
                                var l = n.join(",");
                                t.selected = i, t.NowSelect = n, t.NowSelectStr = l;
                            },
                            removeThis: function (e) {
                                for (var t = this, a = e.currentTarget.dataset.num, n = t.NowSelect, r = 0; r < n.length; r++) n[r] == a && n.splice(r, 1);
                                for (var i = [], o = [], l = 0; l < n.length; l++) i = n[l].split("a"), o[l] = {},
                                    o[l].row = t.table.rowstr[parseInt(i[0]) - 1], o[l].column = t.table.columnstr[parseInt(i[1]) - 1];
                                var d = n.join(",");
                                t.selected = o, t.NowSelect = n, t.NowSelectStr = d;
                            },
                            bindDateChange: function (e) {
                                for (var t = [], a = 0; a < 1; a++) {
                                    var n = o.dateLater(e.detail.value, a);
                                    t.push(n);
                                }
                                return this.date_ = e.detail.value, this.date = t[0].year + "-" + t[0].month + "-" + t[0].day + " (" + t[0].week + ")",
                                    this.getSelected(), t;
                            },
                            getSelected: function () {
                                var a = this;
                                l.request({
                                    url: a.$baseurl + "doPagegetSelected",
                                    data: {
                                        date: a.date_,
                                        id: a.id,
                                        uniacid: a.$uniacid
                                    },
                                    success: function (e) {
                                        var t = e.data.data.split(",");
                                        a.otherSelect = t;
                                    }
                                });
                          },
                          fixedY: function (o) {
                            var t = this;
                            var query = wx.createSelectorQuery()
                            setTimeout(function(){
                              query.selectAll(o).boundingClientRect(function (rect) {    
                                // console.log(rect[0].currentTarget.offsetTop)
                                console.log(rect[0].width)
                                t.seats = rect;
                                // for(var i in rect){
                                //   // var space = rect[i].offsetTop;
                                //   var space = rect[i].scrollTop;
                                //   rect[i].style.top = space + 'px';
                                //   void function () {
                                //     var goTo = 0;
                                //     var roll = setInterval(function () {
                                //       var height = document.documentElement.scrollTop + document.body.scrollTop + space;
                                //       var top = parseInt(rect[i].style.top);
                                //       if (height != top) {
                                //         goTo = height - parseInt((height - top) * 0.9);
                                //         rect[i].style.top = goTo + 'px';
                                //       }
                                //       //else{if(roll) clearInterval(roll);}
                                //     }, 1);
                                //   }()
                                // }                                
                              })
                              query.exec(function (res) {
                                console.log(res[0])
                                // that.setData({
                                //   menuTop: res[0]
                                // })
                              })
                            }, 3000)
                            
                            
                          },
                          touchStart1: function (e) {
                            startX = e.touches[0].pageX; // 获取触摸时的原点
                            moveFlag = true;
                          },
                          // 触摸移动事件
                          touchMove1: function (e) {
                            endX = e.touches[0].pageX; // 获取触摸时的原点
                            if (moveFlag) {
                              if (endX - startX > 50) {
                                console.log("move right");
                                this.move2right();
                                moveFlag = false;
                              }
                              if (startX - endX > 50) {
                                console.log("move left");
                                this.move2left();
                                moveFlag = false;
                              }
                            }

                          },
                          // 触摸结束事件
                          touchEnd1: function (e) {
                            moveFlag = true; // 回复滑动事件

                          }
                      },
                      onShow: function (e) {
                        var t = this;
                        //获取当前组件到顶部的高度
                        setTimeout(function(){
                          if (t.navbarRInitTop == 0) {

                            wx.createSelectorQuery().selectAll('.navbar_r').boundingClientRect((rect) => {
                              t.navs = rect;
                              t.navbarRInitTop = rect[0].top;
                              
                              // if (rect && rect.top > 0) {
                              //   t.nav = rect;
                              //   var navbarInitTop = rect.top;

                              //   t.navbarInitTop = navbarInitTop

                              // }

                            }).exec();

                          }
                        }, 500)

                      },

                      onPageScroll: function (e) {
                        var that = this;
                        var scrollTop = e.scrollTop;
                        var navs = that.navs;
                        for (var i in navs) {
                          //t.navs = rect[i];
                          // t.navbarInitTop[i]

                          var isSatisfy = scrollTop >= that.navbarRInitTop;
                          if (isSatisfy) {
                            void function () {
                              var goTo = 0;
                              var roll = setInterval(function () {
                                if (goTo != scrollTop) {
                                  that.navRTop = (scrollTop - that.navbarRInitTop+16) + 'px';
                                  goTo = scrollTop;
                                } else {
                                  if (roll) clearInterval(roll);
                                }
                              }, 1);
                            }()

                          }
                        }

                        // var isSatisfy = scrollTop >= that.navbarInitTop;
                        // if (isSatisfy) {
                        //   void function () {
                        //     var goTo = 0;
                        //     var roll = setInterval(function () {

                        //       if (goTo != scrollTop) {
                        //         that.navTop = scrollTop + 'px';
                        //         goTo = scrollTop;
                        //       } else {
                        //         if (roll) clearInterval(roll);
                        //       }
                        //     }, 1);
                        //   }()

                        // }
                        that.isFixed = isSatisfy

                      },
                      touchStart1: function (e) {
                        startX = e.touches[0].pageX; // 获取触摸时的原点
                        moveFlag = true;
                      },
                      // 触摸移动事件
                      touchMove1: function (e) {
                        endX = e.touches[0].pageX; // 获取触摸时的原点
                        if (moveFlag) {
                          if (endX - startX > 50) {
                            console.log("move right");
                            this.move2right();
                            moveFlag = false;
                          }
                          if (startX - endX > 50) {
                            console.log("move left");
                            this.move2left();
                            moveFlag = false;
                          }
                        }

                      },
                      // 触摸结束事件
                      touchEnd1: function (e) {
                        moveFlag = true; // 回复滑动事件

                      }
                    };
                t.default = e;
            }).call(this, a("543d").default);
        },
        2272: function (e, t, a) {},
        "95fa": function (e, t, a) {
            var n = function () {
                    this.$createElement;
                    this._self._c;
                },
                r = [];
            a.d(t, "a", function () {
                return n;
            }), a.d(t, "b", function () {
                return r;
            });
        },
        a32d: function (e, t, a) {
            var n = a("2272");
            a.n(n).a;
        },
        a4da: function (e, t, a) {
            (function (e) {
                function t(e) {
                    return e && e.__esModule ? e : {
                        default: e
                    };
                }
                a("020c"), a("921b"), t(a("66fd")), e(t(a("dee5")).default);
            }).call(this, a("543d").createPage);
        },
        dee5: function (e, t, a) {
            a.r(t);
            var n = a("95fa"),
                r = a("eb71");
            for (var i in r) "default" !== i && function (e) {
                a.d(t, e, function () {
                    return r[e];
                });
            }(i);
            a("a32d");
            var o = a("2877"),
                l = Object(o.a)(r.default, n.a, n.b, !1, null, null, null);
            t.default = l.exports;
        },
        eb71: function (e, t, a) {
            a.r(t);
            var n = a("17bb"),
                r = a.n(n);
            for (var i in n) "default" !== i && function (e) {
                a.d(t, e, function () {
                    return n[e];
                });
            }(i);
            t.default = r.a;
        }
    },
    [
        ["a4da", "common/runtime", "common/vendor"]
    ]

]);

回到顶部