123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import {
- getAuthorityMsg
- } from '~/api/message'
- const app = getApp()
- Page({
- data: {
- messageId: '',
- menu: {
- show: false,
- top: 0,
- left: 0
- },
- authorityMsg: {}
- },
- onLoad(options) {
- },
- onShow() {
- if (typeof this.getTabBar === 'function') {
- this.getTabBar().setData({
- selected: 3
- })
- }
- this.getAuthorityMsg()
- },
- async getAuthorityMsg() {
- let authorityMsg = await getAuthorityMsg()
- console.log(authorityMsg);
- this.setData({
- authorityMsg
- })
- },
- onLongPress(e) {
- console.log(e);
- let {
- currentTarget,
- detail,
- touches,
- target
- } = e
- let remainingW = app.globalData.windowWidth - touches[0].clientX
- let remainingH = app.globalData.windowHeight - touches[0].clientY
- let wFlag = remainingW - 145 > 0
- let hFlag = remainingH - 200 > 0
- this.setData({
- messageId: currentTarget.dataset.id,
- menu: {
- show: true,
- top: hFlag ? touches[0].clientY : touches[0].clientY - 100,
- left: wFlag ? touches[0].clientX : touches[0].clientX - 135
- }
- })
- },
- cancelMenu() {
- this.setData({
- 'menu.show': false
- })
- },
- setIsTop() {},
- delMessage() {
- this.setData({
- 'menu.show': false
- })
- },
- jump({
- currentTarget
- }) {
- wx.navigateTo({
- url: `/pages/${currentTarget.dataset.url}/index`,
- })
- }
- })
|