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
<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.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!