Commit dcec7aa7 by 李伟康

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

1. 修改默认环境index从2改为3,指向生产环境
2. 更新gscDomain的uat和prod配置
3. 优化http.js请求处理逻辑,移除无用console.log
4. 修复dialogue.js组件中的异步处理问题
1 parent f76fc91c
...@@ -2,7 +2,7 @@ import { ...@@ -2,7 +2,7 @@ import {
preReleaseAppId preReleaseAppId
} from '~/config' } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease'] const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 2 let index = 3
/** /**
* *
...@@ -128,9 +128,9 @@ const djSecretKey = { ...@@ -128,9 +128,9 @@ const djSecretKey = {
const gscDomain = { const gscDomain = {
ip: 'http://192.168.3.145:9898', ip: 'http://192.168.3.145:9898',
dev: 'https://gsc-agent.dev.glsx.com.cn', dev: 'https://gsc-agent.dev.glsx.com.cn',
uat: 'https://gsc-agent.dev.glsx.com.cn', uat: 'https://gsc-agent.test.glsx.com.cn',
preRelease: 'https://gsc-agent.beta.glsx.com.cn', preRelease: 'https://gsc-agent.beta.glsx.com.cn',
prod: 'https://gsc-agent.glsx.com.cn' prod: 'https://gsc-agent.gldijia.com.cn'
} [target[index]] } [target[index]]
const pathEnum = { const pathEnum = {
......
...@@ -198,7 +198,6 @@ class Request { ...@@ -198,7 +198,6 @@ class Request {
reject(error) reject(error)
}, },
complete() { complete() {
console.log(`${gscDomain}/gsc-agent-manage-biz/${url}`)
wx.stopPullDownRefresh() wx.stopPullDownRefresh()
wx.hideNavigationBarLoading() wx.hideNavigationBarLoading()
} }
......
...@@ -9,6 +9,17 @@ Component({ ...@@ -9,6 +9,17 @@ Component({
batchId: { batchId: {
type: Number, type: Number,
observer: function (n) { observer: function (n) {
if (this.IntersectionObserver) {
this.IntersectionObserver.disconnect()
this.IntersectionObserver = null
}
this.setData({
flag: false,
progress: 0,
dialogueList: []
})
const data = { const data = {
batchId: n, batchId: n,
}; };
...@@ -47,7 +58,7 @@ Component({ ...@@ -47,7 +58,7 @@ Component({
methods: { methods: {
findCbByBatchId(data) { findCbByBatchId(data) {
let { let {
recordingDuration:totalDuration recordingDuration: totalDuration
} = this.data.recordData, } = this.data.recordData,
margin = 20 margin = 20
wx.p.wxApi.getViewInfo('.axis-bar', ({ wx.p.wxApi.getViewInfo('.axis-bar', ({
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</block> </block>
</block> </block>
</block> </block>
<view class="safeAreaInset">到底了!</view> <view class="safeAreaInset">到底了~</view>
</scroll-view> </scroll-view>
</block> </block>
<block wx:else> <block wx:else>
......
...@@ -18,13 +18,22 @@ Component({ ...@@ -18,13 +18,22 @@ Component({
*/ */
data: { data: {
activeIndex: 0, activeIndex: 0,
activeId: '' activeId: '',
classifyId: ''
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
reset() {
this.setData({
activeIndex: 0,
activeId: '',
classifyId: ''
})
this.getAudioObject()
},
getAudioObject() { getAudioObject() {
thisPage = wx.p.router.getPageInstance() thisPage = wx.p.router.getPageInstance()
if (thisPage.qualityAudio) this.innerAudioContext = thisPage.qualityAudio if (thisPage.qualityAudio) this.innerAudioContext = thisPage.qualityAudio
...@@ -35,9 +44,13 @@ Component({ ...@@ -35,9 +44,13 @@ Component({
changeClassifyType(e) { changeClassifyType(e) {
let { let {
index index
} = e.currentTarget.dataset } = e.currentTarget.dataset, {
activeIndex
} = this.data
if (activeIndex == index) return
this.setData({ this.setData({
activeIndex: index activeIndex: index,
classifyId: `classify-${index}`
}) })
}, },
onTimeUpdate() { onTimeUpdate() {
......
...@@ -7,15 +7,16 @@ ...@@ -7,15 +7,16 @@
height: 100%; height: 100%;
width: 100%; width: 100%;
position: relative; position: relative;
.scroll-classify{
.classify-wrap { width: calc(100% - 56rpx);
margin: 0 28rpx; margin: 0 28rpx;
}
.classify-wrap {
width: 100%;
box-sizing: border-box; box-sizing: border-box;
width: calc(100% - 56rpx);
height: 112rpx; height: 112rpx;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
overflow-x: auto;
background: #f5f9ff; background: #f5f9ff;
border-radius: 16rpx 16rpx 0 0; border-radius: 16rpx 16rpx 0 0;
.classify-item { .classify-item {
......
<view class="view"> <view class="view">
<block wx:if="{{qualityData.length}}"> <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"> <view class="classify-wrap">
<block wx:for="{{qualityData}}" wx:key="index"> <block wx:for="{{qualityData}}" wx:key="index">
<view class="classify-item flex {{index == activeIndex?'active':''}}" bindtap="changeClassifyType" data-index="{{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="title">{{item.tagGroupName}}</view>
<view class="score">{{item.formatScore}}</view> <view class="score">{{item.formatScore}}</view>
</view> </view>
</block> </block>
</view> </view>
</scroll-view>
<scroll-view class="scroll-view" enhanced scroll-y scroll-with-animation scroll-into-view="{{activeId}}"> <scroll-view class="scroll-view" enhanced scroll-y scroll-with-animation scroll-into-view="{{activeId}}">
<block wx:if="{{qualityData[activeIndex]}}"> <block wx:if="{{qualityData[activeIndex]}}">
<view class="quality-block"> <view class="quality-block">
......
...@@ -6,7 +6,6 @@ Page({ ...@@ -6,7 +6,6 @@ Page({
*/ */
data: { data: {
typeLists: ['对话', '质检'], typeLists: ['对话', '质检'],
qualityAudio: '',
activeIndex: 0, activeIndex: 0,
status: 'pause', status: 'pause',
currentTime: '00:00', //当前音频的播放位置 currentTime: '00:00', //当前音频的播放位置
...@@ -39,8 +38,34 @@ Page({ ...@@ -39,8 +38,34 @@ Page({
}) })
}) })
}, },
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() { async getReceptionDetail() {
try { try {
wx.showLoading({
mask: true
})
const { const {
record: { record: {
batchId batchId
......
...@@ -105,7 +105,7 @@ page { ...@@ -105,7 +105,7 @@ page {
.customer-car { .customer-car {
margin-top: auto; margin-top: auto;
transform: translateY(-8rpx);
.customer-car-item { .customer-car-item {
margin-right: 12rpx; margin-right: 12rpx;
padding: 0 8rpx; padding: 0 8rpx;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="reception-wrap"> <view class="reception-wrap">
<view class="customer-list"> <view class="customer-list">
<block wx:for="{{customerList}}" wx:key="index"> <block wx:for="{{customerList}}" wx:key="index">
<view class="customer-item flex {{item.batchId == record.batchId?'active':''}}"> <view class="customer-item flex {{item.batchId == record.batchId?'active':''}}" bindtap="changeDetail" data-item="{{item}}">
<view class="name text-hide">{{item.customerName}}</view> <view class="name text-hide">{{item.customerName}}</view>
<block wx:if="{{item.score != null}}"> <block wx:if="{{item.score != null}}">
<view class="score">{{item.score}}分</view> <view class="score">{{item.score}}分</view>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<view class="name text-hide">{{record.customerName}}</view> <view class="name text-hide">{{record.customerName}}</view>
{{record.customerPhone}} {{record.customerPhone}}
</view> </view>
<view class="customer-car"> <view class="customer-car flex">
<block wx:if="{{record.carBrand}}"> <block wx:if="{{record.carBrand}}">
<view class="customer-car-item">{{record.carBrand}}</view> <view class="customer-car-item">{{record.carBrand}}</view>
</block> </block>
......
...@@ -14,25 +14,23 @@ Page({ ...@@ -14,25 +14,23 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
async onLoad(options) { async onLoad(options) {},
},
async getAiagent(params) { async getAiagent(params) {
const { let {
bussinessType, bussinessType,
staffUuid, staffUuid,
phone, phone,
channelType, channelType,
modelType modelType
} = params, } = params, {
{reviewDate} = this.options reviewDate
} = this.options
const [data] = await wx.p.api.receptionApi.getAiagent({ const [data] = await wx.p.api.receptionApi.getAiagent({
ownerShipType: 1, ownerShipType: 1,
accountPhone: phone, accountPhone: phone,
agentCode: 'AI8' agentCode: 'AI8'
}) })
if (data) { if (data) {
console.log(data, '---')
let { let {
agentUrl, agentUrl,
domainName, domainName,
...@@ -43,7 +41,9 @@ Page({ ...@@ -43,7 +41,9 @@ Page({
2: '比亚迪', 2: '比亚迪',
3: '其他' 3: '其他'
} [channelType], } [channelType],
AIUrl = `${agentUrl}?no_header=1&businessType=${bussinessType}&one_id=${staffUuid}&platformType=1&domain=${domainName}&brandType=${modelType || 1001}` 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')}` AIUrl += `&phone=${phone}&brand=${brand}&date=${dayjs(reviewDate).format('YYYY-MM-DD')}`
if (taskStatus) AIUrl += `&practice_status=${taskStatus}` if (taskStatus) AIUrl += `&practice_status=${taskStatus}`
this.setData({ this.setData({
...@@ -56,12 +56,24 @@ Page({ ...@@ -56,12 +56,24 @@ Page({
wx.showLoading({ wx.showLoading({
mask: true mask: true
}) })
console.log(params) console.log()
if (!params.userId) throw '缺少必要参数:userId'
const data = await wx.p.api.receptionApi.getReceptionList(params) const data = await wx.p.api.receptionApi.getReceptionList(params)
if(!data) throw '获取复盘失败,请稍后再试!'
let total = data.reduce((sum, e) => { let total = data.reduce((sum, e) => {
const length = e?.sopTaskDetailTagList?.length || 0 const length = e?.sopTaskDetailTagList?.length || 0
return sum + Number(length) return sum + Number(length)
}, 0) }, 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({ this.setData({
total, total,
list: data, list: data,
...@@ -74,6 +86,7 @@ Page({ ...@@ -74,6 +86,7 @@ Page({
} catch (error) { } catch (error) {
console.log(error) console.log(error)
wx.hideLoading() wx.hideLoading()
if (error) wx.p.wxApi.showToast(error)
this.setData({ this.setData({
loadComplete: true, loadComplete: true,
}) })
......
...@@ -41,13 +41,15 @@ page { ...@@ -41,13 +41,15 @@ page {
} }
.text { .text {
background: linear-gradient(90deg, #00BDE3 -100%, #0A3479 100%); width: 342rpx;
font-size: 32rpx; height: 48rpx;
-webkit-background-clip: text; // background: linear-gradient(90deg, #00BDE3 -100%, #0A3479 100%);
background-clip: text; // font-size: 32rpx;
color: transparent; // -webkit-background-clip: text;
letter-spacing: -1rpx; // background-clip: text;
line-height: 48rpx; // color: transparent;
// letter-spacing: -1rpx;
// line-height: 48rpx;
} }
} }
...@@ -80,6 +82,11 @@ page { ...@@ -80,6 +82,11 @@ page {
margin-left: auto; margin-left: auto;
color: #3773f8; color: #3773f8;
font-size: 28rpx; font-size: 28rpx;
.icon{
width: 20rpx;
height: 20rpx;
margin-left: 8rpx;
}
} }
} }
...@@ -123,7 +130,7 @@ page { ...@@ -123,7 +130,7 @@ page {
&-info { &-info {
color: #686b70; color: #686b70;
font-size: 28rpx; font-size: 28rpx;
line-height: 44rpx; line-height: 48rpx;
word-break: break-all; word-break: break-all;
} }
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
<view class="tips-box"> <view class="tips-box">
<view class="tips-title flex"> <view class="tips-title flex">
<image src="/assets/images/title-icon.png" class="icon" /> <image src="/assets/images/title-icon.png" class="icon" />
<view class="text">您好,我是质检复盘助理</view> <image src="/assets/images/title-text.png" class="text" />
<!-- <view class="text">您好,我是质检复盘助理</view> -->
</view> </view>
<view class="tips flex"> <view class="tips flex">
{{tips}} {{tips}}
...@@ -13,7 +14,10 @@ ...@@ -13,7 +14,10 @@
质检复盘 质检复盘
<block wx:if="{{total}}"> <block wx:if="{{total}}">
<view class="num">·{{total}}</view> <view class="num">·{{total}}</view>
<view class="btn" bind:tap="toDetail">查看接待详情 →</view> <view class="btn flex" bind:tap="toDetail">
查看接待详情
<image src="/assets/images/more.png" class="icon" />
</view>
</block> </block>
</view> </view>
<scroll-view scroll-y class="scroll"> <scroll-view scroll-y class="scroll">
...@@ -29,13 +33,15 @@ ...@@ -29,13 +33,15 @@
<image src="/assets/images/item-title-icon.png" class="item-icon" /> <image src="/assets/images/item-title-icon.png" class="item-icon" />
{{i.tagName}} {{i.tagName}}
</view> </view>
<view class="item-info">{{i.weakness}}</view> <view class="item-info">
<rich-text nodes="{{i.weakness}}"></rich-text>
</view>
<view class="item-suggestion"> <view class="item-suggestion">
<view class="item-suggestion-title flex"> <view class="item-suggestion-title flex">
<image src="/assets/images/item-suggestion-icon.png" class="item-icon" /> <image src="/assets/images/item-suggestion-icon.png" class="item-icon" />
改善意见 改善意见
</view> </view>
{{i.suggestion}} <rich-text nodes="{{i.suggestion}}"></rich-text>
</view> </view>
<block wx:if="{{i.status != 2 && AIUrl}}"> <block wx:if="{{i.status != 2 && AIUrl}}">
<view class="item-btn flex" bindtap="jumpAI" data-item="{{i}}"> <view class="item-btn flex" bindtap="jumpAI" data-item="{{i}}">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!