12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- const { async } = require("../../../utils/runtime");
- const app = getApp();
- var startX = 0;
- const minXOffset = 40;
- Page({
- /**
- * 页面的初始数据
- */
- data: {
-
- },
- /**
- * 记录手势落点坐标
- * @param {*} event
- */
- touchStart: function (event) {
- startX = event.touches[0].pageX;
- },
- /**
- * 手势结束计算偏移量并切换卡片
- * @param {*} event
- */
- touchEnd: function(event) {
- let endX = event.changedTouches[0].pageX;
- let xOffset = endX - startX;
- if (xOffset > minXOffset) {
- wx.redirectTo({
- url: '../index/index',
- })
- }
- },
- /**
- * 手势被打断重置落点坐标
- * @param {*} event
- */
- touchCancel: function(event) {
- startX = 0;
- },
- /**
- * 页面重定向
- */
- navigatePage: async function(event) {
- const page = parseInt(event.currentTarget.dataset.page)
- // 入场凭证、个人信息校验授权登录
- if(page === 0 || page === 2) {
-
- }
- // 二维码
- if(page === 0) {
- const isAuth = await app.authorization();
- if(isAuth) {
- wx.navigateTo({
- url: '../evidence/index',
- })
- }
- }
- // 商城
- if(page === 1) {
- wx.navigateToMiniProgram({
- appId: 'wx7e1594d8fd280a80',
- })
- }
- // 已登记信息
- if(page === 2) {
- const isAuth = await app.authorization();
- if(isAuth) {
- wx.navigateTo({
- url: '../letter/index?pageCode=navigation',
- })
- }
- }
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- wx.setNavigationBarTitle({
- title: '邀请函',
- })
- }
- })
|