diff --git a/weapp/pages/diary_edit/diary_edit.js b/weapp/pages/diary_edit/diary_edit.js
index 370a74c..446378f 100644
--- a/weapp/pages/diary_edit/diary_edit.js
+++ b/weapp/pages/diary_edit/diary_edit.js
@@ -64,7 +64,9 @@ Page({
},
onContentInput: function(e) {
var val = e.detail.value || '';
- this.setData({ 'form.content': val, contentLength: val.length });
+ // 正文只存于逻辑层,避免每次敲字回传长文本影响原生输入。
+ this.data.form.content = val;
+ this.setData({ contentLength: val.length });
},
chooseImages: function() {
diff --git a/weapp/pages/diary_edit/diary_edit.wxml b/weapp/pages/diary_edit/diary_edit.wxml
index 5cce164..6fb8446 100644
--- a/weapp/pages/diary_edit/diary_edit.wxml
+++ b/weapp/pages/diary_edit/diary_edit.wxml
@@ -15,7 +15,7 @@
{{contentLength}}/5000
-
+
diff --git a/weapp/pages/diary_edit/diary_edit.wxss b/weapp/pages/diary_edit/diary_edit.wxss
index a5c5aa9..e9d7497 100644
--- a/weapp/pages/diary_edit/diary_edit.wxss
+++ b/weapp/pages/diary_edit/diary_edit.wxss
@@ -141,8 +141,8 @@ page { background: linear-gradient(180deg, #FDE4EC 0%, #FFF0F5 48%, #FFF7FA 100%
@import '../../styles/journal.wxss';
-/* 长正文在输入框内滚动,避免输入时整页不断增高。 */
-textarea.diary-editor { height:420rpx; min-height:420rpx; box-sizing:border-box; }
+/* 正文随输入增高,长文由外层页面滚动,避免嵌套原生输入框滚动。 */
+textarea.diary-editor { min-height:420rpx; box-sizing:border-box; }
@import '../../styles/button-theme.wxss';
diff --git a/weapp/pages/publish/publish.js b/weapp/pages/publish/publish.js
index 8cc041f..9050645 100644
--- a/weapp/pages/publish/publish.js
+++ b/weapp/pages/publish/publish.js
@@ -259,7 +259,9 @@ Page({
onDateInput: function(e) { this.setData({ 'form.date': e.detail.value }); this._saveDraft(); },
onContentInput: function(e){
var val = e.detail.value || '';
- this.setData({ 'form.content': val, contentLength: val.length });
+ // 正文只存于逻辑层,避免每次敲字回传长文本影响原生输入。
+ this.data.form.content = val;
+ this.setData({ contentLength: val.length });
this._saveDraft();
},
onLocationInput: function(e){ this.setData({ 'form.location': e.detail.value }); this._saveDraft(); },
diff --git a/weapp/pages/publish/publish.wxml b/weapp/pages/publish/publish.wxml
index a32c2b8..43e73ab 100644
--- a/weapp/pages/publish/publish.wxml
+++ b/weapp/pages/publish/publish.wxml
@@ -101,7 +101,7 @@
{{contentLength}}/5000
-
+
diff --git a/weapp/pages/publish/publish.wxss b/weapp/pages/publish/publish.wxss
index 84df27f..f11e995 100644
--- a/weapp/pages/publish/publish.wxss
+++ b/weapp/pages/publish/publish.wxss
@@ -207,8 +207,8 @@ page { background: linear-gradient(180deg, #FDE4EC 0%, #FFF0F5 48%, #FFF7FA 100%
@import '../../styles/journal.wxss';
-/* 长正文在输入框内滚动,避免输入时整页不断增高。 */
-textarea.diary-editor { height:420rpx; min-height:420rpx; box-sizing:border-box; }
+/* 正文随输入增高,长文由外层页面滚动,避免嵌套原生输入框滚动。 */
+textarea.diary-editor { min-height:420rpx; box-sizing:border-box; }
@import '../../styles/button-theme.wxss';
diff --git a/weapp/tests/diary-input.test.cjs b/weapp/tests/diary-input.test.cjs
index 20ea9b9..7fcf239 100644
--- a/weapp/tests/diary-input.test.cjs
+++ b/weapp/tests/diary-input.test.cjs
@@ -1,6 +1,7 @@
const test=require('node:test');
const assert=require('node:assert/strict');
const path=require('node:path');
+const fs=require('node:fs');
const createLoader=require('./load-module.cjs');
function setup(file,api={}) {
let definition,id=0;const timers=new Map(),storage=new Map(),writes=[];
@@ -15,6 +16,18 @@ test('diary input continues past 100 characters and never rewrites the native te
e.patches.length=0;
for(const length of [100,101,140,1000,5000]){const value='字'.repeat(length);e.page.onContentInput({detail:{value}});assert.equal(e.page.data.form.content,value);assert.equal(e.page.data.contentLength,length);}
assert.ok(e.patches.every(patch=>!('editorContent' in patch)));
+ assert.ok(e.patches.every(patch=>!('form.content' in patch)));
+ }
+});
+test('both diary templates explicitly allow 5000 characters and grow with long text',()=>{
+ for(const file of ['publish/publish','diary_edit/diary_edit']){
+ const base=path.join(__dirname,'../pages',file);
+ const template=fs.readFileSync(base+'.wxml','utf8');
+ const editor=template.match(/