|
@@ -11,22 +11,34 @@ Page({
|
|
|
keyboardHeight: 0,
|
|
keyboardHeight: 0,
|
|
|
isIOS: false,
|
|
isIOS: false,
|
|
|
showRichText: '', //富文本文件
|
|
showRichText: '', //富文本文件
|
|
|
|
|
+ isDisabled: false, //只读
|
|
|
},
|
|
},
|
|
|
readOnlyChange() {
|
|
readOnlyChange() {
|
|
|
this.setData({
|
|
this.setData({
|
|
|
readOnly: !this.data.readOnly
|
|
readOnly: !this.data.readOnly
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- onLoad(options) {
|
|
|
|
|
- console.log(options)
|
|
|
|
|
- this.setData({
|
|
|
|
|
- showRichText: "<p>asdasdsdgss<img src=\"https://bwj.obs.cn-east-2.myhuaweicloud.com:443/202201061641468934405B8cac64d.png\" width=\"80%\" data-custom=\"id=535&role=god\"></p><p><br></p>"
|
|
|
|
|
|
|
+ /* 回调 */
|
|
|
|
|
+ callBack() {
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: '保存成功',
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
|
|
+ this.getOpenerEventChannel().emit('richTextCallBack', {
|
|
|
|
|
+ richText: this.data.showRichText
|
|
|
|
|
+ })
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ wx.navigateBack()
|
|
|
|
|
+ }, 500);
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoad(options) {
|
|
|
|
|
+ let isDisabled = false;
|
|
|
|
|
+ if (wx.getStorageSync('userData').fisadministrator == 1) isDisabled = true;
|
|
|
const platform = wx.getSystemInfoSync().platform
|
|
const platform = wx.getSystemInfoSync().platform
|
|
|
const isIOS = platform === 'ios'
|
|
const isIOS = platform === 'ios'
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- isIOS
|
|
|
|
|
|
|
+ isIOS,
|
|
|
|
|
+ showRichText: decodeURIComponent(options.fintroduction),
|
|
|
|
|
+ isDisabled
|
|
|
})
|
|
})
|
|
|
const that = this
|
|
const that = this
|
|
|
this.updatePosition(0)
|
|
this.updatePosition(0)
|
|
@@ -73,7 +85,6 @@ Page({
|
|
|
onEditorReady() {
|
|
onEditorReady() {
|
|
|
const that = this
|
|
const that = this
|
|
|
wx.createSelectorQuery().select('#editor').context(function (res) {
|
|
wx.createSelectorQuery().select('#editor').context(function (res) {
|
|
|
- console.log(res)
|
|
|
|
|
that.editorCtx = res.context
|
|
that.editorCtx = res.context
|
|
|
that.editorCtx.setContents({
|
|
that.editorCtx.setContents({
|
|
|
html: that.data.showRichText //将数据写入编辑器内
|
|
html: that.data.showRichText //将数据写入编辑器内
|
|
@@ -83,6 +94,7 @@ Page({
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
compileText(e) {
|
|
compileText(e) {
|
|
|
|
|
+ console.log(e.detail.html)
|
|
|
this.setData({
|
|
this.setData({
|
|
|
showRichText: e.detail.html
|
|
showRichText: e.detail.html
|
|
|
})
|
|
})
|
|
@@ -200,7 +212,7 @@ Page({
|
|
|
id: res.data[0].tattachmentid,
|
|
id: res.data[0].tattachmentid,
|
|
|
role: 'god'
|
|
role: 'god'
|
|
|
},
|
|
},
|
|
|
- width: '80%',
|
|
|
|
|
|
|
+ /* width: '80%', */
|
|
|
success: function () {
|
|
success: function () {
|
|
|
console.log('insert image success')
|
|
console.log('insert image success')
|
|
|
}
|
|
}
|