diff --git a/pages/contact/index.js b/pages/contact/index.js index a1a3f47..b8ae3e0 100644 --- a/pages/contact/index.js +++ b/pages/contact/index.js @@ -169,10 +169,13 @@ Page({ // 解析消息内容 if (typeof item.content === 'string') { try { - item.content = JSON.parse(item.content); + const text = JSON.parse(item.content) + item.content = { + message: text.message || text.messages + }; } catch (e) { console.warn('消息内容解析失败:', item.content); - item.content = { messages: item.content }; + item.content = { message: item.content }; } } @@ -406,7 +409,7 @@ Page({ const msg = { id, content: { - messages: welcomeText + message: welcomeText }, "msg_type": 1, receiver_id: '', @@ -433,7 +436,7 @@ Page({ request('app/send_message', 'POST', { "app_id": accountInfo.miniProgram.appId, "content": JSON.stringify({ - messages: welcomeText + message: welcomeText }), "from_user_id": userInfo.openid, "from_user_name": userInfo.user_name, @@ -470,7 +473,7 @@ Page({ const msg = { id, content: { - messages: text + message: text }, "msg_type": 1, receiver_id: '', @@ -492,7 +495,7 @@ Page({ request('app/send_message', 'POST', { "app_id": accountInfo.miniProgram.appId, "content": JSON.stringify({ - messages: text + message: text }), "from_user_id": userInfo.openid, "from_user_name": userInfo.user_name, @@ -550,7 +553,7 @@ Page({ msg_type: '2', receiver_id: '', content: { - messages: tempFilePaths[0] + message: tempFilePaths[0] }, sender_id: userInfo.openid, sender_name: userInfo.user_name, @@ -574,7 +577,7 @@ Page({ request('app/send_message', 'POST', { "app_id": accountInfo.miniProgram.appId, "content": JSON.stringify({ - messages: res + message: res }), "from_user_id": userInfo.openid, "from_user_name": userInfo.user_name, @@ -617,7 +620,7 @@ Page({ // _ts: replyNow // }; // that.setData({ - // messages: that.data.messages.concat(reply) + // message: that.data.messages.concat(reply) // }); // setTimeout(() => { // that.setData({ diff --git a/pages/contact/index.wxml b/pages/contact/index.wxml index 6ea8533..c89bcfc 100644 --- a/pages/contact/index.wxml +++ b/pages/contact/index.wxml @@ -20,10 +20,10 @@ - {{item.content.messages}} + {{item.content.message}} - + diff --git a/project.config.json b/project.config.json index 6b7fbb2..5f47c1b 100644 --- a/project.config.json +++ b/project.config.json @@ -4,7 +4,7 @@ "useSummer": true }, "appid": "wx26ad074017e1e63f", - "libVersion": "3.9.2", + "libVersion": "3.10.3", "setting": { "es6": true, "postcss": false, diff --git a/project.private.config.json b/project.private.config.json index af6a3b7..0264e10 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -28,13 +28,6 @@ "query": "url=1", "scene": null, "launchMode": "default" - }, - { - "name": "pages/index/detail", - "pathName": "pages/index/detail", - "query": "url=1", - "launchMode": "default", - "scene": null } ] }