Commit 3f2c25cf by 李伟康

feat(audio): 添加录音复盘功能及相关组件

- 新增接待复盘列表和质检复盘明细API接口
- 添加录音复盘页面,实现复盘数据展示和状态管理
- 创建对话组件用于录音播放和时间轴控制
- 集成录音对话内容查询和展示功能
- 添加质检侧边栏和对话内容展示
- 修改配置文件,调整环境设置为正式版
- 更新代码格式化工具配置
- 优化页面性能和用户体验
1 parent 5d3d81e1
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"scm.compactFolders": false, "scm.compactFolders": false,
"problems.decorations.enabled": false, "problems.decorations.enabled": false,
"[javascript]": { "[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "Wscats.eno"
}, },
"[wxml]": { "[wxml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
......
...@@ -31,5 +31,30 @@ module.exports = { ...@@ -31,5 +31,30 @@ module.exports = {
// 获取督导任务详情 // 获取督导任务详情
getTaskDetail(data) { getTaskDetail(data) {
return api.post('dj.api.supervisor.mini.getTaskDetailById', data, [], '/rop-dj-supervisor-mini/router') return api.post('dj.api.supervisor.mini.getTaskDetailById', data, [], '/rop-dj-supervisor-mini/router')
} },
/**
* 接待复盘列表
*/
getAudioReviewList(data) {
return api.post('dj.api.supervisor.mini.page.audioReview', data, [], '/rop-dj-supervisor-mini/router')
},
/**
*质检复盘明细
*/
getAudioReviewSummary(data) {
return api.post('dj.api.supervisor.mini.summary.audioReview', data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 质检列表或者侧边栏(新质检)
*/
getReceptionDetail(data) {
return api.gscPost('check/api/findCheckResultByBatchId', data)
},
/**
*查询对话内容
*/
findConversationDetailByBatchId(data) {
return api.gscPost('check/api/findConversationDetailByBatchId', data)
},
} }
...@@ -23,7 +23,7 @@ const accountInfo = wx.getAccountInfoSync(); ...@@ -23,7 +23,7 @@ const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync(); const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion; const envName = accountInfo.miniProgram.envVersion;
//手动控制体验版环境的请求 true就依据下面index false就默认2 //手动控制体验版环境的请求 true就依据下面index false就默认2
const manual = false; const manual = true;
const release = false; const release = false;
// 判断小程序环境 // 判断小程序环境
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<block wx:if="{{item.visible}}"> <block wx:if="{{item.visible}}">
<view class="avatar-box"> <view class="avatar-box">
<view class="icon"> <view class="icon">
<image class="icon" src="{{IMG_URL}}role-{{item.role}}.png" alt=""/> <!-- <image class="icon" src="{{IMG_URL}}role-{{item.role}}.png" alt=""/> -->
</view> </view>
<view class="time">{{item.time}}</view> <view class="time">{{item.time}}</view>
</view> </view>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<view id="{{item.text_id}}" class="quality-item flex {{item.text_id == activeId?'active':''}}" bind:tap="seekPlay" data-item="{{item}}"> <view id="{{item.text_id}}" class="quality-item flex {{item.text_id == activeId?'active':''}}" bind:tap="seekPlay" data-item="{{item}}">
<view class="avatar-box"> <view class="avatar-box">
<view class="icon"> <view class="icon">
<image class="icon" src="{{IMG_URL}}role-{{item.role}}.png" alt=""/> <!-- <image class="icon" src="{{IMG_URL}}role-{{item.role}}.png" alt=""/> -->
</view> </view>
<view class="time">{{item.time}}</view> <view class="time">{{item.time}}</view>
</view> </view>
......
// packageIndex/pages/recordingReview/recordingReview.js // packageIndex/pages/recordingReview/recordingReview.js
import api from '~/api/index/index'
import dayjs from 'dayjs'
Page({ Page({
/**
* 页面的初始数据
*/
data: {
dateGroups: [
{
date: '2 月 3 日',
stats: {
total: 1,
reviewed: 2,
unreviewed: 2
},
records: [
{
index: 1,
userName: '方先生',
phone: '17083127409',
role: '驻店员工',
reviewStatus: 'reviewed',
reviewText: '已复盘',
brand: 'AITO 问界',
carModel: 'M9',
customerType: '理智型客户',
store: '深圳南山问界 4S 店',
qualityScore: '63',
attackScore: '6.7',
actionBtn: {
text: '查看',
type: 'view'
}
},
{
index: 2,
userName: '黄恩雨',
phone: '18902640418',
role: '赵惠惠',
reviewStatus: 'unreviewed',
reviewText: '未复盘',
brand: 'AITO 问界',
carModel: 'M9',
customerType: '理智型客户',
store: '深圳南山问界 4S 店',
qualityScore: '63',
attackScore: '0.0',
actionBtn: {
text: '录音复盘',
type: 'review'
}
},
{
index: 3,
userName: '武汉市华阳通发发发发发看就看',
phone: '18902640418',
role: '陈和',
reviewStatus: 'unreviewed',
reviewText: '未复盘',
brand: 'AITO 问界',
carModel: 'M9',
customerType: '理智型客户',
store: '深圳南山问界 4S 店',
qualityScore: '90',
attackScore: '未发现',
actionBtn: {
text: '录音复盘',
type: 'review'
}
}
]
},
{
date: '2 月 2 日',
stats: {
total: 0,
reviewed: 2,
unreviewed: 0
},
records: [
{
index: 1,
userName: '方先生',
phone: '17083127409',
role: '驻店员工',
reviewStatus: 'reviewed',
reviewText: '已复盘',
brand: 'AITO 问界',
carModel: 'M9',
customerType: '理智型客户',
store: '深圳南山问界 4S 店',
qualityScore: '63',
attackScore: '6.7',
actionBtn: {
text: '查看',
type: 'view'
}
}
]
}
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
/**
* 页面的初始数据
*/
data: {
dateGroups: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getAudioReviewSummary()
this.getAudioReviewList()
},
getAudioReviewSummary() {
api.getAudioReviewSummary({
id: 16
}).then(({
data
}) => {
data.date = dayjs(data.createTime).format('M月D日')
data.statusText = {
0: '待完成',
1: '进行中',
2: '已完成'
} [data.taskStatus]
this.setData({
summary: data
})
})
},
getAudioReviewList() {
api.getAudioReviewList({
id: 16,
pageNum: 1,
pageSize: 10
}).then(({
data
}) => {
let {
list,
total
} = data
list && list.map(e => {
e.reviewText = e.reviewStatus == 1 ? '已复盘' : '未复盘'
e.actionBtn = e.reviewStatus == 1 ? '查看' : '录音复盘'
})
this.setData({
records: list
})
})
},
reviewRecord(e){
const {record} = e.currentTarget.dataset
wx.$router._to('/packageIndex/pages/recordingReviewDetail/recordingReviewDetail', record, 'navigateTo')
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
...@@ -34,10 +34,19 @@ page { ...@@ -34,10 +34,19 @@ page {
height: 40rpx; height: 40rpx;
justify-content: center; justify-content: center;
&.processing {
background: #fff7e6; }
.status-0{
background: #fff7e6;
color: #fa8c16; color: #fa8c16;
} }
.status-1{
background: #fff7e6;
color: #fa8c16;
}
.status-2{
background: #35c37614;
color: #35C376;
} }
} }
......
...@@ -4,69 +4,69 @@ ...@@ -4,69 +4,69 @@
<view class="header"> <view class="header">
<view class="title flex"> <view class="title flex">
<text class="title-text">录音复盘</text> <text class="title-text">录音复盘</text>
<view class="status-tag processing flex">进行中</view> <view class="status-tag flex status-{{summary.taskStatus}}">{{summary.statusText}}</view>
</view> </view>
<view class="subtitle">请按以下要求提交实战效果录音复盘记录</view> <view class="subtitle">请按以下要求提交实战效果录音复盘记录</view>
</view> </view>
<!-- 日期分组列表 --> <!-- 日期分组列表 -->
<view class="date-group" wx:for="{{dateGroups}}" wx:key="date"> <view class="date-group" >
<view class="date-header"> <view class="date-header">
<text class="date-text">{{item.date}}</text> <text class="date-text">{{summary.date}}</text>
<view class="stats"> <view class="stats">
<text class="stat-item">战数 {{item.stats.total}}</text> <text class="stat-item">战数 {{summary.totalCount}}</text>
<text class="stat-item reviewed">已复盘 {{item.stats.reviewed}}</text> <text class="stat-item reviewed">已复盘 {{summary.reviewedCount}}</text>
<text class="stat-item unreviewed">未复盘 {{item.stats.unreviewed}}</text> <text class="stat-item unreviewed">未复盘 {{summary.unreviewedCount}}</text>
</view> </view>
</view> </view>
<!-- 录音记录卡片列表 --> <!-- 录音记录卡片列表 -->
<block wx:for="{{item.records}}" wx:key="index" wx:for-item="record"> <block wx:for="{{records}}" wx:key="index" wx:for-item="record">
<view class="record-block"> <view class="record-block">
<block wx:if="{{index != item.records.length - 1}}"> <block wx:if="{{index != records.length - 1}}">
<view class="line"></view> <view class="line"></view>
</block> </block>
<view class="index-badge-box"> <view class="index-badge-box">
<view class="index-badge"> <view class="index-badge">
{{record.index}} {{index + 1}}
</view> </view>
</view> </view>
<view class="record-card"> <view class="record-card">
<view class="fixed-block flex"> <view class="fixed-block flex">
<view class="user-role">{{record.role}}</view> <view class="user-role">{{record.employeeName}}</view>
<view class="review-status {{record.reviewStatus}}">{{record.reviewText}}</view> <view class="review-status {{record.reviewStatus == 1 ? 'reviewed' : 'unreviewed'}}">{{record.reviewText}}</view>
</view> </view>
<view class="card-header"> <view class="card-header">
<view class="user-info flex"> <view class="user-info flex">
<view class="user-name text-hide">{{record.userName}}</view> <view class="user-name text-hide">{{record.customerName}}</view>
<view class="user-phone">{{record.phone}}</view> <view class="user-phone">{{record.phoneNumber}}</view>
</view> </view>
</view> </view>
<view class="user-tag-box flex"> <view class="user-tag-box flex">
<text class="tag">{{record.brand}}</text> <text class="tag" v-if="{{record.carBrand}}">{{record.carBrand}}</text>
<text class="tag">{{record.carModel}}</text> <text class="tag" v-if="{{record.carModel}}">{{record.carModel}}</text>
<text class="tag">{{record.customerType}}</text> <text class="tag" v-if="{{record.customerType}}">{{record.customerType}}</text>
</view> </view>
<view class="card-body"> <view class="card-body">
<view class="info-row"> <view class="info-row">
<text class="label">服务门店</text> <text class="label">服务门店</text>
<text class="value">{{record.store}}</text> <text class="value">{{record.merchantName || '-'}}</text>
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="label">质检评分</text> <text class="label">质检评分</text>
<text class="value">{{record.qualityScore}}</text> <text class="value">{{record.qualityCheckScore != null ? record.qualityCheckScore : '-'}}</text>
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="label">攻防评分</text> <text class="label">攻防评分</text>
<text class="value">{{record.attackScore}}</text> <text class="value">{{record.attackScore != null ? record.attackScore : '-'}}</text>
</view> </view>
</view> </view>
<view class="card-footer"> <view class="card-footer">
<button class="action-btn {{record.actionBtn.type}}-btn"> <button class="action-btn {{record.reviewStatus == 0 ? 'review-btn' : ''}}" bindtap="reviewRecord" data-record="{{record}}">
{{record.actionBtn.text}} {{record.actionBtn}}
</button> </button>
</view> </view>
</view> </view>
</view> </view>
</block> </block>
</view> </view>
......
// packageEquity/pages/receptionDetail/components/dialogue/dialogue.js
let thisPage = null
import api from '~/api/index/index'
Component({
/**
* 组件的属性列表
*/
properties: {
recordData: Object,
batchId: {
type: Number,
observer: function (n) {
if (this.IntersectionObserver) {
this.IntersectionObserver.disconnect()
this.IntersectionObserver = null
}
this.setData({
flag: false,
progress: 0,
dialogueList: []
})
const data = {
batchId: n,
};
this.findConversationDetailByBatchId(data)
}
},
qualityData: {
type: Array,
observer: function (n) {
if (n.length) this.findCbByBatchId(n)
}
}
},
lifetimes: {
ready() {},
detached() {
this.IntersectionObserver?.disconnect()
}
},
/**
* 组件的初始数据
*/
data: {
progress: 0,
dialogueList: [],
},
/**
* 组件的方法列表
*/
methods: {
findCbByBatchId(data) {
let {
totalDuration
} = this.data.recordData,
margin = 20
wx.$util.getViewInfo('.axis-bar', ({
height: containerHeight,
top: barTop
}) => {
if (containerHeight == 0) {
return setTimeout(() => {
this.findCbByBatchId()
}, 100)
}
this.barTop = barTop
this.containerHeight = containerHeight
let axisList = []
data?.sort((a, b) => a.offset - b.offset).forEach(e => {
const {
offset: mergedOffset,
} = e
e.top = mergedOffset / totalDuration * containerHeight
e.docTop = mergedOffset / totalDuration * containerHeight
e.text_id = `text_${mergedOffset}`
e.mergedOffset = mergedOffset
if (mergedOffset != null) axisList.push(e)
})
axisList.map((e, index) => {
// 检查并调整 top 值,避免重叠
for (let i = 0; i < index; i++) {
if (e.top < axisList[i].top + margin &&
e.top + margin > axisList[i].top) {
// 如果重叠,将当前元素的 top 设置为前一个元素的底部加上 margin
e.top = axisList[i].top + margin;
}
}
})
this.setData({
axisList
})
}, this)
},
getAudioObject() {
thisPage = wx.$router.getPageInstance()
if (thisPage.qualityAudio) this.innerAudioContext = thisPage.qualityAudio
else setTimeout(() => {
this.getAudioObject()
}, 100)
},
onTimeUpdate() {
const {
dialogueList
} = this.data, {
paused
} = this.innerAudioContext, {
mergedOffset
} = this.setProgress(),
item = dialogueList.find(e => e.mergedOffset == mergedOffset)
if (!paused) this.setData({
isPlayIng: true
})
if (this.data.isScrollling) return
if (item && item.id) this.setTopId(item, true)
},
setTopId(item, scroll = false) {
const {
dialogueList
} = this.data
let centerIndex = dialogueList.findIndex(e => e.text_id == item.text_id)
centerIndex -= 3
if (centerIndex < 0) centerIndex = 0
wx.nextTick(() => {
this.setData({
activeId: item.text_id,
})
})
if (scroll) this.setData({
toId: dialogueList[centerIndex].text_id
})
},
setProgress() {
const {
duration,
currentTime
} = this.innerAudioContext,
mergedOffset = Math.ceil(currentTime)
this.setData({
progress: mergedOffset / duration * 100
})
return {
currentTime,
mergedOffset
}
},
toDefenceDetail(e) {
let {
item,
} = e.currentTarget.dataset
this.setData({
toId: item.text_id
})
this.setData({
isScrollling: true
})
this.touchend()
},
seekPlay(e) {
let {
item,
click,
scroll
} = e.currentTarget.dataset, {
activeId
} = this.data
if (!item) return
thisPage.seek(item.mergedOffset)
this.setTopId(item, scroll)
if (click && item.text_id == activeId) {
const {
paused
} = this.innerAudioContext
if (paused) thisPage.play()
else thisPage.onPause()
thisPage.setData({
isOperate: !paused
})
} else {
thisPage.play()
thisPage.setData({
isOperate: false
})
}
},
formatTime(num) {
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return `${minutes}:${seconds}`
},
relativeToViewport() {
if (this.IntersectionObserver) return
this.IntersectionObserver = this.createIntersectionObserver({
observeAll: true
})
this.IntersectionObserver.relativeToViewport({
bottom: 1000,
top: 0,
}).observe('.item', res => {
const {
index
} = res.dataset, {
dialogueList
} = this.data, {
originalList
} = this,
item = dialogueList[index]
if (!item?.visible && res.intersectionRatio > 0) {
this.setData({
[`dialogueList[${index}]`]: originalList[index]
})
}
})
},
/**对话列表 */
async findConversationDetailByBatchId(params) {
const dialogueList = await api.findConversationDetailByBatchId(params)
this.getAudioObject()
dialogueList?.map(e => {
e.visible = true
e.time = this.formatTime(e.mergedOffset)
e.text_id = `text_${e.mergedOffset}`
if (e?.recordingCheckResultList && e.recordingCheckResultList.length) {
e.recordingCheckResultList.map(i => {
i.showCheckDetail = false
let [scriptRec] = JSON.parse(i.scriptRec)
if (scriptRec) i.scriptRec = scriptRec.replace(/\n/g, '<br>')
else i.scriptRec = ''
})
}
})
this.setData({
flag: true,
})
this.originalList = dialogueList
this.setDialogueData(dialogueList)
},
setDialogueData(dialogueList) {
wx.$util.showLoading('加载中...')
const batchSize = 100
let batch = []
// 遍历对话列表,累积数据
for (let i = 0; i < dialogueList.length; i++) {
batch.push({
visible: false,
text_id: dialogueList[i].text_id,
id: dialogueList[i].id,
mergedOffset: dialogueList[i].mergedOffset
});
// 当累积的数据达到批量大小时,执行 setData 更新
if ((i + 1) % batchSize === 0 || i === dialogueList.length - 1) {
this.setData({
dialogueList: [...this.data.dialogueList, ...batch]
});
batch = []; // 清空累积的数据,准备下一批
}
}
// // 确保最后不足100条的数据也被更新
if (batch.length > 0) {
this.setData({
dialogueList: [...this.data.dialogueList, ...batch]
})
}
// // 更新完成后清除加载提示
wx.hideLoading();
this.relativeToViewport();
},
/** 查询质检侧边栏 (质检使用id匹配,攻防用偏移量匹配) */
switchDetail(e) {
const {
index,
value,
ind,
key
} = e.currentTarget.dataset
let target = `dialogueList[${index}]`
if (ind > -1) target = `dialogueList[${index}].recordingCheckResultList[${ind}]`
this.setData({
[`${target}.${key}`]: !value
})
},
touchstart() {
this.setData({
isScrollling: true
})
this.clearTimer()
},
touchend() {
this.touchTimer = setTimeout(() => {
this.setData({
isScrollling: false
})
this.clearTimer()
}, 3e3)
},
clearTimer() {
if (this.touchTimer) {
clearTimeout(this.touchTimer)
this.touchTimer = null
}
},
onPause() {
this.setData({
isPlayIng: false
})
},
barSeek(e) {
function findNearest(arr, target) {
let closest = arr[0];
let minDiff = Math.abs(target - arr[0]);
for (let i = 1; i < arr.length; i++) {
const diff = Math.abs(target - arr[i]);
if (diff < minDiff) {
minDiff = diff;
closest = arr[i];
}
}
return closest;
}
let [touches] = e.touches, {
barTop,
containerHeight
} = this, {
duration
} = this.innerAudioContext, {
dialogueList
} = this.data
if (touches) {
let {
clientY
} = touches,
progress = (clientY - barTop) / containerHeight * 100,
offsetList = dialogueList.map(i => i.mergedOffset),
mergedOffset = findNearest(offsetList, duration * progress / 100),
item = dialogueList.find(i => i.mergedOffset == mergedOffset)
this.seekPlay({
currentTarget: {
dataset: {
item,
scroll: true
}
}
}, false)
}
},
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="view">
<block wx:if="{{flag}}">
<block wx:if="{{dialogueList.length}}">
<scroll-view class="scroll-view" enhanced scroll-y scroll-into-view="{{toId}}" show-scrollbar="{{false}}" bindtouchstart="touchstart" bindtouchend="touchend" scroll-with-animation bindscroll="watchScrollTrack" data-event-code="dialogue">
<block wx:for="{{dialogueList}}" wx:key="index">
<view class="item {{activeId == item.text_id?'active':''}}" id="{{item.text_id}}" data-click bindtap="seekPlay" data-item="{{item}}" data-index="{{index}}">
<block wx:if="{{item.visible}}">
<view class="avatar-box">
<view class="icon">
<!-- <image class="icon" src="/assets/images/role-{{item.role}}.png" /> -->
</view>
<view class="time">{{item.time}}</view>
</view>
<view class="text">
{{item.content}}
</view>
</block>
<block wx:else>
<view class="loading"></view>
</block>
</view>
<!-- 意图匹配 -->
<block wx:if="{{item.recordingCheckResultList}}">
<block wx:for="{{item.recordingCheckResultList}}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
<view class="detail-box {{i.showCheckDetail?'up':'down'}}">
<view class="text-box">
<view class="btn" bindtap="switchDetail" data-index="{{index}}" data-ind="{{ind}}" data-key="showCheckDetail" data-value="{{i.showCheckDetail}}">
意图匹配
<image class="arrow" src="/assets/images/date-arrow.png" mode=""/>
</view>
{{i.tagGroupName}}
<view class="score">{{i.score}}分</view>
</view>
<view class="content-box">
<block wx:if="{{!i.scriptRec}}">
<view class="suggestions-box no">
<image class="icon" src="/assets/images/no-suggestions.png" mode=""/>
暂无话术推荐
</view>
</block>
<block wx:else>
<view class="suggestions-box">
<view class="title">
<image class="icon" src="/assets/images/suggestions-icon.png" />
话术推荐
</view>
<view class="text">
<rich-text nodes="{{i.scriptRec}}"></rich-text>
</view>
</view>
</block>
</view>
</view>
</block>
</block>
</block>
<view class="safeAreaInset">到底了~</view>
</scroll-view>
</block>
<block wx:else>
<view class="nothing flex">
<!-- <image class="icon" src="/assets/images/quality-no-data.png" /> -->
分析中,稍等...
</view>
</block>
</block>
<view class="axis-bar-area" bindtap="barSeek" hidden="{{!qualityData.length}}">
<view class="axis-bar">
<view class="progress-bar" style="height:{{progress + '%'}}"></view>
<block wx:for="{{axisList}}" wx:key="index">
<view class="axis-item {{activeId == item.text_id?'axis-active':''}}" style="top:{{item.docTop + 'px'}};">
<view class="axis-dot {{!isPlayIng && !isScrollling?'':'radius'}}" catchtap="seekPlay" data-item="{{item}}" data-scroll></view>
</view>
<block wx:if="{{!isPlayIng && !isScrollling}}">
<view class="axis-text {{activeId == item.text_id?'axis-text-active':''}}" catchtap="seekPlay" data-item="{{item}}" data-scroll style="top:{{item.top + 'px'}};">
{{item.tagGroupName}}+{{item.score}}
</view>
</block>
</block>
<view class="hide-bar">
<block wx:for="{{axisList}}" wx:key="index">
<block wx:if="{{item.inspectionConversationDetailId}}">
<view class="axis-line {{item.colorName}}" style="height:{{item.height + 20 + 'px'}};top:{{item.docTop - 10 + 'px'}};"></view>
</block>
</block>
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/newReceptionRecords/components/quality/quality.js
let thisPage = null
Component({
/**
* 组件的属性列表
*/
properties: {
qualityData: Array
},
lifetimes: {
ready() {
this.getAudioObject()
}
},
/**
* 组件的初始数据
*/
data: {
activeIndex: 0,
activeId: '',
classifyId: ''
},
/**
* 组件的方法列表
*/
methods: {
reset() {
this.setData({
activeIndex: 0,
activeId: '',
classifyId: ''
})
this.getAudioObject()
},
getAudioObject() {
thisPage = wx.$router.getPageInstance()
if (thisPage.qualityAudio) this.innerAudioContext = thisPage.qualityAudio
else setTimeout(() => {
this.getAudioObject()
}, 100)
},
changeClassifyType(e) {
let {
index
} = e.currentTarget.dataset, {
activeIndex
} = this.data
if (activeIndex == index) return
this.setData({
activeIndex: index,
classifyId: `classify-${index}`
})
},
onTimeUpdate() {
const {
mergedOffset
} = this.setProgress()
this.setData({
activeId: `text_${mergedOffset}`
})
},
setProgress() {
const {
currentTime
} = this.innerAudioContext,
mergedOffset = Math.ceil(currentTime)
return {
currentTime,
mergedOffset
}
},
seekPlay(e) {
let {
activeId
} = this.data, {
item,
} = e.currentTarget.dataset
if (!item) return
thisPage.seek(item.mergedOffset)
if (item.text_id == activeId) {
const {
paused
} = this.innerAudioContext
if (paused) thisPage.play()
else thisPage.onPause()
thisPage.setData({
isOperate: !paused
})
} else {
thisPage.play()
thisPage.setData({
isOperate: false
})
}
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
.flex {
display: flex;
align-items: center;
}
.view {
height: 100%;
width: 100%;
position: relative;
.scroll-classify{
width: calc(100% - 56rpx);
margin: 0 28rpx;
}
.classify-wrap {
width: 100%;
box-sizing: border-box;
height: 112rpx;
display: flex;
flex-wrap: nowrap;
background: #f5f9ff;
border-radius: 16rpx 16rpx 0 0;
.classify-item {
min-width: 160rpx;
height: 100%;
padding: 0 24rpx;
flex-shrink: 0;
justify-content: center;
flex-direction: column;
line-height: 40rpx;
font-size: 28rpx;
transition: all 0.15s;
background: #f5f9ff;
.title {
color: #757980;
}
.score {
color: #347bff;
font-weight: 600;
}
}
.active {
border-radius: 16rpx 16rpx 0 0;
background: #ffffff;
.title {
color: #292d33;
font-weight: 600;
}
}
}
.scroll-view {
height: calc(100% - 112rpx);
}
.quality-block {
width: calc(100% - 56rpx);
margin: 0 28rpx;
.title {
height: 80rpx;
background: linear-gradient(119.9deg, #e1f7fc 0%, #f3f7ff 27%, #f7f2ff 41%, #e8f1ff 66%, #f7f2ff 100%);
font-size: 28rpx;
font-weight: 600;
padding: 0 20rpx;
&::before {
content: '';
width: 8rpx;
height: 8rpx;
background: #000000;
border-radius: 100%;
display: block;
margin-right: 16rpx;
}
.matched-btn {
margin-left: auto;
height: 56rpx;
border-radius: 28rpx;
background: #ffffff;
padding: 0 36rpx;
color: #eb4e4e;
font-size: 24rpx;
font-weight: 600;
}
.hit {
color: #35c376;
}
}
.quality-item {
padding: 20rpx 24rpx;
background: #fff;
.avatar-box {
position: relative;
width: 68rpx;
height: 96rpx;
flex-shrink: 0;
display: flex;
align-items: center;
flex-direction: column;
.icon {
width: 68rpx;
height: 68rpx;
border-radius: 100%;
overflow: hidden;
flex-shrink: 0;
}
.time {
width: 70rpx;
height: 28rpx;
background: #ffffff;
border: 2rpx solid #f0f6ff;
border-radius: 28rpx;
font-size: 20rpx;
color: #999ea8;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
}
.text {
width: 508rpx;
min-height: 80rpx;
color: #292d33;
font-size: 26rpx;
margin-left: 16rpx;
line-height: 44rpx;
}
}
.active {
background: #f0f6ff;
.text {
font-weight: 500;
}
}
.script-rec {
padding: 24rpx;
background-color: #f2f6ff;
.suggestions-box {
background: #FFF;
border-radius: 16rpx;
padding: 24rpx 28rpx;
box-sizing: border-box;
border: 2rpx solid #e8f0ff;
.suggestions-title {
display: flex;
align-items: center;
font-weight: 500;
font-size: 28rpx;
color: #333333;
margin-bottom: 20rpx;
.icon {
width:32rpx;
height:32rpx;
margin-right: 12rpx;
}
}
.text {
color: #292d33;
font-size: 26rpx;
line-height: 44rpx;
}
.suggestions-text {
padding-bottom: 22rpx;
border-bottom: 2rpx solid #f0f6ff;
margin-bottom: 24rpx;
}
}
}
.active {
background: #f0f6ff;
.text {
font-weight: 500;
}
}
}
.nothing {
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
color: #999ea8;
font-size: 24rpx;
background: #fff;
.icon {
width: 172rpx;
height: 172rpx;
}
}
}
\ No newline at end of file \ No newline at end of file
<view class="view">
<block wx:if="{{qualityData.length}}">
<scroll-view class="scroll-classify" scroll-x enable-flex scroll-into-view="{{classifyId}}" scroll-with-animation>
<view class="classify-wrap">
<block wx:for="{{qualityData}}" wx:key="index">
<view class="classify-item flex {{index == activeIndex?'active':''}}" bindtap="changeClassifyType" data-index="{{index}}" id="classify-{{index}}">
<view class="title">{{item.tagGroupName}}</view>
<view class="score">{{item.formatScore}}</view>
</view>
</block>
</view>
</scroll-view>
<scroll-view class="scroll-view" enhanced scroll-y scroll-with-animation scroll-into-view="{{activeId}}">
<block wx:if="{{qualityData[activeIndex]}}">
<view class="quality-block">
<view class="title flex">
{{qualityData[activeIndex].tagGroupName}}
<view class="matched-btn flex {{qualityData[activeIndex].matchedClass}}">{{qualityData[activeIndex].matchedText}}</view>
</view>
<block wx:for="{{qualityData[activeIndex].conversationDetailDTOList}}" wx:key="index">
<block wx:if="{{item.text_id}}">
<view id="{{item.text_id}}" class="quality-item flex {{item.text_id == activeId?'active':''}}" bind:tap="seekPlay" data-item="{{item}}">
<view class="avatar-box">
<view class="icon">
<!-- <image class="icon" src="/assets/images/role-{{item.role}}.png" /> -->
</view>
<view class="time">{{item.time}}</view>
</view>
<view class="text flex">{{item.content}}</view>
</view>
</block>
<block wx:if="{{item.scriptRec}}">
<view class="script-rec">
<view class="suggestions-box">
<view class="suggestions-title">
<image class="icon" src="/assets/images/suggestions-icon.png" />
话术推荐
</view>
<view class="text">
<rich-text nodes="{{item.scriptRec}}"></rich-text>
</view>
</view>
</view>
</block>
</block>
</view>
</block>
</scroll-view>
</block>
<block wx:else>
<view class="nothing flex">
<!-- <image class="icon" src="/assets/images/quality-no-data.png" /> -->
分析中,稍等...
</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
// packageIndex/pages/recordingReviewDetail/recordingReviewDetail.js // packageReception/pages/detail/detail.js
Page({ import api from '~/api/index/index'
/**
* 页面的初始数据
*/
data: {
},
/** Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 页面的初始数据
*/ */
onReady() { data: {
typeLists: ['对话', '质检'],
activeIndex: 0,
status: 'pause',
currentTime: '00:00', //当前音频的播放位置
isOperate: true,
},
}, /**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
record: options
})
this.setAudio()
this.getReceptionDetail()
wx.$util.getViewInfo('.reception-wrap', ({
height
}) => {
let wrapHeight = `${height * 2}rpx`
this.setData({
receptionWrapStyle: `height:calc(100% - ${wrapHeight} - constant(safe-area-inset-bottom));height:calc(100% - ${wrapHeight} - env(safe-area-inset-bottom))`
})
})
},
async getReceptionDetail() {
try {
wx.showLoading({
mask: true
})
const {
record: {
batchId
}
} = this.data,
data = await api.getReceptionDetail({
batchId
})
if (!data) throw '获取数据失败'
data.map(item => {
item.offset = Number(item.offset)
item.formatScore = `${item.score || item.score === 0 ? item.score : '-'}/${item.sumScore || item.sumScore === 0 ? item.sumScore : '-'}`
let hitTextList = JSON.parse(item.hitText),
matchedClass = 'no-hit',
matchedText = '意图不匹配'
if (hitTextList && hitTextList.length) {
item.hitTextList = hitTextList.map(e => e.replace(/\n/g, '<br>'))
matchedClass = 'hit'
matchedText = '意图匹配'
}
item.matchedClass = matchedClass
item.matchedText = matchedText
let [scriptRec] = JSON.parse(item.scriptRec)
if (scriptRec) scriptRec = scriptRec.replace(/\n/g, '<br>')
if (item.conversationDetailDTOList && item.conversationDetailDTOList.length) {
item.conversationDetailDTOList.map(e => {
e.time = this.formatTime(e.mergedOffset)
e.text_id = `text_${e.mergedOffset}`
if (e.mergedOffset == item.offset && !item.matched) {
e.scriptRec = scriptRec
item.matched = true
}
})
if (item.conversationDetailDTOList.findIndex(e => e.scriptRec) == -1) {
/**时间戳都对不上时 话术推荐加到最后 */
item.conversationDetailDTOList[item.conversationDetailDTOList.length - 1].scriptRec = scriptRec
}
} else item.conversationDetailDTOList = [{
scriptRec: scriptRec || '暂无建议'
}]
})
this.setData({
qualityData: data
})
} catch (error) {
console.log(error)
if (error) wx.$util.showToast(error)
}
},
formatTime(seconds) {
let minutes = Math.floor(seconds / 60);
let remainingSeconds = Math.floor(seconds % 60); // 直接取整
/** minutes = minutes.toString().padStart(2, '0');
* 生命周期函数--监听页面显示 remainingSeconds = remainingSeconds.toString().padStart(2, '0');
*/
onShow() {
}, return `${minutes}:${remainingSeconds}`;
},
navbarReady(e) {
let {
height
} = e.detail
this.setData({
layoutStyle: `padding-top:${height}px`
})
},
changeType(e) {
let {
index
} = e.currentTarget.dataset
this.setData({
activeIndex: index
})
},
onHandle(e) {
let {
isOperate
} = this.data;
if (isOperate) {
this.play()
} else {
this.onPause()
}
this.setData({
isOperate: !isOperate
})
},
//音频暂停
onPause() {
this.dialogueRef().onPause()
this.qualityAudio.pause()
/** },
* 生命周期函数--监听页面隐藏 //播放
*/ play() {
onHide() { if (!this.data.showPlayControl) {
return wx.showToast({
title: '音频暂不能播放,稍等...',
icon: 'none'
})
}
const {
paused
} = this.qualityAudio
if (paused) this.qualityAudio.play()
},
//跳转到指定位置
seek(time) {
this.qualityAudio.seek(time)
},
setAudio() {
const {
record
} = this.data
this.qualityAudio = wx.createInnerAudioContext({
useWebAudioImplement: true
})
this.qualityAudio.src = record.fileUrl
this.qualityAudio.onPause(() => {
this.setData({
status: 'pause'
})
this.setKeepScreenOn()
})
//监听音频的播放事件
this.qualityAudio.onPlay(() => {
this.setData({
status: 'start'
})
this.setKeepScreenOn(true)
})
this.qualityAudio.onCanplay(() => {
this.setData({
showPlayControl: true
})
})
this.qualityAudio.onTimeUpdate(this.onTimeUpdate)
this.qualityAudio.onEnded(() => {
this.setData({
status: 'ending',
currentTime: this.formatTime(this.qualityAudio.duration),
isOperate: true
})
this.dialogueRef().setData({
isPlayIng: false
})
this.setKeepScreenOn()
})
},
onTimeUpdate() {
this.setData({
currentTime: this.formatTime(this.qualityAudio.currentTime)
})
this.dialogueRef().onTimeUpdate()
this.qualityRef().onTimeUpdate()
},
dialogueRef() {
return this.selectComponent('#dialogue')
},
qualityRef() {
return this.selectComponent('#quality')
},
format(seconds) {
seconds = Math.floor(seconds / 1000)
let formattedTime = ''
if (seconds < 60) return seconds + '秒'
else {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
if (remainingSeconds > 0) formattedTime += remainingSeconds + '秒'
return formattedTime
}
},
//屏幕是否常亮
setKeepScreenOn(keepScreenOn = false) {
wx.setKeepScreenOn({
keepScreenOn
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面显示
*/ */
onUnload() { onShow() {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 生命周期函数--监听页面隐藏
*/ */
onPullDownRefresh() { onHide() {
this.qualityAudio.stop()
},
}, /**
* 生命周期函数--监听页面卸载
*/
onUnload() {
this.qualityAudio.stop()
},
/** /**
* 页面上拉触底事件的处理函数 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onReachBottom() { onPullDownRefresh() {
}, },
/** /**
* 用户点击右上角分享 * 页面上拉触底事件的处理函数
*/ */
onShareAppMessage() { onReachBottom() {
}
})
\ No newline at end of file \ No newline at end of file
},
})
{ {
"usingComponents": {} "usingComponents": {
"quality": "./components/quality/quality",
"dialogue":"./components/dialogue/dialogue"
},
"navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
/* packageIndex/pages/recordingReviewDetail/recordingReviewDetail.wxss */
\ No newline at end of file \ No newline at end of file
/* packageReception/pages/detail/detail.wxss */
page {
background: #f3f6fa;
}
.layout {
position: relative;
height: 100vh;
box-sizing: border-box;
&::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 480rpx;
background-image: url('https://img02.glsx.com.cn/weapp/resource/miniprogram/common/reception-bg.png');
background-repeat: no-repeat;
background-size: 100% 100%;
z-index: -1;
}
.customer-list {
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
gap: 0 16rpx;
padding: 8rpx 0 24rpx;
.customer-item {
height: 60rpx;
border-radius: 12rpx;
background: #ffffff;
padding: 0 24rpx;
color: #383a3d;
font-size: 28rpx;
border: 2rpx solid #fff;
flex-shrink: 0;
&:first-of-type {
margin-left: 32rpx;
}
&:last-of-type {
margin-right: 32rpx;
}
.name {
max-width: 224rpx;
}
.score {
flex-shrink: 0;
color: #9d9fa3;
margin-left: 8rpx;
}
}
.active {
border-color: #3773f8;
background: #3773f81a;
color: #3773f8;
font-weight: 500;
.score {
color: #3773f8;
}
}
}
.customer-info-box {
height: 142rpx;
border-radius: 24rpx;
background: #ffffff;
margin: 0 32rpx;
padding: 24rpx;
box-sizing: border-box;
position: relative;
.customer-icon {
width: 80rpx;
height: 80rpx;
margin-right: 16rpx;
}
.customer-info {
display: flex;
flex-direction: column;
height: 100%;
.customer-name {
color: #9d9fa3;
font-size: 24rpx;
.name {
color: #292d33;
font-size: 30rpx;
max-width: 360rpx;
font-weight: 500;
margin-right: 8rpx;
}
}
.customer-car {
margin-top: auto;
transform: translateY(-8rpx);
.customer-car-item {
margin-right: 12rpx;
padding: 0 8rpx;
height: 32rpx;
border-radius: 4rpx;
border: 2rpx solid #e8ecf0;
display: flex;
align-items: center;
color: #9d9fa3;
font-size: 22rpx;
box-sizing: border-box;
width: fit-content;
}
}
}
.customer-score {
position: absolute;
right: 24rpx;
bottom: 24rpx;
color: #292d33;
font-size: 24rpx;
font-weight: 500;
display: flex;
align-items: baseline;
.num {
font-size: 40rpx;
margin-right: 4rpx;
}
}
}
.reception-nav {
display: flex;
align-items: center;
justify-content: space-between;
padding: 24rpx 32rpx 16rpx;
.reception-types {
display: flex;
align-items: center;
.type {
width: 144rpx;
line-height: 40rpx;
padding: 10rpx 0;
background: #FFFFFF;
border-radius: 12rpx;
margin-right: 16rpx;
color: #5a5e66;
font-size: 28rpx;
font-weight: 400;
text-align: center;
}
.active {
font-weight: 600;
color: #fff;
background: linear-gradient(135deg, #4f52ff 0%, #349bff 100%);
}
}
.reception-operate {
display: flex;
align-items: center;
.img {
width: 52rpx;
height: 52rpx;
}
.share {
margin-right: 12rpx;
}
.audio-wrap {
min-width: 140rpx;
height: 60rpx;
display: flex;
align-items: center;
background: #FFFFFF;
padding: 4rpx;
border-radius: 28rpx;
box-sizing: border-box;
transition: all .1s;
.time {
font-weight: 400;
font-size: 26rpx;
color: #757980;
margin-left: 4rpx;
}
}
}
}
}
.type-wrap {
position: relative;
.component-item {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
transition: all 0.15s;
}
.hide {
opacity: 0;
z-index: -1;
}
}
\ No newline at end of file \ No newline at end of file
<!--packageIndex/pages/recordingReviewDetail/recordingReviewDetail.wxml-->
<text>packageIndex/pages/recordingReviewDetail/recordingReviewDetail.wxml</text>
\ No newline at end of file \ No newline at end of file
<navigation-bar bindnavbarReady="navbarReady" navStyle="background-color:transparent;" showBack>接待详情</navigation-bar>
<view class="layout" style="{{layoutStyle}}">
<view class="reception-wrap">
<view class="customer-info-box flex">
<!-- <image src="/assets/images/portrait.png" class="customer-icon" /> -->
<view class="customer-info">
<view class="customer-name flex">
<view class="name text-hide">{{record.customerName}}</view>
{{record.customerPhone}}
</view>
<view class="customer-car flex">
<block wx:if="{{record.carBrand}}">
<view class="customer-car-item">{{record.carBrand}}</view>
</block>
<block wx:if="{{record.carModel}}">
<view class="customer-car-item">{{record.carModel}}</view>
</block>
</view>
</view>
<view class="customer-score">
<view class="num">{{record.score}}</view>
分
</view>
</view>
<view class="reception-nav">
<view class="reception-types">
<block wx:for="{{typeLists}}" wx:key="index">
<view class="type {{activeIndex==index?'active':''}}" data-index="{{index}}" bind:tap="changeType">{{item}}</view>
</block>
</view>
<view class="reception-operate">
<view class="audio-wrap" bind:tap="onHandle">
<!-- <image class="img" src="/assets/images/play.png" wx:if="{{status=='pause'||status=='ending'}}" />
<image class="img" src="/assets/images/stop.png" wx:else /> -->
<view class="time">{{currentTime}}</view>
</view>
</view>
</view>
</view>
<view class="type-wrap" style="{{receptionWrapStyle}}">
<block wx:if="{{receptionWrapStyle}}">
<view class="component-item {{activeIndex != 0 ?'hide':''}}">
<dialogue id="dialogue" batchId="{{record.batchId}}" recordData="{{record}}" qualityData="{{qualityData}}"></dialogue>
</view>
<view class="component-item {{activeIndex != 1?'hide':''}}">
<quality id="quality" qualityData="{{qualityData}}"></quality>
</view>
</block>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -61,9 +61,9 @@ const domain_items = { ...@@ -61,9 +61,9 @@ const domain_items = {
// dj: 'http://192.168.1.165:8292', // dj: 'http://192.168.1.165:8292',
// dj: 'http://192.168.1.104:8292', //叶立庆 // dj: 'http://192.168.1.104:8292', //叶立庆
// dj: "http://192.168.1.169:8292", //蔡远明 // dj: "http://192.168.1.169:8292", //蔡远明
// dj: 'http://192.168.1.104:8292',//范富荣 dj: 'http://192.168.3.193:8429',//范富荣
// dj: 'http://192.168.1.89:8292', //周杭 // dj: 'http://192.168.1.89:8292', //周杭
dj: 'http://192.168.1.76:8292', //璐琦 // dj: 'http://192.168.1.76:8292', //璐琦
// dj: 'http://192.168.1.111:8594', // dj: 'http://192.168.1.111:8594',
// dj: 'http://192.168.1.227:8292',//陈希 // dj: 'http://192.168.1.227:8292',//陈希
// dj: 'http://192.168.1.67:8292',//周立明 // dj: 'http://192.168.1.67:8292',//周立明
...@@ -106,6 +106,14 @@ const domain_items = { ...@@ -106,6 +106,14 @@ const domain_items = {
const target = ["ip", "dev", "uat", "prod", "preRelease", "cdptest"]; const target = ["ip", "dev", "uat", "prod", "preRelease", "cdptest"];
const gscDomain = {
ip: 'http://192.168.3.145:9898',
dev: 'https://gsc-agent.dev.glsx.com.cn',
uat: 'https://gsc-agent.test.glsx.com.cn',
preRelease: 'https://gsc-agent.beta.glsx.com.cn',
prod: 'https://gsc-agent.gldijia.com.cn'
} [target[envIndex]]
module.exports = { module.exports = {
domain: domain_items[target[envIndex]], domain: domain_items[target[envIndex]],
secretKey: { secretKey: {
...@@ -114,4 +122,5 @@ module.exports = { ...@@ -114,4 +122,5 @@ module.exports = {
merchants: scrmSecretKey_items[target[envIndex]], merchants: scrmSecretKey_items[target[envIndex]],
clue: scrmSecretKey_items[target[envIndex]] clue: scrmSecretKey_items[target[envIndex]]
}, },
gscDomain
}; };
\ No newline at end of file \ No newline at end of file
import { import {
gscDomain,
secretKey, secretKey,
domain, domain,
path, path,
...@@ -18,6 +19,7 @@ class Request { ...@@ -18,6 +19,7 @@ class Request {
post(method, data, noSignAttr, requestPath, domainName, failTips) { post(method, data, noSignAttr, requestPath, domainName, failTips) {
return this.request('POST', method, data, noSignAttr, requestPath, domainName, failTips) return this.request('POST', method, data, noSignAttr, requestPath, domainName, failTips)
} }
request(RequestMethods, method, data, noSignAttr = [], requestPath, domainName = 'dj', failTips = true) { request(RequestMethods, method, data, noSignAttr = [], requestPath, domainName = 'dj', failTips = true) {
let _this = this let _this = this
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -159,5 +161,36 @@ class Request { ...@@ -159,5 +161,36 @@ class Request {
}) })
}) })
} }
gscPost(url, data = {}, returnAll = false) {
return this.gscRequest(url, data, 'POST', returnAll)
}
gscRequest(url, data = {}, method = 'GET', returnAll) {
return new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
wx.request({
url: `${gscDomain}/gsc-agent-manage-biz/${url}`,
data,
method,
success(response) {
let {
data
} = response
if (returnAll) {
resolve(data)
return
}
resolve(data.data)
},
fail(error) {
wx.hideLoading()
reject(error)
},
complete() {
wx.stopPullDownRefresh()
wx.hideNavigationBarLoading()
}
})
})
}
} }
export default new Request() export default new Request()
\ 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!