|
@@ -1,6 +1,7 @@
|
|
|
// pages/meeting-cover/meeting-cover.js
|
|
|
const app = getApp();
|
|
|
const util = require('../../utils/util.js');
|
|
|
+
|
|
|
Page({
|
|
|
|
|
|
/**
|
|
@@ -11,18 +12,36 @@ Page({
|
|
|
location: '重庆市城市管理局会议厅1楼105会议室',
|
|
|
title: '',
|
|
|
receptionTime: '',
|
|
|
- item: {}
|
|
|
+ item: {},
|
|
|
+ showBack: true,
|
|
|
+ showPart1: true,
|
|
|
+ showPart2: false,
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
- let item = JSON.parse(options.item);
|
|
|
- this.setData({
|
|
|
- item: item,
|
|
|
- title: item.title,
|
|
|
- receptionTime: util.formatDate(item.receptionTime, 'yyyy年MM月dd日 HH:mm'),
|
|
|
+ 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
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -72,7 +91,21 @@ Page({
|
|
|
* 用户点击右上角分享
|
|
|
*/
|
|
|
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'
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -91,6 +124,81 @@ Page({
|
|
|
wx.navigateBack({
|
|
|
delta: -1,
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 触摸开始事件
|
|
|
+ */
|
|
|
+ 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,
|
|
|
+ });
|
|
|
+ },
|
|
|
})
|