| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762 |
- <!-- 任务详情 -->
- <template>
- <s-layout
- class="task_details_page"
- title="任务详情"
- navbar="inner"
- :bgStyle="state.page"
- :navbarStyle="state.navigationBar"
- showBackButton
- :showExportButton="state.taskInfo.status===10"
- @export="handleExport"
- >
- <view class="task_cont">
- <scroll-view class="task_scroll" :scroll-y="!state.showIntentionSelect" @scrolltolower="scrolltolower">
- <view class="task_details">
- <view class="task_details_cont">
- <view class="top">
- <view class="name_box">
- <view class="name">{{state.taskInfo.name}} </view>
- <view class="time">{{formatDate(state.taskInfo.planTime,'YYYY-MM-DD HH:mm')}}</view>
- </view>
- <view class="verbal">{{state.taskInfo.typeName}}</view>
- </view>
- <view class="cont">
- <view class="detail_item">
- <view class="label">高意向数量</view>
- <view class="num">{{state.taskInfo.highIntentionCount}}</view>
- </view>
- <view class="detail_item">
- <view class="label">拨打数量</view>
- <view class="num">{{state.taskInfo.lingCount||0}}</view>
- </view>
- </view>
- <view class="bottom">
- <view class="detail_item">
- <view class="label">接通率:</view>
- <view class="num">{{((state.taskInfo.answerRate||0)*100).toFixed(2)*100/100}}%</view>
- </view>
- <view class="detail_item">
- <view class="label">未接通率:</view>
- <view class="num">{{((state.taskInfo.notAnswerRate||0)*100).toFixed(2)*100/100}}%</view>
- </view>
- <view class="detail_item">
- <view class="label">号码无效率:</view>
- <view class="num">{{((state.taskInfo.invalidRate||0)*100).toFixed(2)*100/100}}%</view>
- </view>
- </view>
- </view>
- </view>
- <s-empty v-if="state.pagination.total === 0&&state.loadStatus != 'loading'" icon="/static/order-empty.png" text="暂无记录" />
- <view v-else class="task_list">
- <view class="intention_select_vaule">
- <view class="select_vaule" @tap="state.showIntentionSelect=true;state.showIntentionNames=JSON.parse(JSON.stringify(state.intentionNames))">{{state.intentionNames.length?state.intentionNames.join(','):'全部意向'}}</view>
- </view>
- <view v-if="state.showIntentionSelect" class="intention_select">
- <view class="intention_select_bg">
- <view class="select_cont">
- <view class="select_vaule" @tap="state.showIntentionSelect=false">{{state.intentionNames.length?state.intentionNames.join(','):'全部意向'}}</view>
- <view class="intention_list">
- <view class="intention_item" :class="{'select_item':!state.intentionNames.length}" @tap="state.intentionNames=[]">全部意向</view>
- <view class="intention_item" :class="{'select_item':state.intentionNames.includes(item)}" v-for="(item, index) in state.intentionList" :key="index" @tap="onIntention(item)">{{item}}</view>
- </view>
- <view class="group_btn">
- <view class="cancel_btn" @tap="state.showIntentionSelect=false;state.intentionNames=JSON.parse(JSON.stringify(state.showIntentionNames))">取消</view>
- <view class="confirm_btn" @tap="onConfirm">确认</view>
- </view>
- </view>
- </view>
- </view>
- <view class="task_item" :class="{'show_down':item.showDown}" v-for="(item, index) in state.pagination.list" :key="index">
- <view class="task_title" @tap="onDown(item)">
- <view class="left">
- <view class="title">
- <view class="name">{{item.phone}}</view>
- <!-- <image v-if="item.callStatus===2" class="status_icon" src="/static/status_icon1.png"></image> -->
- <div v-if="item.intentionName" class="intention">{{item.intentionName}}</div>
- </view>
- <view v-if="item.callTime" class="time">{{formatDate(item.callTime)}}</view>
- </view>
- <view class="right">
- <image v-if="item.callStatus===2&&item.recordName" class="down_icon" src="/static/down_icon.png"></image>
- </view>
- </view>
- <div class="concern" v-if="!!item.concern">
- <div class="label">客户关注点:</div>
- <div class="concern_list">
- <div class="concern_item" v-for="(name,index) in item.concern.split(',')" :key="index">{{name}}</div>
- </div>
- </div>
- <view class="down_box">
- <view class="sound_play">
- <slider :value="item.currentTime" step="1" block-size="8" block-color="#24D688" backgroundColor="#BBDECF" activeColor="#24D688" min="0" :max="item.duration" @changing="sliderChanging($event,item,index)" />
- <view class="slider_time">
- <view class="play_time">{{Math.floor(item.currentTime/60)}}:{{Math.floor(item.currentTime%60)>=10?Math.floor(item.currentTime%60):'0'+Math.floor(item.currentTime%60)}}</view>
- <view class="total_time">{{Math.floor(item.duration/60)}}:{{item.duration%60>=10?item.duration%60:'0'+item.duration%60}}</view>
- </view>
- <view class="play_tool">
- <image class="play_tool_icon" src="/static/play_tool_icon1.png" @tap="changePlay(-15,item,index)"></image>
- <image v-if="item.isPlaying" class="play_tool_icon" src="/static/play_tool_icon4.png" @tap="pauseAudio"></image>
- <image v-else class="play_tool_icon" src="/static/play_tool_icon2.png" @tap="playAudio(item,index)"></image>
- <image class="play_tool_icon" src="/static/play_tool_icon3.png" @tap="changePlay(15,item,index)"></image>
- </view>
- </view>
- <!-- <view class="ai_analyse">
- <view class="label">AI分析:</view>
- <view class="cont">星光五菱,这个名宇一听就让人心生向往!最近在海吉星买水果的路上,偶遇一辆五菱新车,名为五这辆车真的是太酷了!两种类型可选,纯电和动,
- 满足不同的需求。后脸造型有气势,一看就知道不是普通的车</view>
- </view> -->
- </view>
- </view>
- <!-- 加载更多 -->
- <uni-load-more
- v-if="state.pagination.total > 0"
- :status="state.loadStatus"
- :content-text="{
- contentdown: '上拉加载更多',
- }"
- @tap="loadMore"
- />
- </view>
-
- </scroll-view>
- </view>
- </s-layout>
- </template>
- <script setup>
- import _ from 'lodash-es';
- import $helper from '@/common/helper';
- import { ref, computed, reactive } from 'vue';
- import { onShow, onLoad, onUnload, onPageScroll, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
- import sheep from '@/common';
- import taskApi from '@/common/api/member/task'
- import { formatDate, isWxBrowser } from '@/common/helper/utils'
- const state = reactive({
- navigationBar: {},
- page: {
- backgroundColor: '#FFFFFF',
- backgroundImage: '/static/homeTopBg.png'
- },
- pagination: {
- list: [],
- total: 0,
- page: 1,
- pageCount: 10,
- },
- sliderValue: 10,
- sliderMaxValue: 210,
- taskInfo: {},
- innerAudioContext: null,
- isPlaying: false,
- currentIndex: 0,
- intentionNames:[],
- showIntentionSelect:false,
- intentionList: [],
- showIntentionNames:[]
- })
- onShow(async () => {
- //onShow中获取列表,保证跳转后页面为最新状态
- await getTaskDetail(state.taskInfo.id);
- });
- onLoad((options) => {
- state.taskInfo.id = options.id
- getPhoneList()
- getIntentionList()
- })
- onUnload(()=>{
- if (state.innerAudioContext) {
- try {
- state.innerAudioContext.pause();
- state.innerAudioContext.destroy()
- state.innerAudioContext = null
- } catch (e) {
- //TODO handle the exception
- }
- }
- })
- async function handleExport(){
- if(isWxBrowser()){
- uni.showToast({
- title:'请在浏览器打开导出',
- icon: 'none'
- })
- }else{
- uni.showLoading({
- title:'导出中'
- })
- let res = await taskApi.phoneExport({
- intentionNames: state.intentionNames,
- taskId: state.taskInfo.id,
- page: state.pagination.page,
- pageCount: state.pagination.pageCount,
- })
- uni.hideLoading()
- const { code, data, msg } = res
- if (code === 1) {
- let url = 'https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/' + data.filePyth
- let a = document.createElement('a')
- a.href = url
- a.download = data.filePyth.substr(data.filePyth.lastIndexOf('/') + 1)
- document.body.appendChild(a)
- a.click()
- } else {
- uni.showToast({
- title: msg,
- })
- }
- }
- }
- function onIntention(val){
- if(state.intentionNames.includes(val)){
- state.intentionNames = state.intentionNames.filter(item=>item!=val)
- }else{
- state.intentionNames.push(val)
- }
-
- }
- function onConfirm(){
- if (state.innerAudioContext) {
- try {
- state.innerAudioContext.pause()
- state.innerAudioContext.destroy()
- state.innerAudioContext = null
- state.currentIndex = 0
- } catch (e) {
- //TODO handle the exception
- }
- }
- state.pagination.list = []
- state.pagination.total = 0
- state.pagination.page = 1
- getPhoneList()
- state.showIntentionSelect=false
- }
- async function getTaskDetail(id) {
- let res = await taskApi.taskDetail(id)
- if (res.code === 1) {
- state.taskInfo = res.data
- } else {
- sheep.$router.back()
- }
- }
- async function getIntentionList () {
- let res = await taskApi.intentionList(state.taskInfo.id)
- let { data, code, msg } = res
- if (code === 1) {
- state.intentionList = data
- } else {
- uni.showToast({
- title: msg,
- icon: 'none'
- })
- }
- }
- async function getPhoneList () {
- state.loadStatus = 'loading'
- let response = await taskApi.phoneList({
- intentionNames: state.intentionNames,
- taskId: state.taskInfo.id,
- page: state.pagination.page,
- pageCount: state.pagination.pageCount,
- })
- let { data, code, msg } = response
- if (code === 1) {
- state.pagination.list = _.concat(state.pagination.list, data.records)
- state.pagination.total = data.total
- state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
- } else {
- uni.showToast({
- title: msg,
- icon: 'none'
- })
- }
- }
- function initAudio() {
- state.innerAudioContext = uni.createInnerAudioContext()
- // 监听事件
- state.innerAudioContext.onPlay(() => {
- state.pagination.list[state.currentIndex].isPlaying = true
- })
-
- state.innerAudioContext.onPause(() => {
- state.pagination.list[state.currentIndex].isPlaying = false
- })
-
- state.innerAudioContext.onTimeUpdate(() => {
- state.pagination.list[state.currentIndex].currentTime = state.innerAudioContext.currentTime
- })
- }
- function playAudio(item,index){
- if(!state.innerAudioContext){
- initAudio()
- }
- state.innerAudioContext.pause()
- state.pagination.list[state.currentIndex].isPlaying = false
- state.innerAudioContext.src = item.recordName
- if(item.currentTime){
- state.innerAudioContext.seek(item.currentTime>=item.duration?0:item.currentTime)
- }
- state.currentIndex = index
- state.innerAudioContext.play()
- }
- function pauseAudio(){
- state.innerAudioContext.pause()
- }
- function seekAudio(currentTime){
- state.innerAudioContext.seek(currentTime)
- state.innerAudioContext.play()
- }
- function onDown(item){
- if(item.callStatus===2){
- item.showDown=!item.showDown
- if(item.showDown){
- item.currentTime = item.currentTime||0
- }
- }
- }
- function sliderChanging(event,item,index){
- item.currentTime = event.detail.value
- if(item.isPlaying&&index===state.currentIndex){
- seekAudio(item.currentTime)
- }
- }
- function changePlay(val,item,index){
- let currentTime = item.currentTime + val
- if(currentTime<0){
- currentTime = 0
- }
- if(currentTime>item.duration){
- currentTime = item.duration
- }
- item.currentTime = currentTime
- if(item.isPlaying&&index===state.currentIndex){
- seekAudio(item.currentTime)
- }
- }
- // 加载更多
- function loadMore() {
- if (state.loadStatus === 'noMore') {
- return
- }
- state.pagination.page++
- getPhoneList()
- }
-
- // 上拉加载更多
- onReachBottom(() => {
- loadMore()
- })
- function scrolltolower(){
- loadMore()
- }
-
- // 下拉刷新
- onPullDownRefresh(() => {
- if (state.innerAudioContext) {
- try {
- state.innerAudioContext.pause();
- state.innerAudioContext.destroy()
- state.innerAudioContext = null
- state.currentIndex = 0
- } catch (e) {
- //TODO handle the exception
- }
- }
- state.pagination.list = []
- state.pagination.total = 0
- state.pagination.page = 1
- getPhoneList()
- setTimeout(function () {
- uni.stopPullDownRefresh()
- }, 800);
- });
- onPageScroll((e) => {});
- </script>
- <style lang="scss" scoped>
- .task_cont{
- flex: 1;
- overflow: hidden;
- .task_scroll{
- height: 100%;
- }
- }
- .task_details{
- padding-top: 20rpx;
- }
- .task_details_cont{
- width: 690rpx;
- margin: 0 auto;
- box-sizing: border-box;
- .top{
- margin-bottom:30rpx;
- .name_box{
- display: flex;
- justify-content: space-between;
- .name{
- font-weight: bold;
- font-size: 32rpx;
- color: #222222;
- line-height: 48rpx;
- flex: 1;
- margin-right: 20rpx;
- padding-bottom: 20rpx;
- }
- .time{
- font-weight: 400;
- font-size: 24rpx;
- color: #86B29F;
- line-height: 34rpx;
- }
- }
- .verbal{
- font-weight: 400;
- font-size: 28rpx;
- color: #666666;
- line-height:40rpx;
- }
- }
- .cont{
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap:20rpx;
- .detail_item{
- flex: 1;
- display: flex;
- flex-direction: column;
- width: 336rpx;
- height: 152rpx;
- padding: 20rpx 30rpx;
- box-sizing: border-box;
- .num{
- margin-bottom: 10rpx;
- font-weight: bold;
- font-size: 40rpx;
- line-height: 48rpx;
- }
- .label{
- font-weight: 400;
- font-size: 24rpx;
- color: #666666;
- line-height: 34rpx;
- margin-bottom: 20rpx;
- }
- }
- .detail_item:nth-child(1){
- background: url('/static/num_bg1.png') no-repeat center/cover;
- .num{
- color: #FFA64E;
- }
- }
- .detail_item:nth-child(2){
- background: url('/static/num_bg2.png') no-repeat center/cover;
- .num{
- color: #24D688;
- }
- }
- }
- .bottom{
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 20rpx 0;
- .detail_item{
- display: flex;
- align-items: center;
- flex: 1;
- font-size: 24rpx;
- line-height: 34rpx;
- .num{
- color: #222222;
- }
- .label{
- color: #666666;
- }
- }
- .detail_item:nth-child(1){
- .num{
- color: #1677FF;
- }
- }
- .detail_item:nth-child(2){
- .num{
- color: #FF4E4E;
- }
- }
- .detail_item:nth-child(3){
- .num{
- color: #CCCCCC;
- }
- }
- }
- }
- .task_list{
- min-height: calc(100% - 384rpx);
- padding-top: 30rpx;
- background: #FFFFFF;
- border-radius: 30rpx 30rpx 0 0;
- position: relative;
- box-sizing: border-box;
- .intention_select_vaule,
- .intention_select{
- padding: 0 30rpx;
- height: 50rpx;
- .select_vaule{
- display: inline-block;
- border-radius: 10rpx;
- font-weight: 500;
- font-size: 24rpx;
- color: #222222;
- min-width: 176rpx;
- max-width: 300rpx;
- height: 50rpx;
- line-height: 50rpx;
- padding: 0 48rpx 0 16rpx;
- box-sizing: border-box;
- cursor: pointer;
- white-space: nowrap; /* 防止文本换行 */
- overflow: hidden; /* 隐藏溢出的文本 */
- text-overflow: ellipsis; /* 显示省略符号来代表被修剪的文本 */
- }
- }
- .intention_select_vaule{
- padding-bottom: 30rpx;
- .select_vaule{
- background: #FAFAFA url('/static/down_icon@2x.png') no-repeat right 8rpx center/32rpx 32rpx;
- }
- }
- .intention_select{
- height: 100%;
- width: 100%;
- position: absolute;
- left: -30rpx;
- top: 0;
- z-index: 10;
- .select_vaule{
- background: #FAFAFA url('/static/up_icon@2x.png') no-repeat right 8rpx center/32rpx 32rpx;
- }
- .intention_select_bg{
- height: 100%;
- width: 100%;
- background: rgba(0, 0, 0, 0.4);
- border-radius: 30rpx 30rpx 0 0;
- overflow: hidden;
- }
- .select_cont{
- width: 100%;
- background: #FFFFFF;
- border-radius: 0 0 30rpx 30rpx;
- box-sizing: border-box;
- padding: 30rpx 0 0 0;
- .select_vaule{
- margin: 0 30rpx 16rpx;
- }
- .intention_list{
- display: flex;
- flex-wrap: wrap;
- gap: 30rpx 20rpx;
- padding: 14rpx 30rpx 60rpx;
- box-sizing: border-box;
- max-height: 400rpx;
- overflow-y: auto;
- .intention_item{
- padding: 0 32rpx;
- height: 58rpx;
- line-height: 58rpx;
- border-radius: 20rpx;
- border: 2rpx solid #F2F2F2;
- font-weight: 400;
- font-size: 24rpx;
- color: #222222;
- }
- .select_item{
- background: #EDFFF7;
- border: 2rpx solid #EDFFF7;
- color: #24D688;
- }
- }
- .group_btn{
- display: flex;
- align-items: center;
- .cancel_btn,
- .confirm_btn{
- flex: 1;
- height: 100rpx;
- line-height: 100rpx;
- text-align: center;
- font-weight: 400;
- font-size: 28rpx;
- }
- .cancel_btn{
- background: #F7F7F7;
- border-radius: 0rpx 0rpx 0rpx 30rpx;
- color: #222222;
- }
- .confirm_btn{
- background: #24D688;
- border-radius: 0rpx 0rpx 30rpx 0rpx;
- color: #FFFFFF;
- }
- }
- }
- }
- .task_item{
- padding: 30rpx 20rpx;
- width: 690rpx;
- background: #FAFAFA;
- border-radius: 30rpx;
- box-sizing: border-box;
- margin: 0 auto 30rpx;
- .task_title{
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 10rpx;
- .left{
- .title{
- display: flex;
- align-items: center;
- .status_icon{
- width: 120rpx;
- height: 48rpx;
- }
- .name{
- font-weight: bold;
- font-size: 32rpx;
- color: #222222;
- line-height: 48rpx;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- margin-right: 10rpx;
- }
- .intention{
- height: 48rpx;
- background: rgba(53, 232, 154, 0.5);
- border-radius: 24rpx;
- //font-weight: bold;
- font-size: 24rpx;
- color: #222222;
- line-height: 50rpx;
- padding: 0 24rpx;
- }
- }
- .time{
- font-weight: 400;
- font-size: 24rpx;
- color: #CCCCCC;
- line-height: 34rpx;
- margin-top: 10rpx;
- }
- }
- .right{
- .down_icon,
- .up_icon{
- width: 48rpx;
- height: 48rpx;
- }
- }
- }
- .concern{
- display: flex;
- align-items: flex-start;
- padding: 0 10rpx;
- padding-top: 20rpx;
- .label{
- font-weight: 400;
- font-size: 24rpx;
- color: #999999;
- height: 38rpx;
- line-height: 38rpx;
- margin-right: 10rpx;
- white-space: nowrap;
- }
- .concern_list{
- display: flex;
- flex-wrap: wrap;
- gap: 16rpx;
- .concern_item{
- height: 38rpx;
- line-height: 38rpx;
- padding: 0 16rpx;
- background: rgba(36,214,136,0.05);
- border-radius: 20rpx;
- border: 2rpx solid #24D688;
- box-sizing: border-box;
- font-weight: 400;
- font-size: 24rpx;
- color: #24D688;
- }
- }
- }
- .down_box{
- padding-top: 46rpx;
- display: none;
- .sound_play{
- :deep(uni-slider){
- margin: 0 8px;
- .uni-slider-handle-wrapper{
- height: 4rpx;
- border-radius: 4rpx;
- .uni-slider-tap-area{
- padding: 20rpx 0;
- }
- }
- }
- .slider_time{
- display: flex;
- justify-content: space-between;
- font-weight: 400;
- font-size: 20rpx;
- color: #CCCCCC;
- line-height: 30rpx;
- margin-bottom: 30rpx;
- }
- .play_tool{
- display: flex;
- justify-content: center;
- .play_tool_icon{
- width: 48rpx;
- height: 48rpx;
- margin: 0 30rpx;
- }
- }
- }
- .ai_analyse{
- width: 650rpx;
- background: #DFF7EC;
- border-radius: 30rpx;
- padding: 20rpx 20rpx 50rpx;
- box-sizing: border-box;
- margin-top: 30rpx;
- .label{
- font-weight: 500;
- font-size: 28rpx;
- color: #222222;
- line-height: 40rpx;
- margin-bottom: 16rpx;
- }
- .cont{
- font-weight: 400;
- font-size: 24rpx;
- color: #222222;
- line-height: 40rpx;
- }
- }
- }
- }
- .show_down{
- background: #EDFFF7;
- .down_box{
- display: block;
- }
- }
- }
- .show_slist{
- height: calc(100% - 322rpx);
- overflow: hidden;
- }
- </style>
|