From b94c6c8b29da6e91b999353699315c04f1ce66a4 Mon Sep 17 00:00:00 2001 From: wangxia <779219182@qq.com> Date: Wed, 12 Mar 2025 14:15:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 8 ++-- pages/login/index.js | 2 +- pages/message/index.js | 120 +++++++++++++++++++++++++++++++++++++------------ project.config.json | 2 +- 4 files changed, 99 insertions(+), 33 deletions(-) diff --git a/app.js b/app.js index 0ad1a2a..2042b90 100644 --- a/app.js +++ b/app.js @@ -9,11 +9,12 @@ App({ // ip: "https://test.renminshitang.com.cn/daotian/api_dev", // ip: 'http://localhost:8001', sessionId: "", + appId: wx.getAccountInfoSync().miniProgram.appId, headers2: { "content-type": "multipart/form-data", Authorization: "", Cookie: "", - appId: 'wxe431e0b3abd9ae0b', + appId: wx.getAccountInfoSync().miniProgram.appId, "g-open-env": 'MP_MINI', // 请求来源标识 1.小程序 2.app 3.网页 appClassify: 1, @@ -23,7 +24,7 @@ App({ "content-type": "application/json", Authorization: "", Cookie: "", - appId: 'wxe431e0b3abd9ae0b', + appId: wx.getAccountInfoSync().miniProgram.appId, "g-open-env": 'MP_MINI', appClassify: 1, // appName: encodeURIComponent('伯才') @@ -32,7 +33,7 @@ App({ "content-type": "application/x-www-form-urlencoded", Authorization: "", Cookie: "", - appId: 'wxe431e0b3abd9ae0b', + appId: wx.getAccountInfoSync().miniProgram.appId, "g-open-env": 'MP_MINI', appClassify: 1, // appName: encodeURIComponent('伯才') @@ -70,6 +71,7 @@ App({ onLaunch () { let that = this; wx.hideShareMenu(); + console.log('appId', this.globalData.appId); Array.prototype.logResult = function (data) { console.log("Array"); return data; diff --git a/pages/login/index.js b/pages/login/index.js index 4cb3855..0c5e12d 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -232,7 +232,7 @@ Page({ code: that.data.wxCode, iv: iv, encryptedData: encryptedData, - appId: 'wxe431e0b3abd9ae0b', + appId: app.globalData.appId, } }).then((res) => { app.globalData.openId = res.data.data.openId; diff --git a/pages/message/index.js b/pages/message/index.js index 37be0d0..d02fb84 100644 --- a/pages/message/index.js +++ b/pages/message/index.js @@ -28,6 +28,75 @@ Page({ content: '按偏好订阅每日接收推送', time: '下午 1:30', }, + // { + // title: '发单助手', + // url: '/subPage/todayBill/index', + // img: '../../assets/images/fadan.svg', + // content: '按偏好订阅每日接收推送', + // time: '下午 1:30', + // }, + // { + // title: '报名助手', + // url: '/subPage/todayBill/index', + // img: '../../assets/images/baoming.svg', + // content: '按偏好订阅每日接收推送', + // time: '下午 1:30', + // }, + // { + // title: '账单助手', + // url: '/subPage/todayBill/index', + // img: '../../assets/images/zhangdan.svg', + // content: '按偏好订阅每日接收推送', + // time: '下午 1:30', + // }, + // { + // title: '智能匹配助手', + // url: '/subPage/chat/index?title=智能匹配助手', + // img: '../../assets/images/chat.svg', + // content: 'AI大模型智能匹配', + // time: '下午 1:30', + // }, + + ] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + this.setData({ + messageClick: wx.getStorageSync("messageClick" + app.globalData.loginUserInfo.id), + }); + console.log(this.data.messageClick); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady () { }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow () { + // let serviceInfo = wx.getStorageSync('ServiceInfo') + this.getInfoList(); + console.log('messageTab' + typeof this.getTabBar); + if (app.globalData.appId == 'wxe431e0b3abd9ae0b') { + this.data.list = [{ + title: '平台消息', + url: '/subPage/systemMessage/index', + img: '../../assets/images/ptxx.svg', + content: '新春祝福与品牌升级', + time: '下午 2:30', + }, + { + title: '每日发单', + url: '/subPage/todayBill/index', + img: '../../assets/images/mrfd.svg', + content: '按偏好订阅每日接收推送', + time: '下午 1:30', + }, { title: '发单助手', url: '/subPage/todayBill/index', @@ -50,38 +119,30 @@ Page({ time: '下午 1:30', }, { - title: '智能匹配助手', + title: '智能匹配助手', url: '/subPage/chat/index?title=智能匹配助手', img: '../../assets/images/chat.svg', content: 'AI大模型智能匹配', time: '下午 1:30', - }, - - ] - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad (options) { - this.setData({ - messageClick: wx.getStorageSync("messageClick" + app.globalData.loginUserInfo.id), - }); - console.log(this.data.messageClick); - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady () { }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow () { - // let serviceInfo = wx.getStorageSync('ServiceInfo') - this.getInfoList(); - console.log('messageTab' + typeof this.getTabBar); + }] + } else if (app.globalData.appId == 'wxb0dea4d11428c6a5') { + this.data.list = [ + { + title: '平台消息', + url: '/subPage/systemMessage/index', + img: '../../assets/images/ptxx.svg', + content: '新春祝福与品牌升级', + time: '下午 2:30', + }, + { + title: '每日发单', + url: '/subPage/todayBill/index', + img: '../../assets/images/mrfd.svg', + content: '按偏好订阅每日接收推送', + time: '下午 1:30', + }, + ] + } if (typeof this.getTabBar === "function" && this.getTabBar()) { this.getTabBar().setData({ isShow: true, @@ -93,6 +154,7 @@ Page({ serviceInfo: app.globalData.serviceInfo, isLoading: true, messageClick: wx.getStorageSync("messageClick" + app.globalData.loginUserInfo.id), + list: this.data.list }); }, 10); }, @@ -161,8 +223,10 @@ Page({ item['pubTime'] = dateUtil.timeShow(item.publishTime); console.log(item); }); + this.data.list[0].content = res.data.data.pageBean.recordList[0].title; that.setData({ infoList: res.data.data.pageBean.recordList, + list: this.data.list }); } }) diff --git a/project.config.json b/project.config.json index 577cad2..858bc26 100644 --- a/project.config.json +++ b/project.config.json @@ -44,7 +44,7 @@ "tabIndent": "insertSpaces", "tabSize": 2 }, - "appid": "wxe431e0b3abd9ae0b", + "appid": "wxb0dea4d11428c6a5", "packOptions": { "ignore": [], "include": []