From 4b32d4c7d2300d5d7cf10d711d7e9e79957bdf23 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Fri, 15 Oct 2021 14:12:01 +0800 Subject: [PATCH] no message --- pages/mall/search-list/index.js | 11 ++++++++++- pages/mall/search-list/index.json | 3 ++- pages/mall/search-list/index.wxml | 13 ++++++++++++- pages/moment/moment-item/index.js | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/pages/mall/search-list/index.js b/pages/mall/search-list/index.js index ef1f2d1..142ead0 100644 --- a/pages/mall/search-list/index.js +++ b/pages/mall/search-list/index.js @@ -2,6 +2,7 @@ import { getFactoryPrice, getProxyOrderList } from "../../../api/ztb" import { getPreferList, getInformationList } from "../../../api/moment" const storage = require('../../../utils/storage') const util = require('../../../utils/util') +const event = require('../../../utils/event') const tdsdk = require('../../../libs/tdweapp.js') const app = getApp() const limit = 8 @@ -27,7 +28,8 @@ Page({ requesting: false, finished: false, dataIndex: 0, - taskList: [] + taskList: [], + visible: false }, /** * 生命周期函数--监听页面加载 @@ -49,6 +51,12 @@ Page({ this.setData({searchList: rearchStringList, keyIndex: 0 }) } } + event.on('EventMessage', this, this.onEvent) + }, + onEvent: function (message) { + if(message.what == 223){ + this.setData({ visible: true }) + } }, flodKeybord: function(){ if(this.data.keyIndex > 0 && this.data.keyIndex == 2){ @@ -232,6 +240,7 @@ Page({ }, onUnload: function() { tdsdk.Page.onUnload() + event.remove('EventMessage', this) if(rearchStringList.length){ storage.put('mall-search', rearchStringList.toString()) } diff --git a/pages/mall/search-list/index.json b/pages/mall/search-list/index.json index 960b2e7..9d15b07 100644 --- a/pages/mall/search-list/index.json +++ b/pages/mall/search-list/index.json @@ -6,6 +6,7 @@ "info-item": "/pages/moment/info-item/index", "order-item": "/pages/agent/order-item/index", "agent-item": "/pages/agent/agent-item/index", - "moment-item": "/pages/moment/moment-item/index" + "moment-item": "/pages/moment/moment-item/index", + "wux-popup": "/components/popup/index" } } \ No newline at end of file diff --git a/pages/mall/search-list/index.wxml b/pages/mall/search-list/index.wxml index 397b409..55304c2 100644 --- a/pages/mall/search-list/index.wxml +++ b/pages/mall/search-list/index.wxml @@ -63,4 +63,15 @@ - \ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/pages/moment/moment-item/index.js b/pages/moment/moment-item/index.js index 99ebbdb..d40d1ba 100644 --- a/pages/moment/moment-item/index.js +++ b/pages/moment/moment-item/index.js @@ -27,7 +27,7 @@ Component({ return } if(this.data.item.isCooperate === 1 && !app.globalData.userInfo.isVIP) { - event.emit('EventMessage', {what: 223, desc: 'Logout'}) + event.emit('EventMessage', {what: 223, desc: 'needvip'}) return } this.setData({ unflod: !this.data.unflod })