diff --git a/pages/API/get-univerify-manager/get-univerify-manager.uvue b/pages/API/get-univerify-manager/get-univerify-manager.uvue index 90c68672faff1a35479c39bd00bb029409e5d91f..2d62053af216a3544768f518cb04d510ded0f736 100644 --- a/pages/API/get-univerify-manager/get-univerify-manager.uvue +++ b/pages/API/get-univerify-manager/get-univerify-manager.uvue @@ -24,10 +24,10 @@ this.univerifyManager = uni.getUniverifyManager(); // 预登录 this.univerifyManager?.preLogin({ - success() { + success: () => { console.log("pre login success"); }, - fail(err : PreLoginFail) { + fail: (err : PreLoginFail) => { console.error("pre login fail => " + JSON.stringify(err)); uni.showModal({ title: '预登录失败', diff --git a/pages/component/input/input.test.js b/pages/component/input/input.test.js index fe7fd79e05c4e00cfd8b05d4e204608141c47583..d2d3962ecd90e1be1b8b2401421e95d70d9c8dec 100644 --- a/pages/component/input/input.test.js +++ b/pages/component/input/input.test.js @@ -139,6 +139,14 @@ describe('component-native-input', () => { // await page.waitFor(500) // }) + it("cursor-color", async () => { + await page.setData({ + cursor_color: "transparent", + }) + await page.waitFor(500) + expect(await (await page.$('.uni-input-cursor-color')).property("cursor-color")).toBe("transparent") + }) + it("afterAllTestScreenshot", async () => { const image = await program.screenshot({ fullPage: true diff --git a/pages/component/input/input.uvue b/pages/component/input/input.uvue index 91017ae21f954bd22687c53d7af81d701cbebbb6..d6bf846170fb46142f7c30de43ee556b2b2d090c 100644 --- a/pages/component/input/input.uvue +++ b/pages/component/input/input.uvue @@ -77,8 +77,8 @@ - - + + 自动获取焦点 @@ -134,6 +134,15 @@ + + + + + 设置光标颜色为透明(点击生效,再点复位) + + + + @@ -218,7 +227,8 @@ showClearIcon: false, inputClearValue: '', showPassword: true, - cursor: -1, + cursor: -1, + cursor_color: "#3393E2", selectionStart: -1, selectionEnd: -1, inputEventDetail: '', @@ -290,6 +300,13 @@ }, test_check_input_value():number { return this.onMaxLengthInputValue.length + }, + changeCursorColor(){ + if(this.cursor_color == "#3393E2"){ + this.cursor_color = "transparent" + }else{ + this.cursor_color = "#3393E2" + } } } } diff --git a/pages/component/textarea/textarea.test.js b/pages/component/textarea/textarea.test.js index b8472b67058341331c646db19c8721213c2f5241..76770603b85092eb167a7447eacdc05b17de0818 100644 --- a/pages/component/textarea/textarea.test.js +++ b/pages/component/textarea/textarea.test.js @@ -61,6 +61,13 @@ describe('component-native-textarea', () => { } = await textarea.size() expect(height).toBeLessThanOrEqual(150) }) */ + it("cursor-color", async () => { + await page.setData({ + cursor_color: "transparent", + }) + await page.waitFor(500) + expect(await textarea.property("cursor-color")).toBe("transparent") + }) it("inputmode", async () => { const inputmodeEnum = await page.data("inputmode_enum") diff --git a/pages/component/textarea/textarea.uvue b/pages/component/textarea/textarea.uvue index 38c7ba2cf3c6d9b2b823d4d02effb17a1d2ff5e2..21e5590d3891108772ac95681b50c6e46ff835d6 100644 --- a/pages/component/textarea/textarea.uvue +++ b/pages/component/textarea/textarea.uvue @@ -12,7 +12,8 @@ export default { auto_focus_boolean: false, default_value:"", maxlength:-1, - inputmode_enum: [{"value":0,"name":"none"},{"value":1,"name":"text"},{"value":2,"name":"decimal"},{"value":3,"name":"numeric"},{"value":4,"name":"tel"},{"value":5,"name":"search"},{"value":6,"name":"email"},{"value":7,"name":"url"}] as ItemType[], + inputmode_enum: [{"value":0,"name":"none"},{"value":1,"name":"text"},{"value":2,"name":"decimal"},{"value":3,"name":"numeric"},{"value":4,"name":"tel"},{"value":5,"name":"search"},{"value":6,"name":"email"},{"value":7,"name":"url"}] as ItemType[], + cursor_color: "#3393E2", inputmode_enum_current: 0 } }, @@ -37,7 +38,8 @@ export default { change_auto_height_boolean(checked : boolean) { this.auto_height_boolean = checked }, change_confirm_hold_boolean(checked : boolean) { this.confirm_hold_boolean = checked }, change_focus_boolean(checked : boolean) { this.focus_boolean = checked }, - change_auto_focus_boolean(checked : boolean) { this.auto_focus_boolean = checked }, + change_auto_focus_boolean(checked : boolean) { this.auto_focus_boolean = checked }, + change_cursor_color_boolean(checked : boolean) { if(checked){ this.cursor_color = "transparent"} else {this.cursor_color = "#3393E2"}}, radio_change_inputmode_enum(checked : number) { this.inputmode_enum_current = checked } } } @@ -54,7 +56,8 @@ export default { :auto-height="auto_height_boolean" :fixed="fixed_boolean" :show-confirm-bar="show_confirm_bar_boolean" - :adjust-position="adjust_position_boolean" + :adjust-position="adjust_position_boolean" + :cursor-color="cursor_color" :inputmode="inputmode_enum[inputmode_enum_current].name" :maxlength="maxlength" @click="textarea_click" @@ -114,6 +117,11 @@ export default { :defaultValue="false" title="自动获取焦点" @change="change_auto_focus_boolean" + > +