Commit dcec7aa7 by 李伟康

更新环境配置和请求处理逻辑

1. 修改默认环境index从2改为3,指向生产环境
2. 更新gscDomain的uat和prod配置
3. 优化http.js请求处理逻辑,移除无用console.log
4. 修复dialogue.js组件中的异步处理问题
1 parent f76fc91c
import {
preReleaseAppId
} from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 2
/**
*
0本地
1开发
2测试
3生产
4预发布
*/
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion)
//手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = true
const release = false
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
// trial:体验版
// release:正式版
// console.log( systemInfo.platform);
// console.log(accountInfo.miniProgram.envVersion);
// 对比一下appkey
// console.log();
if (systemInfo.platform != 'devtools') {
// 判断预发布的appid 是强制锁定为4(预发布的地址)
if (accountInfo.miniProgram.appId == preReleaseAppId) {
index = 4
} else {
switch (accountInfo.miniProgram.envVersion) {
case 'develop':
// this.globalData.url = 'http://192.168.0.252:3000/api'; //
break
case 'trial':
index = manual ? index : 2
break
case 'release':
index = release ? index : 3
break
default:
index = 3
break
}
}
}
const secretKey = {
ip: {},
dev: {
sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}
},
uat: {
sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}
},
prod: {
sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}
},
preRelease: {
sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}
}
} [target[index]]
const domain = {
// ip: 'http://192.168.2.94:8558',
// ip: 'http://192.168.2.3:8315',
ip: 'http://192.168.1.170:8315',
/**登录: 192.168.2.3:8315
商城: 192.168.2.3:8558 */
dev: 'https://scrm.dev.glsx.com.cn',
uat: 'https://scrm.test.glsx.com.cn',
preRelease: 'https://scrm.beta.glsx.com.cn',
prod: 'https://scrm.glsx.com.cn'
} [target[index]]
const djDomain = {
ip: 'https://dj.dev.glsx.com.cn',
dev: 'https://dj.dev.glsx.com.cn',
preRelease: 'https://dj.beta.glsx.com.cn',
uat: 'https://dj.test.glsx.com.cn',
prod: 'https://dj.glsx.com.cn',
} [target[index]]
const djSecretKey = {
ip: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
dev: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
uat: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
preRelease: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
prod: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
},
pet: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}
} [target[index]]
const gscDomain = {
ip: 'http://192.168.3.145:9898',
dev: 'https://gsc-agent.dev.glsx.com.cn',
uat: 'https://gsc-agent.dev.glsx.com.cn',
preRelease: 'https://gsc-agent.beta.glsx.com.cn',
prod: 'https://gsc-agent.glsx.com.cn'
} [target[index]]
const pathEnum = {
sso: '/rop-scrm-sso/',
shopmall: '/rop-scrm-shopmall/',
coupon: '/rop-scrm-coupon/',
carlife: '/rop-scrm-carlife/',
live: '/rop-scrm-live/',
equity: '/rop-scrm-equity/',
entmicro: '/rop-scrm-entmicro/',
wechat: '/rop-scrm-wechat/',
boutiquecoupon: '/rop-scrm-boutiquecoupon/',
material: '/rop-scrm-marketing/', //素材
sop: '/rop-scrm-sop/',
customercollect: '/rop-scrm-bigdatautil/',
drac: '/rop-scrm-entmicro/',
busassistant: '/rop-scrm-busassistant/',
pad: '/rop-dj-pad/',
}
const defaultMerchantId = {
ip: '44211227',
dev: '44211227',
uat: '44210895',
prod: '44208317',
preRelease: '44211283'
} [target[index]]
const CONFIG_ENV_MAP = {
'1': 'develope',
'2': 'test',
'3': 'production',
'4': 'beta'
}
module.exports = {
index,
domain,
pathEnum,
secretKey,
defaultMerchantId,
env: CONFIG_ENV_MAP[index],
gscDomain,
djSecretKey,
djDomain
import {
preReleaseAppId
} from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 3
/**
*
0本地
1开发
2测试
3生产
4预发布
*/
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
// console.log(systemInfo);
// console.log(accountInfo.miniProgram.envVersion)
//手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = true
const release = false
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
// trial:体验版
// release:正式版
// console.log( systemInfo.platform);
// console.log(accountInfo.miniProgram.envVersion);
// 对比一下appkey
// console.log();
if (systemInfo.platform != 'devtools') {
// 判断预发布的appid 是强制锁定为4(预发布的地址)
if (accountInfo.miniProgram.appId == preReleaseAppId) {
index = 4
} else {
switch (accountInfo.miniProgram.envVersion) {
case 'develop':
// this.globalData.url = 'http://192.168.0.252:3000/api'; //
break
case 'trial':
index = manual ? index : 2
break
case 'release':
index = release ? index : 3
break
default:
index = 3
break
}
}
}
const secretKey = {
ip: {},
dev: {
sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}
},
uat: {
sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}
},
prod: {
sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}
},
preRelease: {
sso: {
appKey: '8b31ae1009ccb0f96130ca4bd90e3d89',
secret: '02d60f17ae714872845d2aa9d3b087e109ccb0f96130ca4b'
}
}
} [target[index]]
const domain = {
// ip: 'http://192.168.2.94:8558',
// ip: 'http://192.168.2.3:8315',
ip: 'http://192.168.1.170:8315',
/**登录: 192.168.2.3:8315
商城: 192.168.2.3:8558 */
dev: 'https://scrm.dev.glsx.com.cn',
uat: 'https://scrm.test.glsx.com.cn',
preRelease: 'https://scrm.beta.glsx.com.cn',
prod: 'https://scrm.glsx.com.cn'
} [target[index]]
const djDomain = {
ip: 'https://dj.dev.glsx.com.cn',
dev: 'https://dj.dev.glsx.com.cn',
preRelease: 'https://dj.beta.glsx.com.cn',
uat: 'https://dj.test.glsx.com.cn',
prod: 'https://dj.glsx.com.cn',
} [target[index]]
const djSecretKey = {
ip: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
dev: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
uat: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
preRelease: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
},
prod: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
},
pet: {
appKey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}
} [target[index]]
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[index]]
const pathEnum = {
sso: '/rop-scrm-sso/',
shopmall: '/rop-scrm-shopmall/',
coupon: '/rop-scrm-coupon/',
carlife: '/rop-scrm-carlife/',
live: '/rop-scrm-live/',
equity: '/rop-scrm-equity/',
entmicro: '/rop-scrm-entmicro/',
wechat: '/rop-scrm-wechat/',
boutiquecoupon: '/rop-scrm-boutiquecoupon/',
material: '/rop-scrm-marketing/', //素材
sop: '/rop-scrm-sop/',
customercollect: '/rop-scrm-bigdatautil/',
drac: '/rop-scrm-entmicro/',
busassistant: '/rop-scrm-busassistant/',
pad: '/rop-dj-pad/',
}
const defaultMerchantId = {
ip: '44211227',
dev: '44211227',
uat: '44210895',
prod: '44208317',
preRelease: '44211283'
} [target[index]]
const CONFIG_ENV_MAP = {
'1': 'develope',
'2': 'test',
'3': 'production',
'4': 'beta'
}
module.exports = {
index,
domain,
pathEnum,
secretKey,
defaultMerchantId,
env: CONFIG_ENV_MAP[index],
gscDomain,
djSecretKey,
djDomain
}
\ No newline at end of file
import sign from './sign.js'
import {
defaultMerchantId,
secretKey,
pathEnum,
domain,
gscDomain,
djDomain,
djSecretKey
} from '../env/index'
const HOST = {
scrm: domain,
dj: djDomain
}
/**接口 */
class Request {
get(params, returnAll = false, hostType = 'scrm') {
return this.request('GET', params, returnAll, hostType)
}
post(params, returnAll = false, hostType = 'scrm') {
return this.request('POST', params, returnAll, hostType)
}
fetch(method, data, returnAll = true, hostType = 'scrm') {
return this.post({
method,
...data,
},
returnAll,
hostType
);
}
wx_request({
url,
method = 'GET',
data = {},
header = {},
dataType = 'json',
responseType = "text"
}) {
return new Promise((resolve) => {
wx.request({
url,
data,
method,
header,
dataType,
responseType,
success(response) {
resolve(response.data)
}
})
})
}
reportTrack(params) {
return this.request('POST', params, true)
}
request(RequestMethods, params, returnAll , hostType = 'scrm') {
return new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
let header = RequestMethods === 'POST' ? {
'content-type': 'application/x-www-form-urlencoded'
} : {
'Cache-Control': 'no-cache'
}
let {
merchantId
} = wx.p.storage.get('merchant_info')
header.merchantId = wx.$merchant_id || merchantId || defaultMerchantId
let projectName = params.projectName
if (!projectName) projectName = this.getRopProject(params.method)
const path = pathEnum[projectName]
params = this.getData(params, hostType)
wx.request({
url: `${HOST[hostType]}${path}router?method=${params.method}`,
data: params,
method: RequestMethods,
header,
dataType: 'json',
responseType: 'text',
success(response) {
/**业务代码 */
let {
data: {
code,
message
},
data
} = response
if (returnAll) {
resolve(data)
return
}
if (code == 20 || code == 21) {
wx.hideLoading()
const thisPage = wx.p.router.getPageInstance(),
options = Object.keys(thisPage.options)
let currentRoute = thisPage.route,
query = []
if (options.length) {
options.map(key => {
query.push(`${key}=${thisPage.options[key]}`)
})
}
if (query.length) currentRoute += `?${query.join('&')}`
return wx.p.router.redirectTo('/pages/loading/loading', {
url: `/${currentRoute}`
})
} else {
if (code == '0') {
resolve(data.data)
} else {
wx.showToast({
title: message || '系统异常',
icon: 'none'
})
}
}
},
fail(error) {
wx.hideLoading()
console.error(`接口异常:`, error)
wx.showToast({
title: typeof error == 'string' ? error : JSON.stringify(error) || '系统异常',
icon: 'error'
})
reject(error)
},
complete() {
wx.stopPullDownRefresh()
wx.hideNavigationBarLoading()
}
})
})
}
getData(params,hostType) {
let projectName = params.projectName
if (!projectName) projectName = this.getRopProject(params.method)
else delete params.projectName
let appKey = '48e5e13229b82c1b4e6e8c96151f0637'
let secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
if (secretKey[projectName]) {
appKey = secretKey[projectName].appKey
secret = secretKey[projectName].secret
}
if(hostType == 'dj'){
appKey = djSecretKey.appKey
secret = djSecretKey.secret
}
let {
sessionId
} = wx.p.storage.get()
let noSignAttr = []
if (!params.sessionId && sessionId) params.sessionId = sessionId
if (params.delSessionId) {
delete params.sessionId
delete params.delSessionId
}
if (params.noSignAttr) {
noSignAttr = params.noSignAttr
delete params.noSignAttr
}
params.v = '1.0.0'
params.format = 'json'
params.locale = 'zh_CN'
params.source = 'dj-wechat'
params.appKey = appKey
return sign(params, secret, noSignAttr)
}
getRopProject(method) {
const projectName = method.split('.')[2]
return projectName
}
gscGet(url, data = {}, returnAll = false) {
return this.gscRequest(url, params, 'GET', returnAll)
}
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() {
console.log(`${gscDomain}/gsc-agent-manage-biz/${url}`)
wx.stopPullDownRefresh()
wx.hideNavigationBarLoading()
}
})
})
}
}
import sign from './sign.js'
import {
defaultMerchantId,
secretKey,
pathEnum,
domain,
gscDomain,
djDomain,
djSecretKey
} from '../env/index'
const HOST = {
scrm: domain,
dj: djDomain
}
/**接口 */
class Request {
get(params, returnAll = false, hostType = 'scrm') {
return this.request('GET', params, returnAll, hostType)
}
post(params, returnAll = false, hostType = 'scrm') {
return this.request('POST', params, returnAll, hostType)
}
fetch(method, data, returnAll = true, hostType = 'scrm') {
return this.post({
method,
...data,
},
returnAll,
hostType
);
}
wx_request({
url,
method = 'GET',
data = {},
header = {},
dataType = 'json',
responseType = "text"
}) {
return new Promise((resolve) => {
wx.request({
url,
data,
method,
header,
dataType,
responseType,
success(response) {
resolve(response.data)
}
})
})
}
reportTrack(params) {
return this.request('POST', params, true)
}
request(RequestMethods, params, returnAll , hostType = 'scrm') {
return new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
let header = RequestMethods === 'POST' ? {
'content-type': 'application/x-www-form-urlencoded'
} : {
'Cache-Control': 'no-cache'
}
let {
merchantId
} = wx.p.storage.get('merchant_info')
header.merchantId = wx.$merchant_id || merchantId || defaultMerchantId
let projectName = params.projectName
if (!projectName) projectName = this.getRopProject(params.method)
const path = pathEnum[projectName]
params = this.getData(params, hostType)
wx.request({
url: `${HOST[hostType]}${path}router?method=${params.method}`,
data: params,
method: RequestMethods,
header,
dataType: 'json',
responseType: 'text',
success(response) {
/**业务代码 */
let {
data: {
code,
message
},
data
} = response
if (returnAll) {
resolve(data)
return
}
if (code == 20 || code == 21) {
wx.hideLoading()
const thisPage = wx.p.router.getPageInstance(),
options = Object.keys(thisPage.options)
let currentRoute = thisPage.route,
query = []
if (options.length) {
options.map(key => {
query.push(`${key}=${thisPage.options[key]}`)
})
}
if (query.length) currentRoute += `?${query.join('&')}`
return wx.p.router.redirectTo('/pages/loading/loading', {
url: `/${currentRoute}`
})
} else {
if (code == '0') {
resolve(data.data)
} else {
wx.showToast({
title: message || '系统异常',
icon: 'none'
})
}
}
},
fail(error) {
wx.hideLoading()
console.error(`接口异常:`, error)
wx.showToast({
title: typeof error == 'string' ? error : JSON.stringify(error) || '系统异常',
icon: 'error'
})
reject(error)
},
complete() {
wx.stopPullDownRefresh()
wx.hideNavigationBarLoading()
}
})
})
}
getData(params,hostType) {
let projectName = params.projectName
if (!projectName) projectName = this.getRopProject(params.method)
else delete params.projectName
let appKey = '48e5e13229b82c1b4e6e8c96151f0637'
let secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
if (secretKey[projectName]) {
appKey = secretKey[projectName].appKey
secret = secretKey[projectName].secret
}
if(hostType == 'dj'){
appKey = djSecretKey.appKey
secret = djSecretKey.secret
}
let {
sessionId
} = wx.p.storage.get()
let noSignAttr = []
if (!params.sessionId && sessionId) params.sessionId = sessionId
if (params.delSessionId) {
delete params.sessionId
delete params.delSessionId
}
if (params.noSignAttr) {
noSignAttr = params.noSignAttr
delete params.noSignAttr
}
params.v = '1.0.0'
params.format = 'json'
params.locale = 'zh_CN'
params.source = 'dj-wechat'
params.appKey = appKey
return sign(params, secret, noSignAttr)
}
getRopProject(method) {
const projectName = method.split('.')[2]
return projectName
}
gscGet(url, data = {}, returnAll = false) {
return this.gscRequest(url, params, 'GET', returnAll)
}
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()
\ No newline at end of file
// packageEquity/pages/receptionDetail/components/dialogue/dialogue.js
let thisPage = null
Component({
/**
* 组件的属性列表
*/
properties: {
recordData: Object,
batchId: {
type: Number,
observer: function (n) {
const data = {
batchId: n,
};
this.findConversationDetailByBatchId(data)
}
},
totalDuration: {
type: Number,
value: 0
},
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 {
recordingDuration:totalDuration
} = this.data.recordData,
margin = 20
wx.p.wxApi.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.p.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 wx.p.api.receptionApi.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.p.wxApi.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)
}
},
}
// packageEquity/pages/receptionDetail/components/dialogue/dialogue.js
let thisPage = null
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)
}
},
totalDuration: {
type: Number,
value: 0
},
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 {
recordingDuration: totalDuration
} = this.data.recordData,
margin = 20
wx.p.wxApi.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.p.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 wx.p.api.receptionApi.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.p.wxApi.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
<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 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
// packageEquity/pages/newReceptionRecords/components/quality/quality.js
let thisPage = null
Component({
/**
* 组件的属性列表
*/
properties: {
qualityData: Array
},
lifetimes: {
ready() {
this.getAudioObject()
}
},
/**
* 组件的初始数据
*/
data: {
activeIndex: 0,
activeId: ''
},
/**
* 组件的方法列表
*/
methods: {
getAudioObject() {
thisPage = wx.p.router.getPageInstance()
if (thisPage.qualityAudio) this.innerAudioContext = thisPage.qualityAudio
else setTimeout(() => {
this.getAudioObject()
}, 100)
},
changeClassifyType(e) {
let {
index
} = e.currentTarget.dataset
this.setData({
activeIndex: 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
})
}
}
}
// 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.p.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
.flex {
display: flex;
align-items: center;
}
.view {
height: 100%;
width: 100%;
position: relative;
.classify-wrap {
margin: 0 28rpx;
box-sizing: border-box;
width: calc(100% - 56rpx);
height: 112rpx;
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
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;
}
}
.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
<view class="view">
<block wx:if="{{qualityData.length}}">
<view class="classify-wrap">
<block wx:for="{{qualityData}}" wx:key="index">
<view class="classify-item flex {{index == activeIndex?'active':''}}" bindtap="changeClassifyType" data-index="{{index}}">
<view class="title">{{item.tagGroupName}}</view>
<view class="score">{{item.formatScore}}</view>
</view>
</block>
</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 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
// packageReception/pages/detail/detail.js
Page({
/**
* 页面的初始数据
*/
data: {
typeLists: ['对话', '质检'],
qualityAudio: '',
activeIndex: 0,
status: 'pause',
currentTime: '00:00', //当前音频的播放位置
isOperate: true,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getReceptionBatchIdList(options)
},
async getReceptionBatchIdList(params) {
const data = await wx.p.api.receptionApi.getReceptionBatchIdList(params)
if (data && data.length) {
this.setData({
customerList: data,
record: data[0]
}, () => {
this.setAudio()
})
this.getReceptionDetail()
}
wx.p.wxApi.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 {
const {
record: {
batchId
}
} = this.data,
data = await wx.p.api.receptionApi.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.p.wxApi.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');
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() {
const {
openId
} = this.data.userInfo
wx.p.api.receptionApi.addCustomerDynamicRecord({
customerOpenId: openId,
goodsId: 1,
goodsType: 1
})
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.recordingUrl
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() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
this.qualityAudio.stop()
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
this.qualityAudio.stop()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
// packageReception/pages/detail/detail.js
Page({
/**
* 页面的初始数据
*/
data: {
typeLists: ['对话', '质检'],
activeIndex: 0,
status: 'pause',
currentTime: '00:00', //当前音频的播放位置
isOperate: true,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getReceptionBatchIdList(options)
},
async getReceptionBatchIdList(params) {
const data = await wx.p.api.receptionApi.getReceptionBatchIdList(params)
if (data && data.length) {
this.setData({
customerList: data,
record: data[0]
}, () => {
this.setAudio()
})
this.getReceptionDetail()
}
wx.p.wxApi.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))`
})
})
},
changeDetail(e) {
let {
item
} = e.currentTarget.dataset, {
record
} = this.data
if (!item || item.batchId == record.batchId) return
wx.showLoading({
mask: true
})
this.qualityAudio.destroy()
this.qualityRef().reset()
this.setData({
record: item,
qualityData: [],
status: 'pause',
isOperate: true,
currentTime: '00:00',
}, () => {
this.setAudio()
})
this.getReceptionDetail()
},
async getReceptionDetail() {
try {
wx.showLoading({
mask: true
})
const {
record: {
batchId
}
} = this.data,
data = await wx.p.api.receptionApi.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.p.wxApi.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');
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() {
const {
openId
} = this.data.userInfo
wx.p.api.receptionApi.addCustomerDynamicRecord({
customerOpenId: openId,
goodsId: 1,
goodsType: 1
})
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.recordingUrl
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() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
this.qualityAudio.stop()
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
this.qualityAudio.stop()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
})
\ 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;
.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;
}
/* 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
<navigation-bar bindnavbarReady="navbarReady" navStyle="background-color:transparent;" showBack>接待详情</navigation-bar>
<view class="layout" style="{{layoutStyle}}">
<view class="reception-wrap">
<view class="customer-list">
<block wx:for="{{customerList}}" wx:key="index">
<view class="customer-item flex {{item.batchId == record.batchId?'active':''}}">
<view class="name text-hide">{{item.customerName}}</view>
<block wx:if="{{item.score != null}}">
<view class="score">{{item.score}}分</view>
</block>
</view>
</block>
</view>
<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">
<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>
<navigation-bar bindnavbarReady="navbarReady" navStyle="background-color:transparent;" showBack>接待详情</navigation-bar>
<view class="layout" style="{{layoutStyle}}">
<view class="reception-wrap">
<view class="customer-list">
<block wx:for="{{customerList}}" wx:key="index">
<view class="customer-item flex {{item.batchId == record.batchId?'active':''}}" bindtap="changeDetail" data-item="{{item}}">
<view class="name text-hide">{{item.customerName}}</view>
<block wx:if="{{item.score != null}}">
<view class="score">{{item.score}}分</view>
</block>
</view>
</block>
</view>
<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
// pages/reception/index.js
import dayjs from 'dayjs'
Page({
/**
* 页面的初始数据
*/
data: {
list: [],
tips: '今日无待处理复盘,请继续保持!'
},
/**
* 生命周期函数--监听页面加载
*/
async onLoad(options) {
},
async getAiagent(params) {
const {
bussinessType,
staffUuid,
phone,
channelType,
modelType
} = params,
{reviewDate} = this.options
const [data] = await wx.p.api.receptionApi.getAiagent({
ownerShipType: 1,
accountPhone: phone,
agentCode: 'AI8'
})
if (data) {
console.log(data, '---')
let {
agentUrl,
domainName,
taskStatus
} = data,
brand = {
1: '问界',
2: '比亚迪',
3: '其他'
} [channelType],
AIUrl = `${agentUrl}?no_header=1&businessType=${bussinessType}&one_id=${staffUuid}&platformType=1&domain=${domainName}&brandType=${modelType || 1001}`
AIUrl += `&phone=${phone}&brand=${brand}&date=${dayjs(reviewDate).format('YYYY-MM-DD')}`
if (taskStatus) AIUrl += `&practice_status=${taskStatus}`
this.setData({
AIUrl
})
} else wx.p.wxApi.showToast('获取智能体失败')
},
async getReceptionList(params) {
try {
wx.showLoading({
mask: true
})
console.log(params)
const data = await wx.p.api.receptionApi.getReceptionList(params)
let total = data.reduce((sum, e) => {
const length = e?.sopTaskDetailTagList?.length || 0
return sum + Number(length)
}, 0)
this.setData({
total,
list: data,
loadComplete: true,
tips: total ? `今日有 ${total} 条待复盘记录,请尽快处理哦~` : '今日无待处理复盘,请继续保持!'
})
if (data && data.length && !this.data.AIUrl) this.getAiagent(data[0])
wx.hideLoading()
console.log(data)
} catch (error) {
console.log(error)
wx.hideLoading()
this.setData({
loadComplete: true,
})
}
},
toDetail() {
const {
openId
} = this.data.userInfo
wx.p.api.receptionApi.addCustomerDynamicRecord({
customerOpenId: openId,
goodsId: 1,
goodsType: 3
})
wx.p.router.go('/packageReception/pages/detail/detail', this.options)
},
jumpAI(e) {
const {
openId
} = this.data.userInfo
wx.p.api.receptionApi.addCustomerDynamicRecord({
customerOpenId: openId,
goodsId: 1,
goodsType: 2
})
let {
item
} = e.currentTarget.dataset, {
AIUrl
} = this.data
AIUrl += `&presuppositionProblem=${item.tagName}`
wx.p.router.jumpH5(AIUrl, true)
console.log(e)
},
navbarReady(e) {
let {
height
} = e.detail
this.setData({
layoutStyle: `padding-top:${height}px`
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.getReceptionList(this.options)
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
}
// pages/reception/index.js
import dayjs from 'dayjs'
Page({
/**
* 页面的初始数据
*/
data: {
list: [],
tips: '今日无待处理复盘,请继续保持!'
},
/**
* 生命周期函数--监听页面加载
*/
async onLoad(options) {},
async getAiagent(params) {
let {
bussinessType,
staffUuid,
phone,
channelType,
modelType
} = params, {
reviewDate
} = this.options
const [data] = await wx.p.api.receptionApi.getAiagent({
ownerShipType: 1,
accountPhone: phone,
agentCode: 'AI8'
})
if (data) {
let {
agentUrl,
domainName,
taskStatus
} = data,
brand = {
1: '问界',
2: '比亚迪',
3: '其他'
} [channelType],
AIAvatar = 'https://img01.glsx.com.cn/weapp/resource/miniprogram/common/avatar_ai.png', //左侧头像
AIUrl = `${agentUrl}?avatar_ai=${AIAvatar}&no_header=1&businessType=${bussinessType}&one_id=${staffUuid}&platformType=1&domain=${domainName}&brandType=${modelType || 1001}`
if(!reviewDate) reviewDate = dayjs().subtract(1, 'day')
AIUrl += `&phone=${phone}&brand=${brand}&date=${dayjs(reviewDate).format('YYYY-MM-DD')}`
if (taskStatus) AIUrl += `&practice_status=${taskStatus}`
this.setData({
AIUrl
})
} else wx.p.wxApi.showToast('获取智能体失败')
},
async getReceptionList(params) {
try {
wx.showLoading({
mask: true
})
console.log()
if (!params.userId) throw '缺少必要参数:userId'
const data = await wx.p.api.receptionApi.getReceptionList(params)
if(!data) throw '获取复盘失败,请稍后再试!'
let total = data.reduce((sum, e) => {
const length = e?.sopTaskDetailTagList?.length || 0
return sum + Number(length)
}, 0)
data.map(e => {
e?.sopTaskDetailTagList?.map(i => {
let {
weakness,
suggestion
} = i
i.weakness = weakness ? weakness.replace(/\n/g, '<br>') : '-'
i.suggestion = suggestion ? suggestion.replace(/\n/g, '<br>') : '-'
})
})
this.setData({
total,
list: data,
loadComplete: true,
tips: total ? `今日有 ${total} 条待复盘记录,请尽快处理哦~` : '今日无待处理复盘,请继续保持!'
})
if (data && data.length && !this.data.AIUrl) this.getAiagent(data[0])
wx.hideLoading()
console.log(data)
} catch (error) {
console.log(error)
wx.hideLoading()
if (error) wx.p.wxApi.showToast(error)
this.setData({
loadComplete: true,
})
}
},
toDetail() {
const {
openId
} = this.data.userInfo
wx.p.api.receptionApi.addCustomerDynamicRecord({
customerOpenId: openId,
goodsId: 1,
goodsType: 3
})
wx.p.router.go('/packageReception/pages/detail/detail', this.options)
},
jumpAI(e) {
const {
openId
} = this.data.userInfo
wx.p.api.receptionApi.addCustomerDynamicRecord({
customerOpenId: openId,
goodsId: 1,
goodsType: 2
})
let {
item
} = e.currentTarget.dataset, {
AIUrl
} = this.data
AIUrl += `&presuppositionProblem=${item.tagName}`
wx.p.router.jumpH5(AIUrl, true)
console.log(e)
},
navbarReady(e) {
let {
height
} = e.detail
this.setData({
layoutStyle: `padding-top:${height}px`
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.getReceptionList(this.options)
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
}
})
\ No newline at end of file
/* pages/reception/index.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;
}
.tips-box {
width: 686rpx;
border-radius: 32rpx;
margin: 36rpx auto;
background: linear-gradient(90deg, #cce2ff 0%, #c7e5ff 100%);
.tips-title {
height: 96rpx;
justify-content: center;
position: relative;
.icon {
position: absolute;
width: 120rpx;
height: 120rpx;
left: 24rpx;
bottom: 4rpx;
}
.text {
background: linear-gradient(90deg, #00BDE3 -100%, #0A3479 100%);
font-size: 32rpx;
-webkit-background-clip: text;
background-clip: text;
color: transparent;
letter-spacing: -1rpx;
line-height: 48rpx;
}
}
.tips {
box-sizing: border-box;
padding: 0 40rpx;
height: 100rpx;
border-radius: 28rpx;
border: 2rpx solid #ffffff;
background: #eef7ff;
backdrop-filter: blur(16rpx);
box-shadow: inset 0 -12rpx 20rpx 0 #ffffff99;
color: #3d4b66;
font-size: 28rpx;
}
}
.title {
padding: 0 32rpx;
height: 64rpx;
color: #2d2f33;
font-size: 32rpx;
font-weight: 500;
.num {
margin-left: 8rpx;
}
.btn {
margin-left: auto;
color: #3773f8;
font-size: 28rpx;
}
}
.scroll {
height: calc(100% - 340rpx - var(--constantSafeAreaInsetBottom));
height: calc(100% - 340rpx - var(--envSafeAreaInsetBottom));
.item {
margin: 24rpx 32rpx 0;
border-radius: 28rpx;
background: #ffffff;
padding: 24rpx 32rpx;
position: relative;
&-status {
position: absolute;
top: 24rpx;
right: 32rpx;
height: 52rpx;
padding: 0 16rpx;
border-radius: 24rpx;
font-size: 26rpx;
background: #e9f9f1;
color: #2cca74;
}
&-icon {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
&-title {
line-height: 44rpx;
color: #1d1d1f;
font-size: 30rpx;
font-weight: 500;
margin: 4rpx 0 20rpx;
}
&-info {
color: #686b70;
font-size: 28rpx;
line-height: 44rpx;
word-break: break-all;
}
&-suggestion {
margin-top: 16rpx;
border-radius: 24rpx;
background: #f5f8fc;
padding: 20rpx 24rpx 24rpx;
color: #383a3d;
font-size: 28rpx;
line-height: 44rpx;
word-break: break-all;
.item-icon {
width: 36rpx;
height: 36rpx;
margin-right: 6rpx;
}
&-title {
color: #3773f8;
font-size: 28rpx;
font-weight: 500;
margin-bottom: 12rpx;
}
}
&-btn {
justify-content: center;
color: #ffffff;
font-size: 28rpx;
margin-top: 24rpx;
height: 72rpx;
border-radius: 40rpx;
background: linear-gradient(135deg, #4f52ff 0%, #349bff 100%);
}
&-arrow-icon {
width: 32rpx;
height: 32rpx;
margin-left: 16rpx;
}
}
.bottom {
color: #9d9fa3;
font-size: 26rpx;
line-height: 40rpx;
text-align: center;
padding: 32rpx 0 16rpx;
}
}
}
.nothing {
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
color: #999ea8;
font-size: 24rpx;
.icon {
width: 172rpx;
height: 172rpx;
}
/* pages/reception/index.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;
}
.tips-box {
width: 686rpx;
border-radius: 32rpx;
margin: 36rpx auto;
background: linear-gradient(90deg, #cce2ff 0%, #c7e5ff 100%);
.tips-title {
height: 96rpx;
justify-content: center;
position: relative;
.icon {
position: absolute;
width: 120rpx;
height: 120rpx;
left: 24rpx;
bottom: 4rpx;
}
.text {
width: 342rpx;
height: 48rpx;
// background: linear-gradient(90deg, #00BDE3 -100%, #0A3479 100%);
// font-size: 32rpx;
// -webkit-background-clip: text;
// background-clip: text;
// color: transparent;
// letter-spacing: -1rpx;
// line-height: 48rpx;
}
}
.tips {
box-sizing: border-box;
padding: 0 40rpx;
height: 100rpx;
border-radius: 28rpx;
border: 2rpx solid #ffffff;
background: #eef7ff;
backdrop-filter: blur(16rpx);
box-shadow: inset 0 -12rpx 20rpx 0 #ffffff99;
color: #3d4b66;
font-size: 28rpx;
}
}
.title {
padding: 0 32rpx;
height: 64rpx;
color: #2d2f33;
font-size: 32rpx;
font-weight: 500;
.num {
margin-left: 8rpx;
}
.btn {
margin-left: auto;
color: #3773f8;
font-size: 28rpx;
.icon{
width: 20rpx;
height: 20rpx;
margin-left: 8rpx;
}
}
}
.scroll {
height: calc(100% - 340rpx - var(--constantSafeAreaInsetBottom));
height: calc(100% - 340rpx - var(--envSafeAreaInsetBottom));
.item {
margin: 24rpx 32rpx 0;
border-radius: 28rpx;
background: #ffffff;
padding: 24rpx 32rpx;
position: relative;
&-status {
position: absolute;
top: 24rpx;
right: 32rpx;
height: 52rpx;
padding: 0 16rpx;
border-radius: 24rpx;
font-size: 26rpx;
background: #e9f9f1;
color: #2cca74;
}
&-icon {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
&-title {
line-height: 44rpx;
color: #1d1d1f;
font-size: 30rpx;
font-weight: 500;
margin: 4rpx 0 20rpx;
}
&-info {
color: #686b70;
font-size: 28rpx;
line-height: 48rpx;
word-break: break-all;
}
&-suggestion {
margin-top: 16rpx;
border-radius: 24rpx;
background: #f5f8fc;
padding: 20rpx 24rpx 24rpx;
color: #383a3d;
font-size: 28rpx;
line-height: 44rpx;
word-break: break-all;
.item-icon {
width: 36rpx;
height: 36rpx;
margin-right: 6rpx;
}
&-title {
color: #3773f8;
font-size: 28rpx;
font-weight: 500;
margin-bottom: 12rpx;
}
}
&-btn {
justify-content: center;
color: #ffffff;
font-size: 28rpx;
margin-top: 24rpx;
height: 72rpx;
border-radius: 40rpx;
background: linear-gradient(135deg, #4f52ff 0%, #349bff 100%);
}
&-arrow-icon {
width: 32rpx;
height: 32rpx;
margin-left: 16rpx;
}
}
.bottom {
color: #9d9fa3;
font-size: 26rpx;
line-height: 40rpx;
text-align: center;
padding: 32rpx 0 16rpx;
}
}
}
.nothing {
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
color: #999ea8;
font-size: 24rpx;
.icon {
width: 172rpx;
height: 172rpx;
}
}
\ No newline at end of file
<navigation-bar bindnavbarReady="navbarReady" navStyle="background-color:transparent;">质检复盘</navigation-bar>
<view class="layout" style="{{layoutStyle}}">
<view class="tips-box">
<view class="tips-title flex">
<image src="/assets/images/title-icon.png" class="icon" />
<view class="text">您好,我是质检复盘助理</view>
</view>
<view class="tips flex">
{{tips}}
</view>
</view>
<view class="title flex">
质检复盘
<block wx:if="{{total}}">
<view class="num">·{{total}}</view>
<view class="btn" bind:tap="toDetail">查看接待详情 →</view>
</block>
</view>
<scroll-view scroll-y class="scroll">
<block wx:if="{{loadComplete}}">
<block wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:key="index">
<block wx:for="{{item.sopTaskDetailTagList}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="item">
<block wx:if="{{i.status == 2}}">
<view class="item-status flex">考核通过</view>
</block>
<view class="item-title flex">
<image src="/assets/images/item-title-icon.png" class="item-icon" />
{{i.tagName}}
</view>
<view class="item-info">{{i.weakness}}</view>
<view class="item-suggestion">
<view class="item-suggestion-title flex">
<image src="/assets/images/item-suggestion-icon.png" class="item-icon" />
改善意见
</view>
{{i.suggestion}}
</view>
<block wx:if="{{i.status != 2 && AIUrl}}">
<view class="item-btn flex" bindtap="jumpAI" data-item="{{i}}">
去考核
<image src="/assets/images/item-arrow-icon.png" class="item-arrow-icon" />
</view>
</block>
</view>
</block>
</block>
<view class="bottom">到底了~</view>
</block>
<block wx:else>
<view class="nothing flex">
<image class="icon" src="/assets/images/quality-no-data.png" />
暂无数据
</view>
</block>
</block>
</scroll-view>
<navigation-bar bindnavbarReady="navbarReady" navStyle="background-color:transparent;">质检复盘</navigation-bar>
<view class="layout" style="{{layoutStyle}}">
<view class="tips-box">
<view class="tips-title flex">
<image src="/assets/images/title-icon.png" class="icon" />
<image src="/assets/images/title-text.png" class="text" />
<!-- <view class="text">您好,我是质检复盘助理</view> -->
</view>
<view class="tips flex">
{{tips}}
</view>
</view>
<view class="title flex">
质检复盘
<block wx:if="{{total}}">
<view class="num">·{{total}}</view>
<view class="btn flex" bind:tap="toDetail">
查看接待详情
<image src="/assets/images/more.png" class="icon" />
</view>
</block>
</view>
<scroll-view scroll-y class="scroll">
<block wx:if="{{loadComplete}}">
<block wx:if="{{list.length}}">
<block wx:for="{{list}}" wx:key="index">
<block wx:for="{{item.sopTaskDetailTagList}}" wx:for-item="i" wx:for-index="ind" wx:key="ind">
<view class="item">
<block wx:if="{{i.status == 2}}">
<view class="item-status flex">考核通过</view>
</block>
<view class="item-title flex">
<image src="/assets/images/item-title-icon.png" class="item-icon" />
{{i.tagName}}
</view>
<view class="item-info">
<rich-text nodes="{{i.weakness}}"></rich-text>
</view>
<view class="item-suggestion">
<view class="item-suggestion-title flex">
<image src="/assets/images/item-suggestion-icon.png" class="item-icon" />
改善意见
</view>
<rich-text nodes="{{i.suggestion}}"></rich-text>
</view>
<block wx:if="{{i.status != 2 && AIUrl}}">
<view class="item-btn flex" bindtap="jumpAI" data-item="{{i}}">
去考核
<image src="/assets/images/item-arrow-icon.png" class="item-arrow-icon" />
</view>
</block>
</view>
</block>
</block>
<view class="bottom">到底了~</view>
</block>
<block wx:else>
<view class="nothing flex">
<image class="icon" src="/assets/images/quality-no-data.png" />
暂无数据
</view>
</block>
</block>
</scroll-view>
</view>
\ 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!