123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- const app = require('../../utils/util.js');
- const tools = require('../../utils/tools.js');
- Page({
- data: {
- active: 0,
- wdArr: [],
- ydArr: [],
- showNull: false,
- showNull1: false
- },
- getArr(sessionKey) {
- wx.request({
- url: app.globalData.publicUrl + '/wx/eduNoticeSee/list',
- method: "post",
- data: {
- sessionKey: sessionKey,
- isSee: 1,
- isNotice: 0
- },
- success: (res) => {
- console.log(res);
- if (res.data.code == 0) {
- if (res.data.list.length !== 0) {
- this.setData({
- showNull: false,
- wdArr: res.data.list
- })
- } else {
- this.setData({
- wdArr: res.data.list,
- showNull: true
- })
- }
- } else {
- this.setData({
- showNull: true
- })
- }
- },
- fail: () => {
- this.setData({
- showNull: true
- })
- }
- })
- },
- getArr1(sessionKey) {
- wx.request({
- url: app.globalData.publicUrl + '/wx/eduNoticeSee/list',
- method: "post",
- data: {
- sessionKey: sessionKey,
- isSee: 0,
- isNotice: 0
- },
- success: (res) => {
- if (res.data.code == 0) {
- if (res.data.list.length !== 0) {
- this.setData({
- showNull1: false,
- ydArr: res.data.list
- })
- } else {
- this.setData({
- ydArr: res.data.list,
- showNull1: true
- })
- }
- } else {
- this.setData({
- showNull1: true
- })
- }
- },
- fail: () => {
- this.setData({
- showNull1: true
- })
- }
- })
- },
- async onChange(event) {
- if (event.detail.index == 1) {
- const sessionKey = await tools.checkSessionAndLogin();
- this.getArr1(sessionKey);
- }
- },
- meRead(sessionKey, noticeId) {
- wx.request({
- url: app.globalData.publicUrl + '/wx/eduNoticeSee/edit',
- method: "post",
- data: {
- sessionKey: sessionKey,
- isSee: 0,
- noticeId: noticeId
- },
- success: () => {
- this.getArr(sessionKey)
- }
- })
- },
- async btn(e) {
- let noticeId = e.currentTarget.dataset.item.noticeId;
- const sessionKey = await tools.checkSessionAndLogin();
- this.meRead(sessionKey, noticeId);
- },
- async onLoad() {
- const sessionKey = await tools.checkSessionAndLogin();
- this.getArr(sessionKey);
- }
- })
|