//index.js //获取应用实例 const app = getApp() var util = require("../../../utils/util.js") Page({ data: { lastX: 0, //滑动开始x轴位置 lastY: 0, //滑动开始y轴位置 text: "没有滑动", currentGesture: 0, //标识手势 animationData: {}, arr: [], loaddisplay: true }, onLoad: function(option) { console.log(option) let _this = this; let branche_code = wx.getStorageSync('branche_code'); util.postData(`/getPackageLists?p_branches=${branche_code}&p_type=${option.id}`).then(res => { _this.setData({ arr: res, loaddisplay: 'none' }) }) _this.setData({ navH: app.globalData.navHeight }) }, hrefPackagedetail: function(e) { wx.navigateTo({ url: '/pages/packages/packagedetail/packagedetail?p_id=' + e.currentTarget.dataset.id + '¶=' + e.currentTarget .dataset.pcode }) }, onShareAppMessage: function() { return { title: '悦所-套餐列表', path: '/pages/index/index?skip=1&path=/pages/packages/packages' } }, handletouchmove: function(event) { // var currentX = event.touches[0].pageX // var currentY = event.touches[0].pageY // var tx = currentX - this.data.lastX // var ty = currentY - this.data.lastY // var text = "" // //左右方向滑动 // if (Math.abs(tx) > Math.abs(ty)) {} // //上下方向滑动 // else { // // 向上滑动 // // var animation = wx.createAnimation({ // duration: 500, // timingFunction: 'linear', // }) // this.animation = animation // animation.opacity(0).step() // this.setData({ // animationData: animation.export() // }) // } // //将当前坐标进行保存以进行下一次计算 // this.data.lastX = currentX // this.data.lastY = currentY }, handletouchtart: function(event) { // this.data.lastX = event.touches[0].pageX // this.data.lastY = event.touches[0].pageY }, hrefDiff: function(event) { wx.navigateTo({ url: '/pages/packages/diffpackagedetail/diffpackagedetail?pid=' + event.currentTarget.dataset.pcode }) }, //滑动结束事件 handletouchend: function(event) { // this.data.currentGesture = 0; // //滑动结束 // var animation = wx.createAnimation({ // delay: 500, // duration: 500, // timingFunction: 'linear', // }) // this.animation = animation // animation.opacity(1).step() // this.setData({ // animationData: animation.export() // }) } })