Commit fd89fed0 by 李伟康

commit 合并

1 parent f2474c3b
......@@ -374,7 +374,6 @@ export default {
this.total = total
} catch (error) {
uni.hideLoading()
console.log(error)
this.flag = true
}
},
......@@ -465,7 +464,6 @@ export default {
title: error,
icon: 'none'
})
console.log(error)
}
},
jumpDetail (id) {
......@@ -513,7 +511,6 @@ export default {
this.total = total
this.$forceUpdate()
} catch (error) {
console.log(error)
uni.hideLoading()
this.flag = true
}
......
......@@ -255,7 +255,6 @@ export default {
res.customerTagName = res.customerTagName.replace(/,/g, '|')
res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
this.customerInfo = res
console.log(res)
},
back () {
this.backClass = 'backClass'
......
<template>
<view class="record-box">
<view class="record-content" v-if="showRecord">
<view
class="record-content"
v-if="showRecord"
>
<view class="data-box">
<template v-for="(i, index) in dataList">
<view :class="['data-item', i.type]" :key="index">
<image :src="i.icon" class="data-item-bg" />
<template>
<view
v-for="(i, index) in dataList"
:class="['data-item', i.type]"
:key="index"
>
<image
:src="i.icon"
class="data-item-bg"
/>
<view class="title">{{ dateList[index].text }}</view>
<view class="content">
<view class="total">
......@@ -28,35 +38,74 @@
</view>
<view class="data-container">
<view :class="['type-box']">
<view class="tab-item" v-for="(i, index) in typeList" :key="index" @click="changeType(index, 'firstIndex')">
<view class="sprite-icon" :class="[firstIndex == index ? `icon-${firstClass[index]} active` : '', firstLeft[index]]"></view>
<view class="text" :class="[firstIndex == index ? `active` : '']">
<view
class="tab-item"
v-for="(i, index) in typeList"
:key="index"
@click="changeType(index, 'firstIndex')"
>
<view :class="['sprite-icon',firstIndex == index ? `icon-${firstClass[index]} active` : '', firstLeft[index]]"></view>
<view
class="text"
:class="[firstIndex == index ? `active` : '']"
>
{{ i.tabName }}
<template v-if="index == 1 && i.num && recordFailList.length > 0">({{ recordFailList.length }})</template>
<template v-if="index == 2 && i.num && preRecordFailList.length > 0">({{ preRecordFailList.length }})</template>
<div class="dot" v-if="index == 2 && i.num && preRecordFailList.length > 0"></div>
<template>{{ i.num() }}</template>
<!-- <template>({{ preRecordFailList.length }})</template> -->
<div
class="dot"
:style="{ right: '86rpx' }"
v-if="i.dot && i.dot()"
></div>
</view>
</view>
</view>
<view class="tabs-bottom"></view>
<view v-if="firstIndex == 0" class="data-tabs-box">
<view
v-if="firstIndex == 0"
class="data-tabs-box"
>
<view class="data-tabs">
<template v-for="(i, index) in dateList">
<view :class="['tab flex', { active: dateIndex == index }]" :key="index" @click="changeIndex(index)">{{ i.text }}</view>
<template>
<view
v-for="(i, index) in dateList"
:class="['tab flex', { active: dateIndex == index }]"
:key="index"
@click="changeIndex(index)"
>{{ i.text }}</view>
</template>
<view :class="['active-btn', `active-btn-${dateIndex}`]"></view>
</view>
</view>
<scroll-view :class="['record-list', { 'type-1': firstIndex == 1 }]" scroll-y @scrolltolower="pageonReachBottom" @scroll="scroll">
<div class="record-tips" v-if="firstIndex == 2 && list.length && list[0] && list[0].length">以下非正常结束的接待记录,需要进行信息确认后才能提交到系统。</div>
<scroll-view
:class="['record-list', { 'type-1': firstIndex == 1 }]"
scroll-y
@scrolltolower="pageonReachBottom"
@scroll="scroll"
>
<div
class="record-tips"
v-if="firstIndex == 2 && list.length && list[0] && list[0].length"
>以下非正常结束的接待记录,需要进行信息确认后才能提交到系统。</div>
<view class="list">
<template v-if="flag">
<template v-if="list.length && list[0] && list[0].length">
<template v-for="i in list">
<template v-for="item in i">
<view class="item" :key="item.id" @click="jumpDetail(item)">
<view class="status flex disabled" v-if="item.receptionStatus === '' || item.receptionStatus === undefined">未知</view>
<view :class="['status flex', { deal: item.receptionStatus == 1 }]" v-else>
<template>
<view
v-for="item in i"
class="item"
:key="item.id"
@click="jumpDetail(item)"
>
<view
class="status flex disabled"
v-if="item.receptionStatus === '' || item.receptionStatus === undefined"
>未知</view>
<view
:class="['status flex', { deal: item.receptionStatus == 1 }]"
v-else
>
{{
{
1: '成交',
......@@ -68,8 +117,12 @@
{{ item.customerName ? item.customerName : '未填写姓名' }}
</view>
<view class="goods-name">{{ item.carModel ? item.carModel : '未选择车型' }}</view>
<template v-for="(k, ind) in itemObject">
<view class="info flex" :key="ind">
<template>
<view
v-for="(k, ind) in itemObject"
class="info flex"
:key="ind"
>
<view class="label">{{ k.label }}</view>
<view class="value">{{ formatValue(item[k.key], k.key) || '-' }}</view>
</view>
......@@ -80,7 +133,10 @@
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../../assets/images/home/nothing.webp" />
<image
class="icon"
src="../../../assets/images/home/nothing.webp"
/>
暂无接待记录
</view>
</template>
......@@ -92,7 +148,12 @@
</scroll-view>
</view>
</view>
<save-record v-else @cancel="handleCancel" @submit="handleSubmit" :customerInfoVal="customerInfo"></save-record>
<save-record
v-else
@cancel="handleCancel"
@submit="handleSubmit"
:customerInfoVal="customerInfo"
></save-record>
</view>
</template>
<script type="text/ecmascript-6">
......@@ -100,18 +161,17 @@ import dayjs from 'dayjs'
const dayImgUrl = require('@/assets/images/common/day.webp')
const weekImgUrl = require('@/assets/images/common/week.webp')
const monthImgUrl = require('@/assets/images/common/month.webp')
import { STORAGE_OBJECTKEY } from '@/utils/cache/constantData'
import interruptRecord from '@/utils/recordManager/interruptRecord'
// import { STORAGE_OBJECTKEY } from '@/utils/cache/constantData'
// import {TempRecord} from '@/utils/recordManager/index'
// const _record = new TempRecord()
// import interruptRecord from '@/utils/recordManager/interruptRecord'
import saveRecord from './saveRecord.vue'
export default {
name: '',
components: { saveRecord },
inject: ['getRecorder'],
data () {
return {
sexType: {
'男': 'icon-male',
'女': 'icon-female'
},
dataList: [
{
label: '客户接待数',
......@@ -129,26 +189,26 @@ export default {
icon: monthImgUrl
}
],
typeList: [
{ tabName: '已上传' },
{ tabName: '待上传', num: true },
{ tabName: '待提交', num: true },
],
typeList: Object.freeze([
{ tabName: '已上传', num: () => '' },
{ tabName: '待上传', num: this.getTabCount('recordFailList') },
{ tabName: '待提交', num: this.getTabCount('preRecordFailList'), dot: () => this.preRecordFailList.length },
]),
firstIndex: 0,
firstLeft: ['first', 'second', 'three'],
firstClass: ['first-nav', 'second-nav', 'second-nav'],
dateList: [
dateList: Object.freeze([
{ text: '今日' },
{ text: '本周' },
{ text: '本月' },
],
itemObject: [
]),
itemObject: Object.freeze([
{ label: '客户电话', key: 'phoneNumber' },
{ label: '销售姓名', key: 'salesName' },
{ label: '接待时长', key: 'duration' },
{ label: '开始接待', key: 'startTime' },
{ label: '结束接待', key: 'endTime' },
],
]),
showRecord: true,
recordFailList: [],
preRecordFailList: [],
......@@ -169,6 +229,14 @@ export default {
this.getPreRecordNum()
},
methods: {
getTabCount (listName) {
return () => {
if (this[listName].length) {
return `(${this[listName].length})`;
}
return '';
};
},
formatValue (val, k) {
if (!val) return
if (k == 'phoneNumber') {
......@@ -185,11 +253,13 @@ export default {
await uni.$dbManager.addRecord(val)
uni.$logger.local.info(`添加记录${JSON.stringify(val)}`)
interruptRecord.removePreRecord(val.id)
delete val.duration
delete val.startTime
await this.recorder.save(val)
this.getRecordNum()
this.getPreRecordFail()
await this.getPreRecordFail()
},
jumpDetail (item) {
console.log(this.firstIndex, 'this.firstIndex')
if (this.firstIndex != 2) return
this.showRecord = false;
this.customerInfo = item
......@@ -197,7 +267,6 @@ export default {
changeType (index, name) {
if (this[name] == index) return // 点击同一个
this.direction = ''
console.log(index, name, this[name])
if (this[name] < index) {
this.direction = 'right'
} else {
......@@ -232,11 +301,10 @@ export default {
let recordFailList = recordFailListAll.filter(i => {
return i.merchantId == shopMerchantId && i.bussinessType == (sceneType == 0 ? 1 : 2) && i.loginPhone == phone
})
console.log(recordFailList);
this.recordFailList = recordFailList.reverse();
},
getPreRecordFail () {
this.getPreRecordNum()
async getPreRecordFail () {
await this.getPreRecordNum()
this.list[0] = this.preRecordFailList.map(i => {
return Object.assign(i, {
duration: 0,
......@@ -245,10 +313,8 @@ export default {
})
this.nothing = this.preRecordFailList.length ? true : false
},
getPreRecordNum () {
const preRecordList = uni.$storage.get(STORAGE_OBJECTKEY.preRecordList) || []
console.log(preRecordList)
async getPreRecordNum () {
const preRecordList = await this.recorder.getRecords()
this.preRecordFailList = preRecordList.reverse()
},
getRecordFail () {
......@@ -274,12 +340,12 @@ export default {
startTime,
endTime
} = this.getDateRange(tatget)
console.log(this.getDateRange(tatget))
e.startTime = startTime
e.endTime = endTime
})
this.getReceptionList()
this.getReceptionStatistics(0)
this.recorder = this.getRecorder()
},
async getReceptionStatistics (index) {
try {
......@@ -308,7 +374,6 @@ export default {
await uni.$isNetWork()
} catch (error) {
const recordSuccessList = JSON.parse(uni.$storage.get("recordSuccessList") || "{}")
console.log(recordSuccessList[this.dateIndex] || [])
this.list[0] = recordSuccessList[this.dateIndex] || []
this.flag = true
return
......@@ -345,7 +410,6 @@ export default {
}
this.$set(this.list, pageNum - 1, list)
// this.list[pageNum - 1] = list
console.log(this.list)
this.flag = true
this.total = total
} catch (error) {
......@@ -388,7 +452,6 @@ export default {
},
pageonReachBottom () {
let { pageNum, total, nothing, pageSize } = this
console.log(pageNum, total, nothing, pageSize)
if (this.firstIndex == 1) {
return
}
......
......@@ -118,7 +118,6 @@ export default {
message
} = await uni.$api.userApi.logout(),
userInfo = uni.$storage.get("userInfo")
console.log(code)
if (code == 0) {
uni.$storage.rm("userInfo");
uni.$storage.rm("sessionId");
......@@ -131,7 +130,6 @@ export default {
}, 500)
} else throw message
} catch (error) {
console.log(error)
uni.hideLoading()
uni.showToast({
title: error,
......
......@@ -115,7 +115,6 @@ export default {
},
mounted() {
this.customerInfo = utils.deepClone(this.customerInfoVal)
console.log(this.customerInfo)
const i = this.receptionList.findIndex(e => e.value === this.customerInfo.receptionStatus)
this.$set(this.customerInfo, 'receptionStatus', i == -1?'':this.receptionList[i].label)
},
......@@ -157,7 +156,6 @@ export default {
},
handleSelect(item, popkey) {
this.$refs[popkey].close()
console.log(item, popkey)
if (popkey == 'employeeBoxVisible') {
this.customerInfo.salesUuid = item.uuid
this.customerInfo.salesName = item.staffName
......
<template>
<view class="container" @click="handleTouchStart">
<view
class="container"
@click="handleTouchStart"
>
<view :class="['home', { show: !id && showHome }]">
<left-side :userInfo="userInfo" :tabIndex.sync="tabIndex" ref="leftBox" @changeTab="$emit('changeTab', $event)" @stopAudio="stopAudio" />
<left-side
:userInfo="userInfo"
:tabIndex.sync="tabIndex"
ref="leftBox"
@changeTab="$emit('changeTab', $event)"
@stopAudio="stopAudio"
/>
<view class="right-side">
<template v-if="tabIndex == 0">
<view class="right-content">
<view class="start" @click="$emit('start')">
<image class="start-btn" src="../../assets/images/home/start.gif" alt="开始接待" />
<image class="start-border" src="../../assets/images/home/start-border.png" />
<view
class="start"
@click="$emit('start')"
>
<image
class="start-btn"
src="../../assets/images/home/start.gif"
alt="开始接待"
/>
<image
class="start-border"
src="../../assets/images/home/start-border.png"
/>
</view>
<view class="module-list">
<slot name="module" />
......@@ -15,9 +34,16 @@
</view>
</template>
<template v-else>
<component :is="componentName" :userInfo="userInfo" @showPage="handleShowPage" />
<component
:is="componentName"
:userInfo="userInfo"
@showPage="handleShowPage"
/>
</template>
<view class="store-addr" v-if="footerBox">
<view
class="store-addr"
v-if="footerBox"
>
<view class="icon-addr sprite-icon icon-addr"></view>
<view class="addr-text">{{ userInfo.shopMerchantName }}</view>
</view>
......@@ -26,17 +52,41 @@
<view :class="['detail', { show: id }]">
<slot name="detail" />
</view>
<view class="point-page" v-if="!showHome">
<component :is="pointComponentName" @backHome="backHome" @jump="jump" :transfer="transfer" />
<view
class="point-page"
v-if="!showHome"
>
<component
:is="pointComponentName"
@backHome="backHome"
@jump="jump"
:transfer="transfer"
/>
</view>
<!-- 未点击开始接待,弹窗 -->
<MessageBox ref="previewRef" @confirm="$emit('preview')" :popupW="704" content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」" confirmBtnText="预览素材" @cancel="$emit('previewCancel')" @close="$emit('previewClose')"></MessageBox>
<MessageBox
ref="previewRef"
@confirm="$emit('preview')"
:popupW="704"
content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」"
confirmBtnText="预览素材"
@cancel="$emit('previewCancel')"
@close="$emit('previewClose')"
></MessageBox>
<!-- 停留弹框 -->
<MessageBox ref="tipBox" @cancel="tipCancel" @confirm="tipConfirm" content="系统检测到您在当前页面停留较久,是否仍在客户接待中?" cancelBtnText="否" confirmBtnText="是"></MessageBox>
<!-- <MessageBox ref="tipBox" @cancel="tipCancel" @confirm="tipConfirm" content="系统检测到您在当前页面停留较久,是否仍在客户接待中?" cancelBtnText="否" confirmBtnText="是"></MessageBox> -->
<!-- 退出弹框 -->
<MessageBox :popupW="704" ref="finish" :content="finishContene" :isFooter="false">
<MessageBox
:popupW="704"
ref="finish"
:content="finishContene"
:isFooter="false"
>
<view class="footer">
<view class="footer-btn confirm flex" @click="$emit('openStep')">
<view
class="footer-btn confirm flex"
@click="$emit('openStep')"
>
<template v-if="finishDoneText">
{{ finishDoneText }}
</template>
......@@ -45,7 +95,10 @@
<text>(推荐)</text>
</template>
</view>
<view class="footer-btn cancel flex" @click="$emit('backHome')">
<view
class="footer-btn cancel flex"
@click="$emit('backHome')"
>
仍要退出
<text>(不推荐)</text>
</view>
......@@ -54,13 +107,20 @@
<!-- 升级弹框 -->
<update-box />
<slot name="content" />
<web-view @message="handlerMessage" ref="webview" src="/hybrid/html/index.html"></web-view>
<web-view
@message="handlerMessage"
ref="webview"
src="/hybrid/html/index.html"
></web-view>
</view>
</template>
<script>
import RecordList from './components/RecordList.vue'
import myClick from '@/mixin/click'
import uploader from '@/mixin/uploader.js'
// import myClick from '@/mixin/click'
import timeout from '@/mixin/timeout'
import recorder from '@/mixin/record/recorder'
import uploader from '@/mixin/record/uploader.js'
import versionCheck from '@/mixin/versionCheck.js'
import CustomerFile from './components/CustomerFile.vue'
import LeftSide from './components/LeftSide.vue'
import Point from './components/Point.vue'
......@@ -73,7 +133,7 @@ import Calendar from './components/Income/Calendar.vue'
import Promotion from './components/Income/Promotion.vue'
import History from './components/Income/History.vue'
export default {
mixins: [myClick, uploader],
mixins: [recorder, uploader, timeout, versionCheck],
components: { RecordList, CustomerFile, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History },
props: {
id: [String, Number],
......@@ -83,7 +143,7 @@ export default {
default: '当前操作视为强制退出接待,若需正常流程完成接待请点击「完成接待」'
}
},
data() {
data () {
return {
transfer: '',
footerBox: true,
......@@ -93,24 +153,25 @@ export default {
tabIndex: 0
}
},
mounted() {
mounted () {
const userInfo = uni.$storage.get('userInfo') || {}
this.userInfo = userInfo
this.checkVersion()
},
provide() {
provide () {
return {
showPage: this.handleShowPage,
hideFooter: this.handleFooter
}
},
computed: {
previewRef() {
previewRef () {
return this.$refs.previewRef
},
finishRef() {
finishRef () {
return this.$refs.finish
},
componentName() {
componentName () {
const len = this.$refs.leftBox.tabs.length
if (this.tabIndex == 0) return 'HomeSlot'
else if (this.tabIndex == 1) return 'RecordList'
......@@ -119,20 +180,17 @@ export default {
}
},
methods: {
handleFooter(val) {
console.log(val, 88)
handleFooter (val) {
this.footerBox = val
},
backHome() {
backHome () {
this.showHome = true
},
jump() {
console.log(888)
jump () {
this.showHome = true
this.$emit('start')
},
handleShowPage(name, transfer) {
console.log(transfer, 'transfer')
handleShowPage (name, transfer) {
this.transfer = transfer
this.showHome = false
this.pointComponentName = name
......
......@@ -345,16 +345,8 @@ export default {
this.recording = false
},
async start (before = true) {
const result = await this.$permision.requestAndroidPermission(
"android.permission.RECORD_AUDIO"
);
if (result !== 1) {
uni.showToast({
title: "为了记录语音通话,请打开录音权限",
icon: "none",
});
return false
}
const isPermision = this.$refs.home.isPermission()
if (!isPermision) return false
if (before) this.clearHistory();
this.$refs.home.startAudio();
this.recording = true
......
......@@ -76,6 +76,7 @@
<script>
import { uploadFile } from "@/utils/ossUploadFile/uploadFile.js";
import utils from "@/utils/utils";
import permision from '@/js_sdk/wa-permission/permission.js'
const INFO_LIST = [
{
id: 1,
......@@ -121,7 +122,7 @@ export default {
...mapMutations("audio", ["setBooks"]),
// 上传图
async choose (index) {
const result = await this.$permision.requestAndroidPermission(
const result = await permision.requestAndroidPermission(
"android.permission.CAMERA"
);
if (result !== 1) {
......
......@@ -254,14 +254,6 @@ export default {
uni.showLoading({
mask: true
})
const result = await this.$permision.requestAndroidPermission('android.permission.RECORD_AUDIO')
if (result !== 1) {
uni.showToast({
title: '为了记录语音通话,请打开录音权限',
icon: 'none'
})
return
}
this.getSoure()
this.clearHistory()
this.$refs.home.startAudio()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!