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 {
preReleaseAppId
} from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 2
let index = 3
/**
*
......@@ -128,9 +128,9 @@ const djSecretKey = {
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',
uat: 'https://gsc-agent.test.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]]
const pathEnum = {
......
......@@ -198,7 +198,6 @@ class Request {
reject(error)
},
complete() {
console.log(`${gscDomain}/gsc-agent-manage-biz/${url}`)
wx.stopPullDownRefresh()
wx.hideNavigationBarLoading()
}
......
......@@ -9,6 +9,17 @@ Component({
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,
};
......@@ -47,7 +58,7 @@ Component({
methods: {
findCbByBatchId(data) {
let {
recordingDuration:totalDuration
recordingDuration: totalDuration
} = this.data.recordData,
margin = 20
wx.p.wxApi.getViewInfo('.axis-bar', ({
......
......@@ -54,7 +54,7 @@
</block>
</block>
</block>
<view class="safeAreaInset">到底了!</view>
<view class="safeAreaInset">到底了~</view>
</scroll-view>
</block>
<block wx:else>
......
......@@ -18,13 +18,22 @@ Component({
*/
data: {
activeIndex: 0,
activeId: ''
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
......@@ -35,9 +44,13 @@ Component({
changeClassifyType(e) {
let {
index
} = e.currentTarget.dataset
} = e.currentTarget.dataset, {
activeIndex
} = this.data
if (activeIndex == index) return
this.setData({
activeIndex: index
activeIndex: index,
classifyId: `classify-${index}`
})
},
onTimeUpdate() {
......
......@@ -7,15 +7,16 @@
height: 100%;
width: 100%;
position: relative;
.classify-wrap {
.scroll-classify{
width: calc(100% - 56rpx);
margin: 0 28rpx;
}
.classify-wrap {
width: 100%;
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 {
......
<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}}">
<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">
......
......@@ -6,7 +6,6 @@ Page({
*/
data: {
typeLists: ['对话', '质检'],
qualityAudio: '',
activeIndex: 0,
status: 'pause',
currentTime: '00:00', //当前音频的播放位置
......@@ -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() {
try {
wx.showLoading({
mask: true
})
const {
record: {
batchId
......
......@@ -105,7 +105,7 @@ page {
.customer-car {
margin-top: auto;
transform: translateY(-8rpx);
.customer-car-item {
margin-right: 12rpx;
padding: 0 8rpx;
......
......@@ -3,7 +3,7 @@
<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="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>
......@@ -18,7 +18,7 @@
<view class="name text-hide">{{record.customerName}}</view>
{{record.customerPhone}}
</view>
<view class="customer-car">
<view class="customer-car flex">
<block wx:if="{{record.carBrand}}">
<view class="customer-car-item">{{record.carBrand}}</view>
</block>
......
......@@ -14,25 +14,23 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
async onLoad(options) {
},
async onLoad(options) {},
async getAiagent(params) {
const {
let {
bussinessType,
staffUuid,
phone,
channelType,
modelType
} = params,
{reviewDate} = this.options
} = 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,
......@@ -43,7 +41,9 @@ Page({
2: '比亚迪',
3: '其他'
} [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')}`
if (taskStatus) AIUrl += `&practice_status=${taskStatus}`
this.setData({
......@@ -56,12 +56,24 @@ Page({
wx.showLoading({
mask: true
})
console.log(params)
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,
......@@ -74,6 +86,7 @@ Page({
} catch (error) {
console.log(error)
wx.hideLoading()
if (error) wx.p.wxApi.showToast(error)
this.setData({
loadComplete: true,
})
......
......@@ -41,13 +41,15 @@ page {
}
.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;
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;
}
}
......@@ -80,6 +82,11 @@ page {
margin-left: auto;
color: #3773f8;
font-size: 28rpx;
.icon{
width: 20rpx;
height: 20rpx;
margin-left: 8rpx;
}
}
}
......@@ -123,7 +130,7 @@ page {
&-info {
color: #686b70;
font-size: 28rpx;
line-height: 44rpx;
line-height: 48rpx;
word-break: break-all;
}
......
......@@ -3,7 +3,8 @@
<view class="tips-box">
<view class="tips-title flex">
<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 class="tips flex">
{{tips}}
......@@ -13,7 +14,10 @@
质检复盘
<block wx:if="{{total}}">
<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>
</view>
<scroll-view scroll-y class="scroll">
......@@ -29,13 +33,15 @@
<image src="/assets/images/item-title-icon.png" class="item-icon" />
{{i.tagName}}
</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-title flex">
<image src="/assets/images/item-suggestion-icon.png" class="item-icon" />
改善意见
</view>
{{i.suggestion}}
<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}}">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!