|
|
@@ -8,8 +8,11 @@
|
|
|
<div class="lineGrey"></div>
|
|
|
<div class="lineGrey"></div>
|
|
|
<div class="lineGrey"></div>
|
|
|
- <van-pull-refresh v-model="loading" success-text="加载成功" @refresh="onLoad">
|
|
|
- <!-- <van-list class="myList" v-model="loading" :finished="finished" finished-text="--已经到底了--" @refresh="onLoad">-->
|
|
|
+ <van-pull-refresh
|
|
|
+ v-model="loading"
|
|
|
+ :success-text="successText"
|
|
|
+ @refresh="onLoad"
|
|
|
+ :immediate-check="false">
|
|
|
<div id="snb" ref="snb1">
|
|
|
<div style="font-size: 14px" v-for="(item, index) in Ggreet" :key="index">
|
|
|
<div style="margin: 14px" v-if="item.chatRecordFrom == 'ai' || item.chatRecordFrom == 2">
|
|
|
@@ -375,7 +378,7 @@
|
|
|
bottom: 0;
|
|
|
background-color: white;
|
|
|
width: 100%;
|
|
|
- height: 360px;
|
|
|
+ height: 260px;
|
|
|
">
|
|
|
<div class="audio" v-if="shows">
|
|
|
<div class="wave"></div>
|
|
|
@@ -385,6 +388,7 @@
|
|
|
<div class="wave"></div>
|
|
|
</div>
|
|
|
<div
|
|
|
+ class="audioBox"
|
|
|
style="
|
|
|
background-color: rgb(0, 87, 186);
|
|
|
left: 50%;
|
|
|
@@ -395,6 +399,7 @@
|
|
|
position: absolute;
|
|
|
bottom: 90px;
|
|
|
">
|
|
|
+ <div class="tip">{{ tips }}</div>
|
|
|
<div
|
|
|
style="position: absolute; width: 100%; height: 80px; z-index: 999999"
|
|
|
@touchstart="lujin"
|
|
|
@@ -423,7 +428,7 @@ export default {
|
|
|
return {
|
|
|
loading: false,
|
|
|
finished: false,
|
|
|
- pageNum: 1,
|
|
|
+ pageNum: 0,
|
|
|
avatar: avatar,
|
|
|
yy: yy,
|
|
|
yt: yt,
|
|
|
@@ -459,16 +464,19 @@ export default {
|
|
|
text: '点击此条信息进入推荐门店页面。',
|
|
|
},
|
|
|
],
|
|
|
+ isNoData: false, //是否加载完所有数据
|
|
|
+ successText: '加载成功', //上拉刷新提示语
|
|
|
+ tips: '按住 说话',
|
|
|
};
|
|
|
},
|
|
|
- watch: {
|
|
|
- $route(to, from) {
|
|
|
- if (to.path == '/ai') {
|
|
|
- this.onLoad();
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- created() {
|
|
|
+ // watch: {
|
|
|
+ // $route(to, from) {
|
|
|
+ // if (to.path == '/ai') {
|
|
|
+ // this.onLoad();
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ activated() {
|
|
|
this.onLoad();
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -478,7 +486,13 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
onLoad() {
|
|
|
- this.Ggreet = [];
|
|
|
+ if (this.isNoData) {
|
|
|
+ this.successText = '以下所有内容!';
|
|
|
+ this.$toast('已经加载所有内容!');
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.pageNum++;
|
|
|
this.aiDialogueGgreet();
|
|
|
},
|
|
|
choiceSelct(val, val2) {
|
|
|
@@ -491,6 +505,7 @@ export default {
|
|
|
AItype: val.type,
|
|
|
},
|
|
|
});
|
|
|
+ return;
|
|
|
} else {
|
|
|
let loading1 = this.$toast.loading({
|
|
|
duration: 0,
|
|
|
@@ -521,24 +536,19 @@ export default {
|
|
|
message: '发送中...',
|
|
|
forbidClick: true,
|
|
|
});
|
|
|
- if (this.refreshing) {
|
|
|
- this.Ggreet = [];
|
|
|
- this.refreshing = false;
|
|
|
- }
|
|
|
- aiDialogue({ type: 3, pageNum: this.pageNum, pageSize: 20 }).then((response) => {
|
|
|
+ aiDialogue({ type: 3, pageNum: this.pageNum, pageSize: 10 }).then((response) => {
|
|
|
loading1.clear();
|
|
|
this.loading = false;
|
|
|
if (response.code == 200) {
|
|
|
this.Ggreet = response.rows.concat(this.Ggreet);
|
|
|
if (this.Ggreet.length >= response.total) {
|
|
|
- this.finished = true;
|
|
|
+ this.isNoData = true;
|
|
|
} else {
|
|
|
- this.finished = false;
|
|
|
+ this.isNoData = false;
|
|
|
}
|
|
|
if (this.pageNum == 1) {
|
|
|
this.garbageManager();
|
|
|
}
|
|
|
- this.pageNum = this.pageNum + 1;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -552,14 +562,19 @@ export default {
|
|
|
forbidClick: true,
|
|
|
});
|
|
|
this.btnclik = false;
|
|
|
+ this.Ggreet.push({
|
|
|
+ chatRecordText: this.content,
|
|
|
+ chatRecordFrom: 1,
|
|
|
+ });
|
|
|
aiDialogue({ type: 1, content: this.content }).then((response) => {
|
|
|
loading1.clear();
|
|
|
this.btnclik = true;
|
|
|
if (response.code == 200) {
|
|
|
this.content = '';
|
|
|
- this.pageNum = 1;
|
|
|
- this.Ggreet = [];
|
|
|
- this.aiDialogueGgreet();
|
|
|
+ // this.pageNum = 1;
|
|
|
+ // this.Ggreet = [];
|
|
|
+ this.Ggreet.push(...response.rows);
|
|
|
+ // this.aiDialogueGgreet();
|
|
|
this.garbageManager();
|
|
|
}
|
|
|
});
|
|
|
@@ -602,9 +617,10 @@ export default {
|
|
|
success: function (res) {
|
|
|
aiDialogue({ type: 2, content: res.serverId }).then((response) => {
|
|
|
if (response.code == 200) {
|
|
|
- that.pageNum = 1;
|
|
|
- that.Ggreet = [];
|
|
|
- that.aiDialogueGgreet();
|
|
|
+ // that.pageNum = 1;
|
|
|
+ // that.Ggreet = [];
|
|
|
+ // that.aiDialogueGgreet();
|
|
|
+ this.Ggreet.push(...response.rows);
|
|
|
that.garbageManager();
|
|
|
}
|
|
|
that.show = false;
|
|
|
@@ -629,10 +645,11 @@ export default {
|
|
|
success: function (res) {
|
|
|
aiDialogue({ type: 2, content: res.serverId }).then((response) => {
|
|
|
if (response.code == 200) {
|
|
|
- that.pageNum = 1;
|
|
|
- that.Ggreet = [];
|
|
|
+ // that.pageNum = 1;
|
|
|
+ // that.Ggreet = [];
|
|
|
+ // that.aiDialogueGgreet();
|
|
|
+ this.Ggreet.push(...response.rows);
|
|
|
that.garbageManager();
|
|
|
- that.aiDialogueGgreet();
|
|
|
}
|
|
|
that.shows = false;
|
|
|
that.show = false;
|
|
|
@@ -868,4 +885,22 @@ p {
|
|
|
overflow-y: auto;
|
|
|
height: 700px;
|
|
|
}
|
|
|
+.wrapper {
|
|
|
+ .audioBox {
|
|
|
+ -webkit-touch-callout: none;
|
|
|
+ -webkit-user-select: none;
|
|
|
+ -khtml-user-select: none;
|
|
|
+ -moz-user-select: none;
|
|
|
+ -ms-user-select: none;
|
|
|
+ user-select: none;
|
|
|
+ .tip {
|
|
|
+ position: absolute;
|
|
|
+ top: -26px;
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+ justify-content: center;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|