Browse Source

提交修改audio

test
douzhuo 2 years ago
parent
commit
e17359f852
6 changed files with 540 additions and 715 deletions
  1. +169
    -73
      App.vue
  2. +3
    -1
      main.js
  3. +1
    -0
      manifest.json
  4. +296
    -381
      pages/mine/details.vue
  5. +69
    -259
      pages/mine/details2.vue
  6. +2
    -1
      utils/domain.js

+ 169
- 73
App.vue View File

@@ -1,12 +1,80 @@
<template>
<view>
</view>
</template>
<script> <script>
import Vue from 'vue';
//app.js //app.js
var config = require("./config"); var config = require("./config");
export default { export default {
onLaunch: function(options) {
onLaunch(options) {

uni.getSystemInfo({
success: function(e) {
console.log(e, 'adjsakljdklasjdklsakjdslakjd')
// #ifdef MP-WEIXIN
Vue.prototype.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
Vue.prototype.windowHeight = e.safeArea.height
// #endif
Vue.mixin({
data() {
return {
StatusBar: Vue.prototype.StatusBar,
CustomBar: Vue.prototype.CustomBar,
windowHeight: Vue.prototype.windowHeight
};
},

methods: {
// 目前使用页面为录音页面
SPEAKERSTYLE(index) {
let obj = {
color: '',
}
switch (index) {
case 1:
obj.color = '#60CBEC';
break;
case 2:
obj.color = '#EC8B47';
break;
case 3:
obj.color = '#4F861E';
break;
case 5:
obj.color = '#4980C8';
break;
case 6:
obj.color = '#60CBEC';
break;
case 7:
obj.color = '#EC8B47';
break;
case 8:
obj.color = '#4F861E';
break;
default:
obj.color = '#9F61C8';
break;
}
return obj
},
},

filters: {
// ASCII码转换 大写字母A是65 演讲人是从1开始所以num+64
toCapital(num) {
let str = ''
if (num) {
str = String.fromCharCode(num + 64)
}
return str
}
}
});
}
});


if (wx.canIUse('getUpdateManager')) { if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager() const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function(res) { updateManager.onCheckForUpdate(function(res) {
@@ -49,70 +117,72 @@
this.$u.get("/user/getMenu").then(data => { this.$u.get("/user/getMenu").then(data => {
uni.setStorageSync("weapp_session_Menu_data", data) uni.setStorageSync("weapp_session_Menu_data", data)
}) })
wx.setInnerAudioOption({ wx.setInnerAudioOption({
obeyMuteSwitch: false obeyMuteSwitch: false
});
});
}, },
onShow(options) { onShow(options) {
const token = uni.getStorageSync("weapp_session_login_data") const token = uni.getStorageSync("weapp_session_login_data")
if (typeof token.token != "string") { if (typeof token.token != "string") {
console.log("没有") console.log("没有")
return return
}else{
} else {
this.infoscoket() this.infoscoket()
} }
}, },
onHide() {}, onHide() {},
methods: { methods: {
infoscoket(){
let pushon=uni.getStorageSync('weapp_session_userInfo_data').loginName
infoscoket() {
let pushon = uni.getStorageSync('weapp_session_userInfo_data').loginName
uni.connectSocket({ uni.connectSocket({
url: 'wss://hfju.com/ws?uid='+pushon+'_applets',
header: {
"content-type": "application/json",
'Access-Token': uni.getStorageSync('weapp_session_login_data').token
}
url: 'wss://hfju.com/ws?uid=' + pushon + '_applets',
header: {
"content-type": "application/json",
'Access-Token': uni.getStorageSync('weapp_session_login_data').token
}
}); });
uni.onSocketOpen(function (res) {
console.log('WebSocket连接已打开!');
uni.onSocketOpen(function(res) {
console.log('WebSocket连接已打开!');
}); });
uni.onSocketError(function (res) {
console.log('WebSocket连接打开失败,请检查!');
uni.onSocketError(function(res) {
console.log('WebSocket连接打开失败,请检查!');
}); });
uni.onSocketMessage(function (res) {
console.log('收到服务器内容:' + res.data);
let cedata=JSON.stringify(res);
let data=JSON.parse(cedata);
let zdata=JSON.parse(data.data)
if(zdata.to=="recCmd"){
uni.$emit('update',{msg:'页面更新'})
return
}
uni.showModal({
title: '提示',
content: zdata.to+'的设备电量过低请检查!',
cancelText: "取消", // 取消按钮的文字
confirmText: "查看", // 确认按钮文字
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: `/pages/main/toviewtherecording/index?jump=`+"jump"
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
uni.onSocketMessage(function(res) {
console.log('收到服务器内容:' + res.data);
let cedata = JSON.stringify(res);
let data = JSON.parse(cedata);
let zdata = JSON.parse(data.data)
if (zdata.to == "recCmd") {
uni.$emit('update', {
msg: '页面更新'
})
return
}
uni.showModal({
title: '提示',
content: zdata.to + '的设备电量过低请检查!',
cancelText: "取消", // 取消按钮的文字
confirmText: "查看", // 确认按钮文字
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: `/pages/main/toviewtherecording/index?jump=` + "jump"
})

} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}); });
}, },
Closewebsocke(){
Closewebsocke() {
uni.closeSocket(); uni.closeSocket();
uni.onSocketClose(function (res) {
console.log('WebSocket 已关闭!');
uni.onSocketClose(function(res) {
console.log('WebSocket 已关闭!');
}); });
}, },
} }
@@ -124,17 +194,20 @@
</style> </style>
<style lang="scss"> <style lang="scss">
@import "uview-ui/index.scss"; @import "uview-ui/index.scss";

/*每个页面公共css */ /*每个页面公共css */
//图表样式等 //图表样式等
.single{
.single {
width: 100%; width: 100%;
background: #FFFFFF; background: #FFFFFF;
.title{

.title {
width: 100%; width: 100%;
height: 90rpx; height: 90rpx;
border-bottom: 1rpx solid #E0E0E0; border-bottom: 1rpx solid #E0E0E0;
display: flex; display: flex;
.title1{

.title1 {
flex: 2; flex: 2;
font-size: 30rpx; font-size: 30rpx;
font-weight: 600; font-weight: 600;
@@ -142,28 +215,33 @@
line-height: 90rpx; line-height: 90rpx;
text-indent: 30rpx; text-indent: 30rpx;
} }
.title3{

.title3 {
flex: 3; flex: 3;
height: 90rpx; height: 90rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
.title3-box{

.title3-box {
display: flex; display: flex;
align-items: center; align-items: center;
width: 25%; width: 25%;
justify-content: center; justify-content: center;
.activecltab{

.activecltab {
border-bottom: 2px solid #2671E2; border-bottom: 2px solid #2671E2;
} }
} }
} }
.title2{

.title2 {
flex: 3; flex: 3;
height: 90rpx; height: 90rpx;
display: flex; display: flex;
align-items: center; align-items: center;
.title2-che{

.title2-che {
width: 178rpx; width: 178rpx;
height: 48rpx; height: 48rpx;
background: #FFFFFF; background: #FFFFFF;
@@ -176,7 +254,8 @@
text-indent: 12rpx; text-indent: 12rpx;
margin-left: 35rpx; margin-left: 35rpx;
position: relative; position: relative;
.righttochoose{

.righttochoose {
width: 18rpx; width: 18rpx;
height: 24rpx; height: 24rpx;
position: absolute; position: absolute;
@@ -186,15 +265,18 @@
} }
} }
} }
.swiper-box{

.swiper-box {
width: 97%; width: 97%;
margin: 0 auto; margin: 0 auto;
} }
.hejibox{

.hejibox {
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;
display: flex; display: flex;
.heji{

.heji {
width: 50%; width: 50%;
height: 100%; height: 100%;
font-size: 28rpx; font-size: 28rpx;
@@ -204,7 +286,8 @@
text-indent: 30rpx; text-indent: 30rpx;
} }
} }
.danwei{

.danwei {
width: 100%; width: 100%;
height: 40rpx; height: 40rpx;
font-size: 24rpx; font-size: 24rpx;
@@ -213,31 +296,37 @@
line-height: 40rpx; line-height: 40rpx;
text-indent: 30rpx; text-indent: 30rpx;
} }
.uchaserbox{

.uchaserbox {
width: 95%; width: 95%;
height: 470rpx; height: 470rpx;
} }
.jindu{

.jindu {
width: 100%; width: 100%;
height: 300rpx; height: 300rpx;
.jindu-box{
width: 100%;

.jindu-box {
width: 100%;
padding-left: 30rpx; padding-left: 30rpx;
padding-right: 30rpx; padding-right: 30rpx;
.jindu-boxche{

.jindu-boxche {
width: 100%; width: 100%;
height: 46rpx; height: 46rpx;
display: flex; display: flex;
align-items: center; align-items: center;
height: 50rpx; height: 50rpx;
.jindu-name{

.jindu-name {
width: 120rpx; width: 120rpx;
font-size: 28rpx;
font-size: 28rpx;
color: #666666; color: #666666;
} }
.jindu-zxl{

.jindu-zxl {
width: 120rpx; width: 120rpx;
font-size: 26rpx;
font-size: 26rpx;
margin-left: 16rpx; margin-left: 16rpx;
color: #666666; color: #666666;
text-align: center; text-align: center;
@@ -246,6 +335,7 @@
} }
} }
} }

//时间切换的样式 //时间切换的样式
.boxtittab { .boxtittab {
width: 100; width: 100;
@@ -254,7 +344,7 @@
border: 1px solid #E0E0E0; border: 1px solid #E0E0E0;
display: flex; display: flex;
align-items: center; align-items: center;
.tabbox { .tabbox {
flex: 1; flex: 1;
height: 100%; height: 100%;
@@ -264,40 +354,46 @@
font-size: 28rpx; font-size: 28rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
.activecllasscet { .activecllasscet {
width: 96rpx; width: 96rpx;
border-bottom: 2px solid #2671E2; border-bottom: 2px solid #2671E2;
} }
} }
} }

//多个格子的样式 //多个格子的样式
.boxzonglan { .boxzonglan {
width: 100%; width: 100%;
min-height: 496rpx; min-height: 496rpx;
background: #FFFFFF; background: #FFFFFF;
padding: 30rpx 30rpx 30rpx 30rpx; padding: 30rpx 30rpx 30rpx 30rpx;

.zonglantit { .zonglantit {
font-size: 30rpx; font-size: 30rpx;
color: #333333; color: #333333;
font-family: PingFangSC-Semibold, PingFang SC; font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600; font-weight: 600;
} }

.zonglanbox { .zonglanbox {
width: 100%; width: 100%;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 24rpx; margin-top: 24rpx;

.grid { .grid {
width: 50%; width: 50%;
height: 128rpx; height: 128rpx;
border: 1px solid #E0E0E0; border: 1px solid #E0E0E0;

.audonum { .audonum {
color: #666666; color: #666666;
text-indent: 40rpx; text-indent: 40rpx;
font-size: 26rpx; font-size: 26rpx;
margin-top: 20rpx; margin-top: 20rpx;
} }

.num { .num {
color: #333333; color: #333333;
text-indent: 40rpx; text-indent: 40rpx;


+ 3
- 1
main.js View File

@@ -1,6 +1,7 @@
import Vue from 'vue'; import Vue from 'vue';
import App from './App'; import App from './App';
import dayjs from './utils/dayjs.min.js' import dayjs from './utils/dayjs.min.js'
import store from './store/index.js'
Vue.config.productionTip = false; Vue.config.productionTip = false;


Vue.prototype.$dayjs = dayjs; Vue.prototype.$dayjs = dayjs;
@@ -20,6 +21,7 @@ Vue.use(http, app)
App.mpType = 'app'; App.mpType = 'app';


const app = new Vue({ const app = new Vue({
...App
...App,
store
}); });
app.$mount(); app.$mount();

+ 1
- 0
manifest.json View File

@@ -100,6 +100,7 @@
}, },
"usingComponents" : true, "usingComponents" : true,
"permission" : {}, "permission" : {},
"requiredBackgroundModes" : [ "audio" ],
"plugins" : { "plugins" : {
"WechatSI" : { "WechatSI" : {
"version" : "0.3.4", "version" : "0.3.4",


+ 296
- 381
pages/mine/details.vue
File diff suppressed because it is too large
View File


+ 69
- 259
pages/mine/details2.vue View File

@@ -36,70 +36,9 @@
:class="{active: item.bg < playNow && item.ed > playNow && i==0}" :class="{active: item.bg < playNow && item.ed > playNow && i==0}"
v-for="(item,index) in dialog.message" :key="index" :data-speaker="item.speaker"> v-for="(item,index) in dialog.message" :key="index" :data-speaker="item.speaker">
<view class="avatar"> <view class="avatar">
<view v-if="item.speaker == 1" style="color: #60CBEC;">
<view :style="[SPEAKERSTYLE(item.speaker)]">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image> <image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>A</text>
</view>
<view v-if="item.speaker == 2" style="color: #EC8B47;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>B</text>
</view>
<view v-if="item.speaker == 3" style="color: #4F861E;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>C</text>
</view>
<view v-if="item.speaker == 4" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>D</text>
</view>
<view v-if="item.speaker == 5" style="color: #4980C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>E</text>
</view>

<view v-if="item.speaker == 6" style="color: #60CBEC;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>F</text>
</view>
<view v-if="item.speaker == 7" style="color: #EC8B47;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>G</text>
</view>
<view v-if="item.speaker == 8" style="color: #4F861E;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>H</text>
</view>
<view v-if="item.speaker == 9" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>I</text>
</view>
<view v-if="item.speaker == 10" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>J</text>
</view>
<view v-if="item.speaker == 11" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>K</text>
</view>
<view v-if="item.speaker == 12" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>L</text>
</view>
<view v-if="item.speaker == 13" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>M</text>
</view>
<view v-if="item.speaker == 14" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>N</text>
</view>
<view v-if="item.speaker == 15" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>O</text>
</view>
<view v-if="item.speaker == 16" style="color: #9F61C8;">
<image v-if="item.isShow == 0" :src="Aimg.replace(/[\r\n]/g,'')" mode="widthFix"></image>
<text v-else>P</text>
<text v-else>{{ item.speaker | toCapital }}</text>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
@@ -126,24 +65,12 @@
</view> </view>
</scroll-view> </scroll-view>
<view class="bottombox"> <view class="bottombox">
<!-- <LongAudio :customerId="customerId" :infos="infos" :roleindex="roleindex"></LongAudio> -->
<!-- 播放块 --> <!-- 播放块 -->
<view class="bottomhead">
<view class="audio-play" @tap="changePlayState">
<image class="image" mode="widthFix"
:src="audioPlay ? 'https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/pause.png' : 'https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/play.png'">
</image>
</view>
<view class="audio-slider">
<view class="audio-time">
<text>{{currentTimeStr}}</text>
</view>
<slider class="slider" min="0" :max="sliderMax" @change="sliderChangeComplate" block-size="14"
:value="sliderValue" activeColor="blue"></slider>
<view class="audio-time">
<text>{{timeStr}}</text>
</view>
</view>
</view>

<!-- 播放块 :src="recordPath" -->
<yz-audio ref="zyAudio" @timeUpdate="TimeUpdate" @sliderChangeComplate="sliderChangeComplate"></yz-audio>

<!-- 底部弹框 --> <!-- 底部弹框 -->
<view class="botbotmm"> <view class="botbotmm">
<view class="tmmchen" @click="guanjiancishifo()"> <view class="tmmchen" @click="guanjiancishifo()">
@@ -259,7 +186,7 @@
</view> </view>
<view <view
style="width: 96%;height: 26rpx;display: flex;margin: 0 auto; margin-top: 40rpx;align-items: center;"> style="width: 96%;height: 26rpx;display: flex;margin: 0 auto; margin-top: 40rpx;align-items: center;">
<view style="width: 25%;color: #666666;font-size: 26rpx;">意向客户</view>
<view style="width: 25%;color: #666666;font-size: 26rpx;">意向项目</view>
<view style="width: 75%;color: #333333;font-size: 26rpx;">{{userlistobj.projectName}}</view> <view style="width: 75%;color: #333333;font-size: 26rpx;">{{userlistobj.projectName}}</view>
</view> </view>
<view <view
@@ -420,7 +347,8 @@
</view> </view>
<view class="bioqianwayl" v-if="item.isshow==true"> <view class="bioqianwayl" v-if="item.isshow==true">
<view class="jiangshang" v-for="(chend,i) in item.children" :key='i' v-if="chend.selected==0"> <view class="jiangshang" v-for="(chend,i) in item.children" :key='i' v-if="chend.selected==0">
{{chend.text}}</view>
{{chend.text}}
</view>
</view> </view>
</view> </view>
</view> </view>
@@ -578,6 +506,7 @@
roleisshaw: false, roleisshaw: false,
roleindexrow: 0, roleindexrow: 0,
roletiaoshu: 0, roletiaoshu: 0,
infos: null
}; };
}, },
onLoad: function(options) { onLoad: function(options) {
@@ -586,6 +515,12 @@
this.itemobj = uni.getStorageSync('searchobj'); this.itemobj = uni.getStorageSync('searchobj');
console.log(this.itemobj) console.log(this.itemobj)
this.stateisshow = options.stateisshow; this.stateisshow = options.stateisshow;
uni.$on("playNows", (val) => {
this.playNow = val;
})
uni.$on("scrollIds", (val) => {
this.scrollId = val;
})
}, },
onShow() { onShow() {
this.Menulist = uni.getStorageSync('weapp_session_Menu_data'); this.Menulist = uni.getStorageSync('weapp_session_Menu_data');
@@ -608,45 +543,17 @@
} }
this.roleindex = 0; this.roleindex = 0;
if (this.stateisshow == 2) { if (this.stateisshow == 2) {
var info = this.itemobj;
this.infos = this.itemobj;
} else { } else {
var pages = getCurrentPages(); var pages = getCurrentPages();
var currPage = pages[pages.length - 1]; //当前页面 var currPage = pages[pages.length - 1]; //当前页面
var info = currPage.data.info;
this.infos = currPage.data.info;
} }
this.gituserlist() 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)
this.init(this.infos)


}, },
onHide() {
if (this.innerAudioContext) {
//暂停
this.innerAudioContext.pause()
// 销毁
this.innerAudioContext.destroy();
}
},
onUnload() {
if (this.innerAudioContext) {
//暂停
this.innerAudioContext.pause()
// 销毁
this.innerAudioContext.destroy();
}
},

methods: { methods: {
rolexuanze(index) { rolexuanze(index) {
this.roleindexrow = index; this.roleindexrow = index;
@@ -682,7 +589,6 @@
}, },
argece(item) { argece(item) {
console.log(item) console.log(item)
this.innerAudioContext.destroy();
if (item.selected == 0) { if (item.selected == 0) {
console.log(item) console.log(item)
uni.navigateTo({ uni.navigateTo({
@@ -726,7 +632,6 @@
}, },
//评分点击 //评分点击
clickaudeopal(item) { clickaudeopal(item) {
this.innerAudioContext.destroy();
if (item.selected == 0) { if (item.selected == 0) {
console.log(item) console.log(item)
uni.navigateTo({ uni.navigateTo({
@@ -751,7 +656,6 @@
this.Acquirecustomerintentlist2[i].isshow = !this.Acquirecustomerintentlist2[i].isshow; this.Acquirecustomerintentlist2[i].isshow = !this.Acquirecustomerintentlist2[i].isshow;
}, },
tocalibration() { tocalibration() {
this.innerAudioContext.destroy();
uni.navigateTo({ uni.navigateTo({
url: '/pages/mine/calibration?id=' + this.customerId url: '/pages/mine/calibration?id=' + this.customerId
}); });
@@ -949,7 +853,6 @@
}, },
guanjiancishifo() { guanjiancishifo() {
// this.guanjianciishow=!this.guanjianciishow; // this.guanjianciishow=!this.guanjianciishow;
this.innerAudioContext.destroy();


this.stateisshow = 1; this.stateisshow = 1;
uni.navigateTo({ uni.navigateTo({
@@ -1054,7 +957,7 @@
this.roleindexbiaoji = data.data.data.speaker - 1; this.roleindexbiaoji = data.data.data.speaker - 1;
this.dshfkjsdkksodofydwfkhwdfkjh = data.data.data.speaker - 1; this.dshfkjsdkksodofydwfkhwdfkjh = data.data.data.speaker - 1;
} }
if (this.roleindex > this.tablist.length - 1) {
if (this.roleindex > this.tablist.length - 1) {
this.roleindex = this.tablist.length - 1 this.roleindex = this.tablist.length - 1
this.fenjiaoseunfo() this.fenjiaoseunfo()
} }
@@ -1082,7 +985,6 @@
}) })
}, },
toKeywordsearch() { toKeywordsearch() {
this.innerAudioContext.destroy();


this.stateisshow = 1; this.stateisshow = 1;
uni.navigateTo({ uni.navigateTo({
@@ -1090,92 +992,25 @@
"&skpl=" + "1" "&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;
});
},
onSeeking() {
this.innerAudioContext.onSeeking((res) => {
console.log("进行跳转", res);
})
},
onSeeked() {
this.innerAudioContext.onSeeked((res) => {
console.log("结束跳转", res);
this.$forceUpdate()
});
},
TimeUpdate() {
this.innerAudioContext.onTimeUpdate(() => {
// var pages = getCurrentPages();
// if(pages[pages.length-1].route!="pages/mine/details2"){
// this.innerAudioContext.destroy();
// }
const {
currentTime,
duration
} = this.innerAudioContext;
console.log(currentTime, 'TimeUpdate, currentTime')
this.playNow = parseInt(currentTime * 1000)
console.log(this.playNow)
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;
}

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()
}, },




@@ -1202,34 +1037,26 @@
if (info.bg != 0) { if (info.bg != 0) {
this.luyinList = res; this.luyinList = res;
this.recordPath = res[0].recordPath 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.date = res[0].receptionTime;

this.getCorpusAnalysis(info); this.getCorpusAnalysis(info);
this.creatAudio()
} else { } else {
this.luyinList = res; this.luyinList = res;
this.recordPath = res[0].recordPath 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.date = res[0].receptionTime;

this.getCorpusAnalysis(info); this.getCorpusAnalysis(info);
this.creatAudio()
} }

this.zyAudio()
} }
}) })
}, },
//搜索跳转 //搜索跳转
adasdasdasd(e) { adasdasdasd(e) {
const currTimeStr = this.formatTime(e)
this.currentTimeStr = currTimeStr
this.innerAudioContext.seek(e);
this.$refs.zyAudio.seek(e)
if (uni.getStorageSync('entrance') == 1) { if (uni.getStorageSync('entrance') == 1) {
return return
} else { } else {
this.innerAudioContext.play();
this.$refs.zyAudio.play();
} }
}, },
//下一页 //下一页
@@ -1682,7 +1509,6 @@
} }
}) })
} }

}) })
this.newluyinList = jsonInfo; this.newluyinList = jsonInfo;
this.dialogList.push(jsonInfo[this.textindex]); this.dialogList.push(jsonInfo[this.textindex]);
@@ -1693,21 +1519,18 @@
}, },






getTime(time) { getTime(time) {
return util.formatSecond(time) return util.formatSecond(time)
}, },
// 录音暂停播放
changePlayState() {
if (this.audioPlay == false) {
this.innerAudioContext.play();
} else {
this.innerAudioContext.pause()
}
},


//音频前进回退 //音频前进回退
sliderChangeComplate(e) { sliderChangeComplate(e) {
if (e.isType == 'audio') {
this.$refs.zyAudio.pause()
} else {
this.$refs.zyAudio.audioPause()
}
let platetime = e.detail.value * 1000; let platetime = e.detail.value * 1000;
this.dialogList = [] this.dialogList = []
uni.request({ uni.request({
@@ -1726,11 +1549,14 @@
} else { } else {
this.dialogList.push(this.newluyinList[data.data.data.index]) this.dialogList.push(this.newluyinList[data.data.data.index])
} }
console.log(e.detail, '1233333333333333333333333333333333333333333333333333333333333')
const currTimeStr = this.formatTime(e.detail.value)
this.currentTimeStr = currTimeStr
this.innerAudioContext.seek(e.detail.value);
this.innerAudioContext.play();

if (e.isType == 'audio') {
this.$refs.zyAudio.seek(e.detail.value);
this.$refs.zyAudio.play();
} else {
this.$refs.zyAudio.audioSeek(e.detail.value);
this.$refs.zyAudio.audioPlay();
}
} }
}) })
}, },
@@ -1759,33 +1585,12 @@
this.textindex = data.data.data.index; this.textindex = data.data.data.index;
this.toptextindex = data.data.data.index; this.toptextindex = data.data.data.index;
this.dialogList.push(this.newluyinList[data.data.data.index]) this.dialogList.push(this.newluyinList[data.data.data.index])
const currTimeStr = this.formatTime(newtime)
console.log(currTimeStr, 'currTimeStr')
this.currentTimeStr = currTimeStr this.currentTimeStr = currTimeStr
this.innerAudioContext.seek(newtime);
this.innerAudioContext.play();
this.$refs.zyAudio.seek(newtime)
this.$refs.zyAudio.play()
} }
}) })
}, },
//录音实例
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()
},
formatTime(num) { formatTime(num) {
//格式化时间格式 //格式化时间格式
num = num.toFixed(0); num = num.toFixed(0);
@@ -1799,7 +1604,12 @@
this.dialogListres[0].message.forEach(asd => { this.dialogListres[0].message.forEach(asd => {
asd.isshow = false; asd.isshow = false;
}) })
}
},
//录音实例
zyAudio() {
this.$refs.zyAudio.setSrc(this.recordPath)
},
}, },
} }
</script> </script>
@@ -1915,8 +1725,8 @@
height: 84rpx; height: 84rpx;
border-bottom: 1px solid #E0E0E0; border-bottom: 1px solid #E0E0E0;
display: flex; display: flex;
.boxhead1 {
.boxhead1 {
width: 50%; width: 50%;
color: #303030; color: #303030;
height: 84rpx; height: 84rpx;
@@ -2180,7 +1990,7 @@
left: 50%; left: 50%;
top: 50%; top: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
.headpade { .headpade {
margin-top: 10rpx; margin-top: 10rpx;
padding: 8rpx 8rpx 8rpx 8rpx; padding: 8rpx 8rpx 8rpx 8rpx;


+ 2
- 1
utils/domain.js View File

@@ -17,7 +17,8 @@ const baseUrl = 'https://xitong.pachira.cn/api'; // AI营销辅助 普强使用
// const host = 'http://192.168.31.167:8080/autoSR/api'; // 长龙 // const host = 'http://192.168.31.167:8080/autoSR/api'; // 长龙
// const host = 'http://192.168.31.134:8080/autoSR/api'; // 佳豪 // const host = 'http://192.168.31.134:8080/autoSR/api'; // 佳豪
// const host = 'http://10.2.1.104:8081/autoSR/api'; // 刘敏 // const host = 'http://10.2.1.104:8081/autoSR/api'; // 刘敏
const host = 'https://xitong.pachira.cn/api'; // AI营销辅助 普强使用
// const host = 'https://xitong.pachira.cn/api'; // AI营销辅助 普强使用
const host = baseUrl; // AI营销辅助 普强使用




const iMServiceHost = 'https://im.quhouse.com/'; //IM的后端地址正式 暂未使用留着防止报错 const iMServiceHost = 'https://im.quhouse.com/'; //IM的后端地址正式 暂未使用留着防止报错


Loading…
Cancel
Save