diff --git a/src/apps/AppBroadcast/LiveBroadcast.vue b/src/apps/AppBroadcast/LiveBroadcast.vue index fbd81e01..aeb83d7d 100644 --- a/src/apps/AppBroadcast/LiveBroadcast.vue +++ b/src/apps/AppBroadcast/LiveBroadcast.vue @@ -129,6 +129,7 @@ destroyed () { document.body.removeEventListener('touchmove', this.bindEvent) + this.recorder.close() }, onLoad () { @@ -149,6 +150,19 @@ uni.$on('chooseEquipment', e => { this.equipmentList = e.equipmentList }) + this.recorder = Recorder({ + type: 'mp3', + sampleRate: 16000, + bitRate: 16, + onProcess(buffers, powerLevel, bufferDuration, bufferSampleRate, newBufferIdx, asyncEnd) { + //可利用extensions/waveview.js扩展实时绘制波形 + } + }) + this.recorder.open((e) => { + console.log(e) + }, e => { + console.log(e) + }) }, methods: { @@ -157,6 +171,8 @@ }, onLongtap () { + this.time = 60 + if (!this.equipmentList.length) { return this.$u.toast('请选择播发设备') } @@ -174,43 +190,23 @@ }, record () { - this.duration = 0 - this.recorder = Recorder({ - type: 'mp3', - sampleRate: 16000, - bitRate: 16, - onProcess(buffers, powerLevel, bufferDuration, bufferSampleRate, newBufferIdx, asyncEnd) { - //可利用extensions/waveview.js扩展实时绘制波形 - } - }) - - this.recorder.open(() => { - this.recorder.start() - this.timing() - }) + this.recorder.start() + this.timing() }, timing () { - this.time = this.time - 1 - if (this.time === 0) { this.stop() + + return false } + this.time = this.time - 1 + this.timingTimeout = setTimeout(() => { this.timing() }, 1000) }, - blobToDataURI(blob) { - return new Promise((resolve) => { - var reader = new FileReader() - reader.readAsDataURL(blob) - reader.onload = function (e) { - resolve(e.target.result) - } - }) - }, - play (url, index) { if (this.currIndex === index) { this.innerAudioContext.destroy() @@ -237,9 +233,6 @@ stop (isCancel) { clearTimeout(this.timingTimeout) this.recorder.stop((blob, duration) => { - this.recorder.close() - this.recorder = null - if (isCancel) { this.time = 60 return false @@ -275,21 +268,20 @@ this.isShow = false }).catch(() => { this.isShow = false + uni.hideLoading() }) } else { this.isShow = false } }).catch(() => { + uni.hideLoading() this.isShow = false }) - this.time = 60 console.log(blob, (window.URL || webkitURL).createObjectURL(blob), '时长:' + duration + 'ms') }, msg => { console.log('录音失败:' + msg) - this.recorder.close() this.isShow = false - this.recorder = null }) }, diff --git a/src/apps/AppBroadcast/selectEquipment.vue b/src/apps/AppBroadcast/selectEquipment.vue index 756c97bf..effa2e15 100644 --- a/src/apps/AppBroadcast/selectEquipment.vue +++ b/src/apps/AppBroadcast/selectEquipment.vue @@ -36,6 +36,8 @@ import { mapState } from 'vuex' export default { name: "selectEquipment", + + appName: '选择设备', data() { return { areaId: '', diff --git a/src/common/axios.js b/src/common/axios.js index 78b032fa..40ecdda7 100644 --- a/src/common/axios.js +++ b/src/common/axios.js @@ -23,8 +23,8 @@ instance.interceptors.request.use(config => { }) instance.interceptors.response.use(res => { + uni.hideLoading() if (res.data) { - uni.hideLoading() if (res.data.access_token) { return res.data } diff --git a/src/common/modules.js b/src/common/modules.js index 723034fa..158672e2 100644 --- a/src/common/modules.js +++ b/src/common/modules.js @@ -55,7 +55,7 @@ export const config = { } }, getCode({state, dispatch}, tryAgentSign = false) { - let {corpid: corpId, suiteId} = state, url = location.href, REDIRECT_URI = encodeURIComponent(url), scope = "snsapi_base" + let {corpid: corpId, suiteId, agentid: agentId} = state, url = location.href, REDIRECT_URI = encodeURIComponent(url), scope = "snsapi_privateinfo" if (/\/AppForm\//.test(location.search)) { scope = "snsapi_userinfo" } else if (suiteId) { @@ -64,10 +64,11 @@ export const config = { } return new Promise((resolve, reject) => { if (corpId && scope) { - let oauthURL = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE#wechat_redirect' + let oauthURL = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&agentid=AGENTID#wechat_redirect' .replace(/APPID/g, corpId) .replace(/REDIRECT_URI/g, REDIRECT_URI) .replace(/SCOPE/g, scope) + .replace(/AGENTID/g, agentId) location.replace(oauthURL) } else if (!tryAgentSign) { dispatch("agentSign", {corpId, suiteId}).then(() => dispatch("getCode", true)).then(() => resolve()) diff --git a/src/saas/AppCountryAlbum/PhotoRank.vue b/src/saas/AppCountryAlbum/PhotoRank.vue index 95ff8281..34403751 100644 --- a/src/saas/AppCountryAlbum/PhotoRank.vue +++ b/src/saas/AppCountryAlbum/PhotoRank.vue @@ -43,7 +43,7 @@ methods: { getList (date) { - this.$http.post(`/api/appattendancerecord/userphotosort?queryTime=${date}`).then(res => { + this.$http.post(`/api/appattendancerecord/alluserphotosort?queryTime=${date}`).then(res => { if (res.code === 0) { this.list = Object.keys(res.data).map(v => { return { diff --git a/src/saas/AppCountryAlbum/Watermark.vue b/src/saas/AppCountryAlbum/Watermark.vue index 4d2b5314..4ce102b7 100644 --- a/src/saas/AppCountryAlbum/Watermark.vue +++ b/src/saas/AppCountryAlbum/Watermark.vue @@ -12,7 +12,7 @@
@@ -141,7 +141,7 @@ data () { return { img: '', - currIndex: -1, + currIndex: 0, isHide: true, height: '100%', waterSrc: '', diff --git a/src/saas/AppCountryAlbum/components/report/MeetingMminutes.vue b/src/saas/AppCountryAlbum/components/report/MeetingMminutes.vue index 1450fd5e..db142b56 100644 --- a/src/saas/AppCountryAlbum/components/report/MeetingMminutes.vue +++ b/src/saas/AppCountryAlbum/components/report/MeetingMminutes.vue @@ -102,7 +102,7 @@ if (v.length) { const title = v.filter(v => v.type === '17')[0] const hoster = v.filter(v => v.type === '26')[0] - const date = v.filter(v => v.type === '0')[0] + const date = v.filter(v => v.type === '1')[0] const address = v.filter(v => v.type === '29')[0] const remark = v.filter(v => v.type === '31')[0] const theme = v.filter(v => v.type === '30')[0]