Browse Source

修改音频播放功能

pull/97/head
zq 3 months ago
parent
commit
ef235f961d
  1. 139
      src/views/agent/checkOrderList.vue

139
src/views/agent/checkOrderList.vue

@ -2,19 +2,20 @@
<div class="main-content12">
<!-- page header -->
<div class="pageheader flex-between">
<span class="pagetitle">{{ pageTitle }}</span>
<span class="pagetitle">{{ pageTitle }}</span>
<GuipButton size="table" type="ignore" @click="showPddSetting">拼多多发货</GuipButton>
<GuipDialog :dialogVisible="dialogVisiblePddSetting" title="" :confirmText="pddSettingConfirmText" cancelText="取消"
:show-close-button="false" :show-cancel-button="true" @confirm="pddSetting" @cancel="closePddSetting"
@close="closePddSetting" @dialogVisibleChange="dialogVisibleChange">
<GuipDialog :dialogVisible="dialogVisiblePddSetting" title="" :confirmText="pddSettingConfirmText"
cancelText="取消" :show-close-button="false" :show-cancel-button="true" @confirm="pddSetting"
@cancel="closePddSetting" @close="closePddSetting" @dialogVisibleChange="dialogVisibleChange">
<!-- 自定义内容 -->
<el-form>
<el-form>
<el-tabs v-model="pddSettingActiveName" @tab-click="handleClick">
<el-tab-pane label="拼多多手工发货" name="1">
<PromptText text='导出待发货订单excel,到拼多多导入该excel进行发货' :type="1" />
<GuipSelect class="mt-16" label="选择站点" v-model="pddExportUid" @change="selectPddExportSite()" :options="searchSiteList" valueKey="uid" labelKey="name"
:extraItem="{label:'请选择站点',value:'0'}" placeholder="" clearable width="300px" />
<GuipSelect class="mt-16" label="选择站点" v-model="pddExportUid"
@change="selectPddExportSite()" :options="searchSiteList" valueKey="uid" labelKey="name"
:extraItem="{ label: '请选择站点', value: '0' }" placeholder="" clearable width="300px" />
</el-tab-pane>
<el-tab-pane label="拼多多自动发货" name="2">
@ -25,10 +26,13 @@
</div>
<div class="mt-16">
<div>
<el-checkbox checked disabled><span class="fontblue">允许未发货的有效订单提交检测不可取消</span></el-checkbox>
<el-checkbox checked disabled><span
class="fontblue">允许未发货的有效订单提交检测不可取消</span></el-checkbox>
</div>
<div class="mt-16">
<el-checkbox v-model="selectAllowPddDeliveredDelayedSubmit">允许已发货<el-input v-model="pddDeliveredDelayedSubmitHour" style="width:50px;height:30px"></el-input>小时订单提交论文检测</el-checkbox>
<el-checkbox v-model="selectAllowPddDeliveredDelayedSubmit">允许已发货<el-input
v-model="pddDeliveredDelayedSubmitHour"
style="width:50px;height:30px"></el-input></el-checkbox>
</div>
</div>
</div>
@ -54,14 +58,16 @@
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
</el-date-picker>
<GuipSelect class="mr-32" label="服务类型" v-model="searchType" @change="changeSearchType()" :options="searchTypeList"
:extraItem="{label:'全部',value:'0'}" placeholder="" clearable />
<GuipSelect class="mr-32" label="服务类型" v-model="searchType" @change="changeSearchType()"
:options="searchTypeList" :extraItem="{ label: '全部', value: '0' }" placeholder="" clearable />
<GuipSelect class="mr-32" label="站点" v-model="searchUid" @change="changeSearchSite()" :options="searchSiteList" valueKey="uid" labelKey="name"
:extraItem="{label:'全部',value:'0'}" placeholder="" clearable />
<GuipSelect class="mr-32" label="站点" v-model="searchUid" @change="changeSearchSite()"
:options="searchSiteList" valueKey="uid" labelKey="name" :extraItem="{ label: '全部', value: '0' }"
placeholder="" clearable />
<GuipSelect class="mr-32" width="100px" label="报告状态" v-model="searchStatus" @change="changeSearchStatus()"
:options="searchStatusList" :extraItem="{ label: '全部', value: 'all' }" placeholder="不限" clearable />
<GuipSelect class="mr-32" width="100px" label="报告状态" v-model="searchStatus"
@change="changeSearchStatus()" :options="searchStatusList"
:extraItem="{ label: '全部', value: 'all' }" placeholder="不限" clearable />
</div>
</el-form>
</div>
@ -73,10 +79,12 @@
<div class="flex" style="justify-content: space-between;">
<div class="flex">
<h3 class="checktitle mr-24">{{ pageTitle }}列表</h3>
<GuipSelect class="mr-32" label="报告格式" v-model="reportNameFormat" :options="donwReportNameFormat"
@change="changeReportNameFormat()" clearable v-if="pageTab=='check'" />
<GuipSelect class="mr-32" label="报告格式" v-model="reportNameFormat"
:options="donwReportNameFormat" @change="changeReportNameFormat()" clearable
v-if="pageTab == 'check'" />
</div>
<GuipInput label="订单号" v-model="searchTid" @blur="changeSearchTid()" placeholder="请输入订单号" ref="GuipInput" />
<GuipInput label="订单号" v-model="searchTid" @blur="changeSearchTid()" placeholder="请输入订单号"
ref="GuipInput" />
</div>
@ -133,7 +141,7 @@
</div>
</template>
</el-table-column>
<el-table-column prop="author" label="作者" v-if="pageTab=='check'">
<el-table-column prop="author" label="作者" v-if="pageTab == 'check'">
<template slot-scope="scope">
<div class="flex">
<GuipToolTip :content="'作者:' + scope.row.author + ' 标题:' + scope.row.title">
@ -142,7 +150,7 @@
</div>
</template>
</el-table-column>
<el-table-column prop="title" label="标题" v-else-if="pageTab=='ai'" min-width="200px">
<el-table-column prop="title" label="标题" v-else-if="pageTab == 'ai'" min-width="200px">
<template slot-scope="scope">
<div class="flex">
<GuipToolTip :content="scope.row.title">
@ -173,7 +181,7 @@
</template>
</el-table-column>
<el-table-column prop="wordnum" label="字数"></el-table-column>
<el-table-column v-if="pageTab!='ai'" prop="similarity" label="相似度">
<el-table-column v-if="pageTab != 'ai'" prop="similarity" label="相似度">
<template slot-scope="scope">
<div class="flex">
<p v-if="scope.row.similarity > 0">{{ scope.row.similarity }}%</p>
@ -237,6 +245,9 @@
<!-- 自定义内容 -->
<p class="mx-24 mt12 flex">是否删除 ID:{{ delReportId }} 报告删除后无法恢复</p>
</GuipDialog>
<audio id="notice-sound" ref="audioPlayer" :src="audioSrc" hidden v-if="!isIE"></audio>
<!-- IE浏览器使用的embed元素 -->
<embed v-if="isIE" name="embedPlay" :src="audioSrc" autostart="true" hidden="true" loop="false" />
</div>
</div>
</template>
@ -308,6 +319,9 @@ export default {
intervalId: null,
isMuted: true,
audioSrc: require('@/assets/msg.wav'), //
isIE: false // IE
}
},
mounted() {
@ -315,14 +329,58 @@ export default {
this.getOrderList()
this.getConfig()
this.startTimer();
this.checkBrowser();
if (!this.isIE) {
this.$refs.audioPlayer.load(); //
}
},
beforeUpdate() {
},
beforeDestroy() {
this.stopTimer();
},
methods: {
unmute() {
this.isMuted = false;
if (this.$refs.audioPlayer) {
this.$refs.audioPlayer.muted = false;
}
},
checkBrowser() {
const userAgent = window.navigator.userAgent.toLowerCase();
this.isIE = userAgent.indexOf("ie") >= 0 || userAgent.indexOf("trident") >= 0;
},
//
playSound() {
this.$nextTick(() => {
if (this.isIE) {
// IE使embed
console.log('ienotice');
} else {
// 使audio
try {
const audio = this.$refs.audioPlayer;
this.unmute()
if (audio) {
audio.play().then(() => {
console.log('notice');
}).catch(e => {
console.error('音频播放失败:', e);
});
}
} catch (e) {
console.error('播放出错:', e);
}
}
});
},
startTimer() {
this.intervalId = setInterval(() => {
this.getOrderList()
// // -- is okk
// this.playSound()
// 5
console.log('这个操作每隔5秒执行一次');
}, 10000);
@ -332,12 +390,7 @@ export default {
clearInterval(this.intervalId);
}
},
playSound() {
//const audio = new Audio('/assets/msg.wav'); //
//audio.play();
console.log('播放声音');
},
getFilterParams(){
getFilterParams() {
var stime = '';
var etime = '';
if (this.searchDate && this.searchDate.length > 0) {
@ -354,7 +407,7 @@ export default {
this.getOrderList(params)
},
resetPageParams(){
resetPageParams() {
this.orderListTotalRecords = 0
this.isHasNextPage = true
this.orderListCurrentPage = 1
@ -363,7 +416,7 @@ export default {
this.orderListPrevMaxId = 0
this.orderListEndPage = 0
},
resetSearchParams(){
resetSearchParams() {
this.searchDate = ''
this.searchStatus = 'all'
this.searchType = '0'
@ -415,7 +468,7 @@ export default {
}).then(response => {
this.tableLoading = false
this.$nextTick(() => {
if (this.intervalId && response.data.maxid && this.orderListPrevMaxId && response.data.maxid>this.orderListPrevMaxId) {
if (this.intervalId && response.data.maxid && this.orderListPrevMaxId && response.data.maxid > this.orderListPrevMaxId) {
console.log('有新订单了');
this.playSound();
}
@ -438,7 +491,6 @@ export default {
// this.end_page = 1;
}
// console.log(this.isHasNextPage, 'isHasNextPage')
})
}).catch(error => {
console.error(error, 'error')
@ -465,13 +517,13 @@ export default {
if (this.searchType) params.type = this.searchType;
if (this.searchUid) params.uid = this.searchUid;
this.$http('GET', '/agentnew/export_order', params,{
returnFullResponse: true ,
this.$http('GET', '/agentnew/export_order', params, {
returnFullResponse: true,
headers: {
'Auth': this.token,
},
responseType: 'blob'
}).then(response => {
}).then(response => {
const {
headers, // headers
data, //
@ -495,10 +547,10 @@ export default {
console.error(error, 'error')
})
},
decodeRFC5987Filename(header) {
decodeRFC5987Filename(header) {
// RFC 5987 filename*=utf8''xxx
const match = header.match(/filename\*=(?:utf8|UTF-8)''([^;]+)/i);
console.log(match,'match');
console.log(match, 'match');
if (match) {
return decodeURIComponent(match[1]);
}
@ -516,8 +568,8 @@ export default {
console.log(this.searchUid)
},
changeSearchTid() {
console.log(this.searchTid,'this.searchTid')
this.getOrderList({orderid:this.searchTid})
console.log(this.searchTid, 'this.searchTid')
this.getOrderList({ orderid: this.searchTid })
},
changeSearchType() {
console.log(this.searchType)
@ -596,14 +648,14 @@ export default {
pddSetting() {
if (this.pddSettingActiveName == 1) {
this.$http('GET', '/agentnew/export_pdd_tids', {
uid: this.pddExportUid,
},{
returnFullResponse: true ,
uid: this.pddExportUid,
}, {
returnFullResponse: true,
headers: {
'Auth': this.token,
},
responseType: 'blob'
}).then(response => {
}).then(response => {
const {
headers, // headers
data, //
@ -628,7 +680,7 @@ export default {
})
} else if (this.pddSettingActiveName == 2) {
this.$http('POST', '/agentnew/ajax_set_pdd_delivered_delayed_submit_hour', {
hour: this.selectAllowPddDeliveredDelayedSubmit===true ? this.pddDeliveredDelayedSubmitHour : 0,
hour: this.selectAllowPddDeliveredDelayedSubmit === true ? this.pddDeliveredDelayedSubmitHour : 0,
}, {
headers: {
'Auth': this.token
@ -750,6 +802,7 @@ export default {
.mt-16 {
margin-top: 16px;
}
.mb-10 {
margin-bottom: 10px;
}

Loading…
Cancel
Save