Commit 9c87985d by 胡悦

录音链接分享。添加短链接口

1 parent cd0da2fb
// packageEquity/pages/receptionDetail/receptionDetail.js // packageEquity/pages/receptionDetail/receptionDetail.js
import reportPageTrackMixin from '~/mixins/reportPageTrackMixin' import reportPageTrackMixin from '~/mixins/reportPageTrackMixin'
import { getRecordDetailList } from "../../receptionRecordsApi" import { getRecordDetailList, getShortUrl } from "../../receptionRecordsApi"
Page({ Page({
behaviors: [reportPageTrackMixin], behaviors: [reportPageTrackMixin],
...@@ -21,6 +21,7 @@ Page({ ...@@ -21,6 +21,7 @@ Page({
currentTime: '00:00', //当前音频的播放位置 currentTime: '00:00', //当前音频的播放位置
isOperate: true, isOperate: true,
track_event_code: 'reception_detail', //埋点动作类型 track_event_code: 'reception_detail', //埋点动作类型
receptionStartTime: ''
}, },
/** /**
...@@ -33,6 +34,9 @@ Page({ ...@@ -33,6 +34,9 @@ Page({
// 调用接口获取详情,默认取第一条 // 调用接口获取详情,默认取第一条
const time = new Date(+options.receptionStartTime).format('yyyy-MM-dd') const time = new Date(+options.receptionStartTime).format('yyyy-MM-dd')
console.log(time) console.log(time)
this.setData({
receptionStartTime: options.receptionStartTime
})
const params = { const params = {
batchId: options.batchId, batchId: options.batchId,
merchantNo: options.merchantNo, merchantNo: options.merchantNo,
...@@ -272,7 +276,7 @@ Page({ ...@@ -272,7 +276,7 @@ Page({
qualityRef() { qualityRef() {
return this.selectComponent('#quality') return this.selectComponent('#quality')
}, },
share(e) { async share(e) {
let userInfo = wx.$util.getUserInfo() || {} let userInfo = wx.$util.getUserInfo() || {}
const { const {
record record
...@@ -285,14 +289,26 @@ Page({ ...@@ -285,14 +289,26 @@ Page({
endTime, endTime,
totalDuration, totalDuration,
fileUrl, fileUrl,
startTime startTime,
merchantNo,
batchId,
// receptionStartTime
} = record } = record
// 门店 - 接待开始时间 - 接待时长 - 员工标记的接待结果 - 接待录音mp3地址 console.log(record, 'record')
let text = [record.merchantName, wx.$util.tsFormatTime(startTime, 'Y年M月D日 h:m:s'), wx.$util.tsFormatTime(endTime, 'Y年M月D日 h:m:s'), this.format(totalDuration), receptionStatus, fileUrl].join(' - ') // 获取短链地址
wx.$util.setCopyData(text) const {receptionStartTime} = this
this.setTrackData('copy_content', { const res = await getShortUrl({merchantNo, batchId, receptionStartTime})
context: text, console.log(res, 'res')
}) if (res.code == '0') {
// 门店 - 接待开始时间 - 接待时长 - 员工标记的接待结果 - 接待录音mp3地址(更换成短链)
let text = [record.merchantName, wx.$util.tsFormatTime(startTime, 'Y年M月D日 h:m:s'), wx.$util.tsFormatTime(endTime, 'Y年M月D日 h:m:s'), this.format(totalDuration), receptionStatus, res.data].join(' - ')
wx.$util.setCopyData(text)
this.setTrackData('copy_content', {
context: text,
})
} else {
wx.$util.showToast('获取短链失败')
}
// wx.$util.showToast('复制成功') // wx.$util.showToast('复制成功')
}, },
format(seconds) { format(seconds) {
......
...@@ -11,5 +11,10 @@ module.exports = { ...@@ -11,5 +11,10 @@ module.exports = {
// 分页查询接待列表 // 分页查询接待列表
getRecordDetailList(data) { getRecordDetailList(data) {
return api.post("dj.api.smartcarlife.reception.findReceptionByConditionPage", data) return api.post("dj.api.smartcarlife.reception.findReceptionByConditionPage", data)
},
// 获取短链地址
getShortUrl(data) {
return api.post("dj.api.car.boutique.inspection.batch.file.short.url", data)
} }
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!