123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- // pages/meeting-cover/meeting-cover.js
- const app = getApp();
- const util = require('../../utils/util.js');
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- imgPath: app.globalData.imgPath,
- location: '重庆市城市管理局会议厅1楼105会议室',
- title: '',
- receptionTime: '',
- item: {},
- showBack: true,
- showPart1: true,
- showPart2: false,
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- let that = this;
- console.info(options)
- if (options) {
- that.setData({
- id: options.id
- });
- }
- util.get({
- url: '/api/meeting/info/getByIdNotAuth?id=' + options.id,
- success: (res) => {
- wx.hideLoading();
- console.info('res', res);
- // util.toast(JSON.stringify(res))
- let datas = res.data.data;
- that.setData({
- title: datas.title,
- receptionTime: util.formatDate(datas.receptionTime, 'yyyy年MM月dd日 HH:mm'),
- receptionContent: datas.receptionContent
- });
- }
- });
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- // util.toast('点击分享');
- let that = this;
- that.setData({
- showBack: false
- });
- setTimeout(() => {
- that.setData({
- showBack: true
- });
- }, 10000);
- return {
- title: '会议分享',
- path: '/pages/meeting-cover/meeting-cover?id=' + that.data.id,
- // imageUrl: '/images/call2x.png'
- }
- },
- /**
- * 触摸开始事件
- */
- touchStart: function (e) {
- this.setData({
- moveFlag: true,
- startY: e.touches[0].pageY,
- });
- },
- /**
- * 触摸移动事件
- */
- touchMove: function (e) {
- let that = this;
- let endY = e.touches[0].pageY;
- let startY = that.data.startY;
- if (that.data.moveFlag) {
- // 下滑
- if (endY - startY > 50) {
- console.log("pullDown")
- that.setData({
- moveFlag: false,
- });
- if (!that.data.showPart1 && that.data.showPart2) {
- let ani = wx.createAnimation({
- delay: 0,
- duration: 1000,
- });
- ani.opacity(0.5).step();
- that.setData({
- showPart1: true,
- showPart2: false,
- ani: ani.export()
- });
- ani.opacity(1).step();
- that.setData({
- ani: ani.export()
- });
- }
- }
- // 上滑
- if (startY - endY > 50) {
- console.log("pullup")
- that.setData({
- moveFlag: false,
- });
- if (that.data.showPart1 && !that.data.showPart2) {
- let ani = wx.createAnimation({
- delay: 0,
- duration: 1000,
- });
- ani.opacity(0.5).step();
- that.setData({
- showPart1: false,
- showPart2: true,
- ani: ani.export()
- });
- ani.opacity(1).step();
- that.setData({
- ani: ani.export()
- });
- }
- }
- }
- },
- /**
- * 触摸结束事件
- */
- touchEnd: function (e) {
- this.setData({
- moveFlag: true,
- });
- },
- })
|