diff --git a/pages_order/record/articleSharing.vue b/pages_order/record/articleSharing.vue index 5d18aba..070e5f8 100644 --- a/pages_order/record/articleSharing.vue +++ b/pages_order/record/articleSharing.vue @@ -83,13 +83,22 @@ - + - + + + + + + {{ `${descLen}/${descLengthLimit}` }} + + @@ -129,6 +138,8 @@ // todo }, editorCtx: null, + descLen: 0, + descLengthLimit: 1000, } }, methods: { @@ -137,23 +148,57 @@ this.editorCtx = res.context }).exec() }, + onEditroInput(e) { + const { text } = e.detail + + this.descLen = text?.length || 0 + }, insertImage() { uni.chooseImage({ count: 1, success: (res) => { - this.editorCtx.insertImage({ - src: res.tempFilePaths[0], - alt: '图像', - }) + // this.editorCtx.insertImage({ + // src: res.tempFilePaths[0], + // alt: '图像', + // }) + + // todo: check + this.$Oss.ossUpload(res.tempFilePaths[0]).then(url => { + this.editorCtx.insertImage({ + src: url, + alt: '图像', + }) + }) } }) }, - onSubmit() { - // todo + getEditroContents() { + return new Promise((resolve, reject) => { + this.editorCtx.getContents({ + success: (e) => { + const { html, text } = e + resolve({ html, text }) + }, + fail: () => { + reject() + } + }) + }) + }, + async onSubmit() { + try { + + const description = (await this.getEditroContents())?.html + // todo: decode? - const params = { ...this.form } + const params = { ...this.form, description } - this.$api('submitPersonalSharing', params) + // todo + + this.$api('submitPersonalSharing', params) + } catch (err) { + + } }, } } @@ -163,8 +208,24 @@ \ No newline at end of file diff --git a/pages_order/static/record/icon-add.png b/pages_order/static/record/icon-add.png new file mode 100644 index 0000000..32a1792 Binary files /dev/null and b/pages_order/static/record/icon-add.png differ