|
@@ -68,7 +68,8 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="hallDetailInput" style="text-align:center">
|
|
|
- <wang-editor v-model="content" style="height:130px;padding-bottom:120px"></wang-editor>
|
|
|
+ <wang-editor v-model="content" style="height:130px;padding-bottom:120px" v-if="sending"></wang-editor>
|
|
|
+ <wang-editor v-model="text" style="height:130px;padding-bottom:120px" v-else></wang-editor>
|
|
|
<el-button type="primary" @click="sendMessage">发送</el-button>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
@@ -117,6 +118,8 @@ export default {
|
|
|
info: {},
|
|
|
buyerList: [],
|
|
|
sellerList: [],
|
|
|
+ sending: true,
|
|
|
+ text: '',
|
|
|
}),
|
|
|
created() {
|
|
|
this.search();
|
|
@@ -139,6 +142,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async sendMessage() {
|
|
|
+ // this.$set(this, `sending`, false);
|
|
|
if (!this.user.uid) {
|
|
|
this.$message.error('游客不能发言,请先注册');
|
|
|
return;
|
|
@@ -147,8 +151,11 @@ export default {
|
|
|
let object = { number: this.id, sender_name: this.user.name, content: this.content };
|
|
|
if (this.user.uid) object.sender_id = this.user.uid;
|
|
|
let res = await this.create(object);
|
|
|
+ this.$set(this, `content`, '');
|
|
|
+ this.$forceUpdate();
|
|
|
this.$checkRes(res, null, res.errmsg || '发言失败');
|
|
|
} else this.$message.error('请输入信息后发送');
|
|
|
+ this.$set(this, `sending`, true);
|
|
|
},
|
|
|
channel() {
|
|
|
this.$stomp({
|
|
@@ -163,7 +170,6 @@ export default {
|
|
|
let is_seller = this.sellerList.find(f => f.user_id == body.sender_id);
|
|
|
if (is_seller) this.mainTalk.push({ id: body._id, sender_name: body.sender_name, send_time: body.send_time, content: body.content });
|
|
|
else this.otherTalk.push({ id: body._id, sender_name: body.sender_name, send_time: body.send_time, content: body.content });
|
|
|
- this.content = '';
|
|
|
}
|
|
|
},
|
|
|
},
|