diff --git a/App.vue b/App.vue
index e9f3865..b11624a 100644
--- a/App.vue
+++ b/App.vue
@@ -1,12 +1,80 @@
-
-
-
-
+
+
diff --git a/main.js b/main.js
index 696540a..9c46a47 100644
--- a/main.js
+++ b/main.js
@@ -1,6 +1,7 @@
import Vue from 'vue';
import App from './App';
import dayjs from './utils/dayjs.min.js'
+import store from './store/index.js'
Vue.config.productionTip = false;
Vue.prototype.$dayjs = dayjs;
@@ -20,6 +21,7 @@ Vue.use(http, app)
App.mpType = 'app';
const app = new Vue({
- ...App
+ ...App,
+ store
});
app.$mount();
diff --git a/manifest.json b/manifest.json
index 3e1779f..18f4a72 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,5 +1,5 @@
{
- "name" : "去房质控管家",
+ "name" : "去房智控管家",
"appid" : "__UNI__D88F14A",
"description" : "AI营销助理",
"versionName" : "1.1.0",
@@ -100,6 +100,7 @@
},
"usingComponents" : true,
"permission" : {},
+ "requiredBackgroundModes" : [ "audio" ],
"plugins" : {
"WechatSI" : {
"version" : "0.3.4",
diff --git a/pages/mine/details.vue b/pages/mine/details.vue
index d32e0aa..b37cca5 100644
--- a/pages/mine/details.vue
+++ b/pages/mine/details.vue
@@ -1,6 +1,6 @@
-
@@ -67,20 +52,11 @@
:class="{active: item.bg < playNow && item.ed > playNow && i==0}"
v-for="(item,index) in dialog.message" :key="index" :data-speaker="item.speaker">
- A
- B
- C
- D
- E
-
- F
- G
- H
- I
+ {{ item.speaker | toCapital }}
-
+
复制
@@ -112,14 +88,13 @@
{{((item.ratepercent/item.rate).toFixed(2)*100).toFixed()}}%
-
+
{{subitem.name}}
-
+
@@ -169,33 +144,33 @@
确认
-
+
选择
-
-
-
-
-
-
+ {{item.name}}
+
+
+
+
+
+
+
+
+
取消
确认
-
-
+
+
@@ -205,12 +180,6 @@
export default {
data() {
return {
- audioPlay: false, //当前的播放状态控制
- sliderValue: 0, //进度条最小值
- sliderMax: 0, //进度条最大值
- innerAudioContext: "", //播放实例
- currentTimeStr: "00:00", //当前进度的时间
- timeStr: "00:00", //总的时间
recordPath: "",
customerId: "",
luyinList: [], //录音文件
@@ -240,38 +209,61 @@
jiaoseshow: true,
num: 0, //上拉 转写文件下标
Bnum: 0, //下拉 转写文件下标
- itemobj:{},
- buildingID:'',
- userlistobj:{},
- Menulist:[],
- Menulistisshow:false,
-
- effective:false,
- effectiveindex:'0',
- effectiveitems: [
- {value: '1',name: '没电指派无录音',checked:true},
- {value: '2',name: '离线指派无录音',},
- {value: '3',name: '系统测试误操作'},
- {value: '4',name: '非接访场景录音'},
- {value: '5',name: '其他'}
+ itemobj: {},
+ buildingID: '',
+ userlistobj: {},
+ Menulist: [],
+ Menulistisshow: false,
+
+ effective: false,
+ effectiveindex: '0',
+ effectiveitems: [{
+ value: '1',
+ name: '没电指派无录音',
+ checked: true
+ },
+ {
+ value: '2',
+ name: '离线指派无录音',
+ },
+ {
+ value: '3',
+ name: '系统测试误操作'
+ },
+ {
+ value: '4',
+ name: '非接访场景录音'
+ },
+ {
+ value: '5',
+ name: '其他'
+ }
],
- effectiveitext:'',
- textItself:'',
- argtextindex1:0,
- argtextindex2:0
+ effectiveitext: '',
+ textItself: '',
+ argtextindex1: 0,
+ argtextindex2: 0
};
},
+
+ computed: {
+ nowTime() {
+ return this.getTime(this.luyinList[this.csdFileindex].recordDuration)
+ },
+ },
+
onLoad: function(options) {
this.status = options.status;
this.customerId = options.customerId;
this.itemobj = uni.getStorageSync('searchobj');
- this.stateisshow=options.stateisshow;
+ this.stateisshow = options.stateisshow;
},
+
onShow() {
this.Menulist = uni.getStorageSync('weapp_session_Menu_data');
- this.Menulist.forEach(item=>{
- if(item.name=='标记有效无效接待'){
- this.Menulistisshow=true;
+ this.Menulist.forEach(item => {
+ if (item.name == '标记有效无效接待') {
+ this.Menulistisshow = true;
}
})
this.buildingID = uni.getStorageSync('buildingID').id;
@@ -279,209 +271,124 @@
if (this.userInfo.dataCode == 6) {
this.jiaoseshow = false
}
- if(this.stateisshow==2){
- var info =this.itemobj;
- console.log(info)
- }else{
+ if (this.stateisshow == 2) {
+ var info = this.itemobj;
+ } else {
var pages = getCurrentPages();
var currPage = pages[pages.length - 1]; //当前页面
var info = currPage.data.info;
}
-
+
this.gituserlist()
-
- this.innerAudioContext = uni.createInnerAudioContext();
- this.innerAudioContext.autoplay = false;
- this.innerAudioContext.title = '音频';
-
- this.onPlay()
- this.onPause()
- this.onCanplay()
- this.onEnded()
- this.onSeeking()
- this.onSeeked()
- this.TimeUpdate()
this.init(info)
},
-
- onUnload() {
- //暂停
- this.innerAudioContext.pause()
- // 销毁
- // this.innerAudioContext.destroy();
- },
-
+
methods: {
- effectiveAdd(){
- if(this.effectiveindex==4){
- if(this.effectiveitext.length==0){
+ effectiveAdd() {
+ if (this.effectiveindex == 4) {
+ if (this.effectiveitext.length == 0) {
uni.showToast({
- title: '备注不能为空',
- icon:"none",
- duration: 2000
+ title: '备注不能为空',
+ icon: "none",
+ duration: 2000
});
return
}
}
- this.effective=false;
- let parames={
- id:this.customerId,
- validInvalid:'',
- validInvalid:1,
- invalidReason:Number(this.effectiveindex)+1,
- invalidNote:this.effectiveitext
+ this.effective = false;
+ let parames = {
+ id: this.customerId,
+ validInvalid: '',
+ validInvalid: 1,
+ invalidReason: Number(this.effectiveindex) + 1,
+ invalidNote: this.effectiveitext
}
this.$u.post("/customer/updateValidInvalid", parames).then(res => {
console.log(res)
this.gituserlist()
- })
+ })
},
- radioChange(evt) {
- this.effectiveitext="";
+ radioChange(evt) {
+ this.effectiveitext = "";
for (let i = 0; i < this.effectiveitems.length; i++) {
if (this.effectiveitems[i].value === evt.detail.value) {
- this.effectiveindex = i;
+ this.effectiveindex = i;
break;
}
}
},
//标记
- alllogo(){
- var that=this;
- let msg='';
- if(this.userlistobj.validInvalid!=0){
- msg='是否标记为"有效录音"?';
+ alllogo() {
+ var that = this;
+ let msg = '';
+ if (this.userlistobj.validInvalid != 0) {
+ msg = '是否标记为"有效录音"?';
uni.showModal({
- title: '提示',
- content: msg,
- success: function (res) {
- if (res.confirm) {
- let parames={
- id:that.customerId,
- validInvalid:'',
- invalidReason:0
+ title: '提示',
+ content: msg,
+ success: function(res) {
+ if (res.confirm) {
+ let parames = {
+ id: that.customerId,
+ validInvalid: '',
+ invalidReason: 0
}
- if(that.userlistobj.validInvalid==0){
- parames.validInvalid=1;
- }else{
- parames.validInvalid=0;
+ if (that.userlistobj.validInvalid == 0) {
+ parames.validInvalid = 1;
+ } else {
+ parames.validInvalid = 0;
}
that.$u.post("/customer/updateValidInvalid", parames).then(res => {
console.log(res)
that.gituserlist()
})
- }
- }
+ }
+ }
});
- }else{
- this.effective=true;
+ } else {
+ this.effective = true;
}
},
-
+
//获取用户信息
- gituserlist(){
+ gituserlist() {
this.$u.get("/matchKeywords/personalReceptionRecord", {
customerId: this.customerId
}).then(res => {
- res.endTime1=res.endTime.substring(0, 19);
- this.userlistobj=res;
+ res.endTime1 = res.endTime.substring(0, 19);
+ this.userlistobj = res;
})
},
- toKeywordsearch(){
- this.innerAudioContext.destroy();
- this.stateisshow=1;
+ toKeywordsearch() {
+ this.stateisshow = 1;
uni.navigateTo({
- url: '/pages/learning/Keywordsearch?customerId='+this.customerId +"&status="+this.status +"&skpl="+"1"
+ url: '/pages/learning/Keywordsearch?customerId=' + this.customerId + "&status=" + this.status +
+ "&skpl=" + "1"
})
},
- onPlay(){
- this.innerAudioContext.onPlay(() => {
- // 播放监听
- console.log('播放!');
- this.audioPlay = true;
- wx.enableAlertBeforeUnload({
- message: "是否确认退出详情页面?",
- success: function (res) {
- console.log("方法注册成功:", res);
- },
- fail: function (errMsg) {
- console.log("方法注册失败:", errMsg);
- },
- });
- });
- },
- onPause(){
- this.innerAudioContext.onPause(() => {
- wx.disableAlertBeforeUnload({
- success:function(res){
- console.log(res)
- },
- fail:function(e){
- console.log(e)
- }
- });
- // 暂停监听
- console.log('暂停播放!');
- this.audioPlay = false
- });
- },
- onCanplay() {
- this.innerAudioContext.onCanplay((callback) => {
- console.log("缓冲回调",this.innerAudioContext.duration);
- })
- },
- onEnded(){
- this.innerAudioContext.onEnded(() => {
- // 结束播放监听
- console.log('播放结束!');
- this.audioPlay = false;
- this.qeihuanwenjian()
- });
- },
- onSeeking(){
- this.innerAudioContext.onSeeking((res) => {
- console.log("进行跳转", res);
- })
- },
- onSeeked(){
- this.innerAudioContext.onSeeked((res) => {
- console.log("结束跳转", res);
- this.$forceUpdate()
- });
- },
- TimeUpdate(){
- this.innerAudioContext.onTimeUpdate(() => {
- const {
- currentTime,
- duration
- } = this.innerAudioContext;
- console.log(duration)
- this.playNow = parseInt(currentTime * 1000)
- if (this.dialogList.length == 0) {
-
- } else {
- const message = this.dialogList[0].message
- for (let i = 0; i < message.length; i++) {
- if (Number(message[i].bg) < this.playNow && Number(message[i].ed) > this.playNow) {
- this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
- break;
- }
+
+ TimeUpdate(e) {
+ const {
+ currentTime,
+ duration
+ } = e;
+ this.playNow = parseInt(currentTime * 1000)
+ if (this.dialogList.length == 0) {
+ return
+ } else {
+ const message = this.dialogList[0].message
+ for (let i = 0; i < message.length; i++) {
+ if (Number(message[i].bg) < this.playNow && Number(message[i].ed) > this.playNow) {
+ this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
+ break;
}
}
- const currTimeStr = this.formatTime(currentTime);
- this.sliderValue = parseInt(currentTime);
- // 变动的时间
- this.currentTimeStr = currTimeStr;
- //进度条最大值
- this.sliderMax = this.luyinList[this.csdFileindex].recordDuration;
- this.$forceUpdate()
- });
+ }
+ this.$forceUpdate()
},
-
-
+
+
init(info) {
- this.sliderMax = 0; //进度条最大值
- this.timeStr = "00:00"; //总的时间
const parames = {
pageNum: 1,
pageSize: 100,
@@ -496,61 +403,56 @@
alltime += item.recordDuration
})
this.alltimeStr = this.getTime(alltime)
- if(info){
- res.forEach((item,index) => {
- if(item.id==info.customerId){
+ if (info) {
+ res.forEach((item, index) => {
+ if (item.id == info.customerId) {
console.log(item.id)
this.luyinList = res;
- this.csdFileindex=index;
+ this.csdFileindex = index;
this.recordPath = res[index].recordPath
- this.sliderMax = this.getTime(res[index].recordDuration)
- this.timeStr = this.getTime(res[index].recordDuration)
this.date = res[index].receptionTime;
-
this.isshowFile = false;
this.getCorpusAnalysis(info);
- this.creatAudio()
- var itc=parseInt(info.bg/1000)
+ var itc = parseInt(info.bg / 1000)
this.adasdasdasd(itc)
- console.log("999999999999999999999")
}
- })
- }else{
+ })
+ } else {
this.recordPath = res[0].recordPath
- this.sliderMax = this.getTime(res[0].recordDuration)
- this.timeStr = this.getTime(res[0].recordDuration)
this.date = res[0].receptionTime
- this.innerAudioContext.src = this.recordPath;
- // if(uni.getStorageSync('entrance')==2){
- // this.changePlayState()
- // }
- console.log("11111111111111111111111")
this.luyinList = res;
this.getCorpusAnalysis()
}
+
+ console.log(res, '打印音频列表内容')
+
+ this.zyAudio()
}
})
},
+
+ //录音实例
+ zyAudio() {
+ console.log('this.recordPath', this.recordPath)
+ this.$refs.zyAudio.setSrc(this.recordPath)
+ },
+
//搜索跳转
adasdasdasd(e) {
- console.log(e)
- const currTimeStr = this.formatTime(e)
- this.currentTimeStr = currTimeStr
- this.innerAudioContext.seek(e);
-
- this.innerAudioContext.play();
+ this.$refs.zyAudio.seek(e)
+ this.$refs.zyAudio.play();
},
//下一页
ltolower() {
- var lengthcz=this.luyinList.length-1;
+ var lengthcz = this.luyinList.length - 1;
if (this.num >= lengthcz) {
uni.showToast({
title: '到底了',
duration: 2000
});
return
- }else {
- this.num=this.num+1;
+ } else {
+ this.num = this.num + 1;
uni.showLoading({
title: '加载中'
});
@@ -558,7 +460,8 @@
uni.hideLoading();
}, 2000);
uni.request({
- url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.num].id+"&customerId="+this.customerId, //仅为示例,并非真实接口地址。
+ url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.num].id +
+ "&customerId=" + this.customerId, //仅为示例,并非真实接口地址。
method: "GET",
header: {
'content-type': 'application/json',
@@ -574,7 +477,7 @@
const jsonInfo = JSON.parse(data.data.data.audioContent);
this.dialogList.push({
message: jsonInfo,
- backindex:this.num
+ backindex: this.num
});
this.dialogList.forEach((asd, idx) => {
asd.message.forEach((qwe, inde) => {
@@ -595,14 +498,14 @@
duration: 2000
});
return
- } else if(this.Bnum == 0){
+ } else if (this.Bnum == 0) {
uni.showToast({
title: '到头了',
duration: 2000
});
return
- }else {
- this.Bnum=this.Bnum-1;
+ } else {
+ this.Bnum = this.Bnum - 1;
uni.showLoading({
title: '加载中'
});
@@ -610,7 +513,8 @@
uni.hideLoading();
}, 2000);
uni.request({
- url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.Bnum].id+"&customerId="+this.customerId, //仅为示例,并非真实接口地址。
+ url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.Bnum].id +
+ "&customerId=" + this.customerId, //仅为示例,并非真实接口地址。
method: "GET",
header: {
'content-type': 'application/json',
@@ -688,7 +592,7 @@
let objdata = {
"carId": that.customerId, //客户id
"status": 0,
- "itemId":that.buildingID,
+ "itemId": that.buildingID,
}
uni.request({
url: config.service.addATD,
@@ -746,7 +650,7 @@
if (this.thewrongword) {
if (this.reswrongword) {
let parames = {
- customerId:this.customerId,
+ customerId: this.customerId,
cupid: this.luyinList[this.csdFileindex].id,
wrongWord: this.thewrongword, //错误词
correctWord: this.reswrongword, //正确词
@@ -754,8 +658,8 @@
}
this.isshow2 = false;
- let sas=this.textItself.replace(this.thewrongword,this.reswrongword)
- this.dialogList[this.argtextindex1].message[this.argtextindex2].onebest=sas
+ let sas = this.textItself.replace(this.thewrongword, this.reswrongword)
+ this.dialogList[this.argtextindex1].message[this.argtextindex2].onebest = sas
this.dialogList.forEach(res => {
res.message.forEach(asd => {
asd.isshow = false;
@@ -798,8 +702,8 @@
Addtheessence() {
this.isshow3 = true;
this.biaoqianlist = []
- let parames={
- "itemId":this.buildingID
+ let parames = {
+ "itemId": this.buildingID
}
this.$u.post("/addtodigest/findAllYi", parames).then(data => {
this.biaoqianlist = data
@@ -876,13 +780,13 @@
this.changanitem = item;
this.duihuawenjianid = this.luyinList[this.csdFileindex].id;
this.dialogList[i].message[index].isshow = !this.dialogList[i].message[index].isshow;
- this.textItself=item.onebest;
- let onebest=item.onebest;
- this.thewrongword =onebest.replace(/<.*?>/ig,"");
+ this.textItself = item.onebest;
+ let onebest = item.onebest;
+ this.thewrongword = onebest.replace(/<.*?>/ig, "");
// this.thewrongword = item.onebest;
this.messagelisy = this.dialogList[i].message
- this.argtextindex1=i;
- this.argtextindex2=index;
+ this.argtextindex1 = i;
+ this.argtextindex2 = index;
},
//回到顶部
gotoTop() {
@@ -903,8 +807,6 @@
//录音列表显示隐藏
showFile() {
this.isshowFile = !this.isshowFile;
- this.audioPlay == false;
- this.innerAudioContext.pause()
},
//评分上下显隐
@@ -918,9 +820,6 @@
// 获取评分
getRatelist() {
if (this.ratelist.length == 0) {
- uni.showLoading({
- title: '加载中'
- });
this.$u.get("/customer/findzkMByCusId", {
cusId: this.customerId
}).then(res => {
@@ -972,16 +871,16 @@
},
-
+
// 获取转义后的对话结果
getCorpusAnalysis(info) {
- // let cc=JSON.parse(this.userlistobj.sensitiveWords)[0]
this.dialogList = [];
uni.showLoading({
title: '加载中'
});
uni.request({
- url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.csdFileindex].id+"&customerId="+this.customerId, //仅为示例,并非真实接口地址。
+ url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.csdFileindex].id +
+ "&customerId=" + this.customerId, //仅为示例,并非真实接口地址。
method: "GET",
header: {
'content-type': 'application/json',
@@ -995,35 +894,35 @@
}, 2000);
} else {
const jsonInfo = JSON.parse(data.data.data.audioContent);
- if(this.luyinList[this.csdFileindex].recordDuration>360){
+ if (this.luyinList[this.csdFileindex].recordDuration > 360) {
//拿到总条数
- var stusnum=jsonInfo.length;
+ var stusnum = jsonInfo.length;
this.dialogList.push({
- message: jsonInfo.splice(0,80),
- backindex:this.csdFileindex
+ message: jsonInfo.splice(0, 80),
+ backindex: this.csdFileindex
});
-
+
var auth_timetimer = setInterval(() => {
- stusnum-=100;
- console.log("还剩下"+stusnum)
+ stusnum -= 100;
+ console.log("还剩下" + stusnum)
if (stusnum <= 0) {
console.log("停止")
clearInterval(auth_timetimer);
- }else{
+ } else {
console.log("添加")
-
- var newlistwang=[];
- newlistwang=jsonInfo.splice(0,100);
- console.log("新数组",newlistwang)
- newlistwang.forEach(item=>{
+
+ var newlistwang = [];
+ newlistwang = jsonInfo.splice(0, 100);
+ console.log("新数组", newlistwang)
+ newlistwang.forEach(item => {
this.dialogList[0].message.push(item)
})
}
- }, 1000);
- }else{
+ }, 1000);
+ } else {
this.dialogList.push({
message: jsonInfo,
- backindex:this.csdFileindex
+ backindex: this.csdFileindex
});
}
this.dialogList.forEach((asd, idx) => {
@@ -1031,7 +930,7 @@
qwe.isshow = false;
})
})
-
+
setTimeout(function() {
uni.hideLoading();
}, 2000);
@@ -1056,9 +955,9 @@
return false;
}
});
- },
+ },
//替换方法
- brightKeyword(val,cc) {
+ brightKeyword(val, cc) {
if (val.indexOf(cc) !== -1) {
return val.replace(cc, `${cc}`);
} else {
@@ -1068,90 +967,48 @@
getTime(time) {
return util.formatSecond(time)
},
- // 录音暂停播放
- changePlayState() {
- if (this.audioPlay == false) {
- this.innerAudioContext.play();
- } else {
- this.innerAudioContext.pause()
- }
- },
+
//音频前进回退
sliderChangeComplate(e) {
- const currTimeStr = this.formatTime(e.detail.value)
- this.currentTimeStr = currTimeStr
- this.innerAudioContext.seek(e.detail.value);
- this.innerAudioContext.play();
+ this.$refs.zyAudio.seek(e.detail.value);
+ this.$refs.zyAudio.play();
},
//长按点击播放
- clickbofang(dialog,item) {
- this.innerAudioContext.pause()
+ clickbofang(dialog, item) {
this.dialogList.forEach(res => {
res.message.forEach(asd => {
asd.isshow = false;
})
})
this.$forceUpdate()
- if(dialog==this.csdFileindex){
+ if (dialog == this.csdFileindex) {
let time = parseInt(item.bg / 1000)
- const currTimeStr = this.formatTime(time)
- this.currentTimeStr = currTimeStr
- this.innerAudioContext.seek(time);
- this.innerAudioContext.play();
+ this.$refs.zyAudio.seek(time);
+ this.$refs.zyAudio.play();
return
- }else{
+ } else {
let time = parseInt(item.bg / 1000)
- this.innerAudioContext.destroy()
-
this.csdFileindex = dialog;
this.recordPath = this.luyinList[dialog].recordPath;
- this.sliderMax = this.getTime(this.luyinList[dialog].recordDuration);
- this.timeStr = this.getTime(this.luyinList[dialog].recordDuration);
this.date = this.luyinList[dialog].receptionTime;
- this.creatAudio()
this.getCorpusAnalysis()
-
- const currTimeStr = this.formatTime(time)
- this.currentTimeStr = currTimeStr
- this.innerAudioContext.seek(time);
- this.innerAudioContext.play();
+
+ this.$refs.zyAudio.seek(time);
+ this.$refs.zyAudio.play();
}
},
// 文件切换播放
filechange(item, i) {
- this.num=i;//下拉起始位置
- this.Bnum=i;
- this.innerAudioContext.destroy();
+ this.num = i; //下拉起始位置
+ this.Bnum = i;
this.csdFileindex = i;
this.recordPath = item.recordPath;
- this.sliderMax = this.getTime(item.recordDuration);
- this.timeStr = this.getTime(item.recordDuration);
- this.currentTimeStr = "00:00";
- this.sliderValue=0;
- this.$forceUpdate()
this.date = item.receptionTime;
this.isshowFile = false;
- this.creatAudio()
+ this.zyAudio()
this.getCorpusAnalysis()
-
- },
- //录音实例
- creatAudio() {
- this.innerAudioContext = uni.createInnerAudioContext();
- // if(uni.getStorageSync('entrance')==1){
- this.innerAudioContext.autoplay = false;
- // }else{
- // this.innerAudioContext.autoplay = true;
- // }
- this.innerAudioContext.src = this.recordPath;
- this.innerAudioContext.title = '音频';
- this.onPlay()
- this.onPause()
- this.onCanplay()
- this.onEnded()
- this.onSeeking()
- this.onSeeked()
- this.TimeUpdate()
+ this.$forceUpdate()
+
},
// 自动播放下一个文件
qeihuanwenjian() {
@@ -1184,19 +1041,20 @@
}