|
|
@@ -71,7 +71,7 @@
|
|
|
</div>
|
|
|
<div class="input-area">
|
|
|
<div class="quick-group">
|
|
|
- <div class="emoji-item" @click="showEmoji">
|
|
|
+ <div class="emoji-item">
|
|
|
<el-popover placement="top" :width="400" trigger="click">
|
|
|
<template #reference>
|
|
|
<div class="item-btn">
|
|
|
@@ -93,11 +93,16 @@
|
|
|
</div>
|
|
|
</el-popover>
|
|
|
</div>
|
|
|
- <div class="emoji-item" @click="showUpload">
|
|
|
- <div class="item-btn">
|
|
|
- <el-image style="width:25px;height:25px;" src="https://jymini.oss-cn-guangzhou.aliyuncs.com/pc/more.svg"></el-image>
|
|
|
- <div class="name">图片</div>
|
|
|
- </div>
|
|
|
+ <div class="emoji-item">
|
|
|
+ <el-popover placement="top" :width="174">
|
|
|
+ <template #reference>
|
|
|
+ <div class="item-btn">
|
|
|
+ <el-image style="width:25px;height:25px;" src="https://jymini.oss-cn-guangzhou.aliyuncs.com/pc/more.svg"></el-image>
|
|
|
+ <div class="name">图片</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <sc-upload v-model="uploadImg" :on-success="uploadSuccess"></sc-upload>
|
|
|
+ </el-popover>
|
|
|
</div>
|
|
|
<div class="emoji-item" @click="showQuick">
|
|
|
<div class="item-btn">
|
|
|
@@ -105,18 +110,37 @@
|
|
|
<div class="name">快捷回复</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="emoji-item" @click="showQuick">
|
|
|
- <div class="item-btn">
|
|
|
- <el-image style="width:26px;height:26px;" src="https://jymini.oss-cn-guangzhou.aliyuncs.com/pc/money.svg"></el-image>
|
|
|
- <div class="name">补差价</div>
|
|
|
- </div>
|
|
|
+ <div class="emoji-item">
|
|
|
+ <el-popover placement="top" :width="300" trigger="click">
|
|
|
+ <template #reference>
|
|
|
+ <div class="item-btn">
|
|
|
+ <el-image style="width:26px;height:26px;" src="https://jymini.oss-cn-guangzhou.aliyuncs.com/pc/money.svg"></el-image>
|
|
|
+ <div class="name">补差价</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <el-form :model="priceForm" :rules="rules" ref="priceForm" label-position="top">
|
|
|
+ <el-form-item label="名称" prop="name" class="label-item">
|
|
|
+ <el-input v-model="priceForm.name" placeholder="请输入" clearable />
|
|
|
+ <div class="el-form-item-msg"></div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="差价金额" prop="price" class="label-item">
|
|
|
+ <el-input v-model="priceForm.price" placeholder="请输入" clearable>
|
|
|
+ <template #append>元</template>
|
|
|
+ </el-input>
|
|
|
+ <div class="el-form-item-msg"></div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" :loading="isSaveing" @click="submitPrice()">确定发送</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-popover>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
:rows="3"
|
|
|
v-model="inputMessage"
|
|
|
- placeholder="请输入消息...按 Ctrl+Enter 换行"
|
|
|
+ placeholder="请输入消息..."
|
|
|
@keyup.enter.native="handleKeyCode"
|
|
|
@keydown.native="handleKeyCode"
|
|
|
></el-input>
|
|
|
@@ -174,7 +198,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="order-page">
|
|
|
- <el-pagination :default-page-size="msgSize" small layout="prev, pager, next" @size-change="orderPageChange" @current-change="orderPageChange" :total="orderTotal" :hide-on-single-page="true" />
|
|
|
+ <el-pagination :default-page-size="orderSize" small layout="prev, pager, next" @size-change="orderPageChange" @current-change="orderPageChange" :total="orderTotal" :hide-on-single-page="true" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="order-list-chat" v-else>
|
|
|
@@ -215,6 +239,18 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ rules:{
|
|
|
+ name: [
|
|
|
+ {required: true, message: '请输入'}
|
|
|
+ ],
|
|
|
+ price: [
|
|
|
+ {required: true, message: '请输入'}
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ priceForm:{
|
|
|
+ name:"补差价"
|
|
|
+ },
|
|
|
+ uploadImg:"",
|
|
|
loadMsg:false,
|
|
|
history: {
|
|
|
messages: [],
|
|
|
@@ -237,14 +273,25 @@ export default {
|
|
|
page:1,
|
|
|
size:10,
|
|
|
msgPage:1,
|
|
|
- msgSize:10,
|
|
|
+ msgSize:20,
|
|
|
+ orderSize:10,
|
|
|
chatContact:[],
|
|
|
checkChat:null,
|
|
|
chatItem:null,
|
|
|
emojiList:[],
|
|
|
sendId:null,
|
|
|
myid: this.user.userId,
|
|
|
- userId:null
|
|
|
+ userId:null,
|
|
|
+ isSaveing:false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ chatItem(val){
|
|
|
+ if (val) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.messageListRef?.addEventListener('scroll', this.handleScroll)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
computed: mapState({
|
|
|
@@ -277,8 +324,30 @@ export default {
|
|
|
// if (this.timer) {
|
|
|
// clearInterval(this.timer)
|
|
|
// }
|
|
|
+ this.$refs.messageListRef.removeEventListener('scroll', this.handleScroll)
|
|
|
},
|
|
|
methods: {
|
|
|
+ async submitPrice(){
|
|
|
+ var { priceForm,message } = this;
|
|
|
+ var validate = await this.$refs.priceForm.validate().catch(()=>{});
|
|
|
+ if(!validate){ return false }
|
|
|
+ this.isSaveing = true;
|
|
|
+ priceForm.type = "pay";
|
|
|
+ priceForm.groupId = this.chatItem.poi_id
|
|
|
+ priceForm.openid = this.chatItem.openid
|
|
|
+ var resp = await this.$API.chat.price.post(priceForm);
|
|
|
+ this.isSaveing = false;
|
|
|
+ if (resp.code == 0) {
|
|
|
+ return $message.error(resp.msg)
|
|
|
+ }
|
|
|
+ this.sendMessageData({
|
|
|
+ payload: {
|
|
|
+ pay: resp.data,
|
|
|
+ },
|
|
|
+ type: 'pay'
|
|
|
+ });
|
|
|
+ this.uploadImg = "";
|
|
|
+ },
|
|
|
orderPageChange(e){
|
|
|
this.orderPage = e;
|
|
|
this.getOrderList()
|
|
|
@@ -296,6 +365,7 @@ export default {
|
|
|
const { scrollTop, clientHeight, scrollHeight } = e.target
|
|
|
const isBottom = scrollTop + clientHeight >= scrollHeight - 5 // 5px 缓冲区
|
|
|
const isTop = scrollTop <= 5
|
|
|
+ console.log("滚动",this.history.allLoaded)
|
|
|
if (isBottom && !this.history.allLoaded) {
|
|
|
console.log('到达底部')
|
|
|
// 加载更多等操作
|
|
|
@@ -345,7 +415,7 @@ export default {
|
|
|
* @param data
|
|
|
*/
|
|
|
async sendOrder(data){
|
|
|
- var orderData = {"img":data.img,"name":data.product.product_name,"goods_id":data.life_goods_id,"order":data.out_order_no,"price":data.pay_money,"status":data.status};
|
|
|
+ var orderData = {"img":data.img,"name":data.product.product_name,"goods_id":data.life_goods_id,"order":data.out_order_no,"price":this.$TOOL.disMoney(data.pay_money),"status":data.status};
|
|
|
var resp = await this.sendMessageApi("order",orderData);
|
|
|
if (!resp) {
|
|
|
return ;
|
|
|
@@ -595,6 +665,25 @@ export default {
|
|
|
this.msgPage ++;
|
|
|
}
|
|
|
},
|
|
|
+ async uploadSuccess(data){
|
|
|
+ var resp = await this.sendMessageApi("image",data.data.src);
|
|
|
+ if (!resp) {
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ this.sendMessageData({
|
|
|
+ payload: {
|
|
|
+ contentType: 'image/png',
|
|
|
+ name: data.data.fileName,
|
|
|
+ size: 0,
|
|
|
+ url: data.data.src,
|
|
|
+ width: 2732,
|
|
|
+ height: 2732,
|
|
|
+ thumbnail: data.data.src
|
|
|
+ },
|
|
|
+ type: 'image'
|
|
|
+ });
|
|
|
+ this.uploadImg = "";
|
|
|
+ },
|
|
|
async sendMessageApi(type,content){
|
|
|
this.chatContact[this.checkChat].last.num = 0;
|
|
|
var resp = await this.$API.chat.send.post({type:type,content: content,groupId: this.chatItem.poi_id,openid:this.chatItem.openid})
|
|
|
@@ -606,7 +695,7 @@ export default {
|
|
|
},
|
|
|
async getOrderList(){
|
|
|
this.orderLoad = true;
|
|
|
- var resp = await this.$API.order.list.get({"page":this.orderPage,"pageSize":this.msgSize,"openid":this.chatItem.openid});
|
|
|
+ var resp = await this.$API.order.list.get({"page":this.orderPage,"pageSize":this.orderSize,"openid":this.chatItem.openid});
|
|
|
this.orderLoad = false;
|
|
|
if (resp.code == 0) {
|
|
|
return ;
|
|
|
@@ -680,6 +769,7 @@ export default {
|
|
|
flex-shrink: 0;
|
|
|
transition: all 0.1s;
|
|
|
padding: 10px 0;
|
|
|
+
|
|
|
.img {
|
|
|
width: 55%;
|
|
|
height: 55%;
|