Commit 0f9167a4 by liimin

Merge branch 'v1.0.0' of http://192.168.3.233:8090/glsx/simgle_app into v1.0.0

2 parents 900666d7 77038314
Showing 74 changed files with 78 additions and 17323 deletions
// ${pathEnum.evaluation}
import { gscPost } from '../request/signHttp'
module.exports = {
/** 评估单列表 */
evalOrderList(data) {
return gscPost(
`/evalOrder/page`,
{
...data
},
{ returnAll: true }
)
},
/** 评估单详情 */
evalOrderDetail(data) {
return gscPost(
`/evalOrder/detail`,
{
...data
},
{ returnAll: true }
)
},
/** 评估单创建 */
evalOrderCreate(data) {
return gscPost(
`/evalOrder/create`,
{
...data
},
{ returnAll: true, duplicatePrevention: true }
)
},
/** 评估单分页状态数量 */
evalOrderPageCount(data) {
return gscPost(
`/evalOrder/pageCount`,
{
...data
},
{ returnAll: true }
)
},
/** 评估单更新 */
evalOrderUpdate(data) {
return gscPost(
`/evalOrder/edit`,
{
...data
},
{ returnAll: true, duplicatePrevention: true }
)
},
/** 评估单重新报价 */
evalOrderOwnerReQuote(data) {
return gscPost(
`/evalOrder/ownerReQuote`,
{
...data
},
{ returnAll: true }
)
},
/** 签订买卖合同 */
evalOrderSignContract(data) {
return gscPost(
`/evalOrder/signingSaleContract`,
{
...data
},
{ returnAll: true }
)
},
/** 评估单取消合同 */
evalOrderCancelContract(data) {
return gscPost(
`/evalOrder/cancelSaleContract`,
{
...data
},
{ returnAll: true }
)
},
/** 评估单重新提交 */
evalOrderConfirmVehicleDelivery(data) {
return gscPost(
`/confirmVehicleDelivery/reSubmit`,
{
...data
},
{ returnAll: true }
)
},
/** 确认交车 */
confirmDelivery(data) {
return gscPost(
`/confirmVehicleDelivery/confirmVehicleDelivery`,
{
...data
},
{ returnAll: true }
)
},
/** 支付定金 */
payDepositApplication(data) {
return gscPost(
`/applyPayment/payDepositApplication`,
{
...data
},
{ returnAll: true }
)
},
/** 发起代保管协议签署 */
signAgreement(data) {
return gscPost(
`/applyPayment/payFinal`,
{
...data
},
{ returnAll: true }
)
},
/** 检查代保管协议签署状态 */
checkSignAgreement(data) {
return gscPost(
`/applyPayment/checkSignAgreement`,
{
...data
},
{ returnAll: true }
)
},
/** 检查车辆是否存在重复评估单 */
checkRepeat(data) {
return gscPost(
`/evalOrder/checkRepeat`,
{
...data
},
{ returnAll: true }
)
},
/** 车辆ocr识别 */
vinOcr(data) {
return gscPost(
`/evalOrder/vinOcr`,
{
...data
},
{ returnAll: true }
)
},
/** 行驶证ocr识别 */
carLicenseOcr(data) {
return gscPost(
`/evalOrder/carLicenseOcr`,
{
...data
},
{ returnAll: true }
)
},
/** 获取合同详情 */
getContractDetail(data) {
return gscPost(
`/evalElectronicContract/getDetail`,
{
...data
},
{ returnAll: true }
)
},
/** 获取保管人列表 */
getCustodyAgreementList(data) {
return gscPost(
`/custodyAgreement/custodyAgreementList`,
{
...data
},
{ returnAll: true }
)
},
/** 新增保管人 */
addCustodyAgreement(data) {
return gscPost(
`/custodyAgreement/addCustodyAgreement`,
{
...data
},
{ returnAll: true }
)
},
/** 发送代保管人协议 */
sendCustodyAgreement(data) {
return gscPost(
`/custodyAgreement/sendCustodyAgreement`,
{
...data
},
{ returnAll: true }
)
},
/** 销售协议预览 */
salesAgreementPreview(data) {
return gscPost(
`/evalOrder/salesAgreementPreview`,
{
...data
},
{ returnAll: true }
)
},
/** 线上合同预览 */
viewOnlineContract(data) {
return gscPost(
`/evalOrder/viewOnlineContract`,
{
...data
},
{ returnAll: true }
)
},
/** 评估单简单详情 */
evalOrderSimpleDetail(data) {
return gscPost(
`/evalOrder/simpleDetail`,
{
...data
},
{ returnAll: true }
)
},
/**省市区 */
apiRegion(data) {
const queryString = Object.keys(data)
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(data[key])}`)
.join('&')
return gscPost(`/evalOrder/apiRegion/search${queryString ? '?' + queryString : ''}`, { ...data }, { returnAll: true })
}
}
...@@ -2,14 +2,8 @@ import commonApi from './common' ...@@ -2,14 +2,8 @@ import commonApi from './common'
import systemApi from './systemApi' import systemApi from './systemApi'
import userApi from './userApi' import userApi from './userApi'
import boutiqueApi from './boutique' import boutiqueApi from './boutique'
import evaluationApi from './evaluation'
import customerApi from './customerApi' import customerApi from './customerApi'
import pointApi from './point'
import receptionApi from './receptionApi'
import sceneMarketApi from './sceneMarketApi' import sceneMarketApi from './sceneMarketApi'
import interceptionApi from './interceptionApi'
import popupApi from './popupApi'
import usedCarApi from './usedCar'
import loginApi from './loginApi' import loginApi from './loginApi'
module.exports = { module.exports = {
...@@ -18,12 +12,6 @@ module.exports = { ...@@ -18,12 +12,6 @@ module.exports = {
userApi, userApi,
boutiqueApi, boutiqueApi,
customerApi, customerApi,
pointApi,
receptionApi,
sceneMarketApi, sceneMarketApi,
interceptionApi,
popupApi,
evaluationApi,
usedCarApi,
loginApi loginApi
} }
import http from '../request/http'
import { gscPost } from '../request/signHttp'
module.exports = {
/** 查询该店员工日报是否开启 */
staffDailyReportMerchantValid (data) {
return http.post({
method: 'dj.api.smartcarlife.staff.daily.report.popup.need',
projectName: 'boutique',
...data
})
},
/** 校验手机号是否配置打卡和是否打卡 */
clockInConfigPhone (data) {
return http.post({
method: 'dj.api.smartcarlife.clock.in.config.phone',
projectName: 'boutique',
...data
})
},
/**
* 查询当前员工处罚情况
*/
checkStaffStudyPunish (data) {
return http.post({
method: 'dj.api.carboutique.staff.study.punish',
projectName: 'boutique',
...data
})
},
/**
* 二手车查询员工昨天是否新入职或调店
*/
checkUsedCarStaffIsNew (data) {
return http.post({
method: 'dj.api.smartcarlife.secondHandCar.staffDailyReport.popup.need',
projectName: 'boutique',
...data
})
},
/**
* 查询员工是否需要填写二手车日报
*/
checkUsedCarStaffDailyReportValid (data) {
return gscPost('/carDailyReport/yesterday/check', {
...data
})
},
}
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-12-19 11:02:01
* @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn
* @LastEditTime: 2025-04-23 17:19:15
* @FilePath: \gl-tape\api\module\point.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import http from '../request/http'
module.exports = {
/**驻店规则列表 */
pointRuleList(data) {
return http.post({
method: 'dj.api.car.boutique.resident.point.rule.list',
projectName: 'boutique',
...data
})
} /**驻店规则详情列表 */,
pointRuleDetail(data) {
return http.post({
method: 'dj.api.car.boutique.resident.point.rule.detail.list',
projectName: 'boutique',
...data
})
} /**积分记录 */,
pointRecordList(data) {
return http.post({
method: 'dj.api.car.boutique.resident.point.record.list',
projectName: 'boutique',
...data
})
} /**驻店月份排名 */,
pointMonthRanking(data) {
return http.post({
method: 'dj.api.car.boutique.resident.point.month.ranking',
projectName: 'boutique',
...data
})
} /**每日积分-项目完成情况 */,
pointDayTask(data) {
return http.post({
method: 'dj.api.car.boutique.resident.point.every.day.task',
projectName: 'boutique',
...data
})
},
/**积分首页 */
getPoint(data) {
return http.post({
method: 'dj.api.car.boutique.resident.point.home.page',
projectName: 'boutique',
...data
})
},
/**积分奖励规则 */
rewardRule(data) {
return http.post({
method: 'dj.api.car.boutique.resident.point.reward.rule',
projectName: 'boutique',
...data
})
},
badgeList(data) {
return http.post({
method: 'dj.api.car.boutique.resident.point.month.badge.list',
projectName: 'boutique',
...data
})
},
incomeMeasurementConfig(data) {
return http.post({
method: 'dj.smartcarlife.api.incomeMeasurement.switch.config.search',
projectName: 'boutique',
...data
})
},
/**员工收入测算获取员工信息 */
incomeCalculation(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.incomeCalculation.staffInfo',
projectName: 'boutique',
...data
})
},
/**获取员工绩效测算详情 */
incomeCalculationDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.incomeCalculation.detail',
projectName: 'boutique',
...data
})
},
/**分页查询员工月度工资统计列表 */
pageStat(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.monthSalary.pageStat',
projectName: 'boutique',
...data
})
},
/**获取员工(测算/历史)月度工资明细 */
monthSalaryDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.monthSalary.detail',
projectName: 'boutique',
...data
})
},
/**获取试算门店工资绩效配置详细 */
getLatestConfigDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.incomeCalculation.getLatestConfigDetail',
projectName: 'boutique',
...data
})
},
/**员工工资试算*/
monthSalaryCalculation(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.incomeCalculation.monthSalaryCalculation',
projectName: 'boutique',
...data
})
},
/**员工考勤日历 */
calendarDetail(data) {
return http.post({
method: 'dj.api.smartcarlife.clock.in.staff.calendar',
projectName: 'boutique',
...data
})
},
/**查询员工提示信息 */
getTipsMessage(data) {
return http.post({
method: 'dj.api.smartcarlife.staff.tipsMessage.list',
projectName: 'boutique',
...data
})
},
/**直级介绍配置查询 */
getJobConfig(data) {
return http.post({
method: 'dj.smartcarlife.api.job.rank.config.search',
projectName: 'boutique',
...data
})
},
/** 优惠券二级列表 */
getGrantRecord(data) {
return http.post({
method: 'dj.api.car.boutique.resident.coupon.grant.record',
projectName: 'boutique',
...data
})
},
/** 优惠券领取 */
receiveCoupon(data) {
return http.post({
method: 'dj.api.car.boutique.resident.coupon.receive',
projectName: 'boutique',
...data
})
},
/** 统计 优惠券 类型总数 */
statisticsCount(data) {
return http.post({
method: 'dj.api.smartcarlife.resident.coupon.statistics.count',
projectName: 'boutique',
...data
})
},
/** 查询附近地址 */
searchStoreAddress(data) {
return http.post({
method: 'dj.api.car.boutique.resident.coupon.address.search',
projectName: 'boutique',
...data
})
},
/** 查询勋章列表 */
searchLevelConfig(data) {
return http.post({
method: 'dj.api.car.boutique.resident.level.config.page',
projectName: 'boutique',
...data
})
},
/** 我的考勤相关接口 */
/** 员工考勤日历 */
newCalendar(data) {
return http.post({
method: 'dj.api.car.boutique.clock.in.staff.calendar.new',
projectName: 'boutique',
...data
})
},
/** 打卡申诉列表 */
getAppealList(data) {
return http.post({
method: 'dj.api.car.boutique.clock.in.staff.appeal.list',
projectName: 'boutique',
...data
})
},
/** 提交打卡申诉 */
appealCommit(data) {
return http.post({
method: 'dj.api.car.boutique.clock.in.staff.appeal.commit',
projectName: 'boutique',
...data
})
},
/** 考勤出勤明细 */
attendanceDetail(data) {
return http.post({
method: 'dj.api.car.boutique.clock.in.staff.attendance.detail',
projectName: 'boutique',
...data
})
},
appealExist(data) {
return http.post({
method: 'dj.api.car.boutique.clock.in.staff.appeal.exist',
projectName: 'boutique',
...data
})
}
}
import http from '../request/http'
module.exports = {
/** 销售顾问/录单员 & 交付专员 */
getEmployeeList (data) {
return http.post({
method: 'dj.api.smartcarlife.employee.onTheJob.getByMerchantId',
projectName: 'boutique',
...data
})
},
/**
* 二级流量方
*/
getDiversionMerchantRef (data) {
return http.post({
method: 'dj.api.smartcarlife.diversionMerchant.getDiversionMerchantRef',
projectName: 'boutique',
...data
})
},
/**
* 获取门店品牌车型
*/
getMerchantCarBrandList (data) {
return http.post({
method: 'dj.api.get.car.brandList',
projectName: 'boutique',
needCarSeries: true,
...data
})
},
/***
* 获取门店礼券列表
*/
getMerchantCouponList (data) {
return http.post({
method: 'dj.api.smartCarLife.merchant.coupon.list',
projectName: 'boutique',
...data
})
},
/**
* 获取客户礼券列表
*/
getCustomerCouponList (data) {
return http.post({
method: 'dj.api.customer.coupon.list',
projectName: 'boutique',
...data
})
},
/**
* 获取商品列表
*/
getGoodsList (data) {
return http.post({
method: 'dj.api.smartcarlife.selectOrderGoods.list',
projectName: 'boutique',
...data
})
},
/**获取订单列表筛选转化人员&销售顾问 */
getOrderScreenEmployeeList (data) {
return http.post({
method: 'dj.api.smartcarlife.employee.getByMerchantId',
projectName: 'boutique',
...data
})
},
/**
* 获取园区店配置
*/
getYqStoreConfig (data) {
return http.get({
method: 'dj.api.smarcarlife.yqMerchantConfig.detail',
projectName: 'boutique',
...data
})
},
/**
* 战败下单商品列表
*
*/
getOrderUpgradeGoodsList (data) {
return http.post({
method: 'dj.api.smartcarlife.orderUpgradeGoods.listByMerchantId',
projectName: 'boutique',
...data
})
},
/**
* 获取精品升级场景 太阳膜类商品部位数据
*/
getPositionList (data) {
return http.post({
method: 'dj.api.smartcarlife.goodsPosition.list',
projectName: 'boutique',
...data
})
}
}
\ No newline at end of file \ No newline at end of file
import http from '../request/http'
module.exports = {
/**
* 查询对话内容
*/
findConversationDetailByBatchIdNew(data){
return http.post({
method: 'dj.pad.api.reception.findConversationDetailByBatchIdNew',
projectName: 'pad',
...data
})
},
/**查询质检列表|侧边栏 */
findCheckResultByBatchId (data) {
return http.post({
method: 'dj.pad.api.reception.findCheckResultByBatchId',
projectName: 'pad',
...data
})
},
/**话术标签 */
findRecordingTagByBatchId(data) {
return http.post({
method: 'dj.pad.api.reception.findRecordingTagByBatchId',
projectName: 'pad',
...data
})
},
getShortUrl(data){
return http.post({
method: 'dj.api.car.boutique.inspection.batch.file.short.url',
projectName: 'boutique',
...data
})
},
/**业绩看板 */
getMerchantPerformance(data){
return http.post({
method: 'dj.api.car.boutique.inspection.findMerchantPerformance',
projectName: 'boutique',
...data
})
},
}
import { gscPost } from '../request/signHttp'
module.exports = {
/** 二手车驻店日报列表 */
getCarDailyReportList (data) {
return gscPost('/carDailyReport/list', {
...data
})
},
/**
* 新增二手车驻店日报
*/
addCarDailyReport (data) {
return gscPost('/carDailyReport/add', {
...data
})
},
/**
* 二手车驻店日报详情
*/
getCarDailyReportDetail (data) {
return gscPost('/carDailyReport/detail', {
...data
})
},
/**
* 修改二手车驻店日报
*/
editCarDailyReport (data) {
return gscPost('/carDailyReport/edit', {
...data
})
},
/**
* 交付单列表
*/
getDeliveryOrderPageList (data) {
return gscPost('/deliveryOrderManage/getDeliveryOrderPageList', data ,{
returnAll: true
})
},
/**
* 交付单列表按照支付状态统计数量
*/
getDeliveryOrderListCount (data) {
return gscPost('/deliveryOrderManage/getDeliveryOrderListCount', data)
},
/**
* 交付单详情
*/
getDeliveryOrderDetail (data) {
return gscPost('/deliveryOrderManage/getDeliveryOrderDetail', data)
},
/**
* 交付单操作日志
*/
getDeliveryOrderOpLog (data) {
return gscPost('/deliveryOrderManage/getDeliveryOrderOpLog', data)
},
/**
* 客户确认到店
*/
confirmArrive (data) {
return gscPost('/deliveryOrderManage/confirmArrive', data, { returnAll: true })
},
/**
* 客户确认提车
*/
confirmDelivery (data) {
return gscPost('/deliveryOrderManage/confirmDelivery', data, { returnAll: true })
},
}
<template>
<view class="entrance-box">
<template v-if="entranceList.length">
<view class="entrance-container">
<view class="entrance-list">
<view
class="entrance-item"
v-for="(item, index) in entranceList"
:key="index"
@click="handleClick(item)"
>
<view :class="['sprite-icon', `icon-${item.icon}`]"></view>
<view class="entrance-name">{{ item.label }}</view>
</view>
</view>
</view>
</template>
<template v-else>
<view class="developing flex">
<image
class="developing-icon"
src="../assets/images/common/developing.webp"
/>
功能开发中
</view>
</template>
</view>
</template>
<script>
export default {
name: 'Entrance',
data () {
return {
}
},
computed: {
entranceList () {
let { sceneType } = uni.$storage.get('userInfo'),
entranceList = [
{
icon: 'daily-report',
label: '驻店日报',
name: 'DailyReport',
},
{
icon: 'create-order',
label: '新建工单',
name: 'CreateOrder'
},
{
icon: 'defeat-order',
label: '战败下单',
name: 'DefeatOrder'
},
{
icon: 'order-management',
label: '工单列表',
name: 'OrderManagement'
},
{
icon: 'evaluation-management',
label: '评估单管理',
name: 'EvaluationFormList'
}, {
icon: 'delivery-management',
label: '交付管理',
name: 'DeliveryManagement',
page: '/pages/usedCar/deliveryManagement/index'
}
]
if (sceneType == 0) return []
else if (sceneType === 7) {
return entranceList.filter(e => ['DailyReport', 'EvaluationFormList', 'DeliveryManagement'].includes(e.name));
}
if (sceneType === 1) {
return entranceList.filter(e => !['EvaluationFormList', 'DeliveryManagement'].includes(e.name));
}
}
},
methods: {
handleClick (item) {
// 这里可以根据实际需求进行跳转或功能处理
this.$emit('entranceClick', item)
}
}
}
</script>
<style scoped lang="scss">
.entrance-container {
width: 100%;
// margin-top: toRpx(64);
display: flex;
// justify-content: center;
}
.entrance-list {
display: flex;
flex-wrap: wrap;
gap: toRpx(68);
justify-content: flex-start;
}
.entrance-item {
min-width: toRpx(120);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: toRpx(28);
color: #333;
.entrance-name {
margin-top: toRpx(8);
}
}
.developing {
height: 100%;
flex-direction: column;
color: #999999;
font-size: toRpx(20);
&-icon {
width: toRpx(344);
height: toRpx(208);
}
}
</style>
<template>
<uni-popup
ref="popup"
type="bottom"
border-radius="16px"
>
<view class="kf-box">
<view
class="close flex"
@click="close"
>
<uni-icons
type="closeempty"
:size="18"
color="#1A1A1A"
></uni-icons>
</view>
<view class="title flex">
<view class="sprite-icon icon-qw"></view>
嘀加智慧云
</view>
<view class="info flex">
<view class="text">
<view class="name flex">
云小白 <view class="duty">产品经理</view>
</view>
<view class="content">嘀加智慧云|产品中心</view>
<view class="tool">
<template v-for="(i,index) in tool">
<view
class="tool-item flex"
:key="index"
>
<view :class="['sprite-icon',`icon-kf-${index}`]"></view>
{{i}}
</view>
</template>
</view>
</view>
<view class="qr-box flex">
<image
class="qr"
:src="qr"
/>
使用企业微信扫码
</view>
</view>
</view>
</uni-popup>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
tool: ['使用反馈', '功能建议', '心得分享', '吐槽拍砖'],
qr: require('@/assets/images/common/qr.webp')
}
},
mounted () {
},
methods: {
open () {
this.$refs.popup.open("center");
},
close () {
this.$refs.popup.close()
}
}
}
</script>
<style scoped lang='scss'>
.kf-box {
position: relative;
width: toRpx(864);
height: toRpx(478);
background: #ffffff;
border-radius: toRpx(32);
padding: 0 toRpx(48);
box-sizing: border-box;
.close {
position: absolute;
width: toRpx(120);
height: toRpx(120);
top: 0;
right: 0;
justify-content: center;
}
.title {
font-weight: 500;
font-size: toRpx(32);
padding: toRpx(46) 0;
.sprite-icon {
margin-right: toRpx(16);
}
}
.info {
.name {
position: relative;
width: toRpx(480);
font-weight: 600;
font-size: toRpx(48);
align-items: baseline;
padding-bottom: toRpx(24);
border-bottom: toRpx(2) solid #e6e6e6;
.duty {
font-weight: 400;
font-size: toRpx(28);
margin-left: toRpx(16);
}
&::after {
position: absolute;
left: 0;
bottom: toMinusRpx(2);
width: toRpx(280);
height: toRpx(4);
background: #2c66f7;
content: "";
}
}
.content {
padding: toRpx(28) 0;
font-weight: 500;
font-size: toRpx(28);
}
.tool {
display: flex;
flex-wrap: wrap;
&-item {
flex: 50%;
font-size: toRpx(28);
color: #666666;
margin-bottom: toRpx(20);
.sprite-icon {
margin-right: toRpx(8);
}
}
}
}
.qr-box {
margin-left: toRpx(48);
flex-shrink: 0;
flex-direction: column;
font-weight: 500;
font-size: toRpx(28);
.qr {
width: toRpx(240);
height: toRpx(240);
margin-bottom: toRpx(8);
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view
class="case-item-component"
@click="jumpDetail(item)"
>
<image
class="img"
:src="item.cover || 'https://img02.glsx.com.cn/weapp/resource/app-tape/common/default-cover.webp'"
:style="imgStyle"
mode="aspectFill"
></image>
<view class="case-info">
<view class="case-name text-hide">{{ item.title }}</view>
<template v-for="(j, ind) in caseInfo">
<view
class="case-text flex"
:key="ind"
>
<view class="case-label">{{ j.label }}:</view>
<view :class="['case-value', j.class]">
<template v-if="j.format">
{{ j.format(item) }}
</template>
<template v-else>
{{ item[j.key] || '--' }}
</template>
</view>
</view>
</template>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'CaseItem',
props: {
item: Object,
source: {
type: Number,
default: 1
},
visitsId: [Number, String],
imgStyle: String
},
data () {
return {
caseInfo: [
{
label: '业务场景',
class: 'text-hide',
format: (val) => {
// 业务场景:0-会员权益/升级;1-精品升级;2-次新车转化;3-售后众筹;4-积分商城
return val ? {
0: '会员权益/升级',
1: '精品升级',
2: '次新车转化',
3: '售后众筹',
4: '积分商城'
}[val.scene] : '--'
}
},
{
label: '客户标签',
key: 'tags',
class: 'text-hide'
},
{
label: '适用套餐',
key: 'goods',
class: 'text-two-line'
},
],
}
},
mounted () {
},
methods: {
jumpDetail (item) {
const { source, visitsId } = this
let params = `id=${item.id}&source=${source}`
if (visitsId) params += `&visitsId=${visitsId}`
// 类型:0-图片;1-视频;2-pdf;3-富文本
let url = `/pages/common/caseDetail?${params}`
if (item.type != 3) {
let fileUrl = item?.detailInfos[0]?.image
if (item.type == 2) url = `/pages/common/webview?fileUrl=${fileUrl}&title=${item.title}&${params}`
if (item.type == 1 || item.type == 0) url = `/pages/boutique/preview?tabName=${item.title}&sourceType=${item.type == 1 ? 2 : 1}&detailUrl=${fileUrl}&${params}`
}
uni.navigateTo({
url: `${url}`
})
},
}
}
</script>
<style scoped lang='scss'>
.case-item-component {
width: 100%;
height: 100%;
background: #ffffff;
box-shadow: 0 toRpx(8) toRpx(24) 0 #2c66f71a;
border-radius: toRpx(16);
display: flex;
flex-direction: column;
overflow: hidden;
.img {
width: 100%;
height: toRpx(324);
}
.case-name {
font-weight: 500;
font-size: toRpx(28);
color: #333333;
line-height: toRpx(48);
padding: toRpx(16) toRpx(32) toRpx(8);
}
.case-text {
align-items: flex-start;
font-size: toRpx(24);
color: #666666;
line-height: toRpx(40);
padding: 0 toRpx(32);
margin-bottom: toRpx(4);
}
.case-label {
width: toRpx(120);
flex-shrink: 0;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="record-box">
<view class="record-content">
<view class="data-container">
<view class="control-box flex">
<view class="tabs">
<page-tabs
:list="dateList"
@changeTab="changeIndex"
/>
</view>
<view class="select-box-list select-component flex">
<view
class="add-btn flex"
@click="editItem(false)"
>
<view class="sprite-icon icon-customer-add"></view>
预录信息
</view>
</view>
</view>
<scroll-view
:class="['record-list']"
scroll-y
@scrolltolower="pageonReachBottom"
>
<view class="list">
<template v-if="flag">
<template v-if="list.length && list[0] && list[0].length">
<template v-for="(i,index) in list">
<template v-for="(item,cindex) in i">
<view
class="item"
:key="item.id"
@longpress="longPress(item,index,cindex)"
@click="jumpDetail(item.id)"
>
<view class="name">
{{ item.ownerName }}
</view>
<template v-for="(k, ind) in itemObject">
<view
class="info flex"
:key="`${item.id}-${ind}`"
v-if="showItem(k.key)"
>
<view class="label">{{ k.label }}</view>
<view class="value text-hide">{{ item[k.key] || "-" }}</view>
</view>
</template>
<view
:class="['mask',{'show-mask':item.maskStatus}]"
@click.stop
>
<view
class="mask-close"
@click.stop="closeMask(index,cindex)"
>
<uni-icons
type="closeempty"
:size="16"
color="#fff"
></uni-icons>
</view>
<template v-if="item.showDel">
<view class="mask-del-box flex">
是否删除该客户档案
<view class="btns flex">
<view
class="btn cancel"
@click.stop="switchDel(index,cindex)"
>取消</view>
<view
class="btn"
@click.stop="delItem(item.id,index,cindex)"
>确定</view>
</view>
</view>
</template>
<template v-else>
<view class="mask-box flex">
<view
class="mask-item"
@click="editItem(item)"
>
<view class="sprite-icon icon-mask-edit"></view>
编辑
</view>
<view
class="mask-item"
@click.stop="switchDel(index,cindex, true)"
>
<view class="sprite-icon icon-mask-del"></view>
删除
</view>
</view>
</template>
</view>
</view>
</template>
</template>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../../../assets/images/home/nothing.webp"
/>
暂无预录记录
</view>
</template>
</template>
</view>
<template v-if="nothing">
<view class="end-text">-已经到底了-</view>
</template>
</scroll-view>
</view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
import PageTabs from '@/components/PageTabs.vue'
export default {
components: {
PageTabs
},
name: '',
props: {
show: Boolean
},
data () {
return {
dateList: [
{ text: '今日到店' },
{ text: '全部客户' },
],
itemObject: [
{ label: '车主电话', key: 'ownerPhone' },
{ label: '品牌车型', key: 'brandModel' },
{ label: '客户标签', key: 'customerTagName' },
{ label: '到店日期', key: 'arrivalDate' },
{ label: '接待时间', key: 'receptionTime' },
{ label: '接待人员', key: 'receptionist' },
],
dateIndex: 0,
pageNum: 1,
total: 0,
list: [],
flag: false,
nothing: false,
pageSize: 10,
loaded: false
}
},
computed: {
activeBtnStyle () {
let { dateIndex } = this,
val = dateIndex * 184
return {
transform: `translate(toRpx(${val}), -50%)`
}
},
},
watch: {
show: {
immediate: true,
handler (newval) {
if (newval && !this.loaded) {
this.init()
this.loaded = true
}
}
}
},
mounted () {
},
methods: {
refresh () {
this.flag = false
this.list = []
this.pageNum = 1;
this.nothing = false
this.getReceptionList()
},
init () {
this.dateList.map((e, index) => {
const tatget = ['day', 'all'][index]
const {
startTime,
endTime
} = this.getDateRange(tatget)
e.startTime = startTime
e.endTime = endTime
})
this.getReceptionList()
},
async getReceptionList () {
try {
uni.showLoading({
mask: true
})
let { dateList, dateIndex, pageNum, pageSize } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
{ startTime, endTime } = dateList[dateIndex],
params = {
pageNum,
pageSize,
receptionStatus: 1,
merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2 // 1.延保 2.轻改
}
if (startTime && endTime) {
params.startTime = startTime
params.endTime = endTime
}
const { list, total } = await uni.$api.customerApi.getCustomerFileList(params)
uni.hideLoading()
list?.length && list.map(e => {
let ownerPhone = e.ownerPhone
e.arrivalDate = dayjs(e.arrivalDate).format("YYYY.MM.DD")
e.receptionTime = dayjs(e.receptionTime).format("YYYY.MM.DD HH:mm")
e.ownerPhone = ownerPhone.slice(0, 3) + " " + ownerPhone.slice(3, 7) + " " + ownerPhone.slice(7)
e.customerTagName = e.customerTagName ? e.customerTagName.replace(/,/g, '|') : ''
e.maskStatus = false
})
this.list[pageNum - 1] = list
this.flag = true
this.total = total
} catch (error) {
uni.hideLoading()
this.flag = true
}
},
changeIndex (index) {
if (this.dateIndex == index) return
this.dateIndex = index
this.refresh()
},
pageonReachBottom () {
let { pageNum, total, nothing, pageSize } = this
if (!nothing) nothing = 'nothing'
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1
this.getReceptionList()
} else this.nothing = true
},
getDateRange (type) {
let now = new Date();
let startTime, endTime;
if (type === 'day') {
startTime = new Date(now.getFullYear(), now.getMonth(), now.getDate());
endTime = new Date(now.getFullYear(), now.getMonth(), now.getDate());
} else {
startTime = null
endTime = null
}
return {
startTime: startTime ? dayjs(startTime).format("YYYY-MM-DD") + ' 00:00:00' : '',
endTime: endTime ? dayjs(endTime).format("YYYY-MM-DD") + ' 23:59:59' : ''
};
},
showItem (key) {
let flag = true
if (['receptionTime', 'receptionist'].includes(key)) flag = false
return flag
},
longPress (item, index, ind) {
if (item.maskStatus) return
this.list[index][ind].maskStatus = true
this.$forceUpdate()
},
closeMask (index, ind) {
this.list[index][ind].maskStatus = false
this.switchDel(index, ind, false)
},
switchDel (index, ind, result) {
this.list[index][ind].showDel = result
this.$forceUpdate()
},
editItem (item) {
this.$emit('editCustomer', item.id || '')
},
async delItem (id, index, ind) {
try {
const res = await uni.$api.customerApi.delCustomerFile({ id })
if (res) {
this.list[index].splice(ind, 1)
this.$forceUpdate()
this.$emit('showSuccess')
}
} catch (error) {
uni.showToast({
title: error,
icon: 'none'
})
}
},
jumpDetail (id) {
uni.navigateTo({
url: `/pages/common/customerDetail?id=${id}`,
animationType: 'pop-in',
animationDuration: 100
})
},
}
}
</script>
<style scoped lang="scss">
.record-box {
box-sizing: border-box;
height: 100%;
.record-content {
height: 100%;
box-sizing: border-box;
.data-container {
background: #ffffff;
border-radius: toRpx(48);
height: 100%;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
box-sizing: border-box;
position: relative;
overflow: hidden;
.control-box {
height: toRpx(164);
.tabs {
width: toRpx(392);
height: toRpx(84);
margin-left: toRpx(44);
}
.select-box-list {
margin-left: auto;
gap: 0 toRpx(40);
}
.select-component {
margin-right: toRpx(44);
}
}
}
}
.record-list {
height: calc(100% - #{toRpx(164)});
box-sizing: border-box;
position: relative;
z-index: 4;
}
.list {
display: flex;
flex-wrap: wrap;
gap: toRpx(40) toRpx(46);
padding: toRpx(2) toRpx(44) 0;
.item {
// width: toRpx(610);
width: calc(50% - #{toRpx(23)});
background: #ffffff;
box-sizing: border-box;
padding: toRpx(24) toRpx(32);
position: relative;
box-shadow: 0 toRpx(8) toRpx(24) 0 #2c66f71a;
border-radius: toRpx(16);
.status {
position: absolute;
top: toRpx(24);
right: toRpx(32);
width: toRpx(88);
height: toRpx(44);
background: #fdece9;
color: #f24724;
border-radius: toRpx(4);
font-weight: 500;
font-size: toRpx(24);
justify-content: center;
}
.deal {
background: #eaf9f1;
color: #35c376;
}
.name {
font-weight: 500;
font-size: toRpx(32);
color: #292d33;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: toRpx(44);
max-width: 100%;
}
.info {
margin-top: toRpx(12);
font-size: toRpx(24);
color: #999ea8;
.value {
margin-left: auto;
color: #666666;
max-width: toRpx(388);
}
}
.mask {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.4);
border-radius: toRpx(16);
opacity: 0;
pointer-events: none;
&-close {
position: absolute;
right: toRpx(16);
top: toRpx(16);
z-index: 8;
}
&-box {
width: 100%;
height: 100%;
justify-content: center;
gap: 0 toRpx(96);
.mask-item {
font-size: toRpx(26);
color: #ffffff;
text-align: center;
line-height: toRpx(36);
.sprite-icon {
margin-bottom: toRpx(8);
}
}
}
&-del-box {
width: 100%;
height: 100%;
justify-content: center;
font-size: toRpx(28);
color: #ffffff;
line-height: toRpx(36);
flex-direction: column;
animation: opacity-0-1 0.5s forwards;
.btns {
justify-content: center;
gap: 0 toRpx(16);
margin-top: toRpx(56);
.btn {
width: toRpx(192);
height: toRpx(64);
background-image: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
border-radius: toRpx(32);
box-sizing: border-box;
text-align: center;
line-height: toRpx(64);
font-size: toRpx(26);
color: #ffffff;
}
.cancel {
border: toRpx(2) solid #ffffff;
background-image: none;
}
}
}
}
.show-mask {
pointer-events: auto;
opacity: 1;
}
}
.case-item {
width: 22.8%;
height: toRpx(552);
}
}
}
.add-btn {
width: toRpx(244);
height: toRpx(72);
border-radius: toRpx(16);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
font-size: toRpx(30);
color: #ffffff;
justify-content: center;
.sprite-icon {
margin-right: toRpx(8);
zoom: 2;
}
}
.tabs-bottom {
background: #fff;
height: toRpx(48);
position: relative;
border-radius: toRpx(48) toRpx(48) 0 0;
position: absolute;
width: 100%;
top: toRpx(128);
}
.data-tabs-box {
position: relative;
top: 0;
margin-top: toMinusRpx(8);
.data-tabs {
display: flex;
justify-content: space-between;
width: fit-content;
height: toRpx(68);
background-color: #f2f2f2;
border-radius: toRpx(16);
margin-left: toRpx(64);
position: relative;
padding: toRpx(4);
box-sizing: content-box;
&::after {
position: absolute;
z-index: -2;
background: #ffffff;
width: 100%;
height: 100%;
left: 0;
top: 0;
content: '';
}
.tab {
width: toRpx(184);
height: toRpx(68);
justify-content: center;
font-size: toRpx(28);
color: #1f2133;
z-index: 10;
opacity: 0.7;
}
.active {
opacity: 1;
font-weight: 500;
}
.active-btn {
position: absolute;
width: toRpx(184);
height: toRpx(68);
background: #ffffff;
top: 50%;
transform: translateY(-50%);
border-radius: toRpx(16);
transition: all 0.15s;
}
.active-btn-0 {
left: toRpx(4);
}
.active-btn-1 {
left: toRpx(188);
}
.active-btn-2 {
left: toRpx(372);
}
.active-btn-3 {
left: toRpx(556);
}
}
}
.scene-box {
position: relative;
top: 0;
z-index: 3;
margin-top: toMinusRpx(8);
padding: 0 toRpx(64);
.scene-tabs {
gap: 0 toRpx(24);
.tab {
height: toRpx(80);
background: #f2f2f2;
border-radius: toRpx(16);
padding: 0 toRpx(32);
justify-content: center;
font-size: toRpx(28);
color: #666666;
transition: all 0.15s;
}
.active {
font-weight: 500;
color: #2d66f7;
background: #2d66f71a;
}
}
.btn-list {
margin-left: auto;
gap: 0 toRpx(48);
line-height: toRpx(48);
.search-btn {
&::after {
content: '';
border: toRpx(12) solid transparent;
border-left-color: #000;
margin-left: toRpx(12);
transform: translateY(toMinusRpx(2));
}
}
.check-box {
width: toRpx(32);
height: toRpx(32);
background: #ffffff;
border: toRpx(3) solid #999;
border-radius: toRpx(6);
box-sizing: border-box;
margin-right: toRpx(16);
justify-content: center;
overflow: hidden;
transition: all 0.25s;
flex-shrink: 0;
transform: translateY(toMinusRpx(2));
}
.checked {
background: #2c66f7;
border-color: #2c66f7;
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(260);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(676);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(50) 0;
font-size: toRpx(24);
}
@keyframes opacity-0-1 {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style>
<template>
<view class="customer-flow-box">
<view class="customer-flow-title">门店客流情况</view>
<view class="sprite-icon icon-customer-flow"></view>
<view class="deliveries flex">
累计交付数
<view class="num">{{formattedNumber('cumulativeDeliveryCount')}}</view>
</view>
<view class="touchpoints flex">
实际触客数
<view class="num">{{formattedNumber('actualContactCount')}}</view>
</view>
<view class="touchpoint-rate">
实际触客率
<view :class="['num',{'rate-color':dataShow && pageData.contactRate}]">{{formattedNumber('contactRate', '%')}}</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
pageData: {
type: Object,
default: () => { }
},
dataShow: {
type: Boolean,
default: true
}
},
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
formattedNumber (key, unit) {
let { dataShow, pageData } = this,
num = pageData[key]
if (unit && num) num += unit
if (!dataShow || !num) num = '--'
return num
}
}
}
</script>
<style scoped lang='scss'>
.customer-flow-box {
position: relative;
height: toRpx(422);
color: #333333;
.customer-flow-title {
font-size: toRpx(28);
font-weight: 500;
padding: toRpx(24) toRpx(32) 0;
}
.sprite-icon {
position: absolute;
top: 0;
left: 0;
zoom: 2;
}
.deliveries,
.touchpoints,
.touchpoint-rate {
position: absolute;
font-size: toRpx(20);
box-sizing: border-box;
flex-direction: column;
.num {
transition: all 0.15s;
}
}
.deliveries,
.touchpoints {
color: #ffffff;
width: toRpx(400);
height: toRpx(128);
left: toRpx(32);
.num {
font-size: toRpx(24);
font-weight: 500;
}
}
.deliveries {
top: toRpx(108);
padding-top: toRpx(54);
}
.touchpoints {
top: toRpx(236);
padding-top: toRpx(37);
}
.touchpoint-rate {
top: toRpx(208);
left: toRpx(424);
.num {
font-size: toRpx(28);
font-weight: 700;
}
.rate-color {
color: #4673ff;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view :class="['fixed-page',{'show-box':show}]">
<view :class="['customer-info-box',backClass]">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
客户档案
</view>
<view class="form-box flex">
<template v-for="(i,index) in customerForm">
<view
class="form-item flex"
:key="index"
>
<view class="label flex">
<view
class="required"
v-if="i.required"
>*</view>{{i.label}}
</view>
<template v-if="i.type == 'input'">
<input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input',{error:i.error}]"
placeholder="请选择"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
/>
</template>
<template v-else-if="i.type == 'date'">
<picker
mode="date"
fields="day"
:start="startDate"
:end="endDate"
@change="bindDateChange"
:value="customerInfo[i.valueKey]"
>
<view :class="['select flex',{placeholderStyle:!customerInfo[i.valueKey]}]">
<view class="value text-hide">{{customerInfo[i.valueKey] ||'请选择'}}</view>
<uni-icons
class="arrow"
type="right"
:size="16"
></uni-icons>
</view>
</picker>
</template>
<template v-else>
<view
:class="['select flex',{placeholderStyle:!customerInfo[i.valueKey]}]"
@click="showPopup(i.popKey)"
>
<view class="value text-hide">{{customerInfo[i.valueKey] ||'请选择'}}</view>
<uni-icons
class="arrow"
type="right"
:size="16"
></uni-icons>
</view>
</template>
</view>
</template>
</view>
<view class="btns flex">
<view
class="btn cancel"
@click="back"
>取消</view>
<view
:class="['btn',{disabled:check}]"
@click="submit"
>提交</view>
</view>
</view>
<view class="popup">
<car-brands
ref="carBrandVisible"
@select="handleSelect($event,'carBrandVisible')"
:echoData="customerInfo"
carBrandKey="carBrand"
carModelKey="brandModel"
customBoolean
/>
<customer-tags
ref="customerTagstVisible"
@select="handleSelect($event,'customerTagstVisible')"
:chooseList="tagsList"
></customer-tags>
<reception-sence
ref="receptionSceneVisible"
@select="handleSelect($event,'receptionSceneVisible')"
:customerInfo="customerInfo"
></reception-sence>
</view>
<uni-popup
ref="successRef"
type="message"
>
<uni-popup-message
type="success"
message="数据保存成功"
:duration="1500"
></uni-popup-message>
</uni-popup>
</view>
</template>
<script type='text/ecmascript-6'>
import CarBrands from '@/components/CarBrands.vue'
import dayjs from 'dayjs'
import CustomerTags from './CustomerTags.vue'
import ReceptionSence from './ReceptionSence.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/,
default_customerForm = [{
label: '车主姓名',
valueKey: 'ownerName',
key: 'ownerName',
type: 'input',
inputType: 'text',
required: true,
maxlength: 50
},
{
label: '车主电话',
valueKey: 'ownerPhone',
key: 'ownerPhone',
type: 'input',
inputType: 'tel',
required: true,
maxlength: 11,
error: false
},
{
label: '品牌车型',
valueKey: 'brandModel',
key: 'brandModel',
type: 'select',
required: true,
popKey: 'carBrandVisible'
},
{
label: '接待场景',
valueKey: 'receptionSceneName',
key: 'receptionScene',
type: 'select',
required: true,
popKey: 'receptionSceneVisible'
},
{
label: '到店日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
type: 'date',
required: true,
},
{
label: '客户标签',
valueKey: 'customerTagName',
key: 'customerTagName',
type: 'select',
required: true,
popKey: 'customerTagstVisible'
}]
export default {
props: {
customerId: [Number, String],
show: Boolean
},
name: 'CustomerInfo',
components: { CarBrands, CustomerTags, ReceptionSence },
watch: {
show: {
immediate: true,
handler (newval) {
if (!newval) return
const { sceneType } = uni.$storage.get("userInfo");
default_customerForm[0].maxlength = sceneType == 1 ? 20 : 50
this.$store.dispatch("clearCustomerInfo");
this.$store.dispatch("clearHistory")
this.customerForm = JSON.parse(JSON.stringify(default_customerForm))
this.customerInfo = {
ownerName: '',
ownerPhone: '',
brandModel: '',
receptionScene: '',
arrivalDate: '',
customerTagName: '',
receptionSceneName: ''
}
if (this.customerId) this.findVisitsInfo()
}
}
},
computed: {
check () {
let { customerForm, customerInfo } = this,
result = false
try {
customerForm.map(e => {
if (e.required && !customerInfo[e.key]) throw true
})
} catch (error) {
result = error
}
return result
},
tagsList () {
let list = [],
{ customerInfo, customerTag } = this,
names = customerInfo.customerTagName ? customerInfo.customerTagName.split('|') : [],
isd = customerTag ? customerTag.split(',') : []
names.map((e, index) => {
list.push({
labelName: e,
labelId: isd[index]
})
})
return list
}
},
data () {
return {
customerForm: [],
customerInfo: {},
startDate: '',
endDate: '',
customerTag: '',
backClass: ''
}
},
mounted () {
this.startDate = dayjs(dayjs().subtract(7, 'day')).format("YYYY-MM-DD")
this.endDate = dayjs(dayjs().add(30, 'day')).format("YYYY-MM-DD")
},
methods: {
async findVisitsInfo () {
const res = await uni.$api.customerApi.findVisitsInfo({
id: this.customerId
})
if (res.customerTag) this.customerTag = res.customerTag
res.customerTagName = res.customerTagName.replace(/,/g, '|')
res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
this.customerInfo = res
},
back () {
this.backClass = 'backClass'
setTimeout(() => {
this.backClass = ''
this.$emit('update:show', false)
}, 300)
},
showPopup (e) {
this.$refs[e].open()
},
handleSelect (item, popkey) {
this.$refs[popkey].close()
if (popkey == 'carBrandVisible') {
this.$refs.carBrandVisible.close()
// this.customerInfo.brandModel = item.name
// this.customerInfo.carBrand = item.carChildsBrandName
Object.assign(this.customerInfo, {
brandModel: item.name,
carModelId: item.id,
carBrand: item.carChildsBrandName,
carBrandId: item.carChildsBrandId,
oneCarBrand: item.carBrand,
oneCarBrandId: item.carBrandId
})
} else if (popkey == 'customerTagstVisible') {
let names = [],
ids = []
item.map(i => {
names.push(i.labelName)
ids.push(i.labelId)
})
this.customerInfo.customerTagName = names.join('|')
this.customerTag = ids.join(',')
} else {
this.customerInfo.receptionSceneName = item.receptionSceneName
this.customerInfo.receptionScene = item.id
}
},
bindDateChange (e) {
this.customerInfo.arrivalDate = e.detail.value
},
async submit () {
if (this.check) return
try {
this.customerForm.map(e => {
e.error = false
})
let { customerInfo, customerForm, customerTag } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo',
params = {
customerTag,
merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2 // 1.延保 2.轻改
}
if (!phoneRex.test(customerInfo.ownerPhone)) throw 'ownerPhone'
customerForm.map(e => {
params[e.key] = customerInfo[e.key]
})
if (customerInfo.id) params.id = customerInfo.id
Object.assign(params, {
carModelId: customerInfo.carModelId,
carBrand: customerInfo.carBrand,
carBrandId: customerInfo.carBrandId,
oneCarBrand: customerInfo.oneCarBrand,
oneCarBrandId: customerInfo.oneCarBrandId
})
params.customerTagName = params.customerTagName.replace(/|/g, ',')
uni.showLoading({
mask: true
})
const res = await uni.$api.customerApi[targetApi](params),
_this = this
if (res) {
/**1:成功,2:重复 */
if (res == '1') {
this.$refs.successRef.open()
setTimeout(() => {
uni.hideLoading()
this.back()
this.$emit('refresh')
}, 1e3)
} else {
uni.showModal({
content: '存在与该手机号相同的接待记录,系统将自动归类到已接待',
showCancel: false,
confirmText: '确认',
confirmColor: '#347BFF',
success (res) {
if (res.confirm) {
_this.back()
_this.$emit('refresh')
}
}
})
uni.hideLoading()
}
} else {
uni.hideLoading()
}
} catch (error) {
let index = this.customerForm.findIndex(e => e.key == error)
this.customerForm[index].error = true
this.clickFlag = false
uni.hideLoading()
}
}
}
}
</script>
<style scoped lang='scss'>
.fixed-page {
display: none;
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
pointer-events: none;
z-index: 9;
.customer-info-box {
position: absolute;
top: toRpx(80);
left: toRpx(240);
width: 87.04%;
height: toRpx(1376);
background: #ffffff59;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border-radius: toRpx(48);
backdrop-filter: blur(toRpx(8));
pointer-events: auto;
animation: left-in 0.25s forwards;
.nav-bar {
width: 100%;
top: 0;
height: toRpx(96);
z-index: 9;
text-align: center;
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
line-height: toRpx(96);
position: relative;
margin-top: toRpx(16);
.back {
position: absolute;
left: 0;
top: 0;
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
}
.form-box {
flex-wrap: wrap;
padding: toRpx(32) toRpx(40);
justify-content: space-between;
.form-item {
width: toRpx(934);
height: toRpx(80);
margin-bottom: toRpx(48);
font-size: toRpx(28);
}
.label {
width: toRpx(192);
color: #292d33;
justify-content: center;
.required {
color: #f24724;
font-size: toRpx(28);
}
}
.input,
.select {
width: toRpx(738);
height: toRpx(76);
background: #ffffff;
border-radius: toRpx(16);
border: toRpx(2) solid transparent !important;
outline: none;
color: #333333;
border-radius: toRpx(16);
box-sizing: border-box;
line-height: toRpx(76);
padding: 0 toRpx(32) !important;
box-sizing: border-box;
font-size: toRpx(28);
&::placeholder {
color: #33333333;
}
.value {
max-width: toRpx(598);
}
}
.placeholderStyle {
color: #33333333;
}
.arrow {
color: #999 !important;
margin-left: auto;
flex-shrink: 0;
}
.error {
border: toRpx(2) solid #f24724 !important;
}
}
.btns {
justify-content: center;
gap: 0 toRpx(34);
.btn {
width: toRpx(718);
height: toRpx(80);
background-image: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
border-radius: toRpx(48);
display: flex;
justify-content: center;
align-items: center;
font-weight: 500;
font-size: toRpx(32);
color: #ffffff;
}
.cancel {
background: #dae9ff;
color: #2c66f7;
}
.disabled {
background-image: linear-gradient(0deg, #2c66f799 0%, #48a6ff99 100%);
}
}
}
.backClass {
animation: left-out 0.25s forwards;
}
.popup {
pointer-events: auto;
}
}
.show-box {
display: block;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<MessageBox
ref="customerTagstVisible"
position="bottom"
:isFooter="false"
:title="title"
:maxHeight="1040"
@close="$emit('close')"
>
<view class="select-views">
<template v-for="(i,index) in list">
<view
class="select-group"
:key="index"
>
<view class="select-title">{{ i.labelName }}</view>
<view class="select-box">
<view
class="select-item flex"
:class="{ checked: checkedItem(item) }"
@click="handleSelect(item)"
v-for="(item, ind) in i.nextList"
:key="ind"
>
<view class="sprite-icon icon-tag-checked"></view>
{{ item.labelName }}
</view>
</view>
</view>
</template>
</view>
<view class="footer-btns">
<view
class="btn cancel"
@click="clearSwitch ? clear() : close()"
>{{cancelText}}</view>
<view
:class="['btn',{disabled: disabled}]"
@click="choose"
>确定</view>
</view>
</MessageBox>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'CustomerTags',
props: {
chooseList: Array,
title: {
type: String,
default: '请选择客户标签'
},
disabledSwitch: {
type: Boolean,
default: true
},
cancelText: {
type: String,
default: '取消'
},
clearSwitch: {
type: Boolean,
default: false
},
sceneNumber: {
type: [Number, String],
default: -1
}
},
data () {
return {
list: [],
component_chooseList: [],
}
},
watch: {
watchStatus: {
immediate: true,
handler (newval) {
this.close()
}
},
chooseList: {
immediate: true,
handler (newval) {
this.component_chooseList = JSON.parse(JSON.stringify(newval))
}
}
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
disabled () {
return this.disabledSwitch && this.component_chooseList.length == 0
}
},
mounted () {
},
methods: {
open () {
this.$refs.customerTagstVisible.open()
const userInfo = uni.$storage.get("userInfo"),
{ sceneType } = userInfo,
{ sceneNumber } = this
uni.$api.customerApi
.findCustomerTags({
scene: sceneNumber > -1 ? sceneNumber : sceneType,
})
.then((res) => {
this.list = res || []
})
},
handleSelect (item) {
let { component_chooseList } = this,
index = component_chooseList.findIndex(e => e.labelId == item.labelId)
if (index == -1) component_chooseList.push(item)
else component_chooseList.splice(index, 1)
this.component_chooseList = component_chooseList
this.$forceUpdate()
},
close () {
this.$refs?.customerTagstVisible?.close()
},
checkedItem (item) {
let { component_chooseList } = this
return component_chooseList.findIndex(e => e.labelId == item.labelId) != -1
},
choose () {
if (this.disabled) return
this.$emit('select', this.component_chooseList)
this.close();
},
clear () {
this.component_chooseList = []
this.$forceUpdate()
}
}
}
</script>
<style scoped lang='scss'>
.select-views {
overflow-y: scroll;
max-height: 60vh;
position: relative;
padding-bottom: toRpx(128);
.select-group {
margin: toRpx(32) 0;
.select-title {
font-size: toRpx(28);
color: #999999;
margin-bottom: toRpx(10);
}
.select-box {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: toRpx(32);
.select-item {
text-align: center;
justify-content: center;
opacity: 1;
border: toRpx(2) solid #dce0e6;
color: #333;
font-size: toRpx(32);
border-radius: toRpx(8);
position: relative;
box-sizing: border-box;
padding: toRpx(13) toRpx(40);
word-break: break-all;
line-height: toRpx(44);
.sprite-icon {
display: none;
position: absolute;
right: toMinusRpx(2);
top: toMinusRpx(2);
}
}
.checked {
border: toRpx(2) solid #2c66f7;
background: #ecf1ff;
color: #2c66f7;
.sprite-icon {
display: block;
}
}
}
}
}
.footer-btns {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: toRpx(176);
background: #ffffff;
box-sizing: border-box;
padding-top: toRpx(32);
display: flex;
justify-content: center;
gap: 0 toRpx(34);
.btn {
width: toRpx(718);
height: toRpx(80);
background-image: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
border-radius: toRpx(48);
display: flex;
justify-content: center;
align-items: center;
font-weight: 500;
font-size: toRpx(32);
color: #ffffff;
}
.cancel {
background: #dae9ff;
color: #2c66f7;
}
.disabled {
background-image: linear-gradient(0deg, #2c66f799 0%, #48a6ff99 100%);
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="line-bar-box">
<view class="tabs">
<page-tabs
:list="tabList"
@changeTab="changeTab"
size="small"
/>
</view>
<view class="canvas">
<qiun-data-charts
type="bar"
:opts="opts"
:chartData="chartData"
:tooltipShow="false"
/>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import PageTabs from '@/components/PageTabs.vue'
const rateList = {
excellentStoreAvgDealRate: '优秀门店均值',
thisStoreDealRate: '本门店',
personalDealRate: '个人'
},
priceList = {
excellentStoreAvgDeal: '优秀门店均值',
thisStoreKdj: '本门店',
personalKdj: '个人'
}
export default {
components: {
PageTabs
},
props: {
pageData: {
type: Object,
default: () => { }
},
dataShow: {
type: Boolean,
default: true
},
sceneType: Number,
isHarmony: Boolean, // 是否为鸿蒙
bussinessType: Number
},
watch: {
dataShow: {
immediate: true,
handler (newval) {
this.getServerData()
}
}
},
name: '',
data () {
return {
tabIndex: 0,
tabList: ['本月交付成交率', '本月交付客单价'],
chartData: {},
//您可以通过修改 config-ucharts.js 文件中下标为 ['bar'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
opts: Object.freeze({
fontColor: '#333',
fontSize: 12,
color: ["#2C66F7"],
padding: [20, 80, 0, 0],
enableScroll: false,
legend: {
show: false
},
xAxis: {
disabled: true,
gridColor: '#fff',
},
yAxis: {
axisLineColor: '#cfd4e3'
},
extra: {
bar: {
type: "group",
width: 6,
barColorList: [
['#389FFF', '#2C66F7'],
['#708DFF', '#6858F5'],
['#94CBFF', '#3283FB']
],
linearType: 'custom',
barBorderCircle: true,
}
}
})
}
},
mounted () {
},
methods: {
getServerData () {
let { dataShow, tabIndex, pageData, sceneType, isHarmony, bussinessType } = this
/**
* (sceneType 0: 2.1场景, 1:1.1场景) (bussinessType 1:延保, 3:权益)
* 2.1场景 鸿蒙---问界/鸿蒙 [本月交付客单价] 改成 [整车延保成交数]
* 2.1场景 非鸿蒙---选延保 [本月交付客单价] 改成 [整车延保成交数]
* 2.1场景 非鸿蒙---权益 [本月交付成交率] 改为 [广联权益渗透率]; [本月交付客单价] 改成 [广联权益成交数]
*/
if (sceneType == 0) {
if (isHarmony) {
this.tabList[1] = '整车延保成交数'
} else {
if (bussinessType == 1) this.tabList[1] = '整车延保成交数'
else this.tabList = ['广联权益渗透率', '广联权益成交数']
}
}
let list = [],
categories = [],
data = [],
defaultList = []
if (tabIndex == 0) Object.keys(rateList).map(key => {
list.push({
text: rateList[key],
value: pageData[key]
})
})
else Object.keys(priceList).map(key => {
list.push({
text: priceList[key],
value: pageData[key]
})
})
list.sort((a, b) => b.value - a.value)
list.map(e => {
categories.push(e.text)
data.push(e.value || 0)
defaultList.push(e.value == null)
})
let series = [{
defaultList,
hideData: !dataShow,
textSize: 14,
textColor: '#333',
data
}]
if (tabIndex == 0) series[0].afterUnit = '%'
if (sceneType == 1 && tabIndex == 1) series[0].beforeUnit = '¥' //轻改
this.chartData = {
categories,
series,
}
},
changeTab (index) {
this.tabIndex = index
this.getServerData()
}
}
}
</script>
<style scoped lang="scss">
.line-bar-box {
height: toRpx(388);
box-sizing: border-box;
padding: toRpx(24);
.tabs {
width: toRpx(544);
height: toRpx(64);
}
.canvas {
height: toRpx(260);
}
}
</style>
<template>
<view class="output-value-box">
<view class="output-value-title">本月产值</view>
<view class="output-value">
<view class="value">
{{formattedNumber('actualProduction')}}<view class="unit">万</view>
</view>
<view class="sub-value flex">
个人产值<view class="num">{{formattedNumber('personalProduction')}}万</view>
</view>
</view>
<view class="output-canvas">
<qiun-data-charts
type="arcbar"
:opts="opts"
:chartData="chartData"
:tooltipShow="false"
/>
</view>
<view class="output-view flex">
<view class="item flex">目标<view class="num">{{formattedNumber('targetProduction')}}万</view>
</view>
<view class="item flex">达成比例<view class="num">{{formattedNumber('achievementRatio','%')}}</view>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import NP from 'number-precision'
export default {
name: '',
props: {
pageData: {
type: Object,
default: () => { }
},
dataShow: {
type: Boolean,
default: true
}
},
watch: {
dataShow: {
immediate: true,
handler (newval) {
if (Object.keys(this.chartData).length) this.getServerData()
}
},
pageData: {
immediate: true,
handler (newval) {
this.getServerData()
}
}
},
data () {
return {
chartData: {},
opts: {
padding: undefined,
title: {
name: "产值贡献",
fontSize: 12,
color: "#333"
},
subtitle: {
fontSize: 14,
color: "#4673FF"
},
extra: {
arcbar: {
type: "circle",
width: 11,
backgroundColor: "#4673ff1a",
startAngle: 1.5,
endAngle: 0.25,
gap: 2,
linearType: 'custom',
customColor: ['#2C66F7', '#389FFF']
}
}
}
}
},
mounted () {
},
methods: {
getServerData () {
let { dataShow } = this,
data = this.pageData.productionContribution
this.opts.subtitle.name = data == null ? '--' : `${this.pageData.productionContribution}%`
this.chartData = {
series: [
{
hideData: !dataShow,
data: NP.divide(data || 0, 100)
}
]
}
},
formattedNumber (key, unit) {
let { dataShow, pageData } = this,
num = pageData[key]
if (unit && num) num += unit
if (!dataShow || num == null) num = '--'
return num
}
}
}
</script>
<style scoped lang='scss'>
.output-value-box {
height: toRpx(366);
position: relative;
.output-value-title {
font-size: toRpx(28);
font-weight: 500;
padding: toRpx(24) toRpx(32) 0;
}
.output-value {
padding: toRpx(54) 0 0 toRpx(52);
.value {
display: flex;
align-items: baseline;
color: #4673ff;
font-size: toRpx(40);
line-height: toRpx(48);
font-weight: 700;
margin-bottom: toRpx(14);
.unit {
color: #333333;
font-size: toRpx(26);
font-weight: 400;
margin-left: toRpx(4);
line-height: toRpx(36);
}
}
.sub-value {
color: #333333;
font-size: toRpx(24);
.num {
color: #4673ff;
font-size: toRpx(28);
font-weight: 700;
margin-left: toRpx(8);
}
}
}
.output-canvas {
position: absolute;
right: toRpx(40);
top: toRpx(60);
width: toRpx(200);
height: toRpx(200);
}
.output-view {
position: absolute;
left: 50%;
bottom: toRpx(32);
transform: translateX(-50%);
width: toRpx(528);
height: toRpx(58);
border-radius: toRpx(450);
background: #4673ff0d;
color: #333333;
font-size: toRpx(24);
&::after {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
content: '';
width: toRpx(2);
height: toRpx(28);
background: #cfd4e3;
}
.item {
justify-content: center;
width: 50%;
flex-shrink: 0;
.num {
margin-left: toRpx(8);
color: #4673ff;
font-size: toRpx(28);
font-weight: 700;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<MessageBox
ref="receptionSceneVisible"
position="bottom"
:isFooter="false"
title="请选择接待场景"
:maxHeight="1000"
@close="$emit('close')"
>
<view class="select-box">
<view
class="select-item"
:class="{ checked: id == item.id }"
@click="handleSelect(item)"
v-for="(item, index) in list"
:key="index"
>
{{ item.receptionSceneName }}
</view>
</view>
</MessageBox>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'ReceptionSence',
props: {
customerInfo: Object
},
data () {
return {
list: [],
id: ''
}
},
watch: {
watchStatus: {
immediate: true,
handler (newval) {
this.close()
}
},
watchCustomerInfo: {
immediate: true,
handler (newval) {
this.id = newval.receptionScene
}
},
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
watchCustomerInfo () {
return this.customerInfo
},
},
mounted () {
},
methods: {
open () {
this.$refs.receptionSceneVisible.open()
const userInfo = uni.$storage.get("userInfo"),
{ sceneType } = userInfo;
/**获取接待场景 */
uni.$api.customerApi
.findAllSence({
scene: sceneType,
})
.then((res) => {
this.list = res || []
}).catch(err => {
this.list = []
})
},
handleSelect (item) {
this.close();
this.id = item.id
this.$emit('select', item)
},
close () {
this.$refs?.receptionSceneVisible?.close()
}
}
}
</script>
<style scoped lang='scss'>
.select-box {
margin: toRpx(40) 0;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: toRpx(32);
overflow-y: scroll;
max-height: 50vh;
padding-bottom: toRpx(60);
.select-item {
text-align: center;
height: toRpx(68);
line-height: toRpx(44);
opacity: 1;
border: toRpx(2) solid #dce0e6;
color: #292d33;
font-size: toRpx(28);
border-radius: toRpx(8);
&.checked {
border: toRpx(2) solid #292d33;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="record-box">
<view class="data-container">
<view class="control-box flex">
<view class="tabs">
<page-tabs
:list="tabList"
@changeTab="changeTab"
/>
</view>
<view class="select-box-list select-component flex">
<template v-if="tabIndex == 0">
<select-component
:selectList="orderTypeList"
@chooseType="searchReceptionList($event,'orderFinishFlag')"
/>
<select-component
:selectList="receptionTypeList"
@chooseType="searchReceptionList($event,'reviewFlag')"
/>
</template>
</view>
<template v-if="tabIndex == 1">
<select-component
class="select-component"
:selectList="uploadTypeList"
@chooseType="changeUploadType"
/>
</template>
</view>
<scroll-view
class="record-list"
scroll-y
@scrolltolower="pageonReachBottom"
>
<view
class="record-tips flex"
v-if="tabIndex == 1 && isPrePage && list.length && list[0] && list[0].length"
>
<uni-icons
type="info"
:size="16"
color="#FF9D0A"
class="icon"
></uni-icons>
以下非正常结束的接待记录,需要进行信息确认后才能提交到系统。
</view>
<view class="list">
<template v-if="flag">
<template v-if="list.length && list[0] && list[0].length">
<template v-for="i in list">
<template>
<view
v-for="item in i"
class="item"
:key="item.id"
@click="jumpDetail(item)"
>
<view class="top-right-box flex">
<template v-if="tabIndex == 0">
<view :class="['status flex',`${item.reviewFlag == 0?'deal':'disabled'}`]">
{{item.reviewFlag == 0 ?'已复盘':'未复盘'}}
</view>
<view :class="['status flex', { 'deal': item.orderFinishFlag }]">
{{item.orderFinishFlag? '成交': '战败'}}
</view>
</template>
<!-- <template v-else>
<view :class="[
'status flex',
{'disabled':item.receptionStatus !== 1 && item.receptionStatus !== 0 },
{ 'deal': item.receptionStatus == 1 }
]">
<template v-if="item.receptionStatus === 1 || item.receptionStatus === 0">
{{ {
1: '成交',
0: '战败'
}[item.receptionStatus]}}
</template>
<template v-else>
未知
</template>
</view>
</template> -->
</view>
<view class="name">
{{ item.customerName ? item.customerName : '未填写姓名' }}
</view>
<view class="goods-name">{{ item.carModel ? item.carModel : '未选择车型' }}</view>
<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>
</template>
</view>
</template>
</template>
</template>
<template v-else>
<view class="nothing flex">
<image
class="icon"
src="../../../../assets/images/home/nothing.webp"
/>
暂无接待记录
</view>
</template>
</template>
</view>
<template v-if="nothing">
<view class="end-text">-已经到底了-</view>
</template>
</scroll-view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
import SelectComponent from '@/components/SelectComponent.vue'
import PageTabs from '@/components/PageTabs.vue'
export default {
inject: ['getRecorder'],
name: '',
components: { SelectComponent, PageTabs },
inject: ['getRecorder'],
props: {
show: Boolean
},
data () {
return {
tabList: Object.freeze([
{ text: '已提交' },
{ text: '未提交', dot: () => this.preRecordFailList.length },
]),
orderTypeList: Object.freeze([
{ label: '战败', value: 0 },
{ label: '成交', value: 1 },
]),
receptionTypeList: Object.freeze([
{ label: '未复盘', value: 0 },
{ label: '已复盘', value: 1 },
]),
uploadTypeList: Object.freeze([
{ label: '待上传' },
{ label: '待提交' },
]),
itemObject: Object.freeze([
{ label: '客户电话', key: 'phoneNumber' },
{ label: '销售姓名', key: 'salesName' },
{ label: '接待时长', key: 'duration' },
{ label: '开始接待', key: 'startTime' },
{ label: '结束接待', key: 'endTime' },
]),
recordFailList: [],
preRecordFailList: [],
tabIndex: 0,
pageNum: 1,
total: 0,
list: [],
flag: false,
nothing: false,
pageSize: 10,
isPrePage: false,
reviewFlag: 0,
orderFinishFlag: 0,
loaded: false
}
},
watch: {
show: {
immediate: true,
handler (newval) {
if (newval && !this.loaded) {
this.init();
this.getRecordNum()
this.getPreRecordNum()
this.loaded = true
}
}
}
},
mounted () {
uni.$on('refreshRecord', () => {
this.changeTab(0)
})
},
methods: {
resetData () {
this.flag = false
this.nothing = false
this.total = 0
this.list = []
this.pageNum = 1
},
changeTab (index) {
if (this.tabIndex == index) return
this.resetData()
this.tabIndex = index
this.reviewFlag = 0
this.orderFinishFlag = 0
if (index == 0) this.getReceptionList()
else this.getRecordFail()
},
formatValue (val, k) {
if (!val) return
if (k == 'phoneNumber') {
val = val.toString()
return val.slice(0, 3) + " " + val.slice(3, 7) + " " + val.slice(7)
}
return val
},
jumpDetail (item) {
if (this.tabIndex == 0) { // 已上传 && 新质检
const { sceneType } = uni.$storage.get("userInfo");
if (sceneType == 1 || item.checkHistoryFlag != 0 || item.score == null) return uni.showToast({
title: '该接待尚不支持复盘',
icon: "none"
})
uni.$track.add({ eventCode: item.orderFinishFlag ? 'app_reception_deal' : 'app_reception_defeat' })
this.tabIndex = -1
uni.navigateTo({
url: `/pages/common/receptionDetail/index`,
success (res) {
res.eventChannel.emit('getData', item)
}
})
return
}
if (this.isPrePage) {
this.$emit('openRecordPage', item)
}
},
async getRecordNum () {
let recordFailListAll = await uni.$dbManager.getRecords();
if (typeof recordFailListAll == 'string') {
recordFailListAll = JSON.parse(recordFailListAll || '[]')
}
const { shopMerchantId, sceneType, phone } = uni.$storage.get("userInfo");
let recordFailList = recordFailListAll.filter(i => {
return i.merchantId == shopMerchantId && i.bussinessType == (sceneType == 0 ? 1 : 2) && i.loginPhone == phone
})
this.recordFailList = recordFailList.reverse();
},
async getPreRecordFail () {
await this.getPreRecordNum()
this.list[0] = this.preRecordFailList.map(i => {
return Object.assign(i, {
duration: 0,
startTime: i.receptionStartTime && i.receptionStartTime.replace(/\//g, '.')
})
})
this.isPrePage = true
this.flag = true
this.nothing = this.preRecordFailList.length ? true : false
},
async getPreRecordNum () {
const preRecordList = await this.recorder.getRecords()
this.preRecordFailList = preRecordList.reverse()
},
getRecordFail () {
this.getRecordNum()
this.list[0] = this.recordFailList.map(i => {
return {
receptionStatus: i.receptionStatus,
phoneNumber: i.phoneNumber,
salesName: i.salesName,
customerName: i.customerName,
carModel: i.carModel,
duration: this.formatSeconds(new Date(i.receptionEndTime).getTime() - new Date(i.receptionStartTime).getTime()),
startTime: i.receptionStartTime.replace(/\//g, '.'),
endTime: i.receptionEndTime.replace(/\//g, '.')
}
})
this.flag = true
this.isPrePage = false
this.nothing = this.recordFailList.length ? true : false
},
init () {
this.getReceptionList()
this.recorder = this.getRecorder()
},
async getReceptionList () {
try {
await uni.$isNetWork()
} catch (error) {
const recordSuccessList = JSON.parse(uni.$storage.get("recordSuccessList") || "{}")
this.list[0] = recordSuccessList[this.tabIndex] || []
this.flag = true
return
}
try {
uni.showLoading({
mask: true
})
const { tabIndex, pageNum, pageSize, reviewFlag, orderFinishFlag } = this,
userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId, sceneType } = userInfo,
{ list, total } = await uni.$api.commonApi.getReceptionList({
merchantId: shopMerchantId,
pageNum,
pageSize,
reviewFlag,
orderFinishFlag,
bussinessType: sceneType == 0 ? 1 : 2, // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
})
uni.hideLoading()
list?.length && list.map(e => {
e.duration = this.formatSeconds(e.receptionEndTime - e.receptionStartTime)
e.startTime = dayjs(e.receptionStartTime).format("YYYY.MM.DD HH:mm:ss")
e.endTime = dayjs(e.receptionEndTime).format("YYYY.MM.DD HH:mm:ss")
})
if (pageNum == 1) {
const record = {
[tabIndex]: list
}
const recordSuccessList = JSON.parse(uni.$storage.get("recordSuccessList") || "{}")
const mergeRecord = Object.assign(recordSuccessList, record)
uni.$storage.set("recordSuccessList", JSON.stringify(mergeRecord))
}
this.$set(this.list, pageNum - 1, list)
// this.list[pageNum - 1] = list
this.flag = true
this.total = total
} catch (error) {
this.flag = true
}
},
formatTime (num) {
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return {
minutes,
seconds
}
},
formatSeconds (seconds) {
seconds = Math.floor(seconds / 1000)
let formattedTime = ''
if (seconds < 60) return seconds + '秒'
else {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
if (remainingSeconds > 0) formattedTime += remainingSeconds + '秒'
return formattedTime
}
},
pageonReachBottom () {
let { pageNum, total, nothing, pageSize } = this
if (this.tabIndex == 1) return
if (!nothing) nothing = 'nothing'
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1
this.getReceptionList()
} else this.nothing = true
},
changeUploadType ({ index }) {
this.resetData()
if (index == 0) this.getRecordFail()
else this.getPreRecordFail()
},
async submitRecord (val) {
this.flag = false
delete val.duration
delete val.startTime
const { maxUploadNum = 10 } = uni.$storage.get('mock_data')
if (val.recordUrlList.length > maxUploadNum) {
const userInfo = uni.$storage.get('userInfo')
const { customerName, phoneNumber, carModel, salesName } = val || {}
const { name } = userInfo || {}
uni.$logger.error({
msg: `员工: ${name}, 客户: ${customerName}`,
extra: {
'手机号: ': phoneNumber,
'姓名: ': customerName,
'销售: ': salesName,
'车型: ': carModel,
'原因: ': '录音文件过长,数量' + val.recordUrlList.length
}
})
}
val.recordUrlList = val.recordUrlList.slice(0, maxUploadNum)
await this.recorder.save(val)
this.getRecordNum()
await this.getPreRecordFail()
},
searchReceptionList ({ item }, name) {
if (this[name] == item.value) return
this[name] = item.value
this.resetData()
this.getReceptionList()
}
}
}
</script>
<style scoped lang="scss">
.record-box {
box-sizing: border-box;
height: 100%;
overflow: hidden;
.data-container {
background: #ffffff;
border-radius: toRpx(48);
height: 100%;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
box-sizing: border-box;
position: relative;
.control-box {
height: toRpx(164);
.tabs {
width: toRpx(336);
height: toRpx(84);
margin-left: toRpx(44);
}
.select-box-list {
margin-left: auto;
gap: 0 toRpx(40);
}
.select-component {
margin-right: toRpx(44);
}
}
}
.record-list {
box-sizing: border-box;
height: calc(100% - #{toRpx(164)});
position: relative;
z-index: 4;
.record-tips {
height: toRpx(76);
background: #f58e341a;
border-radius: toRpx(16);
font-size: toRpx(28);
color: #f58e34;
width: calc(100% - #{toRpx(88)});
margin: 0 auto toRpx(40);
justify-content: center;
.icon {
margin-right: toRpx(8);
}
}
}
.list {
display: flex;
flex-wrap: wrap;
gap: toRpx(40) toRpx(46);
padding: toRpx(2) toRpx(44) 0;
.item {
// width: toRpx(610);
width: calc(50% - #{toRpx(23)});
background: #ffffff;
box-sizing: border-box;
padding: toRpx(24) toRpx(32);
position: relative;
box-shadow: 0 toRpx(8) toRpx(24) 0 #2c66f71a;
border-radius: toRpx(16);
.top-right-box {
position: absolute;
top: toRpx(24);
right: toRpx(32);
gap: 0 toRpx(16);
.status {
width: toRpx(88);
height: toRpx(44);
background: #fdece9;
color: #f24724;
border-radius: toRpx(4);
font-weight: 500;
font-size: toRpx(24);
justify-content: center;
}
.disabled {
background: #f2f2f2;
color: #999999;
}
.deal {
background: #eaf9f1;
color: #35c376;
}
}
.name {
font-weight: 500;
font-size: toRpx(32);
color: #292d33;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 62%;
}
.goods-name {
font-weight: 500;
font-size: toRpx(32);
color: #2c66f7;
margin-top: toRpx(16);
}
.info {
margin-top: toRpx(16);
font-size: toRpx(24);
color: #999ea8;
.value {
margin-left: auto;
color: #666666;
}
}
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(260);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(50) 0;
font-size: toRpx(24);
}
</style>
<template>
<view class="reception-box">
<view :class="['record-box-content',`${showInfo || !showRecord?'hide-record':'show-record'}`]">
<view class="left box-class" v-if="!onlyRight">
<view class="common-title">
业绩看板
<view
:class="['sprite-icon',`icon-eyes-${dataShow?'on':'off'}`]"
@click="dataShow = !dataShow"
></view>
<view class="time-box flex">
时间进度
<view class="time-bar">
<view
class="time-line"
:style="{ width: timeProgress + '%' }"
></view>
</view>
<view class="progress">
{{timeProgress }}%
</view>
</view>
<template v-if="sceneType == 0">
<view class="reception-select">
<select-component
:selectList="performanceTypeList"
@chooseType="changePerformance"
/>
</view>
</template>
</view>
<template v-if="showPageFlag">
<view class="customer-box box">
<customer-flow
:pageData="pageData"
:dataShow="dataShow"
/>
</view>
<view class="linebar-box box">
<line-bar
:dataShow="dataShow"
:pageData="pageData"
:sceneType="sceneType"
:isHarmony="isHarmony"
:bussinessType="bussinessType"
/>
</view>
<view class="box">
<output-value
:dataShow="dataShow"
:pageData="pageData"
/>
</view>
</template>
<template v-else>
<view class="loading flex">
<image
class="gif"
src="../../../../assets/images/common/loadding.gif"
/>
<!-- <uni-icons
class="icon"
type="refreshempty"
:size="120"
color="#3773f8"
></uni-icons> -->
</view>
</template>
</view>
<view class="right box-class" :class="{'only-right':onlyRight}">
<type-tab-component
:typeList="typeList"
:tabIndex.sync="tabIndex"
></type-tab-component>
<view :class="['right-content',`${tabIndex != 0?'hide-record':'show-record'}`]">
<record-list
@openRecordPage="openRecordPage"
ref="recordListRef"
:show="tabIndex == 0"
/>
</view>
<view :class="['right-content',`${tabIndex != 1?'hide-record':'show-record'}`]">
<customer-file
@showSuccess="$refs.successRef.open()"
ref="customerFile"
@editCustomer="editCustomer"
:show="tabIndex == 1"
/>
</view>
</view>
</view>
<template v-if="!showRecord">
<view :class="['save-record-box',backClass]">
<save-record
@cancel="handleCancel"
@submit="handleSubmit"
:customerInfoVal="customerInfo"
></save-record>
</view>
</template>
<uni-popup
ref="successRef"
type="message"
>
<uni-popup-message
type="success"
message="删除成功"
:duration="1500"
></uni-popup-message>
</uni-popup>
<customer-info
:customerId="customerId"
:show.sync="showInfo"
@refresh="$refs.customerFile.refresh()"
/>
</view>
</template>
<script type='text/ecmascript-6'>
import dayjs from 'dayjs'
import CustomerFlow from './CustomerFlow.vue'
import LineBar from './LineBar.vue'
import OutputValue from './OutputValue.vue'
import RecordList from './RecordList.vue'
import saveRecord from './saveRecord.vue'
import CustomerFile from './CustomerFile.vue'
import CustomerInfo from './CustomerInfo.vue'
import TypeTabComponent from '@/components/TypeTabComponent.vue'
import SelectComponent from '@/components/SelectComponent.vue'
export default {
components: {
CustomerFlow,
LineBar,
OutputValue,
RecordList,
saveRecord,
CustomerFile,
CustomerInfo,
TypeTabComponent,
SelectComponent
},
name: '',
data () {
return {
backClass: '',
showRecord: true,
customerInfo: {},
dataShow: true,
timeProgress: '',
tabIndex: 0,
typeList: Object.freeze([
{ tabName: '接待复盘' },
{ tabName: '客户预录' },
]),
showInfo: false,
customerId: '',
bussinessType: 1,
pageData: {
//门店客流
// cumulativeDeliveryCount: 0, //累计交付数
// actualContactCount: 0, // 实际触客数
// contactRate: 0, // 触客率(实际触客数 / 累计交付数)
// excellentStoreAvgDealRate: 0, // 优秀门店均值成交率
// thisStoreDealRate: 0, // 本门店成交率
// personalDealRate: 0, // 个人成交率
// excellentStoreAvgDeal: 0, // 优秀门店均值客单价
// thisStoreKdj: 0, // 本门店客单价
// personalKdj: 0, // 个人客单价
// //本月产值
// actualProduction: 0, // 实际完成产值(万元)
// personalProduction: 0, // 个人产值(累计成交金额)
// targetProduction: 0, // 目标产值(万元)
// achievementRatio: 0, // 达成比例 = 实际产值 ÷ 目标产值
// productionContribution: 0 // 产值贡献 = 个人产值 ÷ 实际完成产值
}
}
},
computed: {
onlyRight() {
const userInfo = uni.$storage.get('userInfo')
return userInfo.subLoginUser.channelType == 9
},
showPageFlag () {
return Object.keys(this.pageData).length
},
isHarmony () {
const { channelType } = uni.$storage.get('userInfo')
return channelType == 1
},
performanceTypeList () {
let list = []
if (this.isHarmony) list = [
{ label: '问界', value: 1 },
{ label: '鸿蒙', value: 2 },
]
else list = [
{ label: '延保', value: 1 },
{ label: '权益', value: 3 },
]
return list
},
sceneType () {
return uni.$storage.get('userInfo').sceneType
}
},
mounted () {
this.setTimeProgress()
this.getMerchantPerformance()
},
methods: {
setTimeProgress () {
let nowNum = dayjs().date(),
monthDayNum = dayjs().daysInMonth()
this.timeProgress = Math.round(nowNum / monthDayNum * 100)
},
changeType (index, name) {
if (this[name] == index) return // 点击同一个
},
openRecordPage (item) {
this.showRecord = false
this.customerInfo = item
},
handleCancel () {
this.backClass = 'backClass'
setTimeout(() => {
this.showRecord = true;
this.backClass = ''
}, 300)
},
handleSubmit (val) {
this.handleCancel()
this.$refs.recordListRef.submitRecord(val)
},
editCustomer (id) {
this.customerId = id
this.showInfo = true
},
async getMerchantPerformance (bussinessType = 1, hmzxFlag) {
this.bussinessType = bussinessType
const { shopMerchantId, sceneType } = uni.$storage.get("userInfo")
let params = {
merchantIdList: shopMerchantId,
sceneType,
startDate: dayjs().startOf('month').format('YYYY-MM-DD'),
endDate: dayjs().endOf('month').format('YYYY-MM-DD')
}
if (sceneType == 0) {
params.bussinessType = bussinessType
if (hmzxFlag) params.hmzxFlag = hmzxFlag
if (this.isHarmony && !params.hmzxFlag) params.hmzxFlag = 1
} else params.hmzxFlag = this.isHarmony ? 3 : 4
this.pageData = await uni.$api.receptionApi.getMerchantPerformance(params) || {}
},
changePerformance ({ item }) {
this.pageData = {}
if (this.isHarmony) this.getMerchantPerformance(1, item.value)
else this.getMerchantPerformance(item.value)
}
}
}
</script>
<style scoped lang='scss'>
.reception-box {
.record-box-content {
position: relative;
height: 100vh;
box-sizing: border-box;
padding: toRpx(64) 0 toRpx(80);
display: flex;
gap: 0 toRpx(48);
visibility: visible;
transition: all 0.15s;
opacity: 1;
}
.hide-record {
opacity: 0;
z-index: -1;
visibility: hidden;
}
.show-record {
opacity: 1;
position: relative;
animation: show-box 0.15s forwards;
}
@keyframes show-box {
0% {
left: 100%;
}
100% {
left: 0;
}
}
.box-class {
height: 100%;
background: #ffffff59;
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border-radius: toRpx(48);
overflow: hidden;
}
.left {
width: toRpx(656);
.common-title {
position: relative;
.sprite-icon {
margin-left: toRpx(16);
zoom: 1.5;
}
.time-box {
position: absolute;
left: toRpx(48);
bottom: toRpx(8);
color: #999999;
font-size: toRpx(20);
.time-bar {
width: toRpx(200);
height: toRpx(16);
border-radius: toRpx(8);
background: #ffffff;
overflow: hidden;
margin: 0 toRpx(12);
.time-line {
height: 100%;
border-radius: toRpx(8);
background: linear-gradient(90deg, #75bcff 0%, #2c66f7 100%);
}
}
.progress {
color: #4673ff;
font-weight: 500;
}
}
.reception-select {
position: absolute;
top: toRpx(36);
right: toRpx(32);
/deep/.select {
width: toRpx(148);
height: toRpx(48);
border-radius: toRpx(12);
background: #ffffff59;
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
color: #333333;
font-size: toRpx(26);
padding-left: toRpx(32);
.icon-arrow-bottom {
zoom: 0.75;
}
}
/deep/.pop-box {
top: toRpx(64);
color: #292d33;
font-size: toRpx(28);
.type-item {
height: toRpx(56);
}
}
}
}
.box {
border-radius: toRpx(32);
background: #ffffff;
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
margin: toRpx(20) toRpx(32) 0;
}
.customer-box {
margin: toRpx(24) toRpx(32) toRpx(20);
}
.loading {
width: 100%;
height: 100%;
justify-content: center;
.gif {
width: toRpx(64);
height: toRpx(64);
}
.icon {
animation: rotate 1s infinite;
}
@keyframes rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
}
}
.right {
width: calc(100% - #{toRpx(752)});
border: toRpx(2) solid #fff;
box-sizing: border-box;
&.only-right {
width: calc(100% - #{toRpx(64)});
}
&-content {
width: 100%;
position: absolute;
border-radius: toRpx(48);
background: #ffffff;
height: calc(100% - #{toRpx(128)});
transform: translateY(toMinusRpx(32));
}
}
.save-record-box {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
animation: left-in 0.25s forwards;
}
.backClass {
animation: left-out 0.25s forwards;
}
@keyframes left-in {
0% {
left: 100%;
}
100% {
left: 0;
}
}
@keyframes left-out {
0% {
left: 0;
}
100% {
left: 100%;
}
}
}
</style>
<template>
<view class="data-container">
<view class="nav-bar" @click="$emit('cancel')">
<view class="back" @click="$emit('update:showPayPage', false)">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">接待记录</view>
</view>
<view class="error-tip" v-if="errorTip">以下信息不能为空,请完善信息后保存</view>
<view class="form">
<template v-for="(i, index) in formObject">
<view :class="['form-item', { active: focusIndex == index }]" :key="index">
<view class="label required">{{ i.label }}</view>
<view :class="['value', { error: showError(i.key) }]">
<template v-if="i.type == 'input'">
<input :type="i.inputType" :maxlength="i.maxlength" v-model="customerInfo[i.key]" class="input" :placeholder="i.placeholder" @focus="focusIndex = index" @blur="resetFocusIndex" />
</template>
<template v-else>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.key] }]" @click="showPopup(i.popKey, index)">
<view class="text-hide">{{ customerInfo[i.key] || i.placeholder }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</template>
</view>
</view>
</template>
</view>
<view class="footer-box">
<view class="cancel-btn" @click="$emit('cancel')">取消</view>
<view class="submit-btn" @click="handleSave">提交</view>
</view>
<car-brands ref="carBrandListVisible" @select="handleSelect($event, 'carBrandListVisible')" />
<employee ref="employeeBoxVisible" :salesPropsUuid="customerInfo.salesUuid" @select="handleSelect($event, 'employeeBoxVisible')" />
<MessageBox ref="receptionStatusVisible" position="bottom" :isFooter="false" title="请选择接待结果" :maxHeight="1000">
<view class="select-box">
<view class="select-item" :class="{ checked: customerInfo.receptionStatus == item.label }" @click="selectReception(item.label)" v-for="(item, index) in receptionList" :key="index">
{{ item.label }}
</view>
</view>
</MessageBox>
</view>
</template>
<script type="text/ecmascript-6">
import CarBrands from '@/components/CarBrands.vue'
import Employee from '@/components/Employee.vue'
import CustomerAutocomplete from '@/components/CustomerAutocomplete.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/;
import utils from "@/utils/utils";
export default {
components: {
CarBrands,
Employee,
CustomerAutocomplete
},
props: {
customerInfoVal: {
type: Object,
default: () => ({})
}
},
data() {
return {
errorTip:false,
receptionList: Object.freeze([{
label: '成交',
value: 1
},
{
label: '战败',
value: 0
}
]),
formObject: Object.freeze([{
label: "车主姓名",
placeholder: '车主姓名',
key: 'customerName',
type: 'input',
inputType: 'text',
maxlength: 50
},
{
label: "车主电话",
placeholder: '车主电话',
key: 'phoneNumber',
type: 'input',
inputType: 'tel',
maxlength: 11
},
{
label: "品牌车型",
placeholder: '品牌车型',
key: 'carModel',
type: 'select',
popKey: 'carBrandListVisible'
},
{
label: "接待结果",
key: "receptionStatus",
type: "select",
popKey: "receptionStatusVisible",
placeholder: '请选择',
},
{
label: "销售姓名",
key: "salesName",
type: "select",
popKey: "employeeBoxVisible",
placeholder: '请选择',
},
]),
focusIndex: -1,
customerInfo:{}
}
},
mounted() {
this.customerInfo = utils.deepClone(this.customerInfoVal)
const i = this.receptionList.findIndex(e => e.value === this.customerInfo.receptionStatus)
this.$set(this.customerInfo, 'receptionStatus', i == -1?'':this.receptionList[i].label)
},
methods: {
selectReception(value) {
this.customerInfo.receptionStatus = value
this.$refs.receptionStatusVisible.close()
},
showError(key) {
let flag = !this.customerInfo[key]
if (key == 'phoneNumber' && this.customerInfo[key]) flag = !phoneRex.test(this.customerInfo[key])
return flag
},
handleSave() {
const result = this.check(true)
if (!result) return this.errorTip = true
const i = this.receptionList.findIndex(e => e.label == this.customerInfo.receptionStatus)
this.customerInfo.receptionStatus = this.receptionList[i].value
this.$emit('submit',this.customerInfo)
},
check(all = false) {
let flag = true
try {
this.formObject.map(e => {
if (!this.customerInfo[e.key]) throw false
if (!all && e.key == 'phoneNumber' && !phoneRex.test(this.customerInfo[e.key])) {
uni.showToast({
title: "请输入正确的车主电话",
icon: "none",
});
throw false
}
})
} catch (error) {
flag = error
}
return flag
},
handleSelect(item, popkey) {
this.$refs[popkey].close()
if (popkey == 'employeeBoxVisible') {
this.customerInfo.salesUuid = item.uuid
this.customerInfo.salesName = item.staffName
} else {
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
this.customerInfo.carBrand = item.carChildsBrandName
this.customerInfo.carBrandId = item.carChildsBrandId
this.customerInfo.oneCarBrand = item.carBrand
this.customerInfo.oneCarBrandId = item.carBrandId
}
this.resetFocusIndex()
this.errorTip = false
},
showPopup(e, index) {
this.focusIndex = index
this.$refs[e].open()
},
resetFocusIndex() {
this.focusIndex = -1
this.errorTip = false
}
}
}
</script>
<style scoped lang="scss">
.error-tip {
font-size: toRpx(28);
padding: toRpx(32) toRpx(60) toRpx(24);
margin-top: toRpx(100);
margin-bottom: toMinusRpx(80);
text-align: center;
background-color: rgb(254, 237, 234);
color: #f45c3d;
}
.data-container {
background: #ffffff59;
border-radius: toRpx(48);
margin: toRpx(80) toRpx(66) toRpx(80) 0;
height: calc(100% - #{toRpx(160)});
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border: toRpx(2) solid #fff;
box-sizing: border-box;
position: relative;
.nav-bar {
position: absolute;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(28);
z-index: 9;
text-align: center;
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
line-height: toRpx(96);
.back {
position: absolute;
left: 0;
top: 0;
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
}
.form {
display: flex;
flex-wrap: wrap;
gap: toRpx(80) toRpx(160);
padding: toRpx(80);
margin-top: toRpx(60);
&-item {
width: calc(50% - #{toRpx(80)});
display: flex;
align-items: center;
color: #6c6c70;
font-size: toRpx(30);
height: toRpx(80);
box-sizing: border-box;
.label {
position: relative;
margin-left: auto;
flex-shrink: 0;
width: toRpx(124);
margin-right: toRpx(30);
}
.required {
&::before {
content: '*';
color: #ff0000;
position: absolute;
left: toMinusRpx(20);
top: 50%;
transform: translate(0, -50%);
}
}
.value {
height: toRpx(80);
flex: 1;
border: toRpx(2) solid #e8e8ea;
background: #ffffff;
margin-left: toRpx(32);
box-sizing: border-box;
padding: 0 toRpx(40);
border-radius: toRpx(8);
&.error {
border: toRpx(2) solid #f24724;
border-radius: toRpx(8);
}
.input,
.select {
width: 100%;
height: 100%;
border: none !important;
outline: none;
padding: 0 !important;
font-size: toRpx(30);
color: #333;
&::placeholder {
color: #c9c9c9;
}
}
.placeholderStyle {
color: #999999;
}
.arrow {
color: #999 !important;
margin-left: auto;
flex-shrink: 0;
}
}
}
}
.footer-box {
display: flex;
align-items: center;
justify-content: center;
gap: toRpx(34);
padding: 0 toRpx(280);
.cancel-btn {
height: toRpx(80);
background: #dae9ff;
border-radius: toRpx(48);
line-height: toRpx(80);
text-align: center;
color: #2c66f7;
flex: 1;
}
.submit-btn {
height: toRpx(80);
background-image: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
border-radius: toRpx(48);
line-height: toRpx(80);
text-align: center;
flex: 1;
color: #ffffff;
}
}
}
.select-box {
margin: toRpx(40) 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: toRpx(20);
overflow-y: scroll;
max-height: 50vh;
padding-bottom: toRpx(60);
.select-item {
text-align: center;
height: toRpx(68);
line-height: toRpx(68);
opacity: 1;
border: toRpx(2) solid #dce0e6;
color: #292d33;
font-size: toRpx(28);
border-radius: toRpx(8);
&.checked {
border: toRpx(2) solid #292d33;
}
}
}
</style>
<template>
<view
class="material-item flex"
@click="jump"
>
<!-- <view :class="['status', {'status-green':item.readStatus == 0}]">{{readStatusEnum[item.readStatus]}}</view> -->
<view class="icon">
<template v-if="item.cover">
<image
class="image"
:src="item.cover"
/>
</template>
<template v-else>
<image
class="image"
:src="imgUrl(item)"
/>
</template>
<view class="label">{{materialTypeEnum[item.type]}}</view>
</view>
<view class="text">
<view class="title">{{item.title}}</view>
<view class="tags">
<template v-for="i in item.sceneMarketTagsList">
<view
class="tag"
:key="i.id"
>{{i.tagName}}</view>
</template>
</view>
<view class="date">{{item.date||''}}</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
item: Object,
sceneMarketLevelTwoItem: Object
},
name: '',
data () {
return {
materialTypeEnum: Object.freeze({
0: '图片',
1: '视频',
2: 'PDF',
3: '富文本',
4: 'Excel',
5: 'Word'
}),
// readStatusEnum: Object.freeze({
// 0: '已查看',
// 1: '未查看'
// })
}
},
mounted () {
},
methods: {
imgUrl (item) {
return `https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/material/material-${item.type}.png`
},
async jump () {
let { item, sceneMarketLevelTwoItem } = this,
params = `id=${item.id}&specialFlag=${sceneMarketLevelTwoItem.specialFlag}&directoryName=${sceneMarketLevelTwoItem.directoryName}`
// 类型:0-图片;1-视频;2-pdf;3-富文本; 4-Excel; 5-Word
let url = `/pages/common/caseDetail?${params}`
uni.$track.add({ eventCode: 'scene_market', businessId: item.id })
if (item.type != 3) {
uni.showLoading({
mask: true
})
const data = await uni.$api.customerApi.getMaterialDetail({
id: item.id
})
uni.hideLoading()
let fileUrl = data?.detailInfos[0]?.image
if (item.type == 1 || item.type == 0) url = `/pages/boutique/preview?tabName=${item.title}&sourceType=${item.type == 1 ? 2 : 1}&detailUrl=${fileUrl}&${params}`
else url = `/pages/common/materialDetail/index?fileUrl=${fileUrl}&title=${item.title}&${params}`
}
uni.navigateTo({
url: `${url}`
})
}
}
}
</script>
<style scoped lang='scss'>
.material-item {
display: flex;
position: relative;
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0 toRpx(16);
.status {
position: absolute;
right: 0;
top: 0;
height: toRpx(40);
line-height: toRpx(40);
width: fit-content;
padding: 0 toRpx(12);
font-size: toRpx(22);
color: #999999;
background: #9999991a;
border-radius: toRpx(4);
}
.status-green {
color: #35c376;
background: #35c3761a;
}
.icon {
width: toRpx(128);
height: toRpx(128);
margin-right: toRpx(16);
flex-shrink: 0;
position: relative;
.image {
width: 100%;
height: 100%;
border-radius: toRpx(8);
overflow: hidden;
}
.label {
display: flex;
align-items: center;
padding: 0 toRpx(6);
position: absolute;
width: fit-content;
color: #ffffff;
left: toRpx(8);
top: toRpx(8);
height: toRpx(28);
background: #00000066;
border-radius: toRpx(4);
font-size: toRpx(20);
}
}
.text {
width: calc(100% - #{toRpx(144)});
.title {
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #333333;
font-size: toRpx(30);
font-weight: 700;
}
.tags {
display: flex;
align-items: center;
gap: 0 toRpx(8);
margin: toRpx(8) 0;
.tag {
display: flex;
align-items: center;
height: toRpx(40);
background: #75bcff1a;
padding: 0 toRpx(12);
width: fit-content;
color: #2d66f7;
font-size: toRpx(22);
border-radius: toRpx(4);
}
}
.date {
color: #999999;
font-size: toRpx(24);
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<scroll-view
class="scene-list-box"
scroll-y
>
<template v-if="requestComplete">
<view class="material-box">
<template v-if="materialList.length">
<template v-for="(item,index) in materialList">
<view
class="item"
:key="index"
>
<material
:item="item"
:sceneMarketLevelTwoItem="sceneMarketLevelTwoItem"
></material>
</view>
</template>
<view class="bottom flex">-已经到底了-</view>
</template>
<template v-else>
<view class="list-nothing flex">
<image
class="icon"
src="../../../../../assets/images/home/nothing.webp"
/>
暂无内容
</view>
</template>
</view>
</template>
</scroll-view>
</template>
<script type='text/ecmascript-6'>
import dayjs from 'dayjs'
import Material from './Material.vue'
export default {
props: {
requestParams: Object,
sceneMarketLevelTwoItem:Object
},
components: {
Material
},
name: '',
data () {
return {
requestComplete: false,
materialList: []
}
},
mounted () {
},
methods: {
async getSceneMarketMaterialList () {
try {
uni.showLoading({
title: '加载中',
mask: true
})
const {
requestParams
} = this,
data = await uni.$api.sceneMarketApi.getSceneMarketMaterialList(requestParams)
uni.hideLoading()
data?.map(e => {
e.date = dayjs(e.createdDate).format('YYYY-MM-DD')
})
this.materialList = data
this.requestComplete = true
} catch (error) {
uni.hideLoading()
uni.showToast({
title: error,
icon: "error",
})
}
},
}
}
</script>
<style scoped lang='scss'>
.scene-list-box {
width: 100%;
height: 100%;
.material-box {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
gap: toRpx(28) toRpx(48);
padding: 0 toRpx(44);
align-content: flex-start;
.item {
width: calc((100% - #{toRpx(96)}) / 3);
height: toRpx(164);
border-radius: toRpx(16);
background: #ffffff;
box-shadow: 0 toRpx(8) toRpx(24) 0 #2c66f71a;
}
.bottom {
margin-top: auto;
width: 100%;
justify-content: center;
color: #999;
text-align: center;
padding: toRpx(50) 0;
font-size: toRpx(24);
}
}
.list-nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(260);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="scene-market-box">
<type-tab-component
:typeList="typeList"
:tabIndex="tabIndex"
@tabClick="tabBarClick"
nameKey="directoryName"
></type-tab-component>
<view class="scene-market-content">
<view class="tabs flex">
<template v-for="i in sceneMarketLevelTwoList">
<view
:class="['tab flex',{active: tagId == i.id}]"
:key="i.id"
@click="tabClick(i)"
>{{i.directoryName}}</view>
</template>
</view>
<scene-list
class="scene-list"
ref="sceneListRef"
:requestParams="requestParams"
:sceneMarketLevelTwoItem="sceneMarketLevelTwoItem"
/>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import TypeTabComponent from '../../../TypeTabComponent.vue'
import SceneList from './compontens/SceneList.vue'
export default {
components: {
TypeTabComponent,
SceneList
},
name: '',
data () {
return {
typeList: [],
tabIndex: -1,
tagId: '',
requestParams: {}
}
},
computed: {
sceneListRef () {
return this.$refs.sceneListRef
},
sceneMarketLevelTwoList () {
return this.typeList[this.tabIndex]?.sceneMarketLevelTwoList || []
},
sceneMarketLevelTwoItem () {
return this.sceneMarketLevelTwoList.find(e => e.id == this.tagId)
}
},
mounted () {
this.getSceneMarketMaterialMenu()
},
methods: {
async getSceneMarketMaterialMenu () {
const typeList = await uni.$api.sceneMarketApi.getSceneMarketMaterialMenu()
this.typeList = typeList
this.tabBarClick(0)
},
tabBarClick (index) {
if (this.tabIndex == index) return
const tabIndex = index,
{
typeList
} = this
this.tabIndex = tabIndex
let detail = typeList[tabIndex].code
if (typeList[tabIndex]?.sceneMarketLevelTwoList.length) detail = typeList[tabIndex].sceneMarketLevelTwoList[0]
this.tabClick(detail)
},
tabClick ({ code: businessCode, id }) {
this.tagId = id
if (this.requestParams.businessCode == businessCode) return
this.requestParams.businessCode = businessCode
this.sceneListRef.requestComplete = false
this.sceneListRef.getSceneMarketMaterialList()
},
}
}
</script>
<style scoped lang='scss'>
.scene-market-box {
height: calc(100vh - #{toRpx(144)});
margin: toRpx(64) toRpx(48) 0 0 ;
border-radius: toRpx(48);
background: #ffffff59;
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
box-sizing: border-box;
overflow: hidden;
border: toRpx(2) solid #ffffff;
.scene-market-content {
width: 100%;
height: calc(100% - #{toRpx(128)});
background: #ffffff;
transform: translateY(toMinusRpx(32));
box-sizing: border-box;
border-radius: toRpx(48);
.tabs {
gap: toRpx(24);
padding: toRpx(40) toRpx(44);
.tab {
height: toRpx(80);
background: #f2f2f2;
padding: 0 toRpx(32);
color: #666666;
font-size: toRpx(28);
border-radius: toRpx(16);
}
.active {
background: #2d66f71a;
color: #2d66f7;
font-weight: 500;
}
}
.scene-list {
height: calc(100% - #{toRpx(160)});
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -82,7 +82,6 @@ ...@@ -82,7 +82,6 @@
</view> </view>
</template> </template>
<script> <script>
import SceneMarket from './components/SceneMarket/index.vue'
// import myClick from '@/mixin/click' // import myClick from '@/mixin/click'
import timeout from '@/mixin/timeout' import timeout from '@/mixin/timeout'
import recorder from '@/mixin/record/recorder' import recorder from '@/mixin/record/recorder'
...@@ -91,10 +90,9 @@ import versionCheck from '@/mixin/versionCheck.js' ...@@ -91,10 +90,9 @@ import versionCheck from '@/mixin/versionCheck.js'
import LeftSide from './components/LeftSide.vue' import LeftSide from './components/LeftSide.vue'
// import merge from '@/mixin/record/merge.js' // import merge from '@/mixin/record/merge.js'
import Material from '@/components/MaterialIndex.vue' import Material from '@/components/MaterialIndex.vue'
import { interceptionMixin } from '@/mixin/index'
export default { export default {
mixins: [recorder, uploader, timeout, versionCheck, interceptionMixin], mixins: [recorder, uploader, timeout, versionCheck],
components: { SceneMarket, LeftSide, Material }, components: { LeftSide, Material },
props: { props: {
id: [String, Number], id: [String, Number],
finishDoneText: String, finishDoneText: String,
......
<template>
<view :class="['layout',{'byd-layout':isByd}]">
<wnCanvas
:canvasId="`c-${madiaId}`"
:drawStatus="penSwitch"
custom
@scale="$emit('scale',$event)"
:scaleSwitch="false"
>
<template slot="customContent">
<view class="layout-content">
<view class="title">
<view class="text">{{title}}</view>
</view>
<view class="content">
<view
class="form-box"
:key="watchStatus"
>
<view class="form">
<template v-for="(i, index) in formObject">
<view
:class="['form-item' ,{active:focusIndex == index}]"
:key="index"
>
<view class="form-item-box">
<template v-if="i.type == 'input'">
<input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="customerInfo[i.key]"
class="input"
@input="inputCustomer"
:placeholder="i.placeholder"
@focus="focusIndex = index"
@blur="resetFocusIndex"
:data-key="i.key"
/>
<customer-autocomplete
:showType="i.inputType"
:searchValue="customerInfo[i.key]"
:show="focusIndex == index"
@choose="chooseCustomer"
v-if="i.hasCustomerAutocomplete"
/>
<template v-if="i.unit">
<view class="unit">{{i.unit}}</view>
</template>
</template>
<template v-else>
<view
:class="['select flex',{placeholderStyle:!customerInfo[i.key]}]"
@click="showPopup(i.popKey,index)"
>
<view class="value text-hide">{{customerInfo[i.key] ||i.placeholder}}</view>
<uni-icons
class="arrow"
type="right"
:size="16"
></uni-icons>
</view>
</template>
</view>
</view>
</template>
</view>
</view>
</view>
<insurance-table
:isPreview="isPreview"
:show="show"
/>
</view>
</template>
</wnCanvas>
<car-brands
ref="carBrandListVisible"
@select="handleSelect($event,'carBrandListVisible')"
@close="resetFocusIndex"
/>
<carBuyers
ref="carBuyersVisible"
@select="handleSelect($event,'carBuyersVisible')"
@close="resetFocusIndex"
/>
</view>
</template>
<script type="text/ecmascript-6">
import CarBrands from '@/components/CarBrands.vue'
import InsuranceTable from './components/InsuranceTable.vue'
import carBuyers from './components/carBuyers.vue'
import CustomerAutocomplete from '@/components/CustomerAutocomplete.vue'
export default {
components: { CarBrands, InsuranceTable, CustomerAutocomplete, carBuyers },
props: {
penSwitch: Boolean,
show: Boolean,
title: String,
isPreview: Boolean,
isByd: Boolean,
madiaId: Number
},
name: 'Reception',
data () {
return {
formObject: [
{
placeholder: '车主姓名',
key: 'customerName',
type: 'input',
inputType: 'text',
maxlength: 50,
hasCustomerAutocomplete: true
},
{
placeholder: '车主电话',
key: 'phoneNumber',
type: 'input',
inputType: 'tel',
maxlength: 11,
hasCustomerAutocomplete: true
},
{
placeholder: '品牌车型',
key: 'carModel',
type: 'select',
popKey: 'carBrandListVisible',
},
{
placeholder: '新车开票价',
key: 'newCarFare',
type: 'input',
inputType: 'digit',
maxlength: 10,
unit: '元',
},
{
placeholder: '购车方式',
key: 'carBuyers',
type: 'select',
popKey: 'carBuyersVisible',
}
],
customerInfo: {},
focusIndex: -1,
insuranceList: []
}
},
watch: {
watchCustomerInfo: {
immediate: true,
handler (newval) {
if (newval) this.customerInfo = newval
}
},
},
computed: {
watchCustomerInfo () {
return this.$store.state.user.customerInfo
},
watchStatus () {
return this.$store.state.user.historyStatus
},
},
methods: {
inputCustomer () {
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
handleSelect (item, popkey) {
this.$refs[popkey].close()
if (popkey == 'employeeBoxVisible') {
this.customerInfo.salesUuid = item.uuid
this.customerInfo.staffName = item.staffName
} else if (popkey == 'carBuyersVisible') {
this.customerInfo.carBuyers = item.name
this.customerInfo.carPurchaseMethod = item.id
} else {
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
this.customerInfo.carModelId = item.id
}
this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo)
},
showPopup (e, index) {
this.focusIndex = index
this.$refs[e].open()
},
closeAllPopup () {
this.$refs.carBrandListVisible.close()
this.resetFocusIndex()
},
resetFocusIndex (e) {
this.focusIndex = -1
if (e?.currentTarget && e?.target) {
const { key } = e.currentTarget.dataset
if (e.target.value.length == 0) return
if (key == 'newCarFare') {
let value = Number(e.target.value) >= 9999999 ? 9999999 : e.target.value
// 判断是否为整数
if (!Number.isInteger(value)) value = String(value).replace(/(\d*\.?\d{0,2})\d*/, '$1')
value = Number(String(value).replace(/^0+/, ''))
this.customerInfo[key] = Number(value).toFixed(2) ? Number(value).toFixed(2) >= 0 ? value : '' : ''
this.inputCustomer()
}
}
},
chooseCustomer (e) {
this.customerInfo = {
...this.customerInfo,
phoneNumber: e.ownerPhone,
customerName: e.ownerName,
carModel: e.brandModel
}
this.inputCustomer()
}
}
}
</script>
<style scoped lang="scss">
.layout {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/media/insurance-bg.webp');
background-size: 100%;
&-content {
height: 100%;
margin: $margin;
position: relative;
}
.title {
padding: toRpx(120) 0 toRpx(48) toRpx(128);
.text {
line-height: toRpx(80);
font-weight: 500;
font-size: toRpx(56);
color: #333333;
}
}
.content {
.form-box {
height: toRpx(80);
padding: 0 toRpx(128);
.form {
display: flex;
gap: 0 toRpx(28);
height: 100%;
&-item {
width: toRpx(368);
height: 100%;
position: relative;
&-box {
position: relative;
width: 100%;
height: 100%;
background: #ffffff;
border: toRpx(3) solid #a8c1ff;
border-radius: toRpx(16);
box-sizing: border-box;
padding: 0 toRpx(24);
z-index: 2;
display: flex;
align-items: center;
.unit {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: toRpx(24);
font-weight: 300;
font-size: toRpx(28);
color: #292d33;
line-height: toRpx(36);
}
}
.input,
.select {
width: 100%;
height: toRpx(60);
border: none !important;
outline: none;
font-size: toRpx(28);
color: #333333;
border-radius: toRpx(16);
box-sizing: border-box;
padding: 0 !important;
display: flex;
align-items: center;
&::placeholder {
color: #999999;
}
}
.placeholderStyle {
color: #999999;
line-height: toRpx(80);
}
.arrow {
color: #999 !important;
margin-left: auto;
flex-shrink: 0;
}
}
.active {
&::after {
position: absolute;
left: toMinusRpx(2);
top: toMinusRpx(2);
width: calc(100% + #{toRpx(4)});
height: calc(100% + #{toRpx(4)});
content: '';
background-image: linear-gradient(#2f6af7, #75bcff);
box-shadow: 0 0 0 toRpx(8) #2c66f71a;
border-radius: toRpx(16);
}
}
}
}
}
}
.byd-layout {
background-image: url('@/assets/images/media/byd-insurance-bg.webp') !important;
.title {
padding: toRpx(120) toRpx(128) toRpx(48);
.text {
text-align: center;
}
}
}
</style>
<template>
<uni-popup
ref="popup"
type="bottom"
>
<!-- :mask-click="false" -->
<view class="detail-box">
<view
class="close-box flex"
@click="close"
>
<uni-icons
type="clear"
:size="28"
color="#76787f"
></uni-icons>
</view>
<view class="sprite-icon icon-bao"></view>
<view class="title text-hide">
{{item.itemName}}
</view>
<view class="type">{{item.main}}</view>
<view class="content">
<rich-text :nodes="item.itemDesc"></rich-text>
</view>
</view>
</uni-popup>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
item: Object
},
data () {
return {
}
},
mounted () {
},
methods: {
open () {
this.$refs.popup.open("center");
},
close () {
this.$refs.popup.close()
}
}
}
</script>
<style scoped lang='scss'>
.detail-box {
position: relative;
width: toRpx(720);
max-height: toRpx(640);
border-radius: toRpx(40);
padding: toRpx(48) toRpx(64) toRpx(88);
box-sizing: border-box;
overflow: hidden;
&::before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: toRpx(240);
background-image: linear-gradient(180deg, #e5edfe 0%, #ffffff 100%);
content: '';
z-index: -1;
}
&::after {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
content: '';
background-color: #fff;
z-index: -2;
}
.icon-bao {
position: absolute;
top: toRpx(48);
right: toRpx(68);
}
.close-box {
position: absolute;
width: toRpx(136);
height: toRpx(136);
top: 0;
right: 0;
justify-content: center;
z-index: 2;
}
.title {
font-weight: 500;
font-size: toRpx(40);
color: #292d33;
line-height: toRpx(64);
padding: toRpx(48) 0 toRpx(24);
}
.type {
background: #f2f2f2;
border-radius: toRpx(6);
padding: toRpx(2) toRpx(16);
font-size: toRpx(26);
color: #666666;
line-height: toRpx(40);
width: fit-content;
}
.content {
margin-top: toRpx(48);
max-height: toRpx(276);
font-size: toRpx(30);
color: #292d33;
line-height: toRpx(48);
overflow-y: auto;
word-break: break-all;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view :class="['views-box', {'preview':isPreview}]">
<view class="views-title-box flex">
<template v-for="(i,index) in viewsTitle">
<view
v-if="showRow(index)"
:class="['title-item flex',`row-${index + 1}`]"
:key="index"
>{{i}}</view>
</template>
</view>
<view class="views-content">
<view
class="main"
v-if="flag && check"
>商业险</view>
<scroll-view
class="table"
scroll-y
:scroll-top="scrollTop"
>
<template v-if="flag">
<template v-if="check">
<template v-for="(i,index) in insuranceList">
<view
:class="['insurance-item flex',{'disabled':!i.show},{'disabled-input':!i.checked}]"
:key="index"
v-if="showInsurance(i)"
>
<view class="row-1 flex">
<view :class="['block',defaultBlock(i)]"></view>
<view
class="name flex"
@click="choose(i,index)"
>
<template v-if="!isPreview">
<view :class="['check-box flex',{'checked':i.checked}]">
<uni-icons
type="checkmarkempty"
:size="14"
color="#fff"
></uni-icons>
</view>
</template>
<view class="text-two-line">{{i.itemName}}</view>
</view>
</view>
<view
class="range row-2"
@click="showDetail(i)"
>
<view class="text-two-line">
<rich-text :nodes="i.itemDesc"></rich-text>
</view>
</view>
<view class="cost row-3">
<view class="cost-input">
<input
type="digit"
maxlength="9"
v-model="i.cost"
class="input"
placeholder="输入金额"
:disabled="!i.show || !i.checked"
:placeholder-style="`color:${i.show && i.checked?'#999':'#ccc'}`"
@blur="handleInput"
:data-index="index"
/>
<view class="unit">元</view>
</view>
</view>
<view
class="show row-4"
@click="setItemDisabled(i,index)"
>
<view :class="['sprite-icon',`${i.show ? 'icon-visible' : 'icon-invisible'}`]"></view>
</view>
</view>
</template>
</template>
<template v-else>
<view class="nothing flex">
<view class="sprite-icon icon-no-insurance-data"></view>
暂无数据{{!isPreview?',请进入预览模式,开启相关车险及权益内容':''}}
</view>
</template>
</template>
</scroll-view>
</view>
<view class="views-footer flex">
<view class="sprite-icon icon-total"></view>
合计
<view class="total">{{total}}</view>
<view class="util">元</view>
</view>
<insurance-popup
ref="popupRef"
:item="currentItem"
></insurance-popup>
</view>
</template>
<script type='text/ecmascript-6'>
import NP from 'number-precision'
import InsurancePopup from './InsurancePopup'
export default {
props: {
isPreview: Boolean,
show: Boolean,
},
components: { InsurancePopup },
data () {
return {
viewsTitle: ['险种及权益', '主要保障范围', '费用', '是否显示'],
currentItem: {},
insuranceList: [],
scrollTop: 0,
storageKey: '',
flag: false
}
},
watch: {
watchStatus: {
immediate: true,
handler (newval) {
this.$refs.popupRef?.close()
this.flag = false
this.scrollTop = -1
setTimeout(() => {
this.scrollTop = 0
}, 100);
const storageKey = this.getStorageKey(),
insuranceList = uni.getStorageSync(storageKey)
if (insuranceList) {
insuranceList.map(e => e.cost = '')
this.insuranceList = JSON.parse(JSON.stringify(insuranceList))
this.flag = true
}
}
},
show (n) {
if (n) {
this.getMerchantInsuranceList()
}
},
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
total () {
return this.insuranceList.reduce((pre, cur) => {
return NP.plus(pre, NP.times(cur.cost, (this.isPreview ? cur.show : cur.checked) ? 1 : 0))
}, 0)
},
check () {
return this.isPreview ? this.insuranceList.length : this.insuranceList.filter(item => item.show).length
}
},
mounted () {
this.getStorageKey()
},
methods: {
getStorageKey () {
const { phone, shopMerchantId } = uni.$storage.get("userInfo"),
storageKey = `${shopMerchantId}_${phone}_insurance_list`
this.storageKey = storageKey
return storageKey
},
showRow (index) {
let flag = true
if (index == this.viewsTitle.length - 1 && !this.isPreview) flag = false
return flag
},
showDetail (e) {
this.currentItem = e
this.$refs.popupRef.open()
},
handleInput (event) {
let value = event.target.value,
{ index } = event.currentTarget.dataset
if (value.length == 0) return
value = Number(value) > 999999 ? 999999 : value
if (!Number.isInteger(value)) value = String(value).replace(/(\d*\.?\d{0,2})\d*/, '$1')
value = Number(String(value).replace(/^0+/, ''))
this.insuranceList[index].cost = Number(value).toFixed(2) ? Number(value).toFixed(2) >= 0 ? value : '' : ''
},
defaultBlock (item) {
return item.main == '交强险' ? (this.isPreview ? 'has-default' : item.show ? 'has-default' : '') : ''
},
showInsurance (item) {
return this.isPreview ? true : item.show ? true : false
},
setItemDisabled (item, index) {
const { storageKey } = this
this.insuranceList[index].show = !item.show
uni.setStorageSync(storageKey, this.insuranceList);
},
/**
* 查询门店保险权益
*/
async getMerchantInsuranceList () {
try {
const { storageKey } = this,
{ shopMerchantId } = uni.$storage.get("userInfo"),
storageInsuranceList = uni.getStorageSync(storageKey),
list = await uni.$api.userApi.getMerchantInsuranceList({
merchantId: shopMerchantId,
})
list?.map(e => {
e.cost = ''
e.checked = true
e.main = e.itemName == '交强险' ? '交强险' : '商业险'
e.show = false
e.itemDesc = e.itemDesc ? this.processHtmlString(e.itemDesc) : ''
})
if (!storageInsuranceList) {
uni.showLoading({
mask: true
})
this.setInsuranceList(storageKey, list || [])
}
else {
let { insuranceList } = this,
combinedList = [...insuranceList, ...list]
const deduplicatedList = combinedList.reduce((acc, item) => {
const existingItem = acc.find(existing => String(existing.id) === String(item.id));
if (existingItem) {
existingItem.itemName = item.itemName || ''
existingItem.itemDesc = item.itemDesc || ''
if (this.currentItem.id == existingItem.id) this.currentItem = existingItem
} else acc.push(item)
return acc;
}, [])
let arr = []
deduplicatedList.map(e => {
let index = list.findIndex(item => String(item.id) === String(e.id))
if (index != -1) arr.push(e)
})
this.setInsuranceList(storageKey, arr)
}
} catch (error) {
this.flag = true
}
},
setInsuranceList (storageKey, value) {
uni.hideLoading()
this.insuranceList = JSON.parse(JSON.stringify(value))
value.map(e => e.checked = true)
uni.setStorageSync(storageKey, value);
this.flag = true
},
processHtmlString (htmlString) {
// 移除 `<br>` 及其变体,并用 `<div></div>` 替换
let processedString = htmlString.replace(/<\/?br\s*\/?>|\n/g, '<div></div>')
// 移除 `style` 属性
processedString = processedString.replace(/style="[^"]*"/g, '');
// 移除 `<strong>`, `</strong>`, `<em>`, `</em>` 和孤立的 `<` 标签
processedString = processedString.replace(/<strong>|<\/strong>|<em>|<\/em>|<>/g, '');
// 替换非 `div` 和非 `span` 的 HTML 标签
processedString = processedString.replace(/<(?!div|span|p)[^>]*>/g, '</div>');
return processedString
},
choose (item, index) {
if (this.isPreview) return
this.insuranceList[index].checked = !item.checked
},
}
}
</script>
<style scoped lang='scss'>
.views-box {
width: toRpx(2090);
height: toRpx(1080);
box-sizing: border-box;
border: toRpx(4) solid #ffffff;
border-radius: toRpx(40);
margin: toRpx(56) auto 0;
.views-title-box {
height: toRpx(96);
background-image: linear-gradient(92deg, #d0e6fecc 0%, #c2dbffcc 33%, #d1e4ffcc 77%, #bdd6ffcc 100%);
backdrop-filter: blur(toRpx(6));
border-radius: toRpx(40) toRpx(40) 0 0;
font-weight: 500;
font-size: toRpx(26);
color: #292d33;
line-height: toRpx(40);
.title-item {
height: toRpx(96);
justify-content: center;
box-sizing: border-box;
flex-shrink: 0;
}
}
.row-1 {
width: toRpx(470);
}
.row-2 {
width: toRpx(1092);
border-right: toRpx(4) solid #fff;
border-left: toRpx(4) solid #fff;
}
.row-3 {
width: toRpx(528);
}
.views-content {
height: calc(100% - #{toRpx(192)});
display: flex;
box-sizing: border-box;
border-top: toRpx(4) solid #ffffff;
border-bottom: toRpx(4) solid #ffffff;
position: relative;
.main {
position: absolute;
top: toRpx(120);
left: 0;
width: toRpx(108);
height: toRpx(748);
font-weight: 500;
font-size: toRpx(26);
color: #292d33;
display: flex;
align-items: center;
justify-content: center;
writing-mode: vertical-lr;
text-orientation: upright;
letter-spacing: toRpx(32);
z-index: 2;
}
.table {
height: 100%;
.insurance-item {
background-color: #f7f9ff;
border-bottom: toRpx(4) solid #ffffff;
position: relative;
.name,
.range,
.cost,
.show {
min-height: toRpx(120);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: all 0.25s;
}
.name,
.range {
font-size: toRpx(26);
color: #292d33;
padding: toRpx(40) 0;
}
.block {
position: absolute;
width: toRpx(104);
height: calc(100% + #{toRpx(4)});
background: #cfe3fe;
top: 0;
left: 0;
}
.name {
width: toRpx(366);
margin-left: toRpx(108);
justify-content: flex-start;
padding: 0 toRpx(40);
.check-box {
width: toRpx(32);
height: toRpx(32);
background: #ffffff;
border: toRpx(3) solid #a8c1ff;
border-radius: toRpx(4);
box-sizing: border-box;
margin-right: toRpx(32);
justify-content: center;
overflow: hidden;
font-weight: 700;
transition: all 0.25s;
flex-shrink: 0;
}
.checked {
background: #2c66f7;
border-color: #2c66f7;
}
}
.range {
padding: toRpx(40) toRpx(64);
box-sizing: border-box;
text-align: center;
}
.cost {
&-input {
position: relative;
width: toRpx(368);
height: toRpx(72);
background: #ffffff;
border: toRpx(3) solid #a8c1ff;
border-radius: toRpx(12);
box-sizing: border-box;
padding: 0 toRpx(24);
.input {
width: 100%;
height: 100%;
font-size: toRpx(28);
border: none !important;
outline: none;
color: #292d33;
line-height: toRpx(72);
&::placeholder {
padding: 0 !important;
}
}
.unit {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: toRpx(24);
font-weight: 300;
font-size: toRpx(28);
color: #292d33;
line-height: toRpx(36);
}
}
}
&:nth-child(even) {
background: #ebf1ff;
}
&:last-child {
border: none;
.block {
height: 100%;
}
}
.has-default {
box-sizing: border-box;
border-bottom: toRpx(4) solid #ffffff;
}
}
.disabled {
.name,
.range {
color: #999999;
}
.cost {
&-input {
border-color: #d8dce6;
.input,
.unit {
color: #cccccc;
}
}
}
}
.disabled-input {
.cost {
&-input {
border-color: #d8dce6;
.input,
.unit {
color: #cccccc;
}
}
}
}
}
&::before {
position: absolute;
left: toRpx(100);
top: 0;
width: toRpx(4);
height: 100%;
background: #fff;
content: '';
z-index: 2;
}
&::after {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: toRpx(104);
background: #cfe3fe;
content: '';
z-index: -1;
}
.nothing {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
justify-content: center;
flex-direction: column;
font-size: toRpx(26);
color: #808291;
.sprite-icon {
margin-bottom: toRpx(24);
}
}
}
.views-footer {
height: toRpx(96);
background-image: linear-gradient(92deg, #d1e7ffcc 0%, #c2dbffcc 33%, #d1e4ffcc 77%, #bdd6ffcc 100%);
backdrop-filter: blur(toRpx(6));
border-radius: 0 0 toRpx(40) toRpx(40);
justify-content: flex-end;
box-sizing: border-box;
padding-right: toRpx(104);
font-weight: 500;
font-size: toRpx(28);
color: #292d33;
line-height: toRpx(40);
.sprite-icon {
margin-right: toRpx(14);
}
.total {
color: #2c66f7;
font-size: toRpx(48);
margin: 0 toRpx(16) 0 toRpx(32);
line-height: toRpx(64);
}
.util {
color: #2c66f7;
}
}
}
//预览模式样式
.preview {
.row-1,
.row-2,
.row-3,
.row-4 {
flex-shrink: 0;
}
.row-1 {
width: toRpx(404);
}
.row-2 {
width: toRpx(1052);
}
.row-3 {
width: toRpx(465);
}
.row-4 {
border-left: toRpx(4) solid #fff;
width: toRpx(158);
}
.insurance-item {
position: relative;
.name {
width: toRpx(296) !important;
padding: 0 toRpx(24) !important;
}
.show {
border-left: none;
}
&::after {
position: absolute;
top: 0;
right: toRpx(158);
width: toRpx(4);
height: 100%;
background: #fff;
content: '';
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<MessageBox
ref="carBuyersVisible"
position="bottom"
:isFooter="false"
:title="`请选择${title}`"
:maxHeight="1000"
@close="$emit('close')"
>
<view class="select-box">
<view
class="select-item"
:class="{ checked: carBuyers == item.name }"
@click="handleSelect(item)"
v-for="(item, index) in carBuyersList"
:key="index"
>
{{ item.name }}
</view>
</view>
</MessageBox>
</template>
<script type="text/ecmascript-6">
export default {
name: 'carBuyers',
props: {
title: {
type: String,
default: '购车方式'
},
salesPropsUuid: {
type: String,
default: ''
}
},
data () {
return {
carBuyersList: [
{
name: '全款',
id: 1
},
{
name: '按揭',
id: 2
}
]
}
},
watch: {
watchStatus: {
immediate: true,
handler (newval) {
this.close()
}
},
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
carBuyers () {
return this.$store.state.user.customerInfo.carBuyers
},
},
mounted () {
},
methods: {
open () {
this.$refs.carBuyersVisible.open()
},
handleSelect (item) {
this.close();
this.$emit('select', item)
},
close () {
this.$refs?.carBuyersVisible?.close()
}
}
}
</script>
<style scoped lang="scss">
.select-box {
margin: toRpx(40) 0;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: toRpx(32);
overflow-y: scroll;
max-height: 50vh;
padding-bottom: toRpx(60);
.select-item {
text-align: center;
height: toRpx(68);
line-height: toRpx(44);
opacity: 1;
border: toRpx(2) solid #dce0e6;
color: #333;
font-size: toRpx(32);
border-radius: toRpx(8);
&.checked {
border: toRpx(2) solid #292d33;
}
}
}
</style>
<template>
<uni-popup
ref="learnPopup"
type="center"
:is-mask-click="false"
>
<view class="learn-box">
<view class="sprite-icon icon-learn-bg"></view>
<view class="learn-content">
<view class="learn-title">退出提醒</view>
<text class="learn-text">{{content}}</text>
</view>
<view class="learn-footer flex">
<view
class="learn-btn learn-confirm"
@click="confirm"
>确认退出</view>
<view
class="learn-btn learn-cancel"
@click="cancel"
>继续学习</view>
</view>
</view>
</uni-popup>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
content: {
type: String,
default: ''
}
},
name: '',
data () {
return {
}
},
computed: {
learnRef () {
return this.$refs.learnPopup
}
},
mounted () {
},
methods: {
open () {
this.learnRef.open()
},
cancel () {
this.close()
this.$emit('cancel')
},
close () {
this.learnRef.close()
},
confirm () {
this.close()
this.$emit('confirm')
}
}
}
</script>
<style scoped lang='scss'>
.learn-box {
width: toRpx(848);
height: toRpx(648);
border-radius: toRpx(48);
background: #ffffff;
position: relative;
overflow: hidden;
.sprite-icon{
position: absolute;
top: 0;
left: 0;
zoom: 2;
}
.learn-content {
padding: toRpx(296) toRpx(64) toRpx(32);
text-align: center;
.learn-title {
color: #333333;
font-size: toRpx(40);
font-weight: 500;
margin-bottom: toRpx(16);
}
.learn-text {
color: #666666;
font-size: toRpx(32);
}
}
.learn-footer {
height: toRpx(160);
padding: 0 toRpx(64);
justify-content: space-between;
.learn-btn {
width: toRpx(344);
height: toRpx(80);
border-radius: toRpx(64);
background: #f0f1f5;
display: flex;
align-items: center;
justify-content: center;
color: #1a1a1a;
font-size: toRpx(28);
}
.learn-cancel {
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #fff;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -94,6 +94,17 @@ export default { ...@@ -94,6 +94,17 @@ export default {
console.log(this.datalist, '===') console.log(this.datalist, '===')
const list = JSON.parse(JSON.stringify(this.style_object)) const list = JSON.parse(JSON.stringify(this.style_object))
const len = this.datalist.length const len = this.datalist.length
// 自动播放控制:仅当素材数量大于1时才开启
if (len > 1 && this.autoplay) {
this.autoPlayFunction()
} else {
if (this.autoPlayTimer) {
clearTimeout(this.autoPlayTimer)
this.autoPlayTimer = null
}
}
if (!len) { if (!len) {
this.imagelist = [] this.imagelist = []
return return
...@@ -114,13 +125,22 @@ export default { ...@@ -114,13 +125,22 @@ export default {
return return
} }
const count = Math.min(3, len) const count = Math.min(3, len)
// 初始化:
// block-left: len-1 (Last)
// block-center: 0 (First)
// block-right: 1 (Second)
this.imagelist = Array.from({ length: count }).map((_, i) => { this.imagelist = Array.from({ length: count }).map((_, i) => {
let isIndex
if (i === 0) isIndex = len - 1
else if (i === 1) isIndex = 0
else isIndex = 1
const cfg = list[i] const cfg = list[i]
return { return {
isToor: cfg.index, isToor: cfg.index,
class: cfg.class, class: cfg.class,
imgUrl: this.datalist[i].materialUrl, imgUrl: this.datalist[isIndex].materialUrl,
isIndex: i, isIndex: isIndex,
index: cfg.index index: cfg.index
} }
}) })
...@@ -129,7 +149,7 @@ export default { ...@@ -129,7 +149,7 @@ export default {
}, },
// 自动播放控制:递归定时触发 updateCarouselPositions // 自动播放控制:递归定时触发 updateCarouselPositions
autoPlayFunction() { autoPlayFunction() {
if (!this.autoplay) return if (!this.autoplay || this.datalist.length <= 1) return
if (this.autoPlayTimer) clearTimeout(this.autoPlayTimer) if (this.autoPlayTimer) clearTimeout(this.autoPlayTimer)
this.autoPlayTimer = setTimeout(() => { this.autoPlayTimer = setTimeout(() => {
if (!this.playStatus) { if (!this.playStatus) {
...@@ -166,34 +186,62 @@ export default { ...@@ -166,34 +186,62 @@ export default {
const ci2 = this.imagelist.findIndex(item => item.class === 'block-center') const ci2 = this.imagelist.findIndex(item => item.class === 'block-center')
if (ci2 !== -1) this.currentIndex = this.imagelist[ci2].isIndex if (ci2 !== -1) this.currentIndex = this.imagelist[ci2].isIndex
} else { } else {
// 更新 currentIndex
if (direction === 'left') {
this.currentIndex = (this.currentIndex + 1) % len
} else {
this.currentIndex = (this.currentIndex - 1 + len) % len
}
this.imagelist.forEach(item => { this.imagelist.forEach(item => {
const toor = direction === 'left' const toor = direction === 'left'
? (item.isToor - 1) < 0 ? imagelist.length - 1 : item.isToor - 1 ? (item.isToor - 1) < 0 ? imagelist.length - 1 : item.isToor - 1
: (item.isToor + 1) > imagelist.length - 1 ? 0 : item.isToor + 1 : (item.isToor + 1) > imagelist.length - 1 ? 0 : item.isToor + 1
item.isToor = toor item.isToor = toor
item.imgUrl = ''
item.class = list[toor].class item.class = list[toor].class
item.x = 0 item.x = 0
// 根据新位置设置内容
// Center: currentIndex
// Left: (currentIndex - 1 + len) % len
// Right: (currentIndex + 1) % len
if (item.class === 'block-center') {
// 已经是正确的数据了,或者需要更新?
// 实际上如果是滑动过来的,它原本的数据就是我们想要的
// 比如 Left (prev) -> Center (current).
// 所以这里理论上不需要动 isIndex,除非我们需要“补”数据
// 但是为了确保数据绝对正确,我们可以强制赋值
// 注意:这样可能会导致图片闪烁,如果 DOM 复用而 src 变了。
// 只有当该卡片是从“不可见/替补”区域变过来时才需要更新 src。
// 在 3 卡片循环中,Left->Center, Center->Right, Right->Left (如果是左滑)
// Right 变成了 Left(替补位),此时它应该装载 (currentIndex - 1) 的数据吗?
// 如果是左滑(看下一张):
// Center(0) -> Left(0). Left(len-1) -> Right(1). Right(1) -> Center(1).
// 此时:
// 新 Left 是旧 Center(0)。期望是 (1-1)=0。正确。
// 新 Center 是旧 Right(1)。期望是 1。正确。
// 新 Right 是旧 Left(len-1)。期望是 2。
// 所以只有“跳跃”的那张卡需要更新。
}
let isIndex = item.isIndex let isIndex = item.isIndex
if (direction === 'left' && item.class === 'block-right') { if (direction === 'left' && item.class === 'block-right') {
if (isIndex === len) isIndex = 2 // 原 Left 变成了 Right,需要装载下下张图
else if (isIndex === len - 1) isIndex = 1 isIndex = (this.currentIndex + 1) % len
else isIndex += 3
if (isIndex > len) isIndex = 0
} }
if (direction === 'right' && item.class === 'block-left') { if (direction === 'right' && item.class === 'block-left') {
if (isIndex === 1) isIndex = len - 1 // 原 Right 变成了 Left,需要装载上上张图
else if (isIndex === 0) isIndex = len - 2 isIndex = (this.currentIndex - 1 + len) % len
else isIndex -= 3
if (isIndex < 0) isIndex = len
} }
item.isIndex = isIndex item.isIndex = isIndex
item.imgUrl = datalist[isIndex].materialUrl || '' item.imgUrl = datalist[isIndex].materialUrl || ''
item.index = list[toor].index item.index = list[toor].index
}) })
} }
const ci = this.imagelist.findIndex(item => item.index === 1) // 这里的 ci 计算其实是多余的,因为我们已经手动维护了 currentIndex
if (ci !== -1) this.currentIndex = this.imagelist[ci].isIndex // const ci = this.imagelist.findIndex(item => item.index === 1)
// if (ci !== -1) this.currentIndex = this.imagelist[ci].isIndex
}, },
// 触摸开始:暂停自动播放、记录起点 // 触摸开始:暂停自动播放、记录起点
starts(e) { starts(e) {
......
<template>
<uni-popup ref="popup" type="center" border-radius="16px" :mask-click="false">
<view class="popup-content" :class="[`popup-${type}`]">
<view class="popup-icon">
<image
:src="require(`@/assets/images/common/${type}-notice.png`)"
mode="aspectFit"
class="icon-image"
/>
</view>
<view class="popup-title">{{ title }}</view>
<view class="popup-text">{{ text }}</view>
<view class="popup-buttons">
<view
v-for="(button, index) in buttonsList"
:key="index"
class="popup-button"
:class="[
`button-${button.type || 'default'}`,
{ 'single-button': buttonsList.length === 1 }
]"
@click="handleButtonClick(button)"
>
{{ button.text }}
</view>
</view>
</view>
</uni-popup>
</template>
<script>
import utils from '@/utils/utils'
export default {
props: {
// 弹窗类型:success, error, warning, info
type: {
type: String,
default: 'info'
},
// 弹窗标题
title: {
type: String,
default: 'warning'
},
// 弹窗内容
text: {
type: String,
default: ''
},
// 按钮配置
buttons: {
type: Array,
default: () => [{
text: '确认',
type: 'primary',
callback: null
}]
}
},
data() {
return {
popupShow: false,
buttonsList: []
}
},
methods: {
open() {
this.$refs.popup.open("center");
},
close() {
this.$refs.popup.close()
},
// 处理按钮点击事件
handleButtonClick(button) {
if (typeof button.callback === 'function') {
button.callback()
} else {
this.close()
}
// 触发点击事件,传递按钮信息
this.$emit('buttonClick', button)
}
},
// 监听props变化,更新本地数据
watch: {
buttons: {
immediate: true,
deep: true,
handler(newVal) {
if (newVal) {
this.buttonsList = utils.deepClone(newVal)
}
}
}
},
created() {
// 初始化时将buttons赋值给buttonsList
this.buttonsList = utils.deepClone(this.buttons)
}
}
</script>
<style scoped lang="scss">
.popup-content {
background-color: #fff;
border-radius: toRpx(38);
width: toRpx(848);
min-height: toRpx(660);
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
overflow: hidden;
}
.popup-icon {
width: 100%;
margin-bottom: toRpx(48);
.icon-image {
width: 100%;
height: toRpx(248);
// border-radius: toRpx(38) toRpx(38) 0 0;
}
}
.popup-title {
font-size: toRpx(48);
font-weight: 500;
color: #333;
margin-bottom: toRpx(24);
text-align: center;
}
.popup-text {
font-size: 28rpx;
color: #666;
text-align: center;
margin:0 64rpx 32rpx;
line-height: 1.5;
}
.popup-buttons {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
gap: toRpx(32);
margin-top: auto;
height: toRpx(160);
}
.popup-button {
flex: 1;
height: toRpx(80);
line-height: toRpx(80);
text-align: center;
border-radius: toRpx(40);
font-size: toRpx(28);
max-width: toRpx(344);
&.single-button {
max-width: toRpx(688);
}
}
.button-primary {
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #fff;
}
.button-default {
background-color: #f5f5f5;
color: #333;
}
.button-danger {
background-color: #f45001;
color: #fff;
}
</style>
\ No newline at end of file \ No newline at end of file
<!--针对弹窗穿透滚动,统一封装的popup-->
<template>
<page-meta :page-style="'overflow:' + (show ? 'hidden' : 'visible')"></page-meta>
<uni-popup :class="popupClass" ref="publishPopup" :type="type" @change="change" :is-mask-click="isMaskClick" :safe-area="safeArea" :showClose="showClose">
<!-- 顶部标题栏插槽 -->
<slot name="header">
<view class="popup-top-box flex align-center" v-if="showTitle">
<text class="popup-top-box-title">{{ title }}</text>
<view @click.stop="closePopup">
<uni-icons class="icon-close" type="closeempty"></uni-icons>
</view>
</view>
</slot>
<!-- 主要内容插槽 -->
<slot name="content"></slot>
<!-- 底部插槽 插槽有内容就优先自定义内容-->
<slot name="footer">
<view class="footer-box flex justify-center" v-if="isShowFooter">
<view class="cancle-btn btn" @click.stop="closePopup">{{ cancelText }}</view>
<view class="sure-btn btn" @click.stop="confirm">{{ confirmText }}</view>
</view>
</slot>
</uni-popup>
</template>
<script>
export default {
name: 'PublishPopup',
props: {
type: {
type: String,
default: 'bottom'
},
isMaskClick: {
type: Boolean,
default: true
},
safeArea: {
type: Boolean,
default: true
},
popupClass: {
type: String,
default: ''
},
showClose: {
type: Boolean,
default: true
},
title: {
type: String,
default: ''
},
showTitle: {
type: Boolean,
default: true
},
isShowFooter: {
type: Boolean,
default: true
},
cancelText: {
type: String,
default: '取消'
},
confirmText: {
type: String,
default: '确定'
}
},
data() {
return {
show: false
}
},
methods: {
open() {
this.$nextTick(() => {
console.log(this.$refs)
if (this.$refs.publishPopup) {
this.$refs.publishPopup.open()
}
})
return new Promise((resolve, reject) => {
this.resolve = resolve
this.reject = reject
})
},
change(e) {
this.show = e.show
},
closePopup() {
this.$refs.publishPopup.close()
if (this.reject) {
this.reject(null)
}
this.$emit('close')
},
confirm() {
if (this.resolve) {
this.$refs.publishPopup.close()
this.resolve()
}
this.$emit('confirm')
}
}
}
</script>
<style scoped lang="scss">
.popup-top-box {
color: #333333;
font-size: toRpx(36);
font-weight: 500;
text-align: center;
padding: toRpx(32);
.popup-top-box-title {
flex: 1;
}
.icon-close {
text-align: end;
}
}
.justify-between {
-webkit-box-pack: justify;
-ms-flex-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.align-center {
align-items: center;
}
.uniui-closeempty {
color: #1a1a1a;
font-size: toRpx(24);
font-weight: 600;
}
.footer-box {
width: 100%;
height: toRpx(164);
background-color: #fff;
position: absolute;
border-radius: 0 0 toRpx(42) toRpx(42);
bottom: 0;
.btn {
width: 40%;
height: toRpx(80);
border-radius: toRpx(48);
opacity: 1;
line-height: toRpx(80);
text-align: center;
color: rgba(26, 26, 26, 0.6);
font-size: toRpx(32);
font-weight: 500;
}
.cancle-btn {
background: #f0f1f5;
}
.sure-btn {
color: #fff;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
margin-left: toRpx(32);
}
}
</style>
<template>
<view class="select-box">
<view
class="select"
@click.stop="isSelect = !isSelect"
>
{{selectList[selectIndex].label}}
<view class="sprite-icon icon-arrow-bottom"></view>
</view>
<view
class="pop-box"
v-if="isSelect"
>
<view
v-for="(i,index) in selectList"
:key="index"
class="type-item flex"
:class="index == selectIndex ? 'active' : ''"
@click="chooseType(index, i)"
>{{i[labelKey]}}</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
selectList: Array,
labelKey: {
type: String,
default: 'label'
}
},
name: '',
data () {
return {
selectIndex: 0,
isSelect: false
}
},
mounted () {
},
methods: {
hideSelect () {
this.isSelect = false
},
chooseType (index, item) {
this.selectIndex = index
this.isSelect = false
this.$emit('chooseType', { item, index })
},
}
}
</script>
<style scoped lang='scss'>
.select-box {
position: relative;
z-index: 5;
.select {
display: flex;
align-items: center;
justify-content: flex-end;
height: toRpx(84);
border-radius: toRpx(16);
opacity: 1;
background: #f2f2f2;
padding: 0 toRpx(24) 0 toRpx(40);
}
.arrow-bottom {
width: toRpx(48);
height: toRpx(48);
}
.pop-box {
position: absolute;
top: toRpx(100);
left: 0;
width: 100%;
background: #ffffff;
box-shadow: 0 0 toRpx(16) 0 #99999933;
border-radius: toRpx(16);
padding: toRpx(16) 0;
text-align: center;
animation: show-view-opacity 0.15s forwards;
.type-item {
padding: 0 toRpx(28);
margin-bottom: toRpx(8);
height: toRpx(84);
justify-content: center;
&:last-child {
margin-bottom: 0;
}
&.active {
background-color: #ecf1ff;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view :class="['swiper-box',{'type-2':swiperType == 2}]">
<template v-if="loadComplete">
<template v-if="moduleList.length">
<movable-area
class="swiper-carousel"
@touchstart="starts"
@touchend="ends"
>
<template v-for="(item,index) in imagelist">
<movable-view
:key="index"
:class="['carousel-block',item.class]"
@click.stop="changeBlock(item)"
direction="horizontal"
@change="change"
:disabled="item.class != 'block-center' || moduleList.length == 1"
:x="item.class != 'block-center' ? 0 : viewX"
:data-index="item.isIndex"
v-if="item.imgUrl"
>
<template v-if="custom">
<slot
:content="item"
name="swiper"
></slot>
</template>
<template v-else>
<image
class="image-block"
:src="item.imgUrl"
@load="item.hide = true"
/>
<view
class="bg"
v-if="item.hide"
></view>
</template>
<!-- <view :class="['error-block',{hide:item.hide}]">
<uni-icons
:type="icon"
:size="size"
color="#909399"
></uni-icons>
</view> -->
</movable-view>
</template>
</movable-area>
<view class="module-title flex">
{{moduleTitle}}
</view>
<view class="module-dots flex">
<template v-for="(i,index) in moduleList">
<div
:class="['dot', {'active': index == currentIndex}]"
:key="index"
>
</div>
</template>
</view>
</template>
<template v-else>
<view class="nothing flex">
<template v-if="noDataObject.icon">
<image
:src="noDataObject.icon"
class="icon"
:style="noDataObject.style"
/>
</template>
{{noDataObject.text || '该场景尚未配置素材,请联系总部人员'}}
</view>
</template>
</template>
<template v-else>
<view class="loading flex">
<image
class="gif"
src="../assets/images/common/loadding.gif"
/>
<!-- <uni-icons
class="icon"
type="refreshempty"
:size="120"
color="#3773f8"
></uni-icons> -->
</view>
</template>
</view>
</template>
<script>
import utils from "@/utils/utils.js";
export default {
name: 'SwiperComponent',
props: {
moduleList: {
type: Array,
default: () => []
},
imgKey: {
type: String,
default: 'thumbnail'
},
icon: {
type: String,
default: 'image'
},
size: {
type: [Number, String],
default: '40'
},
interval: {
type: [Number, String],
default: 5e3
},
autoplay: {
type: Boolean,
default: true
},
stopAutoPlay: {
type: Boolean,
default: false
},
loadComplete: Boolean,
noDataObject: {
type: Object,
default: () => ({})
},
custom: Boolean,
swiperType: [Number, String]
},
watch: {
moduleList: {
handler (val) {
if (!val.length) {
this.datalist = []
this.imagelist = []
}
if (val.length && !this.imagelist.length) this.getDatalist()
},
deep: true
},
stopAutoPlay: {
handler (val) {
if (this.autoplay && !val) this.autoPlayFunction()
},
deep: true
}
},
computed: {
moduleTitle () {
return this.moduleList[this.currentIndex]?.materialName || ''
}
},
created () {
// this.getDatalist()
},
data () {
return {
datalist: [],
imagelist: [],
ismove: 0,
currentIndex: 0,
autoPlayTimer: null,
endTimer: null,
playStatus: true,
style_object: Object.freeze([
{ index: 0, class: 'block-left' },
{ index: 1, class: 'block-center' },
{ index: 2, class: 'block-right' }
]),
blockX: 0,
viewX: 0
}
},
beforeDestroy () {
// 组件销毁时清理自动播放定时器
if (this.autoPlayTimer) {
clearTimeout(this.autoPlayTimer);
this.autoPlayTimer = null;
}
},
methods: {
getDatalist () {
if (this.moduleList) {
this.currentIndex = 0
this.datalist = JSON.parse(JSON.stringify(this.moduleList))
let num = 3
let diff = num - this.moduleList.length
if (diff > 0) {
for (let i = 0; i < diff; i++) {
let obj = {}
obj[this.imgKey] = ''
this.datalist.push(obj)
}
}
this.getImagelist()
}
},
getImagelist () {
let { datalist, autoplay, style_object } = this
this.imagelist = JSON.parse(JSON.stringify(style_object))
this.imagelist.forEach((item, index) => {
const dataIndex = index - 1 < 0 ? datalist.length - 1 : index - 1
item.isIndex = dataIndex
item.isToor = index
item.imgUrl = datalist[dataIndex]?.[this.imgKey] || ''
item.originalData = datalist[dataIndex]
item.x = 0
})
if (autoplay) this.autoPlayFunction()
},
autoPlayFunction () {
if (!this.autoplay) return
if (this.stopAutoPlay || !this.playStatus) {
if (this.autoPlayTimer) {
clearTimeout(this.autoPlayTimer);
this.autoPlayTimer = null;
}
return;
}
// 设置新的自动播放定时器
this.autoPlayTimer = setTimeout(() => {
// 再次检查是否需要停止播放
if (this.stopAutoPlay || !this.playStatus) {
clearTimeout(this.autoPlayTimer);
this.autoPlayTimer = null;
return;
}
// 执行轮播动画并递归调用自身
this.updateCarouselPositions();
this.autoPlayFunction();
}, this.interval);
},
updateCarouselPositions (direction = 'left') {
let { imagelist, datalist, moduleList } = this,
len = datalist.length - 1,
list = JSON.parse(JSON.stringify(this.style_object))
if (moduleList.length == 2) {
this.imagelist.forEach((item, index) => {
if (index != 0) {
let toor = item.isToor == 1 ? 2 : 1
item.isToor = toor
item.imgUrl = ''
item.class = list[toor].class
item.x = 0
let isIndex = item.isIndex
item.isIndex = isIndex
item.imgUrl = datalist[isIndex][this.imgKey] || ''
item.index = list[toor].index
}
})
} else {
this.imagelist.forEach(item => {
let toor = direction == 'left' ?
(item.isToor - 1) < 0 ? imagelist.length - 1 : item.isToor - 1
: (item.isToor + 1) > imagelist.length - 1 ? 0 : item.isToor + 1
item.isToor = toor
item.imgUrl = ''
item.class = list[toor].class
item.x = 0
let isIndex = item.isIndex
if (direction == 'left' && item.class == 'block-right') {
if (isIndex == len) isIndex = 2
else if (isIndex == len - 1) isIndex = 1
else isIndex += 3
if (isIndex > len) isIndex = 0
}
if (direction == 'right' && item.class == 'block-left') {
if (isIndex == 1) isIndex = len - 1
else if (isIndex == 0) isIndex = len - 2
else isIndex -= 3
if (isIndex < 0) isIndex = len
}
item.isIndex = isIndex
item.imgUrl = datalist[isIndex][this.imgKey] || ''
item.index = list[toor].index
})
}
let currentIndex = this.imagelist.findIndex(item => item.index == 1)
this.currentIndex = this.imagelist[currentIndex].isIndex
},
changeBlock (item) {
let toor = item.isToor
if (toor === 0) this.updateCarouselPositions('right')
if (toor == 2) this.updateCarouselPositions()
this.$emit('click', item.isIndex)
},
starts (e) {
this.ismove = e.touches[0].pageX
this.playStatus = false
if (this.endTimer) {
clearTimeout(this.endTimer);
this.endTimer = null;
return;
}
},
ends (e) {
let { moduleList } = this
if (moduleList.length == 1) return
let { blockX, ismove } = this
let pageX = e.changedTouches[0].pageX
let nums = ismove - pageX
if (nums == 0) return
if (!(nums > 50 || blockX < -30) || !(nums < -50 || blockX > 30)) {
this.viewX = -10
setTimeout(() => {
this.viewX = 0
}, 16)
}
if (nums > 50 || blockX < -30) this.updateCarouselPositions()
if (nums < -50 || blockX > 30) this.updateCarouselPositions('right')
this.endTimer = setTimeout(() => {
if (!this.playStatus) {
this.playStatus = true
this.autoPlayFunction()
}
}, this.interval)
},
change: utils.throttle(function (e, item) {
let { x } = e.detail
this.blockX = x
}, 16)
}
}
</script>
<style lang="scss" scoped>
.swiper-box {
height: 100%;
.loading {
width: 100%;
height: 100%;
justify-content: center;
.gif {
width: toRpx(64);
height: toRpx(64);
}
.icon {
animation: rotate 1s infinite;
}
@keyframes rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
}
}
.swiper-carousel {
width: 100%;
height: toRpx(440);
position: relative;
overflow: hidden;
.carousel-block {
position: absolute;
border-radius: 10upx;
overflow: hidden;
box-shadow: 0 0 5px #0000001a;
transition: all 0.2s ease; /* 添加过渡 */
border: toRpx(2) solid #ffffffb3;
box-shadow: 0 toRpx(3) toRpx(12) 0 #5294ff33;
border-radius: toRpx(24);
.image-block {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-size: 100% 100%;
z-index: 5;
}
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: linear-gradient(180deg, #e6edff 0%, #f0f4ff 100%);
z-index: 4;
}
.error-block {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: #f5f7fa;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
}
.hide {
opacity: 0;
}
}
.block-left,
.block-right {
top: toRpx(68);
height: toRpx(306);
width: toRpx(468);
transition: all 0.1s;
}
.block-left {
left: toRpx(150);
z-index: 10;
}
.block-right {
left: toRpx(592);
z-index: 15;
}
.block-center {
left: toRpx(294);
top: toRpx(16);
height: toRpx(408);
width: toRpx(624);
z-index: 20;
transition: all 0.3s;
}
}
.module-title {
color: #333333;
font-size: toRpx(24);
margin-top: toRpx(24);
justify-content: center;
position: relative;
}
.module-dots {
position: absolute;
bottom: toRpx(56);
right: toRpx(48);
gap: toRpx(12);
.dot {
width: toRpx(12);
height: toRpx(12);
opacity: 1;
background: #0007400d;
border-radius: 100%;
}
.active {
background: #fff;
}
}
.nothing {
width: 100%;
height: 100%;
justify-content: center;
color: #999;
font-size: toRpx(20);
flex-direction: column;
.icon {
width: toRpx(344);
height: toRpx(236);
}
}
.type-2 {
.swiper-carousel {
height: toRpx(460);
.carousel-block {
border: none;
}
.block-left,
.block-right {
top: toRpx(68);
height: toRpx(306);
width: toRpx(604);
transition: all 0.1s;
}
.block-left {
left: toRpx(88);
z-index: 10;
}
.block-right {
left: toRpx(508);
z-index: 15;
}
.block-center {
left: toRpx(180);
top: toRpx(10);
width: toRpx(848);
height: toRpx(428);
}
}
flex-direction: column;
.icon {
width: toRpx(344);
height: toRpx(236);
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="type-tab">
<view class="type-box">
<view
class="tab-item"
v-for="(i, index) in typeList"
:key="index"
@click="tabClick(index)"
>
<view
:class="['sprite-icon',tabClass(index)]"
:style="{
left:blockLeft
}"
></view>
<view
class="text"
:class="[tabIndex == index ? `active` : '']"
>
{{ i[nameKey] }}
</view>
</view>
</view>
<view class="mask-box"></view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
typeList: Array,
tabIndex: {
type: Number,
default: 0
},
nameKey: {
type: String,
default: 'tabName'
}
},
name: '',
data () {
return {
firstClass: Object.freeze(['first-nav', 'second-nav']),
}
},
computed: {
blockLeft () {
let { tabIndex } = this
return `${(tabIndex * 400) - (tabIndex == 0 ? 0 : 48)}rpx`
}
},
mounted () {
},
methods: {
tabClass (index) {
let className = ''
if (this.tabIndex == index) {
className = 'active icon-'
if (index == 0) className += 'first-nav'
else className += 'second-nav'
}
return className
},
tabClick (index) {
this.$emit('update:tabIndex', index)
this.$emit('tabClick',index)
}
}
}
</script>
<style scoped lang='scss'>
.type-tab {
position: relative;
.type-box {
position: relative;
display: flex;
width: 100%;
background-color: #eef4fe;
height: toRpx(160);
line-height: toRpx(128);
border-radius: toRpx(48) toRpx(48) 0 0;
overflow: hidden;
z-index: 0;
.tab-item {
width: toRpx(400);
text-align: center;
font-weight: 500;
font-size: toRpx(40);
color: #1f2133;
.text {
position: relative;
text-align: center;
width: toRpx(400);
}
.active {
position: absolute;
top: 0;
z-index: -1;
font-weight: 700;
font-size: toRpx(40);
color: #2c66f7;
&::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: toRpx(48);
height: toRpx(8);
background-color: #2c66f7;
border-radius: toRpx(16);
}
}
.sprite-icon {
transition: left 0.15s;
}
}
}
.mask-box {
position: absolute;
height: 100vh;
width: 100%;
background: #fff;
left: 0;
top: toRpx(128);
border-radius: toRpx(48);
overflow: hidden;
}
}
</style>
\ No newline at end of file \ No newline at end of file
export default {
data () {
return {
AIUrl: ''
}
},
mounted () {
},
methods: {
async getAiagent (options, agentCode = 'AI6') {
const { phone } = uni.$storage.get('userInfo'),
[data] = await uni.$api.sceneMarketApi.getAiagent({
ownerShipType: 1,
accountPhone: phone,
agentCode
})
if (data) {
const { sceneType, uuid, phone, channelType = 1 } = uni.$storage.get('userInfo'),
bussinessType = sceneType == 0 ? 1 : 2,// sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
brand = {
1: '问界',
2: '比亚迪',
3: '其他'
}[channelType]
let title = options.directoryName
if(options.title) title += `-${options.title}`
let { agentUrl, domainName } = data,
url = `${agentUrl}?no_header=1&business_type=${bussinessType}&phone=${phone}&brand=${brand}&one_id=${uuid}&platformType=1&domain=${domainName}&presuppositionProblem=${title}`
if (options.id) url += `&enter_id=${options.id}`
this.AIUrl = url
this.setWebviewStyle()
} else uni.showToast({
title: '获取智能体失败',
icon: 'error'
})
},
setWebviewStyle () {
const setWebviewStyleWithRetry = () => {
const currentWebview = this.$scope.$getAppWebview()
let [wv1, wv2] = currentWebview.children()
let wv1Flag = false,
wv2Flag = false
if (wv2) {
if (wv1) {
wv1.setStyle({
left: '0',
top: '9.37%',
height: '90.63%',
width: '71.36%'
});
wv1Flag = true;
}
if (wv2) {
wv2.setStyle({
left: '71.9%',
top: '17.18%',
height: '82.82%',
width: '28.3%'
});
wv2Flag = true;
}
} else {
if (wv1) {
wv1.setStyle({
left: '71.9%',
top: '17.18%',
height: '82.82%',
width: '28.3%'
});
wv1Flag = true;
wv2Flag = true;
}
}
return wv1Flag && wv2Flag
};
const retrySetWebviewStyle = () => {
if (!setWebviewStyleWithRetry()) {
// 如果未成功,继续重试
setTimeout(retrySetWebviewStyle, 50);
} else {
// 成功设置样式,结束循环
console.log('Webview样式设置成功');
}
};
setTimeout(retrySetWebviewStyle, 100);
}
}
}
import loginMixin from './loginMixin'
import receptionTrackMixin from './receptionTrackMixin' import receptionTrackMixin from './receptionTrackMixin'
import aiUrlMixin from './aiUrlMixin'
import report from './report'
import interceptionMixin from './interceptionMixin'
module.exports = { module.exports = {
loginMixin,
receptionTrackMixin, receptionTrackMixin,
aiUrlMixin,
report,
interceptionMixin
} }
let modalQueue = [],
eventRequest = []
export default {
data () {
return {}
},
computed: {
userInfo () {
return uni.$storage.get('userInfo') || {}
}
},
mounted () { },
methods: {
/**
*
* @param {是否需要检测企微打卡} checkWW
* @returns
*/
async checkDailyReport (checkWW = true) {
modalQueue = []
eventRequest = []
let { sceneType, isSuper, loginRole } = this.userInfo
if (!(isSuper || loginRole == 3 || loginRole == 5 || loginRole == 6)) {
// 判断员工是否已打卡上班
if (checkWW) eventRequest.push(this.clockedIntoWork())
let apiName = {
0: this.equityStaffDailyReport,
1: this.staffDailyReport,
7: this.usedCarDailyReport
}
eventRequest.push(apiName[sceneType]())
}
return new Promise(resolve => {
Promise.all(eventRequest).then(results => {
results = results.slice(-2)
let resultFlag = results.some(item => item)
this.showNextModal()
resolve(resultFlag)
})
})
},
showNextModal () {
if (modalQueue.length > 0) {
const modalInfo = modalQueue.pop()
// if (wx.__HAS_SHOW_MODAL) return;
// wx.__HAS_SHOW_MODAL = true;
uni.showModal({
title: modalInfo.title,
content: modalInfo.content,
showCancel: modalInfo.showCancel,
cancelColor: '#292D33',
confirmText: modalInfo.confirmText,
confirmColor: '#347BFF',
success: function (res) {
// wx.__HAS_SHOW_MODAL = false;
// if (res.cancel) _this.showNextModal();
if (res.cancel) showNextModal()
modalInfo.eventCallback(res)
}
})
}
},
/**
* 轻改日报
*/
staffDailyReport () {
let { userInfo } = this
return new Promise((resolve, reject) => {
uni.$api.interceptionApi
.staffDailyReportMerchantValid({
merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid,
sceneType: 1
})
.then(data => {
if (data) {
// 获取当前日期
let currentDate = new Date()
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
// if (wx.__HAS_NOTLOGIN_MODAL) return false; //
this.addModalToQueue('日报提醒', '您有未填写的日报,请点击前往。', '前往填写', false, 2, res => {
if (res.confirm) {
console.log(formattedDate)
const pages = getCurrentPages(),
currentPage = pages[pages.length - 1]
if (currentPage.route == 'pages/boutique/tool/index') uni.$emit('jumpToDailyReport', formattedDate)
else uni.navigateTo({
url: `/pages/boutique/tool/index?componentName=DailyReport&currentDate=${formattedDate}`
})
}
})
resolve(true)
} else {
resolve(false)
}
})
.catch(err => {
resolve()
})
})
},
/**
* 二手车日报
*/
usedCarDailyReport () {
let { userInfo } = this
return new Promise(async (resolve, reject) => {
const data = await uni.$api.interceptionApi.checkUsedCarStaffIsNew({
merchantId: userInfo.shopMerchantId,
yqMerchantId: userInfo.merchantId,
staffUuid: userInfo.uuid,
staffPhone: userInfo.phone,
sceneType: 7
})
if (!data) resolve(false) //检测是否新员工或调店 flase不检测日报 true检测日报
else {
const _data = await uni.$api.interceptionApi.checkUsedCarStaffDailyReportValid({
sellerMerchantId: userInfo.shopMerchantId,
}) //true 已填写 false 未填写
if (!_data) {
// 获取当前日期
let currentDate = new Date()
// 获取上一天的日期
let previousDate = new Date(currentDate)
previousDate.setDate(currentDate.getDate() - 1)
// toISOString 方法会丢失时区 导致与北京时间差八小时
let hour = previousDate.getHours() + 8
previousDate.setHours(hour)
// 格式化日期为"yyyy-mm-dd"
let formattedDate = previousDate.toISOString().split('T')[0]
this.addModalToQueue('日报提醒', '您有未填写的日报,请点击前往。', '前往填写', false, 2, res => {
if (res.confirm) {
const pages = getCurrentPages(),
currentPage = pages[pages.length - 1]
if (currentPage.route == 'pages/usedCar/tool/index') uni.$emit('jumpToDailyReport', formattedDate)
else uni.navigateTo({
url: `/pages/usedCar/tool/index?componentName=DailyReport&currentDate=${formattedDate}`
})
}
})
resolve(true)
} else resolve(false)
}
})
},
clockedIntoWork () {
return new Promise((resolve, reject) => {
uni.$api.interceptionApi
.clockInConfigPhone({})
.then(res => {
let { need, clockIn } = res
// 已配置未打卡
if (need == 1 && clockIn == 0) {
// 有配置并且没有打卡就提示
this.addModalToQueue('打卡提醒', '您当前企微未打卡,无法录单,请前往企微打卡后再试,如有异议请联系管理员。', '知道了', false, 4, res => {
if (res.confirm) {
// wx.$router.go("tabWorkOrder.staffDaily", {
// // reportDate: formattedDate,
// });
}
})
resolve(true)
} else {
resolve(false)
}
})
.catch(err => {
resolve(false)
})
})
},
/**延保日报 */
equityStaffDailyReport () { },
addModalToQueue (title, content, confirmText, showCancel, priority, eventCallback) {
if (modalQueue.findIndex(val => val.content == content) < 0)
modalQueue.push({
title,
content,
confirmText,
showCancel,
priority,
eventCallback
})
modalQueue.sort((a, b) => a.priority - b.priority)
},
/**
* 查询当前员工处罚情况
*/
async inspectionOfProhibitionBill () {
const data = await uni.$api.interceptionApi.checkStaffStudyPunish()
if (data)
uni.showModal({
title: '温馨提示',
content: '未完成学习任务,禁止提单!\n请在平板电脑上展业助手-学习中心完成学习。',
showCancel: false,
cancelColor: '#292D33',
confirmText: '确定',
confirmColor: '#347BFF'
})
return Promise.resolve(data)
}
}
}
import dayjs from 'dayjs'
export default {
data() {
return {
IncomeList: [
{
label: '基本工资',
icon: 'jbgz-icon',
content: '实发底薪=应发底薪÷应出勤天数x实际出勤天数',
value: 'actualBasicSalary',
recordKey: 'refundOffsetRecords',
showNext: true,
sort: 1,
base: true,
customize: true,
basicList: [
{
label: '应发底薪',
tips: '',
prop: 'basicSalary',
actualProp: 'actualBasicSalary',
value: 3000
},
{
label: '应出勤天数',
value: 27,
prop: 'shouldWorkDay',
unit: '天'
},
{
label: '实际出勤天数',
value: 22,
prop: 'actualWorkDay',
unit: '天'
}
],
performance: {
label: '绩效工资',
prop: 'performanceSalary',
actualProp: 'actualPerformanceSalary',
},
},
{
label: '退单冲减',
icon: 'tdcj-icon',
content: '历史已发放提成订单客户本月退单,当月冲减该月提成',
value: 'refundOffset',
recordKey: 'refundOffsetRecords',
sort: 4,
tabelTh: [
{
title: '序号',
width: 10
},
{
title: '退单记录描述'
},
{
title: '提成',
width: 20
}
],
tabelTr: [
'remark',
{
key: 'deduction',
format: val => {
return '-' + val
}
}
],
showUnit: '-'
},
{
label: '会员权益/升级',
icon: 'qytc-icon',
content: '权益提成 = 权益产值 × 提成系数 × 提成比例',
subContent: '延保提成 = 售前延保产值×提成系数×安心包Max考核系数×提成比例 +售后延保产值×提成比例 +安心包Max产值×提成系数×提成比例',
warnList: [
{ style: 'font-size: 28rpx;color: #808291;line-height: 48rpx;', message: '当安心包Max渗透率<15%,安心包Max考核系数为 0.8' },
{
style: 'font-size: 28rpx;color: #808291;line-height: 48rpx;',
message: '当安心包Max渗透率>15%,安心包Max考核系数为 1.0'
},
{
style: 'font-size: 28rpx;color: #F47F13;line-height: 48rpx;',
message: '问界安心包、安心包PRO、轮胎服务,三项合计交付渗透率>15% 的部分,可以计入安心包Max渗透率;如三项渗透率为20%,其中5%计入安心包Max考核。'
}
],
value: 'equityCommission',
recordKey: 'equityMerchantCommissions',
sort: 2,
tabelTh: [
{
title: '序号',
width: 10
},
{
title: '门店名称'
},
{
title: '提成',
width: 20
}
],
tabelTr: [
{
name: val => {
const typeName = val.thirdLevelGoodsTypeName || val.secondaryGoodsTypeName || val.goodsTypeName
return `${val.merchantName}${typeName ? `-${typeName}` : ''}`
},
style: val => {
return val == 1 ? 'color: #3773F8;background-color:rgba(55, 115, 248, .2)' : 'color: #7C2CF5;background-color: rgba(124, 44, 245, .2);'
},
type: 'configCarType',
text: val => {
const typeMap = {
1: '问界',
2: '其他',
3: '鸿蒙'
}
return typeMap[val] || ''
}
},
'commission'
]
},
{
label: '日报扣款',
icon: 'rbkk-icon',
content: '日报填写错误或未在约定时间内填写日报',
value: 'dailyDeductMoney',
recordKey: 'dailyDeductionRecords',
sort: 5,
tabelTh: [
{
title: '序号',
width: 10
},
{
title: '日期'
},
{
title: '扣款',
width: 20
}
],
tabelTr: [
'deductDate',
{
key: 'deductMoney',
format: val => {
return '-' + val
}
}
],
showUnit: '-'
},
{
label: '轻改提成',
icon: 'qgtc-icon',
content: '轻改产值x提成系数x提成比例',
value: 'lightCommission',
recordKey: 'lightMerchantCommissions',
sort: 3,
tabelTh: [
{
title: '序号',
width: 10
},
{
title: '门店名称'
},
{
title: '提成',
width: 20
}
],
tabelTr: [
{
name: val => {
const typeName = val.thirdLevelGoodsTypeName || val.secondaryGoodsTypeName || val.goodsTypeName
return `${val.merchantName}${typeName ? `-${typeName}` : ''}`
}
},
'commission'
]
},
{
label: '平板接待扣款',
icon: 'pbjd-icon',
content: '无效或虚假平板接待以及未使用平板接待',
value: 'padDeductMoney',
recordKey: 'padDeductionRecords',
sort: 6,
tabelTh: [
{
title: '序号',
width: 10
},
{
title: '日期'
},
{
title: '扣款',
width: 20
}
],
tabelTr: [
'deductDate',
{
key: 'deductMoney',
format: val => {
return '-' + val
}
}
],
showUnit: '-'
},
{
label: '本月递延金',
icon: 'bydyj-icon',
content: '本月递延金 = 本月提成 × 10%',
desc: '递延金将于6个月后提成发放时返还',
value: 'deferExpenses',
sort: 7,
showUnit: '-'
},
{
label: '返还递延金',
icon: 'ffdyj-icon',
content: '本月递延金 = 提成(M-6)× 10%',
desc: '6个月前提成递延金在本月返还',
value: 'deferIncome',
sort: 8
},
{
label: '其他',
icon: 'qt-icon',
content: '其他扣款、奖励事项',
recordKey: 'otherDeductionRecords',
sort: 9,
tabelTh: [
{
title: '序号',
width: 10
},
{
title: '日期'
},
{
title: '备注'
},
{
title: '金额',
width: 20
}
],
tabelTr: [
{
key: 'createdDate',
format: val => {
return dayjs(val).format('YYYY-MM-DD')
}
},
'remark',
'deduction'
],
value: 'otherDeduction'
}
],
year: '',
month: '',
currentMonth: '',
date: ''
}
},
mounted() {
const year = new Date().getFullYear()
const month = new Date().getMonth() + 1
const day = new Date().getDate()
this.year = year
this.month = month
this.day = day
this.currentMonth = month
this.getDetail && this.getDetail(`${this.year}-${this.month}`, day)
this.date = `${this.year}-${this.month}-${day}`
},
methods: {
formatNumber(num, decimalPlaces = 2) {
// 保证小数部分精度
let [integer, decimal] = Number(num).toFixed(decimalPlaces).split('.')
// 格式化整数部分(千分位)
integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
// 如果有小数部分,则保留小数部分
return decimal ? `${integer}.${decimal}` : integer
},
back() {
console.log(88)
this.$emit('backHome')
},
prevTab() {
this.month = this.month - 1
if (this.month < 1) {
this.month = 12
this.year = this.year - 1
}
this.updateDetail && this.updateDetail(`${this.year}-${this.month}`)
},
nextTab() {
this.month = this.month + 1
// if (this.month < 1) {
// this.month = 12
// this.year = this.year - 1
// }
this.updateDetail && this.updateDetail(`${this.year}-${this.month}`)
}
}
}
/*
* @Author: yangming@didihu.com.cn yangming@didihu.com.cn
* @Date: 2025-05-01 11:00:20
* @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn
* @LastEditTime: 2025-05-07 09:58:48
* @FilePath: \gl-tape\mixin\pointTrack.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const FILTER_PAGE = ['收入测算试算页']
const REPORT_MAN = 5
let REPORT_STATUS = false
import dayjs from 'dayjs'
export default {
data() {
return {
currentTime: null
}
},
mounted() {
if (!FILTER_PAGE.includes(this.pageName) && this.pageName) {
this.enterPage()
}
},
methods: {
init() {
this.enterPage()
},
// 上报埋点
report(recordList) {
REPORT_STATUS = true
uni.$api.commonApi
.recordInsert({ recordList })
.then(res => {
if (res) {
let recordTrackList = uni.$storage.get('recordTrackList') || []
recordTrackList = recordTrackList.slice(REPORT_MAN)
uni.$storage.set('recordTrackList', recordTrackList)
REPORT_STATUS = false
}
})
.catch(err => {
REPORT_STATUS = false // 允许下次重试
})
},
collect() {
const { phone: phoneNumber, name: loginAccount, uuid, sceneType: scene, userType } = uni.$storage.get('userInfo')
const params = {
userType,
loginAccount,
phoneNumber,
uuid,
scene,
prePagePath: '/',
pagePath: this.pageName,
eventCode: this.eventCode,
eventTime: dayjs(Date.now()).format('YYYY-MM-DD HH:mm:ss'),
batchId: this.currentTime,
systemSource: 3,
eventType: 2
}
const recordTrackList = uni.$storage.get('recordTrackList') || []
recordTrackList.push(params)
uni.$storage.set('recordTrackList', recordTrackList)
if (recordTrackList.length >= REPORT_MAN && !REPORT_STATUS) {
this.report(recordTrackList.slice(0, REPORT_MAN))
}
},
// 离开页面埋点
leavePage() {
this.collect()
},
// 进入页面埋点
enterPage() {
this.currentTime = Date.now()
this.collect()
}
},
beforeDestroy() {
if (!FILTER_PAGE.includes(this.pageName) && this.pageName) {
this.leavePage()
}
}
}
export default {
data () {
return {
list: [],
dateIndex: 0,
pageNum: 1,
total: 0,
flag: true,
nothing: false,
pageSize: 18,
total: 0,
isEnd: false
};
},
mounted () { },
methods: {
async getList (api, params) {
try {
uni.showLoading({
mask: true
});
const { list, total } = await uni.$api.boutiqueApi[api](params);
uni.hideLoading();
this.list = [...(params.pageNum == 1 ? [] : this.list), ...list];
this.flag = true;
this.total = total;
} catch (error) {
uni.hideLoading()
this.flag = true;
this.isEnd = true
throw error;
}
},
},
};
export default {
data () {
return {
goodsId: '',
visitsId: '',
source: ''
}
},
onLoad (options) {
this.visitsId = options.visitsId || ''
this.goodsId = options.id
if (options.source) this.source = options.source
this.addRecord()
},
methods: {
addRecord () {
const { shopMerchantId: merchantId, shopMerchantName: merchantName } = uni.$storage.get('userInfo')
if (!merchantId || !this.goodsId) return
const params = {
goodsId: this.goodsId,
goodsType: 0,
merchantId,
merchantName,
}
if (this.visitsId) params.visitsId = this.visitsId
if (this.source) params.searchSource = this.source
uni.$api.commonApi.addRecord(params).then(res => {
this.addId = res
})
}
},
onUnload () {
if (!this.addId) return
const params = {
id: this.addId
}
if (this.visitsId) params.visitsId = this.visitsId
uni.$api.commonApi.leaveRecord(params).then(res => {
})
}
}
...@@ -30,19 +30,6 @@ ...@@ -30,19 +30,6 @@
} }
}, },
{ {
"path": "pages/common/nothing",
"style": {
"navigationBarTitleText": "提示"
}
},
{
"path": "pages/common/imgPreview",
"style": {
"navigationStyle": "custom",
"disableSwipeBack": true
}
},
{
"path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup", "path": "uni_modules/uni-upgrade-center-app/pages/upgrade-popup",
"style": { "style": {
"disableScroll": true, "disableScroll": true,
...@@ -59,87 +46,6 @@ ...@@ -59,87 +46,6 @@
}, },
{ {
"path": "pages/common/webview" "path": "pages/common/webview"
},
{
"path": "pages/common/aiWebview",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/msgwebview"
},
{
"path": "pages/common/customerDetail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/caseDetail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/messageDetail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/earlyWarnDetail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/messageList",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/systemDetail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/receptionDetail/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/studyDetail/longCourse",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/studyDetail/shortCourse",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/studyDetail/detail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/serviceDetail/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/materialDetail/index",
"style": {
"navigationStyle": "custom"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-28 18:19:19
* @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn
* @LastEditTime: 2025-04-30 13:31:51
* @FilePath: \gl-tape\pages\common\webview.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<view>
<view
class="header"
@click="back"
>
<view class="nav-bar">
<view class="back">
<uni-icons
type="left"
:size="20"
color="#000000"
></uni-icons>
</view>
<view class="title">{{ title }}</view>
</view>
</view>
<view
class="ai-window"
v-if="url"
>
<web-view :src="url"></web-view>
</view>
<learn-popup
ref="learn"
content="您还没有完成本次对练考核,\n是否确定退出?"
@cancel="cancel"
@confirm="confirm"
/>
</view>
</template>
<script type="text/ecmascript-6">
import LearnPopup from '@/components/LearnPopup.vue'
export default {
components: {
LearnPopup
},
name: '',
data () {
return {
url: '',
title: '广联AI集市',
wv: null,
studyId: '',
}
},
computed: {
learnRef () {
return this.$refs.learn
},
},
onLoad (options) {
if (options.studyId) this.studyId = options.studyId
if (options.pageTitle) this.title = options.pageTitle
const { sceneType, uuid, phone, channelType = 1 } = uni.$storage.get('userInfo')
const bussinessType = sceneType == 0 ? 1 : 2 // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
const brand = {
1: '问界',
2: '比亚迪',
3: '其他'
}[channelType]
this.url = `${options.url}?no_header=1&business_type=${bussinessType}&phone=${phone}&brand=${brand}&one_id=${uuid}&platformType=1&domain=${options.domain}&presuppositionProblem=${options.presuppositionProblem}`
if (options.practice_status) {
this.url += `&practice_status=${options.practice_status}`
}
if (options.businessType) {
this.url += `&businessType=${options.businessType}`
}
if (options.brandType) {
this.url += `&brandType=${options.brandType}`
}
if (options.date) {
this.url += `&date=${options.date}`
}
console.log(this.url, 999)
// this.url='http://assistant.test.glsx.com.cn/chat/jHpvpOmuMWPxYxKo?business_type=12&brand=%E9%97%AE%E7%95%8C&one_id=266&platformType=2&no_header=1&domain=http://aiassistant.test.glsx.com.cn'
setTimeout(() => {
const currentWebview = this.$scope.$getAppWebview()
const wv = currentWebview.children()[0]
if (wv) {
this.wv = wv
wv.setStyle({ top: '10%', height: '90%' })
}
}, 1000)
},
onBackPress (options) {
if (options.from === 'backbutton') {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
this.back()
return true
}
// 其他情况允许正常返回
return false
},
mounted () {
},
methods: {
async back () {
try {
const { studyId } = this
if (studyId) {
uni.showLoading()
const { aiReviewReport } = await uni.$api.commonApi.getShortCourseDetail({ id: this.studyId })
uni.hideLoading()
let open = false
aiReviewReport.map(e => {
if (e.examStatus != 2 && !open) open = true
})
if (open) {
this.learnRef.open()
this.wv.setVisible(false)
} else this.confirm()
} else throw false
} catch (error) {
uni.hideLoading()
this.confirm()
}
},
cancel () {
this.wv.setVisible(true)
},
confirm () {
uni.navigateBack()
uni.$emit('refreshStudyList')
}
}
}
</script>
<style scoped lang="scss">
.header {
// background: url('https://img02.glsx.com.cn/weapp/resource/saas/ai/ai-app-bg.jpg');
padding-top: 30px;
background-color: #f5f9ff;
z-index: 9;
background-size: 100% 100%;
position: fixed;
height: 10%;
width: 100%;
.nav-bar {
width: 100%;
height: 48px;
display: flex;
align-items: center;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
.title {
color: #333333;
flex: 1;
font-size: 16px;
font-weight: 700;
text-align: center;
}
}
}
.ai-window {
background-color: #f5f9ff;
position: absolute;
top: 10%;
left: 0;
width: 100%;
height: 90vh;
z-index: 1;
}
</style>
<template>
<view class="case-layout">
<view class="case-box">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
{{ caseObject.title }}
</view>
<view :class="['case-content',{'has-ai':AIUrl}]">
<view class="left-menu">
<view class="title">方案目录</view>
<scroll-view
scroll-y
class="scroll"
:scroll-into-view="`menu-${currentId}`"
@scroll="menuScroll"
>
<view
class="scroll-content"
id="scroll-content"
>
<template v-for="(item, index) in detailInfo">
<view
class="item"
:key="index"
>
<view
:class="['name', isLast(index), isActive(item)]"
@click="menuClick(item)"
>
<view
class="text text-hide"
:id="`menu-${item.id}`"
>{{ item.headings }}</view>
</view>
<template v-if="item.children && item.children.length">
<template v-for="(i, j) in item.children">
<view
:class="['name', isLast(index, j, item.children), isActive(i)]"
:key="j"
@click="menuClick(i)"
>
<view
class="text"
:id="`menu-${i.id}`"
>
<view class="icon"></view>
<view class="text-hide">{{ i.headings }}</view>
</view>
</view>
</template>
</template>
</view>
</template>
<template v-if="currentId">
<view
class="block"
:style="blockTop"
></view>
</template>
</view>
</scroll-view>
</view>
<scroll-view
class="right-content"
scroll-y
:scroll-into-view="`case-${contentId}`"
@scroll="contentScroll"
enable-flex
>
<!-- scroll-with-animation -->
<template v-for="(item, index) in detailInfo">
<view
class="detail-item"
:key="item.id"
>
<view
class="item-title"
:id="`case-${item.id}`"
>{{ item.headings }}</view>
<template v-if="item.audio">
<audio-component
:src="item.audio"
@onPlay="onPlay(item)"
:ref="`audio-${item.id}`"
:audioKey="`key${item.id}`"
/>
</template>
<view class="item-content">
<rich-text :nodes="item.content"></rich-text>
</view>
<template v-for="(i, ind) in item.imgList">
<view
class="picture"
:key="`img-${index}-${ind}`"
:id="`img-${index}-${ind}`"
:data-item="item"
:data-index="ind"
>
<image
:src="i.url"
class="item-img"
mode="widthFix"
@load="imgLoad"
v-if="i.visible"
></image>
</view>
</template>
<template v-if="item.children && item.children.length">
<template v-for="(i, s) in item.children">
<view
class="sub-item-content"
:key="s"
>
<view
class="item-title sub-item-title flex"
:id="`case-${i.id}`"
>{{ i.headings }}</view>
<template v-if="i.audio">
<audio-component
:src="i.audio"
@onPlay="onPlay(i)"
:ref="`audio-${i.id}`"
:audioKey="`key${i.id}`"
/>
</template>
<view class="item-content">
<rich-text :nodes="i.content"></rich-text>
</view>
<template v-for="(c, k) in i.imgList">
<view
class="picture"
:key="`cimg-${s}-${k}`"
:id="`cimg-${s}-${k}`"
:data-item="i"
:data-index="k"
data-is-child
>
<image
:src="c.url"
class="item-img"
mode="widthFix"
@load="imgLoad"
v-if="c.visible"
></image>
</view>
</template>
</view>
</template>
</template>
</view>
</template>
<view class="content-end">-已经到底了-</view>
</scroll-view>
</view>
</view>
<view
class="AI-window"
v-if="AIUrl"
>
<view class="AI-title flex">场景二拓</view>
<web-view :src="AIUrl"></web-view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import AudioComponent from './components/AudioComponent.vue'
import { aiUrlMixin, report } from '@/mixin/index.js'
let view_padding_top = 88,
menuHeight = 68
export default {
components: {
AudioComponent
},
mixins: [report, aiUrlMixin],
data () {
return {
detailInfo: [],
currentId: '',
blockTop: '',
menuScrollTop: 0,
topList: [],
itemList: [],
contentId: '',
caseObject: {},
imgLength: 0,
contentScrollNumber: 0,
}
},
onLoad (options) {
this.getMaterialDetail(options)
},
watch: {
currentId (n) {
if (!n) return
const query = uni.createSelectorQuery()
query.select(`#menu-${n}`).boundingClientRect((data) => {
let top = data.top - (view_padding_top + menuHeight) + this.menuScrollTop
this.blockTop = `transform:translateY(${top * 2}rpx);`
}).exec()
}
},
computed: {
},
methods: {
async getMaterialDetail (options) {
try {
uni.showLoading({
mask: true
})
const res = await uni.$api.customerApi.getMaterialDetail({
id: options.id
})
let detailInfo = []
, imgLength = 0
this.caseObject = res
if (options.specialFlag == 1) this.getAiagent({ ...res, directoryName: options.directoryName })
res.richTextInfoList?.map(e => {
let imgList = []
if (e.content) e.content = this.highlightText(e.content)
if (e.pictureList && e.pictureList.length) {
imgLength += e.pictureList.length
e.pictureList.map(i => {
imgList.push({
// visible: false,
visible: true,
url: i
})
})
e.imgList = imgList
}
if (e.level == 1) detailInfo.push({
...e,
children: []
})
})
res.richTextInfoList?.map(e => {
if (e.level == 2) {
let index = detailInfo.findIndex(item => item.id == e.parentId)
if (index > -1) detailInfo[index].children.push(e)
}
})
this.imgLength = imgLength
this.detailInfo = detailInfo
this.$nextTick(() => {
this.initScrollListTop()
// this.observerPicture()
// uni.hideLoading()
})
if (imgLength == 0) uni.hideLoading()
} catch (error) {
uni.hideLoading()
console.log(error)
}
},
observerPicture () {
uni.createIntersectionObserver(this, {
observeAll: true
})
.relativeToViewport({
top: 0,
bottom: 300,
}).observe('.picture', res => {
const {
item,
index,
isChild
} = res.dataset,
currentItem = item.imgList[index]
if (!currentItem?.visible && res.intersectionRatio > 0) {
let parentIndex = this.detailInfo.findIndex(e => e.id == (isChild ? item.parentId : item.id))
if (isChild) {
let childIndex = this.detailInfo[parentIndex].children.findIndex(e => e.id == item.id)
console.log(this.detailInfo[parentIndex].children[childIndex], index)
this.detailInfo[parentIndex].children[childIndex].imgList[index].visible = true
} else this.detailInfo[parentIndex].imgList[index].visible = true
this.initScrollListTop()
this.$forceUpdate()
}
})
},
highlightText (text) {
text = text.replace(/<\/?br\s*\/?>|\n/g, '<br>')
const matches = text.match(/#/g)
if (!matches) return text
const spanCount = matches.length
let lastSpan = spanCount % 2 === 1,
parts = [],
currentIndex = 0
for (let i = 0; i < spanCount; i++) {
const matchIndex = text.indexOf('#', currentIndex)
parts.push(text.substring(currentIndex, matchIndex))
if (i === spanCount - 1 && lastSpan) parts.push('')
else {
if (i % 2 === 0) parts.push('<span style="color:#FF8D1A;font-weight: 500;">')
else parts.push('</span>')
}
currentIndex = matchIndex + 1
}
parts.push(text.substring(currentIndex))
return parts.join('')
},
back () {
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100
})
},
async initScrollListTop () {
let { detailInfo, contentScrollNumber } = this,
topList = [],
itemList = [],
itemHeight = view_padding_top + 30
await detailInfo.map(async e => {
let query = uni.createSelectorQuery()
query.select(`#case-${e.id}`).boundingClientRect(data => {
if (data) {
topList.push(data.top - itemHeight + contentScrollNumber)
e.top = data.top - itemHeight + contentScrollNumber
itemList.push(e)
}
}).exec()
if (e.children) e.children.map(i => {
let c_query = uni.createSelectorQuery()
c_query.select(`#case-${i.id}`).boundingClientRect((data) => {
if (data) {
topList.push(data.top - itemHeight + contentScrollNumber)
i.top = data.top - itemHeight + contentScrollNumber
itemList.push(i)
}
}).exec()
})
})
this.topList = topList
this.itemList = itemList
this.detailInfo = detailInfo
const query = uni.createSelectorQuery()
query.select('.title').boundingClientRect((box) => {
menuHeight = box.height
})
query.select('.case-content').boundingClientRect((box) => {
view_padding_top = box.top
}).exec()
if (!this.currentId) this.currentId = detailInfo[0].id
this.$forceUpdate()
},
isLast (index, ind, children) {
let result = false
if (ind > - 1 && children) result = ind == children.length - 1 && index == this.detailInfo.length - 1
else result = (index == this.detailInfo.length - 1 && !this.detailInfo[index].children.length)
return result ? 'last' : ''
},
isActive (item) {
return item.id == this.currentId ? 'active' : ''
},
menuScroll (e) {
this.menuScrollTop = e.detail.scrollTop
},
contentScroll (e) {
this.contentScrollNumber = e.detail.scrollTop
let { topList, itemList } = this,
targetNum = this.findClosestNotGreaterThan(e.detail.scrollTop, topList)
let item = itemList.find(i => i.top == targetNum)
if (item) this.currentId = item.id
},
findClosestNotGreaterThan (target, arr) {
let closest = arr[0]
for (let i = 0; i < arr.length; i++) {
if (arr[i] <= target) closest = arr[i]
else break
}
return closest
},
menuClick (item) {
this.currentId = item.id
this.contentId = item.id
},
onPlay (item) {
Object.keys(this.$refs).map(key => {
if (`audio-${item.id}` != key) this.$refs[key][0]?.stop()
})
let innerAudioContext = this.$refs[`audio-${item.id}`][0]?.innerAudioContext[`key${item.id}`]
if (innerAudioContext) innerAudioContext.play()
},
imgLoad () {
this.imgLength -= 1
if (this.imgLength == 0) uni.hideLoading()
this.initScrollListTop()
},
}
}
</script>
<style scoped lang="scss">
.case-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: linear-gradient(0deg, #eef3ff 0%, #f3f6ff 100%);
box-sizing: border-box;
padding-top: toRpx(176);
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 9;
text-align: center;
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
line-height: toRpx(96);
.back {
position: absolute;
left: 0;
top: 0;
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
}
.case-content {
height: calc(100vh - #{toRpx(176)});
position: relative;
.left-menu {
position: absolute;
top: 0;
left: 2.7%;
width: 20.4%;
height: toRpx(1296);
border-radius: toRpx(16);
background-color: #fff;
background-image: url('@/assets/images/common/left-menu.webp');
background-size: 100%;
.title {
padding: toRpx(48) toRpx(48) toRpx(32);
font-weight: 500;
font-size: toRpx(36);
color: #333333;
line-height: toRpx(56);
}
.scroll {
height: calc(100% - #{toRpx(184)});
padding-left: toRpx(48);
&-content {
position: relative;
&::after {
content: '';
position: absolute;
left: 0;
top: 0;
width: toRpx(6);
height: 100%;
background: #0000001a;
}
.block {
position: absolute;
top: 0;
left: 0;
width: toRpx(6);
height: toRpx(40);
background-image: linear-gradient(173deg, #75bcff 6%, #2c66f7 100%);
box-shadow: 0 toRpx(8) toRpx(16) 0 #2c66f759;
transition: all 0.15s;
}
}
.item {
padding: 0 toRpx(20) 0 toRpx(30);
.name {
font-size: toRpx(30);
color: #333333b3;
line-height: toRpx(40);
padding-bottom: toRpx(48);
.text {
display: flex;
align-items: center;
position: relative;
}
.icon {
width: toRpx(6);
height: toRpx(6);
border-radius: 100%;
background: #33333399;
margin: 0 toRpx(12);
flex-shrink: 0;
}
}
.active {
font-weight: 500;
color: #333;
position: relative;
.icon {
background: #333;
}
}
&:first-child {
.name {
&:first-child {
padding-top: toRpx(16);
}
}
}
.last {
padding-bottom: toRpx(16);
}
}
}
}
.right-content {
width: 73.4%;
height: 100%;
margin-left: 26.6%;
/deep/.uni-scroll-view-content {
display: flex;
flex-direction: column;
}
.detail-item {
padding-right: toRpx(64);
.item-title {
font-weight: 500;
font-size: toRpx(40);
color: #333333;
line-height: toRpx(56);
margin-bottom: toRpx(24);
}
.sub-item-title {
font-size: toRpx(32);
line-height: toRpx(48);
&::before {
content: '';
width: toRpx(8);
height: toRpx(8);
border-radius: 100%;
background: #333;
margin: 0 toRpx(16);
flex-shrink: 0;
}
}
.item-content {
color: #333333e6;
font-size: toRpx(28);
line-height: toRpx(44);
margin-bottom: toRpx(24);
word-wrap: break-word;
}
.picture {
width: 78.9%;
margin: 0 auto toRpx(24);
min-height: toRpx(100);
}
.item-img {
display: block;
width: 100%;
}
}
.content-end {
width: 100%;
text-align: center;
color: #999;
text-align: center;
padding: toRpx(24) toRpx(64) toRpx(24) 0;
font-size: toRpx(24);
margin-top: auto;
}
}
}
.has-ai {
width: 71.36% !important;
}
}
.AI-window {
width: 28.3vw;
height: 90.63vh;
position: fixed;
top: 9.37vh;
right: 0;
background: #f5f9ff;
.AI-title {
height: 5.73vh;
padding-top: 2.08vh;
font-size: toRpx(34);
font-weight: 500;
justify-content: center;
color: #333333;
}
}
</style>
<template>
<view class="audio-box flex">
<view
:class="['sprite-icon',`${paused? 'icon-play' : 'icon-pause'}`]"
@click="play"
></view>
<slider
@change="sliderChange"
backgroundColor="#D8D8D8"
block-color="#2C66F7"
block-size="5"
class="progress-box"
:max="innerAudioContext[audioKey].duration||10"
:value="innerAudioContext[audioKey].currentTime||0"
/>
<view class="duration">{{currentTime}}/{{duration}}</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'AudioComponent',
props: {
src: String,
auto: Boolean,
audioKey: String
},
data () {
return {
innerAudioContext: {},
currentTime: '00:00',
duration: '00:00',
paused: true,
progress: ''
}
},
watch: {
src: {
immediate: true,
handler (newval) {
if (newval) this.init(newval)
}
},
},
computed: {
},
destroyed () {
this.innerAudioContext[this.audioKey].destroy()
},
mounted () {
},
methods: {
init (src) {
const innerAudioContext = uni.createInnerAudioContext(),
{ audioKey } = this
innerAudioContext.src = src
innerAudioContext.sessionCategory = 'soloAmbient'
innerAudioContext.onCanplay(this.onCanplay)
innerAudioContext.onPlay(() => this.paused = false)
innerAudioContext.onPause(() => this.paused = true)
innerAudioContext.onTimeUpdate(this.onTimeUpdate)
this.innerAudioContext[audioKey] = innerAudioContext
},
onCanplay () {
this.duration = this.formatTime(this.innerAudioContext[this.audioKey].duration)
},
onTimeUpdate () {
const {
duration,
currentTime
} = this.innerAudioContext[this.audioKey],
mergedOffset = Math.ceil(currentTime)
this.progress = mergedOffset / duration * 100
this.currentTime = this.formatTime(currentTime)
},
formatTime (num) {
num = Math.floor(num);
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return `${minutes}:${seconds}`
},
play () {
if (this.paused) {
if (this.auto) this.innerAudioContext[this.audioKey].play()
this.$emit('onPlay')
}
else this.innerAudioContext[this.audioKey].pause()
},
stop () {
this.currentTime = '00:00'
this.innerAudioContext[this.audioKey].stop()
},
seek (e) {
let query = uni.createSelectorQuery()
query.select('.progress-box').boundingClientRect(data => {
const seconds = (e.changedTouches[0].clientX - data.left) / data.width * this.innerAudioContext[this.audioKey].duration
this.innerAudioContext[this.audioKey].seek(seconds)
}).exec()
},
sliderChange (e) {
this.innerAudioContext[this.audioKey].seek(e.detail.value)
}
}
}
</script>
<style scoped lang='scss'>
.audio-box {
width: toRpx(1120);
height: toRpx(80);
background-image: url('@/assets/images/common/audio-bg.webp');
background-size: 100%;
margin-bottom: toRpx(24);
box-sizing: border-box;
padding: 0 toRpx(32);
font-size: toRpx(28);
color: #333333;
.sprite-icon {
margin-right: toRpx(16);
}
.progress-box {
width: toRpx(796);
margin: 0 !important;
/deep/.uni-slider-track {
background-image: linear-gradient(90deg, #2c66f7 0%, #75bcff 100%);
}
/deep/.uni-slider-thumb {
&::after {
width: toRpx(14);
height: toRpx(14);
border: toRpx(2) solid #f4f4f4;
content: '';
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
border-radius: 100%;
box-sizing: border-box;
}
}
}
.duration {
margin-left: auto;
flex-shrink: 0;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="list-not">
<image
src="@/assets/images/login/nothing.webp"
class="list-not-img"
/>
暂无内容
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'NoData',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.list-not {
font-size: toRpx(28);
color: #999999;
margin: auto;
text-align: center;
&-img {
width: toRpx(676);
height: toRpx(284);
margin: toRpx(192) auto toRpx(24);
display: block;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<MessageBox
ref="packageVisible"
position="bottom"
:isFooter="false"
title="请选择适用套餐"
:maxHeight="1000"
@close="$emit('close')"
>
<view class="search-box">
<view class="search-input">
<template v-if="!edit">
<view
:class="['input', `${searchValue ? '' : 'placeholder'}`]"
@click="openInput"
>
<template v-if="searchValue">
{{searchValue}}
</template>
<template v-else>
请输入关键字搜索
<view class="sprite-icon icon-search"></view>
</template>
</view>
</template>
<template v-else>
<input
type="text"
class="input"
v-model="searchValue"
:focus='inputFocus'
confirm-type="search"
@confirm="search"
/>
</template>
</view>
<template v-if="searchValue">
<view
class="clear"
@click="clear"
>
<uni-icons
type="closeempty"
:size="16"
color="#1A1A1A"
></uni-icons>
</view>
</template>
</view>
<view class="select-box">
<view
class="select-item"
:class="{ checked: salesUuid == item.uuid }"
@click="handleSelect(item)"
v-for="(item, index) in employeeList"
:key="index"
>
{{ item.staffName }}
</view>
</view>
</MessageBox>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Employee',
props: {
},
data () {
return {
searchValue: '',
edit: false,
}
},
watch: {
watchStatus: {
immediate: true,
handler (newval) {
this.close()
}
},
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
salesUuid () {
return this.$store.state.user.customerInfo.salesUuid
},
employeeList () {
return this.$store.state.user.employeeList
}
},
mounted () {
},
methods: {
search () {
this.edit = false
console.log(this.searchValue)
},
openInput () {
this.edit = true
this.inputFocus = true
},
open () {
this.$refs.packageVisible.open()
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo;
/**获取销售人员 */
uni.$api.commonApi
.getEmployeeList({
merchantId: shopMerchantId,
})
.then((res) => {
this.$store.dispatch("setEmployeeList", res);
uni.$storage.set("employeeList", res || []);
})
},
handleSelect (item) {
this.close();
this.$emit('select', item)
},
close () {
this.$emit('close')
this.$refs?.packageVisible?.close()
},
clear () {
this.searchValue = ''
this.search()
}
}
}
</script>
<style scoped lang='scss'>
.search-box {
margin: toRpx(32) 0;
position: relative;
z-index: 2;
.search-input {
width: 100%;
height: toRpx(80);
background: #ffffff;
border: toRpx(3) solid #a8c1ff;
border-radius: toRpx(16);
box-sizing: border-box;
color: #333;
padding: 0 toRpx(24);
font-size: toRpx(28);
position: relative;
.input {
display: flex;
align-items: center;
height: 100%;
width: 100%;
justify-content: center;
text-align: center;
font-size: toRpx(28);
}
.icon-search {
margin-left: toRpx(16);
}
.placeholder {
font-size: toRpx(28);
color: #999999;
}
}
.clear {
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
padding: 0 toRpx(32);
height: 100%;
display: flex;
align-items: center;
}
}
.select-box {
margin: toRpx(32) 0;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: toRpx(32);
overflow-y: scroll;
max-height: 50vh;
padding-bottom: toRpx(60);
.select-item {
text-align: center;
height: toRpx(68);
line-height: toRpx(68);
opacity: 1;
border: toRpx(2) solid #dce0e6;
color: #292d33;
font-size: toRpx(28);
border-radius: toRpx(8);
&.checked {
border: toRpx(2) solid #292d33;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view
class="detail-box"
@click="closeToolTip"
>
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
车主详情
</view>
<view class="customer-box box">
<view class="title">车主信息</view>
<view class="customer-info">
<template v-for="(item, index) in customerForm">
<view
class="item flex"
:key="index"
>
<view class="label">{{ item.label }}</view>
<view
class="value text-hide"
:id="item.key"
>
{{ customerInfo[item.key] }}
</view>
<template v-if="item.showTooltipIcon">
<view
class="sprite-icon icon-customer-detail"
@click.stop="showTooltipBox(item)"
></view>
<view
class="tooltip-box"
v-if="item.showTooltip"
@click.stop
> {{ customerInfo[item.key] }}</view>
</template>
</view>
</template>
</view>
</view>
<view class="case-box box">
<view class="title flex">推荐套餐</view>
<scroll-view
class="case-scroll-box"
scroll-y
@scrolltolower="pageonReachBottom"
>
<view class="case-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="case-item"
:key="item.id"
>
<case-item
:item="item"
:visitsId="visitsId"
/>
</view>
</template>
</template>
</template>
<template v-else>
<view class="nothing flex">
<view class="icon"></view>
暂无推荐套餐
</view>
</template>
</template>
<template v-if="nothing">
<view class="end-text">-已经到底了-</view>
</template>
</view>
</scroll-view>
</view>
<!-- <package-popup
ref="packageVisible"
@select="handleSearch"
@close="arrowPopup = false"
></package-popup> -->
</view>
</template>
<script type="text/ecmascript-6">
import dayjs from 'dayjs'
import PackagePopup from './components/PackagePopup.vue'
import CaseItem from '@/components/HomeFrame/components/ReceptionCenter/CaseItem.vue'
export default {
components: {
PackagePopup,
CaseItem
},
data () {
return {
customerForm: [{
label: '车主姓名',
key: 'ownerName',
},
{
label: '车主电话',
key: 'ownerPhone',
},
{
label: '品牌车型',
key: 'brandModel',
},
{
label: '接待场景',
key: 'receptionSceneName',
},
{
label: '到店日期',
key: 'arrivalDate',
},
{
label: '客户标签',
key: 'customerTagName',
hasTooltip: true
}],
caseInfo: [
{
label: '业务场景',
class: 'text-hide',
format: (val) => {
// 业务场景:0-会员权益/升级;1-精品升级;2-次新车转化;3-售后众筹;4-积分商城
return val ? {
0: '会员权益/升级',
1: '精品升级',
2: '次新车转化',
3: '售后众筹',
4: '积分商城'
}[val.scene] : '--'
}
},
{
label: '客户标签',
key: 'tags',
class: 'text-hide'
},
{
label: '适用套餐',
key: 'goods',
class: 'text-two-line'
},
],
customerInfo: {},
arrowPopup: false,
nothing: true,
list: [],
currentPage: 1,
total: 0,
flag: false,
nothing: false,
pageSize: 8
}
},
onLoad (options) {
if (options.id) {
this.findVisitsInfo(options.id)
this.visitsId = options.id
}
else {
uni.showToast({
title: '客户id为空',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 200
})
}, 1e3)
}
},
mounted () {
},
methods: {
async findVisitsInfo (id) {
const customerInfo = await uni.$api.customerApi.findVisitsInfo({
id
}),
{ customerForm } = this
customerInfo.customerTagName = customerInfo.customerTagName.replace(/,/g, '|')
customerInfo.arrivalDate = dayjs(customerInfo.arrivalDate).format("YYYY.MM.DD")
this.customerInfo = customerInfo
this.getMaterialResponsePage()
this.$nextTick(() => {
this.checkTextWidth(customerForm.find(e => e.hasTooltip))
})
},
showPopup () {
this.arrowPopup = true
this.$refs.packageVisible.open()
},
async getMaterialResponsePage () {
try {
uni.showLoading({
mask: true
})
let { shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
{ customerInfo: { receptionScene, customerTag }, pageSize, currentPage } = this,
customerLabelList = []
customerTag.split(',')?.map(e => customerLabelList.push({
labelId: e
}))
let params = {
currentPage,
pageSize,
receptionScene,
status: 1,
receptionSceneInfoList: [
{ receptionSceneId: receptionScene }
],
customerLabelList,
merchantId: shopMerchantId,
showChannel: 2,
scene: sceneType
}
const { list, total } = await uni.$api.customerApi.getMaterialResponsePage(params)
uni.hideLoading()
list.map(e => {
let tags = [],
goods = []
e.customerLabelInfoList?.map(item => {
tags.push(item.labelName)
})
e.productPackageInfoList?.map(item => {
goods.push(item.upgradeGoodsName)
})
e.tags = tags.join('、')
e.goods = goods.join('、')
})
this.list[currentPage - 1] = list
this.flag = true
this.total = total
this.$forceUpdate()
} catch (error) {
uni.hideLoading()
this.flag = true
}
},
back () {
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100
})
},
pageonReachBottom () {
let { currentPage, total, nothing, pageSize } = this
if (!nothing) nothing = 'nothing'
if (Math.ceil(total / pageSize) > currentPage) {
this.currentPage += 1
this.getMaterialResponsePage()
} else this.nothing = true
},
checkTextWidth (item) {
if (!item) return
let query = uni.createSelectorQuery().in(this)
query.select(`#${item.key}`).boundingClientRect((data) => {
if (data.width > 410) item.showTooltipIcon = true
this.$forceUpdate()
}).exec()
},
showTooltipBox (item) {
item.showTooltip = !item.showTooltip
this.$forceUpdate()
},
closeToolTip () {
let item = this.customerForm.find(e => e.hasTooltip)
if (item.showTooltipIcon) {
item.showTooltip = false
this.$forceUpdate()
}
}
}
}
</script>
<style scoped lang="scss">
.detail-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding-top: toRpx(160);
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 9;
text-align: center;
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
line-height: toRpx(96);
.back {
position: absolute;
left: 0;
top: 0;
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
}
.box {
width: toRpx(2218);
background: #ffffff59;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border-radius: toRpx(48);
backdrop-filter: blur(toRpx(8));
margin: 0 auto;
box-sizing: border-box;
.title {
font-weight: 500;
font-size: toRpx(32);
color: #333333;
line-height: toRpx(44);
padding: toRpx(32) toRpx(48) toRpx(28);
.search-btn {
margin-left: auto;
position: relative;
&::after {
content: '';
display: block;
border: toRpx(16) solid transparent;
border-left-width: toRpx(12);
border-right-width: toRpx(12);
border-top-color: #000000e6;
position: relative;
top: toRpx(8);
margin-left: toRpx(20);
transition: all 0.15s;
}
}
.arrow-popup {
&::after {
transform: rotate(180deg);
top: toMinusRpx(8);
}
}
}
}
.customer-box {
height: toRpx(292);
margin-bottom: toRpx(32);
position: relative;
z-index: 2;
.customer-info {
display: flex;
flex-wrap: wrap;
padding: 0 toRpx(48);
gap: toRpx(12) toRpx(38);
.item {
width: toRpx(1042);
flex-shrink: 0;
font-size: toRpx(28);
line-height: toRpx(44);
position: relative;
.label {
color: #292d3399;
width: toRpx(160);
flex-shrink: 0;
}
.value {
color: #292d33;
}
.icon-customer-detail {
flex-shrink: 0;
margin-left: toRpx(16);
}
.tooltip-box {
position: absolute;
right: 0;
top: toRpx(60);
width: toRpx(792);
background: #ffffffcc;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border-radius: toRpx(16);
backdrop-filter: blur(toRpx(8));
box-sizing: border-box;
padding: toRpx(24) toRpx(28);
font-size: toRpx(28);
color: #292d33;
line-height: toRpx(44);
max-height: 50vh;
overflow-y: scroll;
word-break: break-all;
}
}
}
}
.case-box {
height: toRpx(1020);
padding: 0 !important;
.case-scroll-box {
height: calc(100% - #{toRpx(104)});
}
.case-list {
display: flex;
flex-wrap: wrap;
gap: toRpx(32) toRpx(46);
padding: 0 toRpx(48);
.case-item {
width: toRpx(496);
height: toRpx(588);
}
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(112);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(676);
height: toRpx(284);
margin-bottom: toRpx(24);
background-image: url('@/assets/images/home/nothing.webp');
background-size: 100% 100%;
}
}
.end-text {
width: 100%;
text-align: center;
color: #999;
text-align: center;
padding: toRpx(50) 0;
font-size: toRpx(24);
}
</style>
<template>
<view class="detail-box">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">话术违规预警</view>
</view>
<view class="weekly-tips">
<scroll-view scroll-y class="outstanding-tip-list">
<view class="outstanding-tip-item">
<view class="tip-header">
<view class="tip-time">{{ warningInfo.time }}</view>
<view class="tip-tags">{{ warningInfo.warningTag }}</view>
</view>
<view class="tip-content warning-content">{{ warningInfo.warningContent }}
<view class="tips">你在以上的接待记录中,存在过度承诺现象,这极易引发客户纠纷,损害公司信誉。请严格依据公司政策与产品实际情况介绍,切勿做出无法兑现的承诺。因本次违规已扣除本月行为类-行为异常积分,后续将加强监管,违规者将严肃处理。
当购车者车辆出现问题,依据商家“任何小毛病都免费修”的承诺前往维修,却发现不在质保范围内需自费维修时,会产生经济上的落差与困扰。这不仅增加维修成本,还可能因与商家的售后纠纷,耗费大量时间与精力去沟通协调。</view>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
export default {
name: 'EarlyWarnDetail',
data() {
return {
warningInfo: {}
}
},
onLoad(options) {
const { row } = options
const _row = JSON.parse(row)
this.warningInfo = _row
this.updateStatus()
},
methods: {
// 返回
back() {
uni.$emit('pageList', this.warningInfo.id);
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100
})
},
async updateStatus() {
const idList = [this.warningInfo.id]
const res = await uni.$api.commonApi.updateMessageStatus({
idList
})
}
}
}
</script>
<style scoped lang="scss">
.detail-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding-top: toRpx(160);
}
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
}
.weekly-tips {
position: relative;
margin: 0 toRpx(64) toRpx(80);
background-color: rgba(255, 255, 255, 0.35);
border: toRpx(4) solid #fff;
border-radius: toRpx(16);
height: calc(100% - #{toRpx(80)});
.outstanding-tip-list {
height: 100%;
background-color: #fff;
border-radius: toRpx(16);
padding: toRpx(24) 0;
}
.outstanding-tip-item {
width: 100%;
padding: 0 toRpx(32);
border-radius: toRpx(16);
background-color: #fff;
height: 100%;
.tip-header {
display: flex;
align-items: center;
.tip-rank {
color: #333;
font-size: toRpx(32);
font-weight: 500;
line-height: toRpx(44);
margin-right: toRpx(24);
}
.tip-time {
color: rgba(102, 102, 102, 0.6);
font-size: toRpx(28);
line-height: toRpx(44);
}
.tip-tags {
border-radius: toRpx(4);
background: rgba(255, 157, 10, 0.1);
padding: toRpx(8) toRpx(24);
color: #ff9d0a;
font-size: toRpx(24);
font-weight: 500;
margin-left: toRpx(24);
}
}
.tip-content {
padding: toRpx(17) 0;
color: #333;
font-size: toRpx(28);
line-height: toRpx(48);
&.warning-content {
white-space: pre-line;
}
.tips {
color: #666;
margin-top: toRpx(16);
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="popup-box" v-if="popupShow">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#fff"></uni-icons>
</view>
<view class="title">{{ title }}</view>
</view>
<view class="popup-body">
<video ref="videoPlayer" :src="detailUrl" controls v-if="sourceType == 2"></video>
<view class="img-detail" v-else>
<image @click="back" :src="detailUrl" mode="heightFix" />
</view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import systemTrack from "@/mixin/systemTrack.js";
export default {
props: {
isComponents: Boolean,
show: Boolean,
mediaObject: Object
},
data () {
return {
width: 0,
title: '',
sourceType: '',
detailUrl: ''
}
},
watch:{
show:{
immediate: true,
handler (n) {
if (n) {
console.log(this.mediaObject)
this.init(this.mediaObject)
}
}
}
},
computed: {
popupShow () {
let status = true
if (this.isComponents) status = this.show
return status
},
},
mixins: [systemTrack],
onLoad (options) {
this.init(options)
},
methods: {
init (options) {
console.log(11, options)
const { tabName, sourceType, detailUrl } = options
this.title = tabName
this.sourceType = sourceType
this.detailUrl = detailUrl
// const _this = this
// uni.getImageInfo({
// src: detailUrl, // 替换为你的图片路径
// success (img) {
// uni.createSelectorQuery().select('.img-detail').boundingClientRect(function (rect) {
// _this.width = rect.height * img.height / img.width
// }).exec();
// },
// fail: function (error) {
// console.error('获取图片信息失败:', error);
// }
// });
},
back () {
if (this.isComponents) this.$emit('previewBack')
else uni.navigateBack()
},
}
}
</script>
<style scoped lang="scss">
.popup-box {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: #000;
padding: toRpx(60) 0;
z-index: 999;
.nav-bar {
width: 100%;
height: toRpx(96);
margin-bottom: toRpx(50);
display: flex;
align-items: center;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
.title {
color: #fff;
flex: 1;
font-size: toRpx(32);
font-weight: 700;
text-align: center;
}
}
.popup-body {
width: 100%;
height: calc(100% - #{toRpx(200)});
video {
width: 100%;
height: 100%;
}
.img-detail {
height: 100%;
text-align: center;
image {
height: calc(100% - #{toRpx(200)});
width: auto;
}
}
}
}
</style>
<template>
<view class="material-detail">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
{{ title }}
</view>
<!-- <web-view :src="url"></web-view> -->
<view :class="['file-box',{'has-ai':AIUrl}]">
<lk-preview-office :url="url"></lk-preview-office>
</view>
<view
class="AI-window"
v-if="AIUrl"
>
<view class="AI-title flex">场景二拓</view>
<web-view :src="AIUrl"></web-view>
</view>
</view>
</template>
<script type="text/ecmascript-6">
import { report } from '@/mixin/index.js'
export default {
name: '',
mixins: [report],
data () {
return {
url: '',
viewerUrl: Object.freeze('/hybrid/html/web/viewer.html'),
AIUrl: '',
title: ''
}
},
onLoad (options) {
console.log(options)
// if (options.fileUrl) this.url = `https://view.officeapps.live.com/op/view.aspx?src=${options.fileUrl}`
if (options.fileUrl) this.url = `${options.fileUrl}`
// if (options.fileUrl) this.url = `${this.viewerUrl}?file=${options.fileUrl}`
else this.url = options.url
if (options.title) this.title = options.title
if (options.specialFlag == 1) this.getAiagent(options)
// else this.setWv()
},
mounted () {
},
methods: {
back () {
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100
})
},
async getAiagent (options, agentCode = 'AI6') {
const { phone } = uni.$storage.get('userInfo'),
[data] = await uni.$api.sceneMarketApi.getAiagent({
ownerShipType: 1,
accountPhone: phone,
agentCode
})
if (data) {
const { sceneType, uuid, phone, channelType = 1 } = uni.$storage.get('userInfo'),
bussinessType = sceneType == 0 ? 1 : 2,// sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
brand = {
1: '问界',
2: '比亚迪',
3: '其他'
}[channelType]
let title = options.directoryName
if (options.title) title += `-${options.title}`
let { agentUrl, domainName } = data,
url = `${agentUrl}?no_header=1&business_type=${bussinessType}&phone=${phone}&brand=${brand}&one_id=${uuid}&platformType=1&domain=${domainName}&presuppositionProblem=${title}`
if (options.id) url += `&enter_id=${options.id}`
this.AIUrl = url
this.setWebviewStyle()
} else uni.showToast({
title: '获取智能体失败',
icon: 'error'
})
},
setWebviewStyle () {
const setWebviewStyleWithRetry = () => {
const currentWebview = this.$scope.$getAppWebview()
let [wv] = currentWebview.children(),
wvFlag = false
if (wv) {
wv.setStyle({
left: '71.9%',
top: '17.18%',
height: '82.82%',
width: '28.3%'
})
wvFlag = true;
}
return wvFlag
}
const retrySetWebviewStyle = () => {
if (!setWebviewStyleWithRetry()) {
// 如果未成功,继续重试
setTimeout(retrySetWebviewStyle, 50);
} else {
// 成功设置样式,结束循环
console.log('Webview样式设置成功');
}
};
setTimeout(retrySetWebviewStyle, 100);
}
}
}
</script>
<style scoped lang="scss">
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 9;
text-align: center;
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
line-height: toRpx(96);
.back {
position: absolute;
left: 0;
top: 0;
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
}
.file-box {
position: fixed;
top: 5.2vh;
height: 94.8vh;
left: 0;
width: 100vw;
}
.has-ai{
width: 71.36vw;
}
.AI-window {
width: 28.3vw;
height: 90.63vh;
position: fixed;
top: 9.37vh;
right: 0;
background: #f5f9ff;
.AI-title {
height: 5.73vh;
padding-top: 2.08vh;
font-size: toRpx(34);
font-weight: 500;
justify-content: center;
color: #333333;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="detail-box">
<view class="nav-bar">
<view v-if="messageInfo.status == 1" class="back" @click="backArrow">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">优秀话术-{{ messageInfo.sceneLabelName }}</view>
</view>
<view class="weekly-tips">
<view :class="['outstanding-tip-item', messageInfo.status == 1 ? 'single' : 'read']">
<view class="tip-header">
<!-- <view class="tip-rank">优秀话术-{{ messageInfo.className }}</view> -->
<view class="tip-time">{{ messageInfo.time }}</view>
<view v-if="messageInfo.excellentLabelName" class="tip-tags">{{ messageInfo.excellentLabelName }}</view>
</view>
<view class="tip-content">
{{ messageInfo.polishContent }}
</view>
</view>
<view class="detail-footer">
<template v-if="messageInfo.status == 0">
<view class="tips">以上内容请认真阅读,至少读完{{ countTime }}分钟,如未按照要求阅读完内容,今日无法使用pad接待</view>
<view :class="['btn', !countFlag ? '' : 'blue']" @click="handleCompleted">已完成阅读 {{ !countFlag ?
`${countdown}s` :
'' }}</view>
</template>
<template v-if="pageType == 'service' && messageInfo.status == 1">
<view class="btn blue more-script" @click="handleMoreScript">更多话术</view>
</template>
</view>
</view>
</view>
</template>
<script>
let timer = null
let countTimer = 1
import dayjs from 'dayjs'
export default {
name: 'MessageDetail',
data() {
return {
recordDetailList: [],
classCountList: [],
countdown: 5,
countFlag: false,
messageInfo: {},
tagIndex: '',
enterTime: '',
isProcessing: false,
MOCKDATA: {},
countTime: 0,
pageType: ''
}
},
computed: {
onlyOneLength() {
return this.recordDetailList.length == 1
},
},
created() {
// 获取mock配置的时间
this.MOCKDATA = uni.$storage.get('mock_data')
this.countTime = this.MOCKDATA.timer || countTimer
// this.countTime = 0.1
this.countdown = this.countTime * 60 - 1
},
onLoad(options) {
console.log(options)
const { row } = options
// 开始倒计时
this.startCountdown()
// 进入埋点的时间
this.enterTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
this.messageInfo = JSON.parse(row)
this.pageType = options.type
},
beforeDestroy() {
if (timer) {
clearInterval(timer);
}
},
// inject: ['showPage'],
methods: {
async backArrow() {
const idList = [this.messageInfo.scriptId]
// 埋点
await uni.$api.commonApi.extractExcellent({
scriptIdList: idList,
startTime: this.enterTime,
endTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
})
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100
})
},
// 返回
// back(idList = null) {
// console.log(idList)
// // this.showPage(name, obj)
// // if (idList) uni.$emit('pageList', idList[0]);
// uni.navigateBack({
// delta: 1,
// animationType: 'pop-out',
// animationDuration: 100
// })
// },
async backPage(scriptId = null, ids = null) {
let idList = scriptId
if (!idList) {
idList = [this.messageInfo.scriptId];
}
// 埋点
await uni.$api.commonApi.extractExcellent({
scriptIdList: idList,
startTime: this.enterTime,
endTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
})
// if (ids) {
// this.back(ids)
// } else {
uni.redirectTo({
url: '/pages/common/messageList'
});
// }
// if (type == 'read') this.$emit("backHome")
// else if (type == 'view') this.back('MessageList', {firstIndex: 1})
// this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex})
},
// 开始倒计时
startCountdown() {
timer = setInterval(() => {
if (this.countdown > 0) {
this.countdown--;
} else {
this.countFlag = true
clearInterval(timer);
}
}, 1000);
},
// 点击已完成按钮
async handleCompleted() {
if (this.isProcessing) return;
console.log(this.countFlag)
let scriptId = null
if (this.countFlag) {
let idList
idList = [this.messageInfo.id];
scriptId = [this.messageInfo.scriptId]
try {
this.isProcessing = true;
// 接口调用
const res = await uni.$api.commonApi.updateMessageStatus({
idList
})
} catch (error) {
// this.backPage(scriptId, idList)
console.error('更新消息状态时出现错误:', error)
} finally {
this.isProcessing = false; // 处理完成,将标志位设为 false
this.backPage(scriptId)
}
}
},
handleMoreScript() {
uni.redirectTo({
url: '/pages/common/messageList?type=more',
fail: (err) => {
console.error('页面跳转失败:', err);
}
});
}
}
}
</script>
<style scoped lang="scss">
.detail-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding-top: toRpx(160);
}
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
}
.weekly-tips {
position: relative;
margin: 0 toRpx(64) toRpx(80);
background-color: rgba(255, 255, 255, 0.35);
border: toRpx(4) solid #fff;
border-radius: toRpx(48);
height: calc(100% - #{toRpx(80)});
padding-top: toRpx(40);
.tips-title {
display: flex;
font-size: toRpx(36);
font-weight: 500;
padding: 0 toRpx(64) toRpx(40);
.tips-tags {
display: flex;
color: #4673FF;
.tags-separator {
margin: 0 toRpx(10);
}
}
}
.outstanding-tip-list {
height: calc(100% - #{toRpx(348)});
}
.outstanding-tip-item {
width: calc(100% - #{toRpx(128)});
padding: toRpx(24) toRpx(32);
border-radius: toRpx(16);
background-color: #fff;
margin: 0 toRpx(64) toRpx(40);
&.long {
height: 100%;
}
&.single {
height: calc(100% - #{toRpx(40)});
}
&.read {
height: calc(100% - #{toRpx(216)});
}
.tip-header {
display: flex;
align-items: center;
.tip-rank {
color: #333;
font-size: toRpx(32);
font-weight: 500;
line-height: toRpx(44);
margin-right: toRpx(24);
}
.tip-time {
color: rgba(102, 102, 102, 0.6);
font-size: toRpx(28);
line-height: toRpx(44);
}
.tip-tags {
border-radius: toRpx(4);
background: rgba(255, 157, 10, 0.1);
padding: toRpx(8) toRpx(24);
color: #ff9d0a;
font-size: toRpx(24);
font-weight: 500;
margin-left: toRpx(24);
}
}
.tip-content {
margin-top: toRpx(17);
color: #666;
font-size: toRpx(28);
line-height: toRpx(48);
}
}
.detail-footer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: absolute;
bottom: toRpx(32);
left: 50%;
transform: translateX(-50%);
width: 100%;
}
.tips {
color: #ff9d0a;
font-size: toRpx(32);
margin-bottom: toRpx(32);
}
.btn {
width: toRpx(720);
height: toRpx(80);
border-radius: toRpx(48);
opacity: 0.4;
border: toRpx(2) solid #979797;
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
color: #fff;
font-size: toRpx(32);
line-height: toRpx(80);
text-align: center;
opacity: 0.4;
&.blue {
opacity: 1;
}
}
.more-script {
margin-bottom: toRpx(48);
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="message-box">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">优秀话术</view>
</view>
<view class="message-body">
<view class="data-container">
<view class="tag-box">
<view :class="['tag-item', i.classCode == tagIndex ? 'active' : '']" v-for="i in tagList" :key="i.className"
@click="selectTag(i)">{{ i.className }}</view>
</view>
<scroll-view scroll-y ref="scrollViewRef" :class="['message-list', getScrollHeight]"
@scrolltolower="pageonReachBottom" :scroll-top="scrollTop">
<template v-if="messageList.length">
<view class="message-item" v-for="item in messageList" :key="item.id" @click="openDetail(item)">
<view class="message-header">
<view :class="['dot', item.status == 1 ? '' : 'red']"></view>
<view class="message-type">优秀话术-{{ item.sceneLabelName }}</view>
<view class="message-time">{{ item.time }}</view>
<view v-if="item.excellentLabelName" class="message-tag">{{ item.excellentLabelName }}</view>
</view>
<view class="message-content">{{ item.polishContent }}</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../assets/images/home/nothing.webp" />
暂无数据
</view>
</template>
<template v-if="nothing">
<view class="end-text">-已经到底了-</view>
</template>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
const PAGE_SIZE = 10
const PAGE_NUM = 1
import dayjs from 'dayjs'
export default {
data() {
return {
messageList: [],
nothing: false,
total: 0,
pageNum: PAGE_NUM,
pageSize: PAGE_SIZE,
tagList: [],
tagIndex: '',
scrollTop: 0,
type: ''
}
},
computed: {
getScrollHeight() {
return this.messageList.length > 0 ? 'scroll-list' : ''
}
},
created() {
// uni.$on('pageList', (data) => {
// console.log('接收到上一个页面返回的数据:', data);
// // 可以在这里添加处理数据的逻辑
// if (data) {
// const message = this.getList.find(item => item.id == data)
// if (message) message.status = 1
// }
// });
this.init()
},
onLoad(options) {
console.log(options)
if (options.type) this.type = options.type
// this.init()
},
methods: {
init() {
this.getMessagePage();
this.getLabelList();
},
// 跳转详情
openDetail(row) {
uni.navigateTo({
url: `/pages/common/messageDetail?row=${encodeURIComponent(JSON.stringify(row))}&type=view`,
fail: (err) => {
console.error('页面跳转失败:', err);
}
});
},
back() {
let pageNum = 2
if (this.type == 'read') {
pageNum = 1
}
uni.$emit('pageBack')
uni.navigateBack({
delta: pageNum,
animationType: 'pop-out',
animationDuration: 100
})
},
// 选择标签
selectTag(item) {
this.tagIndex = item.classCode
this.scrollTop = 1
this.total = 0
this.pageNum = PAGE_NUM
this.pageSize = PAGE_SIZE
this.nothing = false
setTimeout(() => {
this.scrollTop = 0
}, 100);
this.getMessagePage()
},
/** 接口定义 */
// 客户标签
async getLabelList() {
const res = await uni.$api.commonApi.getClassConfig()
const _all = [{
className: '全部',
classCode: ''
}]
this.tagList = _all.concat(res)
},
// 获取优秀话术分页列表
async getMessagePage() {
try {
uni.showLoading({
mask: true
})
const { sceneType, uuid } = uni.$storage.get("userInfo")
const { tagIndex, pageNum, pageSize } = this
let businessTypeList = []
if (sceneType == 0) {
businessTypeList = [0, 2]
} else if (sceneType == 1) {
businessTypeList = [1]
}
const params = {
// businessType: sceneType,
businessTypeList,
uuid,
classCode: tagIndex,
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getPageRecord(params)
res.list?.length && res.list.map(e => {
e.time = dayjs(new Date(e.pushTime)).format("YYYY-MM-DD HH:mm:ss")
})
if (pageNum == 1) {
this.messageList = res.list
} else {
this.messageList = this.messageList.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
/**
* 页面触底时的处理函数
* 当页面触底时,判断是否还有更多数据,如果有则加载下一页数据
* 如果没有更多数据,则标记为没有更多数据状态
*/
pageonReachBottom() {
console.log('到底了');
// 解构赋值,设置 nothing 的默认值
let { pageNum, total, nothing = 'nothing', pageSize } = this;
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1;
this.getMessagePage();
} else {
this.nothing = true;
}
}
}
}
</script>
<style scoped lang="scss">
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
}
.message-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding-top: toRpx(160);
.message-body {
position: relative;
margin: 0 toRpx(64) toRpx(80);
background-color: rgba(255, 255, 255, 0.35);
border-radius: toRpx(48);
.data-container {
background: #ffffff;
border-radius: toRpx(48);
height: calc(100vh - #{toRpx(244)});
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border: toRpx(2) solid #fff;
box-sizing: border-box;
position: relative;
overflow: hidden;
padding: toRpx(24) 0;
}
.message-list {
position: relative;
background-color: #fff;
border-radius: 0 0 toRpx(48) toRpx(48);
&.scroll-list {
height: calc(100% - #{toRpx(120)});
}
.message-item {
border-radius: toRpx(16);
box-shadow: 0 4px 12px 0 #2c66f71a;
margin: 0 toRpx(64) toRpx(40);
padding: toRpx(24) toRpx(32);
box-sizing: border-box;
&:first-child {
margin-top: toRpx(10);
}
.message-header {
display: flex;
align-items: center;
.dot {
width: toRpx(12);
height: toRpx(12);
border-radius: 50%;
background-color: #999;
margin-right: toRpx(24);
&.red {
background-color: #F24724;
}
}
.message-type {
color: #333;
font-size: toRpx(32);
font-weight: 500;
line-height: toRpx(44);
margin-right: toRpx(24);
}
.message-time {
color: rgba(102, 102, 102, 0.6);
font-size: toRpx(28);
}
.message-tag {
border-radius: toRpx(4);
background: rgba(255, 157, 10, 0.1);
padding: toRpx(8) toRpx(24);
color: #ff9d0a;
font-size: toRpx(24);
font-weight: 500;
margin-left: toRpx(24);
}
}
.message-content {
color: #666666;
font-size: toRpx(28);
line-height: toRpx(48);
margin-top: toRpx(17);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
&.warning-content {
white-space: pre-line;
-webkit-line-clamp: 4;
}
}
}
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(250);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0;
font-size: toRpx(24);
}
.tag-box {
display: flex;
margin: toRpx(2) toRpx(64) 0;
.tag-item {
padding: toRpx(18) toRpx(32);
border-radius: toRpx(16);
opacity: 1;
background: #f2f2f2;
margin-right: toRpx(24);
margin-bottom: toRpx(40);
&.active {
color: #2D66F7;
background: #2d66f71a;
}
}
}
/deep/ {
.uni-scroll-view-content {
height: calc(100% - #{toRpx(10)});
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="message-box">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">消息中心</view>
</view>
<view class="message-body">
<view class="data-container">
<view :class="['type-box']">
<view class="tab-item" v-for="(i, index) in typeList" :key="index" @click="changeType(index)">
<view
:class="['sprite-icon', firstIndex == index ? `icon-${firstClass[index]} active` : '', firstLeft[index]]">
</view>
<view class="text" :class="[firstIndex == index ? `active` : '']">
{{ i.tabName }}
<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 class="tag-box" v-if="firstIndex == 1">
<view :class="['tag-item', i.classCode == tagIndex ? 'active' : '']" v-for="i in tagList" :key="i.className"
@click="selectTag(i)">{{ i.className }}</view>
</view>
<scroll-view scroll-y ref="scrollViewRef" :class="['message-list', getScrollHeight]"
@scrolltolower="pageonReachBottom" :scroll-top="scrollTop">
<template v-if="getList.length">
<view class="message-item" v-for="item in getList" :key="item.id" @click="openDetail(item)">
<template v-if="firstIndex == 0">
<view class="message-header">
<view :class="['dot', item.readFlag ? '' : 'red']"></view>
<view class="message-type">系统通知</view>
<view class="message-time">{{ item.actualSendTimeStr }}</view>
<view class="message-tag">{{ CONTRNT_TYPE[item.contentType] }}</view>
</view>
<view class="message-content"> 您有新的消息【{{ item.title }}】{{ item.subtitle ? item.subtitle.length > 40 ?
`[${item.subtitle.slice(0, 39)}...]` : `[${item.subtitle}]` : '' }},请点击查看
</view>
</template>
<template v-else-if="firstIndex == 1">
<view class="message-header">
<view :class="['dot', item.status == 1 ? '' : 'red']"></view>
<view class="message-type">优秀话术-{{ item.sceneLabelName }}</view>
<view class="message-time">{{ item.time }}</view>
<view v-if="item.excellentLabelName" class="message-tag">{{ item.excellentLabelName }}</view>
</view>
<view class="message-content">{{ item.polishContent }}</view>
</template>
<template v-else-if="firstIndex == 2">
<view class="message-header">
<view :class="['dot', item.status == 1 ? '' : 'red']"></view>
<view class="message-type">话术违规预警</view>
<view class="message-time">{{ item.time }}</view>
<view class="message-tag">{{ item.warningTag }}</view>
</view>
<view class="message-content warning-content">
<view>你有以下接待记录判定为话术违规</view>{{ item.warningContent }}
</view>
</template>
<template v-else-if="firstIndex == 3">
<view class="message-header">
<view :class="['dot', item.status == 1 ? '' : 'red']"></view>
<view class="message-type">AI导师消息</view>
<view class="message-time">{{ item.time }}</view>
</view>
<view class="message-content warning-content">
<view>您有新的消息【{{ item.sopTaskDetailInfoDTO ? item.sopTaskDetailInfoDTO.checkDate : ''
}}战败复盘报告】AI导师来帮你进行战败复盘了,请点击查看</view>
</view>
</template>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image class="icon" src="../../assets/images/home/nothing.webp" />
暂无数据
</view>
</template>
<template v-if="nothing">
<view class="end-text">-已经到底了-</view>
</template>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
const PAGE_SIZE = 10
const PAGE_NUM = 1
const CONTRNT_TYPE = {
1: '图文',
2: '视频',
3: 'PDF',
5: '学习任务'
}
import dayjs from 'dayjs'
export default {
data() {
return {
typeList: [
{ tabName: '系统通知', num: () => '' },
{ tabName: '优秀话术', num: () => '' },
{ tabName: '预警通知', num: () => '' },
{ tabName: 'AI导师', num: () => '' }
],
CONTRNT_TYPE: CONTRNT_TYPE,
firstIndex: 0,
firstLeft: ['first', 'second', 'three', 'four'],
firstClass: ['first-nav', 'second-nav', 'second-nav', 'second-nav'],
systemList: [],
messageList: [],
earlyWarnList: [],
aiTutor: [],
nothing: false,
total: 0,
pageNum: PAGE_NUM,
pageSize: PAGE_SIZE,
tagList: [],
tagIndex: '',
scrollTop: 0
}
},
computed: {
getList() {
const listMap = {
0: this.systemList,
1: this.messageList,
2: this.earlyWarnList,
3: this.aiTutor
};
if (this.firstIndex in listMap) {
return listMap[this.firstIndex];
}
return []; // 若 firstIndex 不在 0、1、2 范围内,返回 []
},
getScrollHeight() {
// 调用 getList 函数获取列表
const list = this.getList;
// 如果获取的列表为空,则返回空字符串
if (!list || list.length === 0) {
return '';
}
// 根据 firstIndex 的值返回不同的类名
switch (this.firstIndex) {
case 0:
return 'scroll-list';
case 1:
return 'class-scroll';
case 2:
return 'scroll-list';
default:
return 'scroll-list';
}
}
},
created() {
uni.$on('pageList', (data) => {
console.log('接收到上一个页面返回的数据:', data);
// 可以在这里添加处理数据的逻辑
if (data) {
const message = this.getList.find(item => item.id == data)
if (message) message.status = 1
}
});
this.init()
},
onLoad(options) {
console.log(options)
if (options && options.type == 'read') {
this.changeType(1)
}
},
methods: {
init() {
this.getSystemPage()
},
// tab切换
changeType(index, tagIndex) {
console.log(index)
this.firstIndex = index
this.total = 0
this.pageNum = PAGE_NUM
this.pageSize = PAGE_SIZE
if (tagIndex) this.tagIndex = tagIndex
else this.tagIndex = ''
const actionMap = {
0: () => this.getSystemPage(),
1: () => {
this.getMessagePage();
this.getLabelList();
},
2: () => this.getWarningPage(),
3: () => this.getAiAgentPage()
};
const action = actionMap[index];
if (action) {
action();
}
},
// 跳转详情
openDetail(row) {
console.log(row);
const { id } = row;
const actionMap = {
3: async() => {
const { aiAgentInfoDTO, sopTaskDetailInfoDTO } = row;
const { agentUrl, domainName, presuppositionProblem } = aiAgentInfoDTO || {};
const { taskStatus, checkDate } = sopTaskDetailInfoDTO || {};
if (!agentUrl) {
return uni.showToast({
title: '链接无效',
icon: 'none'
});
}
const url = `/pages/common/aiWebview?url=${agentUrl}&domain=${domainName}&presuppositionProblem=${presuppositionProblem}&practice_status=${taskStatus}&date=${checkDate}`;
uni.navigateTo({ url });
// 不刷新列表的更新消息状态
if (row.status == 0) {
this.getList.find(item => item.boxId == row.boxId).status = 1
// 调用接口更新消息状态
const res = await uni.$api.commonApi.updateMessageStatus({
idList: [row.boxId]
})
}
},
2: () => {
uni.navigateTo({
url: `/pages/common/earlyWarnDetail?row=${encodeURIComponent(JSON.stringify(row))}`,
fail: (err) => {
console.error('页面跳转失败:', err);
}
});
},
1: () => {
uni.navigateTo({
url: `/pages/common/messageDetail?row=${encodeURIComponent(JSON.stringify(row))}&type=view`,
fail: (err) => {
console.error('页面跳转失败:', err);
}
});
},
0: () => {
if (row.contentType == 5) {
this.back()
uni.$emit('studyCenter')
} else {
this.getDetailById(id, row.readFlag);
}
}
};
const action = actionMap[this.firstIndex];
if (action) {
action();
}
},
back() {
uni.$emit('pageBack')
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100
})
},
// 选择标签
selectTag(item) {
this.tagIndex = item.classCode
this.scrollTop = 1
this.total = 0
this.pageNum = PAGE_NUM
this.pageSize = PAGE_SIZE
this.nothing = false
setTimeout(() => {
this.scrollTop = 0
}, 100);
this.getMessagePage()
},
/** 接口定义 */
// 客户标签
async getLabelList() {
const res = await uni.$api.commonApi.getClassConfig()
const _all = [{
className: '全部',
classCode: ''
}]
this.tagList = _all.concat(res)
},
// 获取优秀话术分页列表
async getMessagePage() {
try {
uni.showLoading({
mask: true
})
const { sceneType, uuid } = uni.$storage.get("userInfo")
const { tagIndex, pageNum, pageSize } = this
const params = {
businessType: sceneType,
uuid,
classCode: tagIndex,
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getPageRecord(params)
res.list?.length && res.list.map(e => {
e.time = dayjs(new Date(e.pushTime)).format("YYYY-MM-DD HH:mm:ss")
})
if (pageNum == 1) {
this.messageList = res.list
} else {
this.messageList = this.messageList.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
async getSystemPage() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const res = await uni.$api.commonApi.getTaskInfo({
pageNum, pageSize
})
if (pageNum == 1) {
this.systemList = res.list
} else {
this.systemList = this.systemList.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
async getWarningPage() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getWarningPage(params)
res.list?.length && res.list.map(e => {
e.time = dayjs(new Date(e.warningTime)).format("YYYY-MM-DD HH:mm:ss")
})
if (pageNum == 1) {
this.earlyWarnList = res.list
console.log(this.earlyWarnList, '===')
} else {
this.earlyWarnList = this.earlyWarnList.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
// 获取AI导师消息分页列表
async getAiAgentPage() {
try {
uni.showLoading({
mask: true
})
const { sceneType } = uni.$storage.get("userInfo")
const { pageNum, pageSize } = this
const params = {
pageNum,
pageSize,
businessType: sceneType
}
const res = await uni.$api.commonApi.getSopAiAgentMessageList(params)
res.list?.length && res.list.map(e => {
e.time = dayjs(new Date(e.pushTime)).format("YYYY-MM-DD HH:mm:ss")
})
if (pageNum == 1) {
this.aiTutor = res.list
console.log(this.aiTutor, '===')
} else {
this.aiTutor = this.aiTutor.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
async getDetailById(id, readFlag) {
const res = await uni.$api.commonApi.getTaskById({ id })
// 不刷新列表的更新消息状态
if (!readFlag) this.getList.find(item => item.id == id).readFlag = true
const _row = encodeURIComponent(JSON.stringify(res))
if (res.contentType == 1) {
// this.showPage('SystemDetial', { row: res })
uni.navigateTo({
url: `/pages/common/systemDetail?row=${_row}`
})
} else if (res.contentType == 2) {
console.log(JSON.parse(res.content))
const _content = res.content ? JSON.parse(res.content) : []
const url = _content[0]
const { content, title, id } = res
uni.navigateTo({
// url: `/pages/common/msgwebview?url=${url}&title=${title}&id=${id}`
url: `/pages/common/imgPreview?tabName=${title}&sourceType=2&detailUrl=${url}&row=${_row}`
})
} else if (res.contentType == 3) {
const _content = res.content ? JSON.parse(res.content) : []
const url = _content[0].image
const { content, title, id } = res
uni.navigateTo({
url: `/pages/common/msgwebview?fileUrl=${url}&title=${title}&id=${id}&row=${_row}`
})
}
},
/**
* 页面触底时的处理函数
* 当页面触底时,判断是否还有更多数据,如果有则加载下一页数据
* 如果没有更多数据,则标记为没有更多数据状态
*/
pageonReachBottom() {
console.log('到底了');
// 解构赋值,设置 nothing 的默认值
let { pageNum, total, nothing = 'nothing', pageSize } = this;
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1;
// 根据 firstIndex 的值调用不同的方法
switch (this.firstIndex) {
case 1:
try {
this.getMessagePage();
} catch (error) {
console.error('调用 getMessagePage 方法时出错:', error);
}
break;
case 0:
try {
this.getSystemPage();
} catch (error) {
console.error('调用 getSystemPage 方法时出错:', error);
}
break;
case 2:
try {
this.getWarningPage();
} catch (error) {
console.error('调用 getWarningPage 方法时出错:', error);
}
break;
default:
break;
}
} else {
this.nothing = true;
}
}
}
}
</script>
<style scoped lang="scss">
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
}
.message-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding-top: toRpx(160);
.message-body {
position: relative;
margin: 0 toRpx(64) toRpx(80);
background-color: rgba(255, 255, 255, 0.35);
// border: toRpx(4) solid #fff;
border-radius: toRpx(48);
// height: calc(100% - #{toRpx(236)});
.data-container {
background: #ffffff;
border-radius: toRpx(48);
height: calc(100vh - #{toRpx(244)});
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
border: toRpx(2) solid #fff;
box-sizing: border-box;
position: relative;
overflow: hidden;
.type-box {
position: relative;
display: flex;
width: 100%;
background-color: #eef4fe;
height: toRpx(176);
line-height: toRpx(128);
border-radius: toRpx(48) toRpx(48) 0 0;
z-index: 0;
.tab-item {
width: toRpx(400);
text-align: center;
font-weight: 500;
font-size: toRpx(40);
color: #1f2133;
.first {
left: 0;
}
.second {
left: toRpx(352);
}
.three {
left: toRpx(756);
}
.four {
left: toRpx(1162);
}
.text {
position: relative;
text-align: center;
width: toRpx(400);
.dot {
width: toRpx(16);
height: toRpx(16);
background: #999;
position: absolute;
top: toRpx(40);
border-radius: 50%;
right: toRpx(86);
}
}
.active {
position: absolute;
top: 0;
z-index: -1;
font-weight: 700;
font-size: toRpx(40);
color: #2c66f7;
&::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: toRpx(48);
height: toRpx(8);
background-color: #2c66f7;
border-radius: toRpx(16);
}
}
}
}
.tabs-bottom {
background: #fff;
height: toRpx(50);
position: relative;
border-radius: toRpx(24) toRpx(24) 0 0;
position: absolute;
width: 100%;
top: toRpx(128);
}
}
.message-list {
position: relative;
background-color: #fff;
border-radius: 0 0 toRpx(48) toRpx(48);
&.scroll-list {
height: calc(100% - #{toRpx(222)});
}
&.class-scroll {
height: calc(100% - #{toRpx(338)});
}
.message-item {
border-radius: toRpx(16);
// box-shadow: 0 toRpx(4) toRpx(20) 0 #0000001a;
box-shadow: 0 4px 12px 0 #2c66f71a;
margin: 0 toRpx(64) toRpx(40);
padding: toRpx(24) toRpx(32);
box-sizing: border-box;
&:first-child {
margin-top: toRpx(10);
}
.message-header {
display: flex;
align-items: center;
.dot {
width: toRpx(12);
height: toRpx(12);
border-radius: 50%;
background-color: #999;
margin-right: toRpx(24);
&.red {
background-color: #F24724;
}
}
.message-type {
color: #333;
font-size: toRpx(32);
font-weight: 500;
line-height: toRpx(44);
margin-right: toRpx(24);
}
.message-time {
color: rgba(102, 102, 102, 0.6);
font-size: toRpx(28);
}
.message-tag {
border-radius: toRpx(4);
background: rgba(255, 157, 10, 0.1);
padding: toRpx(8) toRpx(24);
color: #ff9d0a;
font-size: toRpx(24);
font-weight: 500;
margin-left: toRpx(24);
}
}
.message-content {
color: #666666;
font-size: toRpx(28);
line-height: toRpx(48);
margin-top: toRpx(17);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
&.warning-content {
white-space: pre-line;
-webkit-line-clamp: 4;
}
}
}
}
}
}
.nothing {
width: 100%;
flex-direction: column;
margin-top: toRpx(230);
font-size: toRpx(28);
color: #999999;
.icon {
width: toRpx(678);
height: toRpx(284);
margin-bottom: toRpx(24);
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0;
font-size: toRpx(24);
}
.tag-box {
display: flex;
margin: toRpx(2) toRpx(64) 0;
.tag-item {
padding: toRpx(18) toRpx(32);
border-radius: toRpx(16);
opacity: 1;
background: #f2f2f2;
margin-right: toRpx(24);
margin-bottom: toRpx(40);
&.active {
color: #2D66F7;
background: #2d66f71a;
}
}
}
/deep/ {
.uni-scroll-view-content {
height: calc(100% - #{toRpx(10)});
}
}
</style>
\ No newline at end of file \ No newline at end of file
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-28 18:19:19
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-09-06 14:42:32
* @FilePath: \gl-tape\pages\common\webview.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<web-view ref="webview" :src="url"></web-view>
</template>
<script type="text/ecmascript-6">
import systemTrack from '../../mixin/systemTrack';
export default {
name: '',
data () {
return {
url: '',
viewerUrl: '/hybrid/html/web/viewer.html',
}
},
mixins: [systemTrack],
onLoad (options) {
console.log(options,'options')
if(options.fileUrl) this.url = `${this.viewerUrl}?file=${options.fileUrl}`
else this.url = options.url
if (options.title) {
this.url = `${this.url}&title=${options.title}`
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang="scss"></style>
<template>
<view class="nothing">
暂未绑定账号
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.nothing {
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="view">
<scroll-view
class="scroll-view"
enhanced
scroll-y
scroll-with-animation
:scroll-into-view="toId"
@touchstart="touchstart"
@touchend="touchend"
>
<template v-if="dialogueList.length">
<block
v-for="(item,index) in dialogueList"
:key="index"
>
<view
:class="['item flex', {active:item.text_id == activeId}]"
:id="item.text_id"
@click="seekPlay({item,click:true})"
>
<view class="avatar-box">
<view :class="['sprite-icon',`icon-role-${item.role}`]"></view>
<view class="time">{{item.time}}</view>
</view>
<view class="text flex">{{item.content}}</view>
</view>
<!-- 意图匹配 -->
<block v-if="item.recordingCheckResultList && item.recordingCheckResultList.length">
<template v-for="(i, ind) in item.recordingCheckResultList">
<view
:class="['detail-box',i.detailClassName]"
:key="`text_${index}_${ind}`"
>
<view class="text-box">
<view
class="btn"
@click="changeDetailClassName(i)"
>
意图匹配
<view class="arrow sprite-icon icon-suggestions-arrow"></view>
</view>
{{i.tagGroupName}}
<view class="score">{{i.score}}分</view>
</view>
<view class="content-box">
<block v-if="!i.scriptRec">
<view class="suggestions-box no">
暂无话术推荐
</view>
</block>
<block v-else>
<view class="suggestions-box">
<view class="title">
<view class="sprite-icon icon-suggestions-icon"></view>
话术推荐
</view>
<view class="text">
<rich-text :nodes="i.scriptRec"></rich-text>
</view>
</view>
</block>
</view>
</view>
</template>
</block>
</block>
<view class="safeAreaInset">-已经到底了-</view>
</template>
<template v-else>
<view class="nothing flex">
<view class="sprite-icon icon-quality-no-data"></view>
分析中,稍等...
</view>
</template>
</scroll-view>
<view
class="axis-bar-area"
:hidden="!qualityData.length"
@click="barSeek"
>
<view class="axis-bar">
<view
class="progress-bar"
:style="[{height:`${progress}%`}]"
></view>
<template v-if="true">
<template v-for="(item,index) in axisList">
<block :key="index">
<view
:class="['axis-item',{'axis-active':activeId == item.text_id}]"
:style="[{top:`${item.docTop + 'px'}`}]"
>
<view :class="['axis-dot', `${!isPlayIng && !isScrolllIng?'':'radius'}`]"></view>
</view>
<template v-if="!isPlayIng && !isScrolllIng">
<view
:class="['axis-text',{'axis-text-active':activeId == item.text_id}]"
:style="[{top:`${item.top + 'px'}`}]"
@click.stop="seekPlay({
item,
scroll:true
})"
>
{{item.tagGroupName}}+{{item.score}}
</view>
</template>
</block>
</template>
<view class="hide-bar">
<block
v-for="(item,index) in axisList"
:key="index"
>
<block v-if="item.inspectionConversationDetailId">
<view
:class="['axis-line']"
:style="[{height:`${item.height + 20 + 'px'}`},{top:`${item.docTop - 10 + 'px'}`}]"
></view>
</block>
</block>
</view>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import utils from '@/utils/utils'
export default {
name: '',
props: {
batchId: [String, Number],
qualityData: {
type: Array,
default: () => []
},
totalDuration: {
type: Number,
default: 0
},
qualityAudio: {
type: Object,
default: () => ({})
}
},
watch: {
batchId: {
handler (n) {
const data = {
batchId: n,
};
this.findConversationDetailByBatchIdNew(data)
},
immediate: true
},
qualityData: {
handler (n) {
if (n.length) this.findCbByBatchId()
},
immediate: true
}
},
data () {
return {
dialogueList: [],
activeId: '',
progress: 0,
barTop: 0,
containerHeight: 0,
axisList: [],
isPlayIng: false,
isScrolllIng: false,
toId: '',
touchTimer: null
}
},
mounted () {
},
methods: {
formatTime (num) {
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return `${minutes}:${seconds}`
},
transitionBr (text) {
let regex = new RegExp('</br>', 'g')
text = text.replace(regex, '<div></div>')
return text
},
changeDetailClassName (i) {
i.detailClassName = i.detailClassName == 'up' ? 'down' : 'up'
},
async findConversationDetailByBatchIdNew (params) {
const res = await uni.$api.receptionApi.findConversationDetailByBatchIdNew(params)
res.map(e => {
e.time = this.formatTime(e.mergedOffset)
e.text_id = `text_${e.mergedOffset}`
if (e?.recordingCheckResultList && e.recordingCheckResultList.length) {
e.recordingCheckResultList.map(i => {
i.detailClassName = 'down'
console.log(i.scriptRec)
let [scriptRec] = JSON.parse(i.scriptRec)
if (scriptRec) i.scriptRec = scriptRec.replace(/\n/g, '<br>')
else i.scriptRec = ''
})
}
})
this.dialogueList = res
},
async findCbByBatchId () {
let data = JSON.parse(JSON.stringify(this.qualityData))
let { totalDuration } = this,
margin = 20
utils.getViewInfo('.axis-bar', ({
height: containerHeight,
top: barTop
}) => {
if (containerHeight == 0) {
return setTimeout(() => {
this.findCbByBatchId()
}, 100)
}
this.barTop = barTop
this.containerHeight = containerHeight
let axisList = []
data?.sort((a, b) => a.offset - b.offset).forEach(e => {
const {
offset: mergedOffset,
id
} = e
e.top = mergedOffset / totalDuration * containerHeight
e.docTop = mergedOffset / totalDuration * containerHeight
e.text_id = `text_${mergedOffset}`
e.mergedOffset = mergedOffset
if (mergedOffset != null) axisList.push(e)
})
axisList.map((e, index) => {
// 检查并调整 top 值,避免重叠
for (let i = 0; i < index; i++) {
if (e.top < axisList[i].top + margin &&
e.top + margin > axisList[i].top) {
// 如果重叠,将当前元素的 top 设置为前一个元素的底部加上 margin
e.top = axisList[i].top + margin;
}
}
})
this.axisList = axisList
})
},
onTimeUpdate () {
const {
dialogueList,
} = this, {
paused
} = this.qualityAudio, {
mergedOffset
} = this.setProgress(),
item = dialogueList.find(e => e.mergedOffset == mergedOffset)
if (!paused) this.isPlayIng = true
if (this.isScrolllIng) return
if (item && item.id) this.setTopId(item, true)
},
setTopId (item, scroll = false) {
const {
dialogueList
} = this
let centerIndex = dialogueList.findIndex(e => e.text_id == item.text_id)
centerIndex -= 3
if (centerIndex < 0) centerIndex = 0
this.$nextTick(() => {
this.activeId = item.text_id
})
if (scroll) this.toId = dialogueList[centerIndex].text_id
},
setProgress () {
const {
duration,
currentTime
} = this.qualityAudio,
mergedOffset = Math.ceil(currentTime)
this.progress = mergedOffset / duration * 100
return {
currentTime,
mergedOffset
}
},
seekPlay (e) {
let {
item,
click,
scroll
} = e, {
activeId,
} = this
if (!item) return
this.$emit('seek', item.mergedOffset)
this.setTopId(item, scroll)
if (click && item.text_id == activeId) {
const {
paused
} = this.qualityAudio
if (paused) this.$emit('onPlay')
else this.$emit('onPause')
this.$emit('changeOperate', !paused)
} else {
this.$emit('onPlay')
this.$emit('changeOperate', false)
}
},
touchstart () {
this.isScrolllIng = true
this.clearTimer()
},
touchend () {
this.touchTimer = setTimeout(() => {
this.isScrolllIng = false
this.clearTimer()
}, 3e3)
},
clearTimer () {
if (this.touchTimer) {
clearTimeout(this.touchTimer)
this.touchTimer = null
}
},
barSeek (e) {
function findNearest (arr, target) {
let closest = arr[0];
let minDiff = Math.abs(target - arr[0]);
for (let i = 1; i < arr.length; i++) {
const diff = Math.abs(target - arr[i]);
if (diff < minDiff) {
minDiff = diff;
closest = arr[i];
}
}
return closest;
}
let [touches] = e.touches, {
barTop,
containerHeight
} = this, {
duration
} = this.qualityAudio, {
dialogueList
} = this
if (touches) {
let {
clientY
} = touches,
progress = (clientY - barTop) / containerHeight * 100,
offsetList = dialogueList.map(i => i.mergedOffset),
mergedOffset = findNearest(offsetList, duration * progress / 100),
item = dialogueList.find(i => i.mergedOffset == mergedOffset)
this.seekPlay({
item,
scroll: true
})
}
},
}
}
</script>
<style scoped lang='scss'>
.view {
height: 100%;
width: 100%;
position: relative;
.scroll-view {
height: 100%;
width: 100%;
border-radius: toRpx(28);
background: #fff;
.item {
padding: toRpx(20) toRpx(24);
.avatar-box {
position: relative;
width: toRpx(68);
height: toRpx(96);
flex-shrink: 0;
display: flex;
align-items: center;
flex-direction: column;
.sprite-icon {
border-radius: 100%;
overflow: hidden;
flex-shrink: 0;
}
.time {
width: toRpx(70);
height: toRpx(28);
background: #ffffff;
border: toRpx(2) solid #f0f6ff;
border-radius: toRpx(28);
font-size: toRpx(20);
color: #999ea8;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
}
.text {
width: toRpx(722);
min-height: toRpx(80);
color: #292d33;
font-size: toRpx(26);
margin-left: toRpx(16);
line-height: toRpx(44);
}
}
.active {
background: #f0f6ff;
.text {
font-weight: 500;
}
}
.detail-box {
background: #f5f8fc;
overflow: hidden;
opacity: 0;
.content-box {
transform: translateY(-100%);
}
.text-box {
height: toRpx(80);
display: flex;
align-items: center;
color: #133667;
font-size: toRpx(24);
padding: 0 toRpx(24);
border-bottom: toRpx(2) solid #e8f0ff;
position: relative;
background: #f5f8fc;
z-index: 2;
.btn {
display: flex;
align-items: center;
justify-content: center;
width: toRpx(172);
height: toRpx(56);
background: #ffffff;
border-radius: toRpx(28);
margin-right: toRpx(8);
.arrow {
transition: all 0.25s;
}
}
.score {
font-weight: 600;
margin-left: toRpx(8);
}
}
.suggestions-box {
width: toRpx(796);
background: #ffffff;
border-radius: toRpx(16);
margin: toRpx(24);
padding: toRpx(24) toRpx(28);
box-sizing: border-box;
.title {
display: flex;
align-items: center;
font-weight: 500;
font-size: toRpx(28);
color: #333333;
margin-bottom: toRpx(20);
.sprite-icon {
margin-right: toRpx(12);
}
}
.text {
color: #292d33;
font-size: toRpx(26);
line-height: toRpx(44);
}
.suggestions-text {
padding-bottom: toRpx(22);
border-bottom: toRpx(2) solid #f0f6ff;
margin-bottom: toRpx(24);
}
}
.no {
display: flex;
align-items: center;
justify-content: center;
height: toRpx(124);
font-size: toRpx(24);
color: #8a8c90;
}
}
.up {
height: auto;
opacity: 1;
.arrow {
transform: rotate(180deg);
}
.content-box {
animation: move-up 0.2s forwards;
}
}
.down {
animation: hide-box 0.2s 0.1s forwards;
.content-box {
animation: move-down 0.2s forwards;
}
}
@keyframes hide-box {
100% {
height: toRpx(80);
opacity: 1;
}
}
@keyframes move-up {
0% {
transform: translateY(-100%);
}
100% {
transform: translateY(0);
}
}
@keyframes move-down {
0% {
transform: translateY(0);
}
100% {
transform: translateY(-100%);
}
}
.safeAreaInset {
text-align: center;
line-height: toRpx(40);
color: #999;
font-size: toRpx(24);
padding-bottom: toRpx(20);
}
}
.nothing {
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
color: #808291;
font-size: toRpx(28);
background: #fff;
}
.axis-bar-area {
position: absolute;
top: 50%;
height: toRpx(912);
transform: translateY(-50%);
z-index: 8;
width: toRpx(36);
right: toMinusRpx(20);
.axis-bar {
position: absolute;
top: 0;
left: 0;
width: toRpx(16);
height: 100%;
background-color: #e7e7e7;
border-radius: toRpx(8);
.hide-bar {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
border-radius: toRpx(8);
overflow: hidden;
z-index: 2;
.axis-line {
border-radius: toRpx(4);
position: absolute;
left: 50%;
transform: translateX(-50%);
z-index: -1;
width: toRpx(8);
background: #347bff;
}
}
.progress-bar {
position: absolute;
width: 100%;
background-color: #347bff;
top: 0;
left: 0;
border-radius: toRpx(8);
z-index: 3;
transition: all 0.1s;
}
.axis-item {
position: absolute;
left: 50%;
transform: translateX(-50%);
z-index: 3;
}
.axis-dot {
position: absolute;
left: 50%;
top: 0;
transform: translate(-50%, -50%);
width: toRpx(20);
height: toRpx(20);
background: #ffffff;
border: toRpx(4) solid #347bff;
box-shadow: 0 toRpx(4) toRpx(16) 0 #7a7a7a33;
border-radius: 100%;
box-sizing: border-box;
}
.default-axis-dot {
width: toRpx(36);
height: toRpx(36);
border: toRpx(6) solid #347bff;
z-index: 9;
}
.axis-text {
position: absolute;
right: toRpx(20);
font-size: toRpx(24);
color: #757980;
display: inline-flex;
align-items: center;
height: toRpx(36);
border-radius: toRpx(16);
padding: 0 toRpx(22) 0 toRpx(12);
transform: translateY(-50%);
white-space: nowrap;
background: #347bff1a;
/* 防止文本换行 */
}
.axis-active {
z-index: 4;
.axis-dot {
width: toRpx(36);
height: toRpx(36);
background: #347bff !important;
border: none;
box-shadow: 0 toRpx(4) toRpx(16) 0 #7a7a7a33;
border-radius: 0 100% 100% 0;
&::after {
position: absolute;
content: '';
border-radius: 100%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #fff;
width: toRpx(26);
height: toRpx(26);
}
}
.radius {
border-radius: 100%;
}
}
.axis-text-active {
color: #ffffff !important;
background-color: #347bff !important;
border-radius: toRpx(16) 0 0 toRpx(16);
right: toRpx(18);
z-index: 2;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="view">
<template v-if="qualityData.length">
<view class="classify-wrap">
<template v-for="(item,index) in qualityData">
<view
:class="['classify-item flex',{active: index == activeIndex}]"
:key="index"
@click="tabClick(item,index)"
>
<view class="title">{{item.tagGroupName}}</view>
<view class="score">{{item.formatScore}}</view>
</view>
</template>
</view>
<scroll-view
class="scroll-view"
enhanced
scroll-y
scroll-with-animation
:scroll-into-view="activeId"
>
<template v-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>
<template v-for="(item,index) in qualityData[activeIndex].conversationDetailDTOList">
<block :key="index">
<view
v-if="item.text_id"
:id="item.text_id"
:class="['quality-item flex',{active:item.text_id == activeId}]"
@click="seekPlay(item)"
>
<view class="avatar-box">
<view :class="['sprite-icon',`icon-role-${item.role}`]"></view>
<view class="time">{{item.time}}</view>
</view>
<view class="text flex">{{item.content}}</view>
</view>
<template v-if="item.scriptRec">
<view class="script-rec">
<view class="suggestions-box">
<view class="suggestions-title">
<view class="sprite-icon icon-suggestions-icon"></view>
话术推荐
</view>
<view class="text">
<rich-text :nodes="item.scriptRec"></rich-text>
</view>
</view>
</view>
</template>
</block>
</template>
</view>
</template>
</scroll-view>
</template>
<template v-else>
<view class="nothing flex">
<view class="sprite-icon icon-quality-no-data"></view>
分析中,稍等...
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
props: {
qualityData: {
type: Array,
default: () => []
},
qualityAudio: {
type: Object,
default: () => ({})
},
disabled: {
type: Boolean,
default: false
},
disabledText: String
},
data () {
return {
activeIndex: 0,
activeId: ''
}
},
mounted () {
},
methods: {
onTimeUpdate () {
const {
mergedOffset
} = this.setProgress()
this.activeId = `text_${mergedOffset}`
},
setProgress () {
const {
currentTime
} = this.qualityAudio,
mergedOffset = Math.ceil(currentTime)
return {
currentTime,
mergedOffset
}
},
seekPlay (item) {
let { activeId } = this
this.$emit('seek', item.mergedOffset)
if (item.text_id == activeId) {
const {
paused
} = this.qualityAudio
if (paused) this.$emit('onPlay')
else this.$emit('onPause')
this.$emit('changeOperate', !paused)
} else {
this.$emit('onPlay')
this.$emit('changeOperate', false)
}
},
tabClick (item, index) {
if (this.activeIndex == index) return
if (this.disabled && this.disabledText) return uni.showToast({
title: this.disabledText,
icon: 'none',
mask: true,
duration: 2e3
})
this.activeIndex = index
this.$emit('tabClick', item)
}
}
}
</script>
<style scoped lang='scss'>
.view {
height: 100%;
width: 100%;
position: relative;
.classify-wrap {
width: 100%;
height: toRpx(112);
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
.classify-item {
min-width: toRpx(160);
height: 100%;
padding: 0 toRpx(24);
flex-shrink: 0;
justify-content: center;
flex-direction: column;
line-height: toRpx(40);
font-size: toRpx(28);
transition: all 0.15s;
background: #f5f9ff;
.title {
color: #757980;
}
.score {
color: #347bff;
font-weight: 600;
}
}
.active {
border-radius: toRpx(16) toRpx(16) 0 0;
background: #ffffff;
.title {
color: #292d33;
font-weight: 600;
}
}
}
.scroll-view {
height: calc(100% - #{toRpx(112)});
}
.quality-block {
.title {
height: toRpx(80);
background: linear-gradient(119.9deg, #e1f7fc 0%, #f3f7ff 27%, #f7f2ff 41%, #e8f1ff 66%, #f7f2ff 100%);
font-size: toRpx(28);
font-weight: 600;
padding: 0 toRpx(20);
&::before {
content: '';
width: toRpx(8);
height: toRpx(8);
background: #000000;
border-radius: 100%;
display: block;
margin-right: toRpx(16);
}
.matched-btn {
margin-left: auto;
height: toRpx(56);
border-radius: toRpx(28);
background: #ffffff;
padding: 0 toRpx(36);
color: #eb4e4e;
font-size: toRpx(24);
font-weight: 600;
}
.hit {
color: #35c376;
}
}
.quality-item {
padding: toRpx(20) toRpx(24);
background: #fff;
.avatar-box {
position: relative;
width: toRpx(68);
height: toRpx(96);
flex-shrink: 0;
display: flex;
align-items: center;
flex-direction: column;
.sprite-icon {
border-radius: 100%;
overflow: hidden;
flex-shrink: 0;
}
.time {
width: toRpx(70);
height: toRpx(28);
background: #ffffff;
border: toRpx(2) solid #f0f6ff;
border-radius: toRpx(28);
font-size: toRpx(20);
color: #999ea8;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
}
.text {
width: toRpx(722);
min-height: toRpx(80);
color: #292d33;
font-size: toRpx(26);
margin-left: toRpx(16);
line-height: toRpx(44);
}
}
.active {
background: #f0f6ff;
.text {
font-weight: 500;
}
}
.script-rec {
padding: toRpx(24);
.suggestions-box {
background: #ffffff;
border-radius: toRpx(16);
padding: toRpx(24) toRpx(28);
box-sizing: border-box;
.suggestions-title {
display: flex;
align-items: center;
font-weight: 500;
font-size: toRpx(28);
color: #333333;
margin-bottom: toRpx(20);
.sprite-icon {
margin-right: toRpx(12);
}
}
.text {
color: #292d33;
font-size: toRpx(26);
line-height: toRpx(44);
}
.suggestions-text {
padding-bottom: toRpx(22);
border-bottom: toRpx(2) solid #f0f6ff;
margin-bottom: toRpx(24);
}
}
}
.active {
background: #f0f6ff;
.text {
font-weight: 500;
}
}
}
.nothing {
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
color: #808291;
font-size: toRpx(28);
background: #fff;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="quality-table-box">
<reception-title
title="质检明细"
icon="reception-2"
/>
<div class="quality-table">
<view class="quality-title-box flex">
<template v-for="(i,index) in qualityTitle">
<view
:class="['title-item flex',`row-${index + 1}`]"
:key="index"
>{{i}}</view>
</template>
</view>
<view class="quality-content">
<scroll-view
class="table"
scroll-y
>
<template v-if="flag">
<template v-for="(i,index) in qualityData">
<view
class="quality-item"
:key="index"
>
<template v-for="(key,ind) in keyList">
<div
:key="`${index}-${ind}`"
:class="['flex item',`row-${ind + 1}`]"
>
<template v-if="key == 'hitTextList'">
<view class="text-two-line">
<template v-if="i[key] && i[key].length">
<template v-for="(k,kindex) in i[key]">
<rich-text
@click="open(i)"
:key="`text_${index}_${kindex}`"
:nodes="k"
></rich-text>
</template>
</template>
<template v-else>暂无命中文本</template>
</view>
</template>
<template v-else>
{{i[key]}}
</template>
</div>
</template>
</view>
</template>
</template>
</scroll-view>
</view>
</div>
<uni-popup
ref="popup"
type="bottom"
>
<view class="detail-box">
<view
class="close-box flex"
@click="close"
>
<uni-icons
type="clear"
:size="28"
color="#76787f"
></uni-icons>
</view>
<view class="title">{{hitTextDetail.tagGroupName}} {{hitTextDetail.formatScore}}</view>
<view class="content">
<template v-for="(k,kindex) in hitTextDetail.hitTextList">
<rich-text
:key="`text_${kindex}`"
:nodes="k"
></rich-text>
</template>
</view>
</view>
</uni-popup>
</div>
</template>
<script type='text/ecmascript-6'>
import ReceptionTitle from './ReceptionTitle.vue'
export default {
components: {
ReceptionTitle
},
name: '',
props: {
qualityData: {
type: Array,
default: () => []
}
},
data () {
return {
qualityTitle: Object.freeze(['一级分类', '质检得分', '命中文本']),
flag: true,
qualityList: [],
keyList: Object.freeze(['tagGroupName', 'formatScore', 'hitTextList']),
hitTextDetail: []
}
},
mounted () {
},
methods: {
open (hitTextDetail) {
this.hitTextDetail = hitTextDetail
this.$refs.popup.open("center");
},
close () {
this.$refs.popup.close()
}
}
}
</script>
<style scoped lang='scss'>
.quality-table-box {
height: calc(100% - #{toRpx(268)});
.quality-table {
height: calc(100% - #{toRpx(136)});
width: 100%;
box-sizing: border-box;
border-radius: toRpx(16);
overflow: hidden;
.quality-title-box {
height: toRpx(88);
background: #edf3ff;
border-radius: toRpx(16) toRpx(16) 0 0;
font-size: toRpx(26);
line-height: toRpx(40);
.title-item {
height: toRpx(88);
justify-content: center;
box-sizing: border-box;
flex-shrink: 0;
color: #000;
}
}
.row-1 {
width: toRpx(272);
}
.row-2 {
width: toRpx(248);
border-right: toRpx(4) solid #fff;
border-left: toRpx(4) solid #fff;
}
.row-3 {
width: calc(100% - #{toRpx(520)});
}
.quality-content {
height: calc(100% - #{toRpx(88)});
display: flex;
box-sizing: border-box;
border-top: toRpx(4) solid #ffffff;
.table {
height: 100%;
.quality-item {
display: flex;
border-bottom: toRpx(4) solid #ffffff;
color: #333;
.item {
min-height: toRpx(84);
background: #f7f8fa;
height: auto;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
box-sizing: border-box;
}
.row-3 {
padding: toRpx(24) toRpx(48);
justify-content: flex-start;
}
}
}
}
}
}
.detail-box {
position: relative;
width: toRpx(1020);
max-height: toRpx(640);
border-radius: toRpx(40);
padding: 0 toRpx(64) toRpx(88);
box-sizing: border-box;
overflow: hidden;
&::before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: toRpx(240);
background-image: linear-gradient(180deg, #e5edfe 0%, #ffffff 100%);
content: '';
z-index: -1;
}
&::after {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
content: '';
background-color: #fff;
z-index: -2;
}
.icon-bao {
position: absolute;
top: toRpx(48);
right: toRpx(68);
}
.close-box {
position: absolute;
width: toRpx(136);
height: toRpx(136);
top: 0;
right: 0;
justify-content: center;
z-index: 2;
}
.title {
font-weight: 500;
font-size: toRpx(40);
color: #292d33;
line-height: toRpx(64);
padding: toRpx(24) 0;
}
.content {
max-height: toRpx(400);
font-size: toRpx(30);
color: #292d33;
line-height: toRpx(48);
overflow-y: auto;
word-break: break-all;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="title flex">
<div :class="['sprite-icon',`icon-${icon}`]"></div>
{{title}}
</div>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
title: String,
icon: String
},
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.title {
padding: toRpx(24) 0;
color: #333333;
font-size: toRpx(32);
font-weight: 500;
line-height: toRpx(40);
.sprite-icon {
margin-right: toRpx(12);
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="tags-box">
<reception-title
title="话术标签"
icon="reception-1"
/>
<div class="tags-flex flex">
<template v-for="(i ,index) in tags">
<div
:key="index"
class="tag flex"
>{{i}}</div>
</template>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import ReceptionTitle from './ReceptionTitle.vue'
export default {
components: {
ReceptionTitle
},
data () {
return {
tags: []
}
},
props: {
batchId: [String, Number]
},
watch: {
batchId: {
handler (val) {
if (val) this.getTags(val)
},
immediate: true
}
},
mounted () {
},
methods: {
async getTags (batchId) {
const res = await uni.$api.receptionApi.findRecordingTagByBatchId({
batchId
})
let tags = []
res.map(e =>{
tags.push(`${e.tagGroupName}-${e.tagName}`)
})
this.tags = tags
}
}
}
</script>
<style scoped lang='scss'>
.tags-box {
padding-bottom: toRpx(24);
.tags-flex {
gap: toRpx(20);
flex-wrap: wrap;
.tag {
height: toRpx(64);
border-radius: toRpx(16);
background: #edf3ff;
padding: 0 toRpx(20);
color: #4673ff;
font-size: toRpx(28);
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="reception-box">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
接待详情
</view>
<template v-if="pageData.customerName">
<view class="reception-content-box flex">
<view class="reception-left-box">
<view class="customer-info">
<view class="name flex">
<view class="name-text text-hide">
{{pageData.customerName}}
</view>
<view class="phone">{{desensitizePhoneNumber(pageData.phoneNumber)}}</view>
</view>
<view class="brand-box flex">
<view
class="brand flex"
v-if="pageData.carBrand"
>{{pageData.carBrand}}</view>
<view class="brand flex">{{pageData.carModel}}</view>
</view>
<view class="tips flex">
<view :class="['tips-text',{deal:pageData.orderFinishFlag}]">
{{pageData.orderFinishFlag? '成交': '未成交'}}
</view>
<view
class="score-box"
v-if="pageData.score != null"
>
{{pageData.score}}<view class="unit">分</view>
</view>
</view>
</view>
<view class="content-box">
<view class="content-tab-box flex">
<template v-for="i in tab">
<view
:key="i.id"
:class="['tab flex',{'active-tab': tabId == i.id}]"
@click="tabId = i.id"
>
{{i.name}}
</view>
</template>
</view>
<view class="control-box flex">
<view
class="sprite-icon icon-reception-share"
@click="share"
></view>
<template v-if="showPlayControl">
<view
class="play-box flex"
@click="onHandle"
>
<view :class="['sprite-icon', `icon-reception-${status=='pause'||status=='ending' ? 'play' :'pause'}`]"></view>
{{currentTime}}
</view>
</template>
</view>
<view class="component-box">
<!-- <dialogue
:class="['component-item',{hide: tabId != 1}]"
:batchId="pageData.batchId"
:qualityData="qualityData"
:totalDuration="pageData.totalDuration"
ref="dialogueRef"
:qualityAudio="qualityAudio"
@seek="seek"
@onPlay="onPlay"
@onPause="onPause"
@changeOperate="isOperate = $event"
/> -->
<quality
:qualityData="qualityData"
:class="['component-item',{hide: tabId != 2}]"
ref="qualityRef"
:qualityAudio="qualityAudio"
@seek="seek"
@onPlay="onPlay"
@onPause="onPause"
@changeOperate="isOperate = $event"
@tabClick="tabClick"
:disabled="isResponding || isRecording"
:disabledText="disabledText"
/>
</view>
</view>
</view>
<view class="reception-right-box">
<view
class="AI-window"
v-if="AIUrl"
>
<view class="AI-title flex">AI导师</view>
<web-view
:src="AIUrl"
@message="handlerMessage"
></web-view>
</view>
<template v-else>
<view class="nothing flex">
<view class="sprite-icon icon-quality-no-data"></view>
分析中,稍等...
</view>
</template>
<!-- <template v-if="qualityData.length">
<tags :batchId="pageData.batchId" />
<quality-table :qualityData="qualityData" />
</template>-->
</view>
</view>
</template>
</view>
</template>
<script type="text/ecmascript-6">
import Dialogue from './components/Dialogue.vue'
import Quality from './components/Quality.vue'
import Tags from './components/Tags.vue'
import QualityTable from './components/QualityTable.vue'
import dayjs from 'dayjs'
export default {
components: {
QualityTable,
Dialogue,
Quality,
Tags
},
mixins: [],
data () {
return {
tab: Object.freeze([
// {
// id: 1,
// name: '对话',
// componentName: 'dialogue'
// },
{
id: 2,
name: '质检',
componentName: 'quality'
}
]),
tabId: 2,
qualityData: [],
pageData: {},
qualityAudio: {},
currentTime: '00:00',
status: 'pause',
isOperate: true,
showPlayControl: false,
AIUrl: '',
wv: null,
disabledText: '',
isResponding: true,
isRecording: true,
}
},
onLoad () {
let _this = this
this.getOpenerEventChannel().on('getData', function (data) {
console.log(data)
data.totalDuration = (data.receptionEndTime - data.receptionStartTime) / 1000
_this.pageData = data || {}
if (data.batchId) _this.findCheckResultByBatchId(data.batchId)
_this.setAudio(data.recordingUrl)
})
},
onHide () {
this.qualityAudio.stop()
},
onUnload () {
this.qualityAudio.stop()
},
computed: {
// dialogueRef () {
// return this.$refs.dialogueRef
// },
qualityRef () {
return this.$refs.qualityRef
}
},
onBackPress (options) {
if (options.from === 'backbutton') {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
this.back()
return true
}
// 其他情况允许正常返回
return false
},
methods: {
onHandle (e) {
let {
isOperate
} = this;
if (isOperate) {
this.onPlay()
} else {
this.onPause()
}
this.isOperate = !this.isOperate
},
//音频暂停
onPause () {
const {
tabId
} = this
// this.dialogueRef.isPlayIng = false
this.qualityAudio.pause()
},
//播放
onPlay () {
if (!this.showPlayControl) {
return uni.showToast({
title: '音频暂不能播放,稍等...',
icon: 'none'
})
}
const {
paused
} = this.qualityAudio
if (paused) this.qualityAudio.play()
},
setAudio (recordingUrl) {
this.qualityAudio = uni.createInnerAudioContext()
this.qualityAudio.src = recordingUrl
this.qualityAudio.onPause(() => {
this.status = 'pause'
})
//监听音频的播放事件
this.qualityAudio.onPlay(() => {
this.status = 'play'
})
this.qualityAudio.onCanplay(() => {
this.showPlayControl = true
})
this.qualityAudio.onTimeUpdate(this.onTimeUpdate)
this.qualityAudio.onEnded(() => {
this.status = 'ending'
this.currentTime = this.formatTime(this.qualityAudio.duration)
// this.dialogueRef.isPlayIng = false
this.isOperate = true
})
},
onTimeUpdate () {
const {
tabId
} = this
this.currentTime = this.formatTime(this.qualityAudio.currentTime)
// this.dialogueRef?.onTimeUpdate()
this.qualityRef?.onTimeUpdate()
},
formatTime (num) {
num = Math.round(num)
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
minutes = minutes < 10 ? `0${minutes}` : minutes
return `${minutes}:${seconds}`
},
//跳转到指定位置
seek (time) {
this.qualityAudio.seek(time)
},
back () {
uni.$emit('refreshRecord')
if (this.qualityAudio) this.qualityAudio?.pause()
uni.navigateBack()
},
async findCheckResultByBatchId (batchId) {
const res = await uni.$api.receptionApi.findCheckResultByBatchId({
batchId
})
res.map(item => {
item.formatScore = `${item.score || item.score === 0 ? item.score : '-'}/${item.sumScore || item.sumScore === 0 ? item.sumScore : '-'}`
let hitTextList = JSON.parse(item.hitText),
matchedClass = 'no-hit',
matchedText = '意图不匹配'
if (hitTextList && hitTextList.length) {
item.hitTextList = hitTextList.map(e => e.replace(/\n/g, '<br>'))
matchedClass = 'hit'
matchedText = '意图匹配'
}
item.matchedClass = matchedClass
item.matchedText = matchedText
let [scriptRec] = JSON.parse(item.scriptRec)
if (scriptRec) scriptRec = scriptRec.replace(/\n/g, '<br>')
if (item.conversationDetailDTOList && item.conversationDetailDTOList.length) {
item.conversationDetailDTOList.map(e => {
e.time = this.formatTime(e.mergedOffset)
e.text_id = `text_${e.mergedOffset}`
if (e.mergedOffset == item.offset && !item.matched) {
e.scriptRec = scriptRec
item.matched = true
}
})
if (item.conversationDetailDTOList.findIndex(e => e.scriptRec) == -1) {
/**时间戳都对不上时 话术推荐加到最后 */
item.conversationDetailDTOList[item.conversationDetailDTOList.length - 1].scriptRec = scriptRec
}
} else item.conversationDetailDTOList = [{
scriptRec: scriptRec || '暂无话术推荐'
}]
})
this.qualityData = res
this.getAiagent(res[0])
},
desensitizePhoneNumber (phoneNumber) {
return phoneNumber.replace(phoneNumber.slice(3, 7), '****')
},
async share () {
try {
const {
merchantName,
receptionStartTime,
receptionEndTime,
duration,
merchantId,
batchId,
receptionStatus
} = this.pageData,
receptionStatusText = {
1: '成交',
2: '战败',
3: '未知'
}[receptionStatus]
// 获取短链地址
const url = await uni.$api.receptionApi.getShortUrl({
merchantNo: merchantId,
batchId,
receptionStartTime: receptionStartTime
})
if (url) {
// 门店 - 接待开始时间 - 接待时长 - 员工标记的接待结果 - 接待录音mp3地址(更换成短链)
let text = [
merchantName,
dayjs(receptionStartTime).format("YYYY年MM月DD日 HH:mm:ss"),
dayjs(receptionEndTime).format("YYYY年MM月DD日 HH:mm:ss"),
duration,
receptionStatusText,
url
].join(' - ')
uni.setClipboardData({
data: text,
})
} else uni.showToast({
title: "获取短链失败",
icon: "none",
})
} catch (error) {
uni.showToast({
title: error,
icon: "none",
})
}
},
async getAiagent (item) {
if (item) {
uni.showLoading({
mask: true
})
const { phone } = uni.$storage.get('userInfo'),
[data] = await uni.$api.sceneMarketApi.getAiagent({
ownerShipType: 1,
accountPhone: phone,
agentCode: 'AI7'
})
if (data) {
const { sceneType, uuid, phone, channelType = 1 } = uni.$storage.get('userInfo'),
bussinessType = sceneType == 0 ? 1 : 2,// sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
brand = {
1: '问界',
2: '比亚迪',
3: '其他'
}[channelType],
{ modelType } = this.pageData
let title = ''
if (item.sumScore > item.score) title = item.tagGroupName
let { agentUrl, domainName, taskStatus } = data
// agentUrl = 'https://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main-zhangls/chat/0piVRFb1xn6OBTcv'
let url = `${agentUrl}?no_header=1&businessType=${bussinessType}&one_id=${uuid}&platformType=1&domain=${domainName}&presuppositionProblem=${title}&brandType=${modelType || 1001}`
url += `&phone=${phone}&brand=${brand}&date=${dayjs().format('YYYY-MM-DD')}`
if (taskStatus) url += `&practice_status=${taskStatus}`
this.AIUrl = url
this.setWebviewStyle()
} else uni.showToast({
title: '获取智能体失败',
icon: 'error'
})
}
},
setWebviewStyle () {
//修改UA为PC端
const setWebviewStyleWithRetry = () => {
const currentWebview = this.$scope.$getAppWebview()
const [wv] = currentWebview.children()
if (wv) {
this.wv = wv
wv.setStyle({
left: '40.85%',
top: '16.65%',
height: '78.17%',
width: '56.52%'
});
// wv.setCssText( '.chat-panel-bg{background:#f5f9ff !important;}' )
return true; // 成功设置样式
} else {
return false; // 未找到wv
}
};
const retrySetWebviewStyle = () => {
if (!setWebviewStyleWithRetry()) {
// 如果未成功,继续重试
setTimeout(retrySetWebviewStyle, 50);
} else {
// 成功设置样式,结束循环
console.log('Webview样式设置成功');
}
};
setTimeout(retrySetWebviewStyle, 100);
},
tabClick (item) {
if (this.wv) {
let message = item.sumScore > item.score ? item.tagGroupName : ''
this.wv.evalJS(`sendMessage({type:'reset_chat',payload:{message:'${message}'}})`)
}
},
handlerMessage ({ detail }) {
uni.hideLoading()
let [data] = detail.data
if (typeof data.isResponding == 'boolean') this.isResponding = data.isResponding
if (typeof data.isRecording == 'boolean') this.isRecording = data.isRecording
if (data.isResponding || data.isRecording) {
this.disabledText = data.isResponding ? '请等待内容生成后再切换其他质检点' : '请等待录音结束后再切换其他质检点'
}
}
}
}
</script>
<style scoped lang="scss">
.reception-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: linear-gradient(180deg, #ebf2ff 0%, #f1f6ff 100%);
box-sizing: border-box;
padding-top: toRpx(160);
overflow: hidden;
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 9;
text-align: center;
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
line-height: toRpx(96);
.back {
position: absolute;
left: 0;
top: 0;
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
}
}
.reception-content-box {
padding: 0 toRpx(64) toRpx(64);
box-sizing: border-box;
height: 100%;
.reception-left-box {
width: calc(100% - #{toRpx(1326)});
height: 100%;
box-sizing: border-box;
padding-right: toRpx(32);
.customer-info {
width: 100%;
height: toRpx(156);
border-radius: toRpx(24);
background: linear-gradient(180deg, #f0f6ff 0%, #ffffff 100%);
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
box-sizing: border-box;
padding: toRpx(32) toRpx(32) 0;
position: relative;
.name {
color: #333333;
font-size: toRpx(36);
font-weight: 500;
line-height: toRpx(44);
.phone {
color: #79859e;
font-size: toRpx(26);
font-weight: normal;
margin-left: toRpx(16);
flex-shrink: 0;
}
}
.brand-box {
margin-top: toRpx(18);
gap: toRpx(12);
.brand {
height: toRpx(32);
border-radius: toRpx(4);
border: toRpx(2) solid #e8ecf0;
padding: 0 toRpx(8);
color: #79859e;
font-size: toRpx(22);
}
}
.tips {
position: absolute;
right: toRpx(32);
bottom: toRpx(28);
line-height: toRpx(40);
.tips-text {
color: #f24724;
}
.deal {
color: #2cca74;
}
&-box {
opacity: 0.85;
color: #2cca74;
font-size: toRpx(32);
}
.score-box {
opacity: 0.85;
color: #292d33;
font-size: toRpx(48);
font-weight: 700;
line-height: toRpx(44);
margin-left: toRpx(16);
padding-left: toRpx(16);
position: relative;
display: flex;
align-items: baseline;
&::before {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
content: '';
width: toRpx(2);
height: toRpx(14);
background: #979797;
}
.unit {
font-size: toRpx(24);
font-weight: 400;
margin-left: toRpx(4);
}
}
}
}
.content-box {
width: 100%;
height: calc(100% - #{toRpx(192)});
margin-top: toRpx(36);
border-radius: toRpx(32);
background: #ffffff33;
backdrop-filter: blur(toRpx(16));
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
position: relative;
.control-box {
position: absolute;
right: toRpx(32);
top: toRpx(28);
.play-box {
height: toRpx(60);
border-radius: toRpx(28);
border: toRpx(2) solid #f0f6ff;
background: #ffffff;
margin-left: toRpx(8);
padding: 0 toRpx(12) 0 toRpx(4);
color: #757980;
font-size: toRpx(26);
.sprite-icon {
margin-right: toRpx(4);
}
}
}
.content-tab-box {
height: toRpx(112);
padding: 0 toRpx(32);
gap: toRpx(24);
.tab {
width: toRpx(172);
height: toRpx(72);
border-radius: toRpx(16);
border: toRpx(2) solid #ffffffcc;
background: #ffffff;
backdrop-filter: blur(toRpx(12));
box-sizing: border-box;
justify-content: center;
color: #666666;
font-size: toRpx(30);
transition: all 0.1s;
}
.active-tab {
background: linear-gradient(180deg, #6795ff 0%, #4a84f9 100%);
color: #fff;
font-weight: 500;
}
}
.component-box {
width: 100%;
height: calc(100% - #{toRpx(112)});
position: relative;
.component-item {
position: absolute;
top: 0;
left: 0;
transition: all 0.15s;
}
.hide {
opacity: 0;
z-index: -1;
}
}
}
}
.reception-right-box {
height: 100%;
width: toRpx(1326);
border-radius: toRpx(32);
opacity: 1;
background: #f5f9ff;
box-sizing: border-box;
position: relative;
.AI-window {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.AI-title {
height: toRpx(96);
font-size: toRpx(36);
font-weight: 500;
justify-content: center;
color: #333333;
}
}
.nothing {
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
color: #808291;
font-size: toRpx(28);
background: #fff;
}
}
}
}
</style>
<template>
<scroll-view scroll-y class="service-list">
<view class="message-index-box">
<view class="message-list" v-if="getTopList.length > 0">
<view :class="['message-item', moduleType == i.moduleType ? 'active' : '']" v-for="(i, ind) in getTopList"
:key="ind" @click.stop="handleClick(i)">
<view class="message-item-icon">
<view :class="['sprite-icon', `icon-${moduleIconEnum[i.moduleType]}`]"></view>
<view class="message-item-icon-num" v-if="i.count > 0">{{ i.count > 99 ? 99 : i.count }}</view>
</view>
<view class="message-item-content">
<view class="message-item-title">{{ moduleTypeEnum[i.moduleType] }}</view>
<view class="message-item-desc">{{ moduleContentEnum[i.moduleType] ? moduleContentEnum[i.moduleType] :
i.title }}</view>
</view>
<view class="message-item-time-box">
<view class="message-item-time">{{ formatTime(i.createdTime, 'HH:mm') }}</view>
<view class="sprite-icon icon-stick-top"></view>
</view>
</view>
</view>
<template v-if="getList.length > 0">
<view class="message-group" v-for="(item, index) in getList" :key="index">
<view class="message-date">{{ item.date }}</view>
<view class="message-list">
<view :class="['message-item', moduleType == i.moduleType ? 'active' : '']"
v-for="(i, ind) in item.msgList" :key="ind" @click.stop="handleClick(i)">
<view class="message-item-icon">
<view :class="['sprite-icon', `icon-${moduleIconEnum[i.moduleType]}`]"></view>
<view class="message-item-icon-num" v-if="i.count > 0">{{ i.count > 99 ? 99 : i.count }}</view>
</view>
<view class="message-item-content">
<view class="message-item-title">{{ moduleTypeEnum[i.moduleType] }}</view>
<view class="message-item-desc">{{ moduleContentEnum[i.moduleType] ? moduleContentEnum[i.moduleType] :
i.title }}</view>
</view>
<view class="message-item-time">{{ formatTime(i.createdTime, 'HH:mm') }}</view>
</view>
</view>
</view>
</template>
<template v-else>
<view class="message-empty">
<image class="message-empty-img" src="../../../../assets//images/home/notice-nothing.webp"
mode="scaleToFill" />
<view class="message-empty-text">暂无消息</view>
</view>
</template>
</view>
</scroll-view>
</template>
<script>
import dayjs from 'dayjs';
import { moduleTypeEnum, moduleIconEnum, moduleContentEnum } from './contant.js';
export default {
name: 'MessageIndex',
props: {
moduleType: {
type: [Number, String, null],
default: null
},
topListProp: {
type: Array,
default: () => []
},
messageList: {
type: Array,
default: () => []
}
},
data() {
return {
moduleTypeEnum,
moduleIconEnum,
moduleContentEnum,
topList: [],
msgList: [
{
moduleType: 3,
title: '请在06-dfasd',
createdTime: new Date().getTime(),
count: null,
strdate: '2025-06-11'
},
{
moduleType: 4,
title: '请在06-csaf ',
createdTime: new Date().getTime(),
count: 698,
strdate: '2025-06-11'
},
{
moduleType: 0,
title: '#这是通知标题##这是通知标题##这是通知标题##这是通知标题##这是通知标题#',
createdTime: new Date().getTime(),
count: 6,
strdate: '2025-06-11'
},
{
moduleType: 2,
title: 'dfs',
createdTime: new Date().getTime(),
count: 99,
strdate: '2025-06-12'
},
{
moduleType: 1,
title: 'df ',
createdTime: new Date().getTime(),
count: 99,
strdate: '2025-06-12'
}
]
}
},
watch: {
messageList: {
handler(newVal) {
this.msgList = newVal
},
immediate: true
},
topListProp: {
handler(newVal) {
this.topList = newVal
},
immediate: true
}
},
computed: {
getTopList() {
if (!this.topList) return [];
// 过滤出topList中包含moduleType的对象
const result = this.msgList.filter(item => this.topList.includes(item.moduleType));
return result
// // 按topList中的倒序排列
// return this.topList.slice().reverse().map(type =>
// this.msgList.find(item => item.moduleType === type)
// ).filter(Boolean);
},
getList() {
// 过滤掉topList中包含moduleType的对象
const filteredList = this.msgList.filter(item => {
if (!this.topList) return true;
return !this.topList.includes(item.moduleType);
});
// 根据date进行分组
const groupedByDate = {};
filteredList.forEach(item => {
if (!groupedByDate[item.strDate]) {
groupedByDate[item.strDate] = [];
}
groupedByDate[item.strDate].push(item);
});
// 转换为数组格式,并按date降序排列
return Object.keys(groupedByDate)
.sort((a, b) => b.localeCompare(a)) // 日期大的在前面
.map(date => ({
date,
msgList: groupedByDate[date]
}));
}
},
created() {
this.getTopInfo()
},
methods: {
getTopInfo() {
const { phone, shopMerchantId, sceneType } = uni.$storage.get('userInfo')
const _topInfo = uni.$storage.get('noticeTopInfo') || {}
const key = `${phone}-${shopMerchantId}-${sceneType}`
this.topList = _topInfo[key] || []
},
formatTime(time, formatStr) {
return dayjs(time).format(formatStr);
},
handleClick(item) {
this.$emit('handleClick', item)
// uni.navigateTo({
// url: `/pages/common/serviceDetail/index?moduleType=${moduleType}`
// })
}
}
}
</script>
<style scoped lang="scss">
.service-list {
height: 100%;
}
.message-index-box {
margin: 0 toRpx(32);
height: 100%;
.message-group {
.message-date {
color: #999999;
font-size: toRpx(24);
margin-bottom: toRpx(20);
text-align: center;
}
}
.message-list {
margin-bottom: toRpx(20);
.message-item {
position: relative;
display: flex;
align-items: center;
background: #ffffff;
border-radius: toRpx(24);
padding: toRpx(24);
&.active {
background: #4673ff1a;
}
&:not(:last-child) {
margin-bottom: toRpx(20);
}
.message-item-icon {
position: relative;
margin-right: toRpx(24);
&-num {
position: absolute;
top: toRpx(-6);
right: toRpx(-6);
height: toRpx(24);
line-height: toRpx(24);
padding: 0 toRpx(6);
color: #ffffff;
font-size: toRpx(20);
background: #FF4D4F;
border-radius: toRpx(50);
}
}
.message-item-content {
.message-item-title {
color: #333333;
font-size: toRpx(30);
}
.message-item-desc {
color: #999999;
font-size: toRpx(24);
margin-top: toRpx(8);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
}
.message-item-time {
color: #999999;
font-size: toRpx(24);
margin-left: auto;
}
.message-item-time-box {
display: flex;
flex-direction: column;
align-items: center;
margin-left: auto;
.icon-stick-top {
margin-top: toRpx(4);
}
}
}
}
}
.message-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: toRpx(144);
&-img {
width: toRpx(496);
height: toRpx(208);
}
&-text {
color: #999999;
font-size: toRpx(20);
}
}
</style>
\ No newline at end of file \ No newline at end of file
const moduleTypeEnum = {
0: '企业通知',
1: '优秀话术',
2: '违规话术',
3: '短课程学习',
4: '长课程学习'
}
const moduleIconEnum = {
0: 'notice-system',
1: 'notice-script',
2: 'notice-violate',
3: 'notice-study',
4: 'notice-study'
}
const moduleContentEnum = {
1: '叮咚!快来查看优秀话术,提升接待技巧吧',
2: '话术违规预警'
}
export { moduleTypeEnum, moduleIconEnum, moduleContentEnum }
\ No newline at end of file \ No newline at end of file
<template>
<view class="detail-box">
<view class="nav-bar">
<view class="back" @click="backPage">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">服务中心</view>
</view>
<view class="detail-content">
<view class="detail-left">
<ServiceList :moduleType="moduleType" :messageList="messageList" :topListProp="topList" @handleClick="handleClick" />
</view>
<view class="detail-right">
<view class="common-title">
<view>{{ moduleTypeEnum[moduleType] }}</view>
<view class="stick-top" @click="handleStickTop">
<view class="sprite-icon icon-stick-top-blue"></view>
{{ topList.includes(Number(moduleType)) ? '取消置顶' : '置顶' }}
</view>
</view>
<scroll-view scroll-y class="service-list" @scrolltolower="pageonReachBottom" :scroll-top="scrollTop">
<view class="service-item" v-for="(item, index) in list" :key="index" @click="handleDetail(item)">
<view class="service-item-title">
<view class="service-item-title-left">
<view
class="dot-value"
v-if="(
(moduleType == 0 && !item.readFlag) ||
(moduleType == 1 && item.status == 0) ||
(moduleType == 2 && item.status == 0) ||
(moduleType == 3 && item.status == 0) ||
(moduleType == 4 && item.status == 0)
)"
></view>
<template v-if="moduleType == 3 || moduleType == 4">
{{ item.title }}
</template>
<template v-else>
{{ moduleTypeEnum[moduleType] }}
</template>
</view>
<view class="service-item-title-right">
<view>查看详情</view>
<view class="sprite-icon icon-coupon-arrow"></view>
</view>
</view>
<template v-if="moduleType == 3 || moduleType == 4">
<template v-if="item.taskType == 1">
<view class="service-item-text">学习任务名称:{{ item.taskName }}</view>
<view class="service-item-text">任务完成时间:小伙伴,请于{{formatTime(item.finishTime, 'YYYY-MM-DD HH:mm')}}完成哦~</view>
<!-- <view class="service-item-text">提醒内容:{{ item.title }}</view> -->
</template>
<template v-else-if="item.taskType == 2">
<view class="service-item-text">提醒内容:您有未完成的学习任务即将到期:{{formatTime(item.finishTime, 'YYYY-MM-DD HH:mm')}},抓紧时间完成哦!</view>
<!-- <view class="service-item-text">学习任务名称:{{ item.taskName }}</view> -->
</template>
</template>
<view class="service-item-text">提醒时间:{{ item.time || formatTime(item.createdTime, 'YYYY-MM-DD HH:mm') }}</view>
<template v-if="moduleType == 1 || moduleType == 2">
<view class="service-item-text">提醒内容:{{ moduleContentEnum[moduleType] }}</view>
</template>
<template v-else-if="moduleType == 0">
<view class="service-item-text">提醒内容:{{ item.title }}</view>
</template>
</view>
<template v-if="nothing">
<view class="end-text">-已经到底了-</view>
</template>
</scroll-view>
</view>
</view>
<uni-transition :show="noticeTips" mode="slide-top">
<view class="notice-tips" >
<!-- <view class="sprite-icon icon-notice-success"></view> -->
<view>{{ topList.includes(Number(moduleType)) ? '置顶成功' : '取消置顶' }}</view>
</view>
</uni-transition>
</view>
</template>
<script>
const PAGE_SIZE = 10
const PAGE_NUM = 1
let timer = null
import dayjs from 'dayjs'
import { moduleTypeEnum, moduleContentEnum } from './components/contant'
import ServiceList from './components/ServiceList.vue';
import {getMessageSummary} from '../../../api/module/common'
export default {
name: 'ServiceDetail',
components: {
ServiceList
},
data() {
return {
moduleTypeEnum,
moduleContentEnum,
moduleType: null,
topList: [],
scriptList: [],
earlyWarnList: [],
systemList: [],
shortCourseList: [],
longCourseList: [],
total: 0,
nothing: false,
pageNum: 1,
pageSize: 10,
scrollTop: 0,
isLoading: false,
userInfo: {},
noticeTips: false,
messageList: [],
isfirst: true
}
},
computed: {
list() {
switch (this.moduleType) {
case 0:
return this.systemList
case 1:
return this.scriptList
case 2:
return this.earlyWarnList
case 3:
return this.shortCourseList
case 4:
return this.longCourseList
default:
return []
}
}
},
watch: {
moduleType: {
handler(newVal) {
this.getRightList(newVal)
},
}
},
onLoad(options) {
this.userInfo = uni.$storage.get('userInfo')
this.getTopInfo()
this.moduleType = Number(options.moduleType)
this.isfirst = false
},
onShow() {
if (!this.isfirst) {
this.getMessageSummary(this.userInfo.sceneType)
console.log(this.moduleType, 'moduleType')
this.getRightList(this.moduleType)
}
},
methods: {
formatTime(time, formatStr) {
return dayjs(time).format(formatStr);
},
// 获取服务中心列表
async getMessageSummary(sceneType) {
// const userInfo = uni.$storage.get('userInfo')
const res = await getMessageSummary({businessType: sceneType})
this.messageList = res
},
getRightList(val) {
switch (val) {
case 0:
this.getSystemPage()
break
case 1:
this.getScriptList()
break
case 2:
this.getWarningPage()
break
case 3:
this.getCourseList(3)
break
case 4:
this.getCourseList(4)
default:
break
}
},
// 获取缓存中置顶的列表
getTopInfo() {
const {phone, shopMerchantId, sceneType} = this.userInfo
this.getMessageSummary(sceneType)
const _topInfo = uni.$storage.get('noticeTopInfo') || {}
const key = `${phone}-${shopMerchantId}-${sceneType}`
this.topList = _topInfo[key] || []
},
backPage() {
uni.navigateBack({
success: (res) => {
this.getMessageSummary(this.userInfo.sceneType)
uni.$emit('messageBackHome', this.topList)
}
});
},
handleClick(item) {
// 如果点击的是同一个模块类型,则不进行操作
if (this.moduleType === item.moduleType) {
return
}
this.moduleType = item.moduleType
this.pageNum = PAGE_NUM
this.pageSize = PAGE_SIZE
this.scrollTop = 0
this.nothing = false
setTimeout(() => {
this.scrollTop = 0
}, 100);
},
// 企业通知列表
async getSystemPage() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const res = await uni.$api.commonApi.getTaskInfo({
pageNum, pageSize
})
res.list?.length && res.list.map(e => {
e.time = e.actualSendTimeStr
})
if (pageNum == 1) {
this.systemList = res.list
} else {
this.systemList = this.systemList.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
// 优秀话术列表
async getScriptList() {
try {
uni.showLoading({
mask: true
})
const { sceneType, uuid } = uni.$storage.get("userInfo")
const { pageNum, pageSize } = this
let businessTypeList = []
if (sceneType == 0) {
businessTypeList = [0, 2]
} else if (sceneType == 1) {
businessTypeList = [1]
}
const params = {
// businessType: sceneType,
businessTypeList,
uuid,
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getPageRecord(params)
res.list?.length && res.list.map(e => {
e.time = dayjs(new Date(e.pushTime)).format("YYYY-MM-DD HH:mm:ss")
})
if (pageNum == 1) {
this.scriptList = res.list
} else {
this.scriptList = this.scriptList.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
// 违规话术列表
async getWarningPage() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const params = {
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getWarningPage(params)
res.list?.length && res.list.map(e => {
e.time = dayjs(new Date(e.warningTime)).format("YYYY-MM-DD HH:mm:ss")
})
if (pageNum == 1) {
this.earlyWarnList = res.list
console.log(this.earlyWarnList, '===')
} else {
this.earlyWarnList = this.earlyWarnList.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
/**
* 页面触底时的处理函数
* 当页面触底时,判断是否还有更多数据,如果有则加载下一页数据
* 如果没有更多数据,则标记为没有更多数据状态
*/
pageonReachBottom() {
console.log('到底了');
// 解构赋值,设置 nothing 的默认值
let { pageNum, total, nothing = 'nothing', pageSize } = this;
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1;
// 根据 firstIndex 的值调用不同的方法
switch (this.moduleType) {
case 1:
try {
this.getMessagePage();
} catch (error) {
console.error('调用 getMessagePage 方法时出错:', error);
}
break;
case 0:
try {
this.getSystemPage();
} catch (error) {
console.error('调用 getSystemPage 方法时出错:', error);
}
break;
case 2:
try {
this.getWarningPage();
} catch (error) {
console.error('调用 getWarningPage 方法时出错:', error);
}
break;
case 3:
try {
this.getCourseList(3);
} catch (error) {
console.error('调用 getWarningPage 方法时出错:', error);
}
break;
case 4:
try {
this.getCourseList(4);
} catch (error) {
console.error('调用 getWarningPage 方法时出错:', error);
}
break;
default:
break;
}
} else {
this.nothing = true;
}
},
// 查看详情
async handleDetail(item) {
console.log(item, this.moduleType)
const {moduleType} = this
switch (moduleType) {
case 0:
console.log('企业消息跳转')
const res = await uni.$api.commonApi.getTaskById({ id: item.id })
const _row = encodeURIComponent(JSON.stringify(res))
if (res.contentType == 1) {
uni.navigateTo({
url: `/pages/common/systemDetail?row=${_row}`
})
} else if (res.contentType == 2) {
console.log(JSON.parse(res.content))
const _content = res.content ? JSON.parse(res.content) : []
const url = _content[0]
const { content, title, id } = res
uni.navigateTo({
// url: `/pages/common/msgwebview?url=${url}&title=${title}&id=${id}`
url: `/pages/common/imgPreview?tabName=${title}&sourceType=2&detailUrl=${url}&row=${_row}`
})
} else if (res.contentType == 3) {
const _content = res.content ? JSON.parse(res.content) : []
const url = _content[0].image
const { content, title, id } = res
uni.navigateTo({
url: `/pages/common/msgwebview?fileUrl=${url}&title=${title}&id=${id}&row=${_row}`
})
}
break
case 1:
console.log('优秀话术跳转')
uni.navigateTo({
url: `/pages/common/messageDetail?row=${encodeURIComponent(JSON.stringify(item))}&type=service`,
fail: (err) => {
console.error('页面跳转失败:', err);
}
});
break
case 2:
console.log('违规话术跳转')
uni.navigateTo({
url: `/pages/common/earlyWarnDetail?row=${encodeURIComponent(JSON.stringify(item))}`,
fail: (err) => {
console.error('页面跳转失败:', err);
}
});
break
case 3:
console.log('短课程学习跳转')
uni.$track.add({eventCode: 'app_short_course', businessId: item.detailId, pagePath: '/pages/common/serviceDetail/index'})
// const row = {
// ...item,
// }
// row.id = item.detailId
uni.navigateTo({
url: `/pages/common/studyDetail/shortCourse?row=${encodeURIComponent(JSON.stringify(item))}&completeStatus=${item.completeStatus}&from=service`,
fail: (err) => {
console.error('页面跳转失败:', err);
}
});
break
case 4:
console.log('长课程学习跳转')
uni.navigateTo({
url: `/pages/common/studyDetail/longCourse?row=${encodeURIComponent(JSON.stringify(item))}&completeStatus=${item.completeStatus}&from=service`,
fail: (err) => {
console.error('页面跳转失败:', err);
}
});
break
default:
break
}
},
async getCourseList(moduleType) {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this
const res = await uni.$api.commonApi.getCourseList({
pageNum, pageSize, moduleType
})
res.list?.length && res.list.map(e => {
e.time = e.actualSendTimeStr
})
if (pageNum == 1) {
moduleType == 3 ? (this.shortCourseList = res.list) : (this.longCourseList = res.list)
} else {
moduleType == 3 ? (this.shortCourseList = this.shortCourseList.concat(res.list)) : (this.longCourseList = this.longCourseList.concat(res.list))
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
// 置顶,取消置顶
handleStickTop() {
clearTimeout(timer)
const { phone, shopMerchantId, sceneType } = this.userInfo
const _topInfo = uni.$storage.get('noticeTopInfo') || {}
const key = `${phone}-${shopMerchantId}-${sceneType}`
let _topList = _topInfo[key] || []
if (_topList.includes(this.moduleType)) {
_topList = _topList.filter(item => item !== this.moduleType)
} else {
_topList.push(this.moduleType)
}
_topInfo[key] = _topList
this.topList = _topList
this.noticeTips = true
timer = setTimeout(() => {
this.noticeTips = false
}, 3000)
uni.$storage.set('noticeTopInfo', _topInfo)
}
}
}
</script>
<style scoped lang="scss">
.detail-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding: toRpx(160) toRpx(64) 0;
}
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
}
.detail-content {
display: flex;
height: calc(100vh - #{toRpx(212)});
.detail-left {
width: toRpx(800);
height: 100%;
border-radius: toRpx(48);
background: #ffffff59;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
margin-right: toRpx(32);
padding-top: toRpx(32);
}
.detail-right {
// width: toRpx(1368);
width: calc(100% - #{toRpx(832)});
height: 100%;
border-radius: toRpx(48);
background: #ffffff59;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
z-index: 1;
overflow: hidden;
.common-title {
display: flex;
align-items: center;
justify-content: space-between;
}
.stick-top {
height: toRpx(50);
border-radius: toRpx(530);
background: #4673ff1a;
color: #4673ff;
font-size: toRpx(24);
display: flex;
align-items: center;
justify-content: center;
margin-right: toRpx(48);
padding: 0 toRpx(16);
.sprite-icon {
margin-right: toRpx(4);
}
}
.service-list {
width: 100%;
height: calc(100% - #{toRpx(120)});
.service-item {
width: calc(100% - #{toRpx(96)});
background: #fff;
border-radius: toRpx(16);
padding: toRpx(24) toRpx(32);
margin-left: toRpx(48);
margin-right: toRpx(48);
&:not(:last-child) {
margin-bottom: toRpx(32);
}
&-title-left {
display: flex;
align-items: center;
.dot-value {
width: toRpx(12);
height: toRpx(12);
border-radius: 50%;
background: #F24724;
margin-right: toRpx(24);
}
}
&-title {
display: flex;
align-items: center;
justify-content: space-between;
color: #333333;
font-size: toRpx(32);
font-weight: 500;
&-right {
display: flex;
align-items: center;
color: #999999;
font-size: toRpx(24);
}
}
&-text {
color: #999999;
font-size: toRpx(28);
margin-top: toRpx(16);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
}
}
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0;
font-size: toRpx(24);
}
.notice-tips {
position: fixed;
top: toRpx(150);
width: toRpx(400);
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
justify-content: center;
color: #FFFFFF;
font-size: toRpx(28);
padding: toRpx(16) toRpx(24);
border-radius: toRpx(8);
z-index: 1;
background-color: #000000cc;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<uni-popup
ref="coursePopupRef"
type="center"
:is-mask-click="false"
animation
class="center-popup"
>
<view :class="['box', popType]">
<view class="title flex">
<view :class="['sprite-icon', `icon-defeat-${popType}`]"></view>
<view class="text">{{title}}</view>
<view
class="icon-close-box flex"
@click="close"
>
<uni-icons
class="icon-close"
type="closeempty"
:size="16"
color="#1A1A1A"
></uni-icons>
</view>
</view>
<view class="content">
<slot name="content"></slot>
</view>
</view>
</uni-popup>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'CenterPopup',
props: {
title: String,
popType: String,
},
data () {
return {
}
},
mounted () {
},
methods: {
open () {
this.$refs.coursePopupRef.open();
},
close () {
this.$refs.coursePopupRef.close();
this.$emit('cancel')
},
}
}
</script>
<style scoped lang='scss'>
.center-popup {
z-index: 99 !important;
}
.box {
width: toRpx(1456);
height: toRpx(840);
background: #ffffff;
border-radius: toRpx(48);
&.summary {
width: toRpx(848);
height: toRpx(400);
}
.title {
width: 100%;
height: toRpx(128);
padding-left: toRpx(48);
background: linear-gradient(180deg, #e6f0ff 0%, #e6f0ff00 100%);
position: relative;
border-radius: toRpx(48) toRpx(48) 0 0;
.text {
font-weight: 500;
font-size: toRpx(40);
color: #1a1a1a;
margin-left: toRpx(24);
// position: absolute;
// left: 50%;
// top: 50%;
// transform: translate(-50%, -50%);
}
.icon-close-box {
height: 100%;
margin-left: auto;
padding: 0 toRpx(48);
}
}
.content {
padding: toRpx(16) toRpx(80) toRpx(72);
width: 100%;
height: calc(100% - #{toRpx(160)});
gap: 0 toRpx(64);
.item {
width: calc(50% - #{toRpx(32)});
height: 100%;
background: #ffffff;
box-shadow: 0 toRpx(12) toRpx(24) 0 #2c66f726;
border-radius: toRpx(48);
flex-direction: column;
box-sizing: border-box;
padding-top: toRpx(92);
position: relative;
overflow: hidden;
.tag {
position: absolute;
width: 192rpx;
height: 72rpx;
border-radius: 0 0 toRpx(48) 0;
background: #4673ff1a;
left: 0;
top: 0;
color: #4673ff;
font-size: 28rpx;
justify-content: center;
}
&-title {
font-weight: 500;
font-size: toRpx(40);
color: #1a1a1a;
padding: toRpx(32) 0 toRpx(16);
}
&-describe {
font-size: toRpx(32);
color: #808291;
text-align: center;
}
&:first-child {
&::before,
&::after {
background: #f7f5ff;
}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view >
<template v-if="labelColors && labelColors.length > 0">
<qiun-data-charts type="radar" :opts="opts" :tooltipShow="false" :chartData="chartData" :class="['charts-box', heightClass]" />
</template>
<template v-else>
<view class="nothing flex" :class="['big-height']">
<image class="icon" src="../../../../assets/images/boutique/nothing.png" />
暂无数据
</view>
</template>
</view>
</template>
<script>
export default {
name: 'RadarChart',
props: {
chartData: {
type: Object,
default: () => {}
},
heightClass: {
type: String
},
labelColors: {
type: Array,
default: () => ['#666666', '#666666', '#666666', '#666666', '#666666', '#666666', '#666666', '#666666', '#666666']
}
},
watch: {
labelColors: {
handler(newVal) {
console.log(newVal, 'newVal')
this.opts.labelColors = newVal
},
}
},
data() {
return {
opts: {
color: ["#3B73FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"],
padding: [0, 5, 0, 5],
dataLabel: false,
enableScroll: false,
// labelColors: ['#666666', '#666666', '#666666', '#666666', '#666666', '#EB4E4E', '#666666', '#EB4E4E', '#666666'],
fontSize: 12,
legend: {
show: false
},
extra: {
radar: {
gridType: "radar",
gridColor: "#dae8fd",
gridCount: 3,
opacity: 0.2,
max: 3,
labelShow: true,
dataPointShape: false,
axisLabelTofix: 1, // 保留一位小数
labelFormatter: function (val) {
// 精确到小数点后一位
return typeof val === 'number' ? val.toFixed(1) : val;
}
}
}
},
}
},
mounted() {
console.log(this.chartData, ' 详情')
}
}
</script>
<style lang="scss" scoped>
.charts-box {
width: 100%;
height: toRpx(272);
&.big-height {
height: toRpx(300);
}
}
.nothing {
width: 100%;
height: toRpx(228);
flex-direction: column;
margin-top: toRpx(76);
font-size: toRpx(24);
color: #999999;
box-sizing: border-box;
&.big-height {
height: toRpx(234);
}
.icon {
width: toRpx(288);
height: toRpx(144);
margin-bottom: toRpx(4);
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="detail-box">
<view class="nav-bar">
<view class="back" @click="backPage">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">{{ type === 'recommendation' ? '推荐课程' : '任务详情' }}</view>
</view>
<view class="detail-content">
<view class="detail-content-left">
<view class="title">课程列表</view>
<view class="scroll-view-box">
<scroll-view class="scroll-view" scroll-y @scrolltolower="pageonReachBottom">
<view :class="['scroll-view-item', selectedIndex == index ? 'active' : '']"
v-for="(item, index) in getCourseList" :key="index" @click="openCourse(index, item)">
<template v-if="type === 'long'">
<image class="item-img" src="../../../assets/images/common/long-course-default.webp"
mode="scaleToFill" />
<view class="item-content">
<view class="item-title">{{ item.courseName }}</view>
<view class="item-info">
<view class="item-info-label">当前状态</view>
<view :class="['item-info-value', item.status === 5 ? 'green' : 'orange']">
<view v-if="item.status !== 5" class="dot-value"></view>
{{ item.status !== 5 ? `${statusMap[item.status]}(${item.progress === 0 ? 0 : item.progress || 0}%)` : '已完成' }}
</view>
</view>
<view class="item-info">
<view class="item-info-label">考试成绩</view>
<!-- <view class="item-info-value">{{ (item.totalScore || item.totalScore === 0) ? item.totalScore : '待考核' }}</view> -->
<template v-if="item.status !== 5 && item.totalScore == null">待考核</template>
<template v-else-if="item.status !== 5 && item.totalScore != null">{{ item.totalScore }}分</template>
<template v-else-if="item.status === 5 && item.totalScore == null">无需考核</template>
<template v-else-if="item.status === 5 && item.totalScore != null">{{ item.totalScore }}分</template>
</view>
<view class="item-info">
<view class="item-info-label">课程时长</view>
<view class="item-info-value">{{ (item.learnDuration || item.learnDuration === 0) ? `${item.learnDuration}min` : '-' }}</view>
</view>
</view>
<image class="completed-bg" src="../../../assets/images/common/completed-bg.png" mode="scaleToFill"
v-if="item.status === 5" />
<view v-else class="item-btn" @click="openCourse(index, item)">
开始学习
</view>
</template>
<template v-if="type === 'recommendation'">
<image class="recommendation-img" src="../../../assets/images/common/recommend-course-default2.webp"
mode="scaleToFill" />
<view class="item-content">
<view class="recommendation-title">{{ item.courseName }}</view>
<view class="item-info">
<view class="item-info-label">{{ (item.totalDuration || item.totalDuration === 0) ? `${item.totalDuration}min` : '-' }}</view>
</view>
</view>
<view class="item-btn" @click="openCourse(index, item)">
学习
</view>
</template>
</view>
<template v-if="nothing">
<view class="end-text">到底了!</view>
</template>
</scroll-view>
</view>
</view>
<view class="detail-content-right">
<view class="web-view-box">
<web-view ref="studyWebview" v-if="jumpUrl" :src="jumpUrl"></web-view>
</view>
</view>
</view>
</view>
</template>
<script>
const statusMap = {
1: '未学习',
2: '未完成',
3: '待考核',
4: '未通过',
5: '已完成'
}
export default {
data() {
return {
statusMap,
courseList: [],
recommendCourseList: [],
type: '',
selectedIndex: 0,
jumpUrl: '',
webviewHistory: [],
pageData: {},
nothing: false,
tokenUrl: ''
}
},
computed: {
getCourseList() {
switch (this.type) {
case 'recommendation':
return this.recommendCourseList;
case 'long':
return this.courseList;
}
}
},
onLoad(options) {
this.type = options.type;
this.pageData = {
pageNum: options.pageNum,
pageSize: options.pageSize,
total: options.total
}
this.selectedIndex = options.index;
let courseId = null;
if (options.courseList) {
this.courseList = JSON.parse(decodeURIComponent(options.courseList));
courseId = this.courseList[options.index].courseId;
}
if (options.recommendCourseList) {
this.recommendCourseList = JSON.parse(decodeURIComponent(options.recommendCourseList));
courseId = this.recommendCourseList[options.index].courseId;
}
console.log(this.recommendCourseList, 'this.recommendCourseList')
this.handleOperation(courseId);
// 只在页面初始化时设置webview的样式
this.setWebviewStyle();
},
onBackPress (options) {
if (options.from === "backbutton") {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
this.backPage();
return true;
}
// 其他情况允许正常返回
return false;
},
methods: {
backPage() {
const currentWebview = this.$scope.$getAppWebview().children()[0];
if(currentWebview){
currentWebview.close()
}
uni.navigateBack()
},
async openCourse(index, item) {
console.log(index, 'index')
this.selectedIndex = index;
this.tokenUrl = await this.findBeiSenSSOToken() // 每次都重新获取token,防止过期
// const arr = ['80cb90d7-1609-4360-8f23-6c47ddba41c0', '17983a1a-5bcd-4e7d-a180-061ef3f9a49d']
// 只更换url
this.handleOperation(item.courseId);
if (this.type === 'recommendation') {
uni.$track.add({eventCode: 'app_recommend_course', businessId: item.id, pagePath: '/pages/common/studyDetail/detail'})
} else if (this.type === 'long') {
uni.$track.add({eventCode: 'app_long_course', businessId: item.id, pagePath: '/pages/common/studyDetail/detail'})
}
},
findBeiSenSSOToken () {
return new Promise(resolve => {
uni.$api.commonApi.findBeiSenSSOToken({}).then(res => {
uni.$storage.set('beisenToken', res.data)
resolve(res.data)
})
})
},
handleOperation(courseId) {
// 只处理课程详情,设置jumpUrl
const COURSE_ID = courseId;
const baseUrl = 'https://cloud.italent.cn/PageHome/Index';
const params = {
product: 'Learning',
keyName: 'Nusion',
pageCode: 'LearningCourseTraineeDetailPage',
appCode: 'Learning',
id: COURSE_ID
};
this.jumpUrl = ''
const queryString = Object.entries(params)
.map(([key, value]) => `${key}=${value}`)
.join('&');
const tokenUrl = this.tokenUrl || uni.$storage.get('beisenToken')
// this.setWebviewStyle()
const url = encodeURIComponent(`${baseUrl}?${queryString}#/viewDynamic?1=1`);
this.jumpUrl = `${tokenUrl}&return_url=${url}`;
},
setWebviewStyle() {
// 只在页面初始化时设置webview的样式
// plus.navigator.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.0.0')
const setWebviewStyleWithRetry = () => {
console.log(this.$scope.$getAppWebview(), 'this.$parent.$scope')
const currentWebview = this.$scope.$getAppWebview();
const wv = currentWebview.children()[0];
console.log(wv, 'wv')
if (wv) {
wv.setStyle({
left: '470',
top: '100',
height: '620',
width: '653',
borderRadius: '24',
overflow: 'hidden'
});
return true; // 成功设置样式
} else {
return false; // 未找到wv
}
};
const retrySetWebviewStyle = () => {
if (!setWebviewStyleWithRetry()) {
// 如果未成功,继续重试
setTimeout(retrySetWebviewStyle, 50);
} else {
// 成功设置样式,结束循环
console.log('Webview样式设置成功');
}
};
setTimeout(retrySetWebviewStyle, 100);
},
pageonReachBottom() {
console.log('到底了', this.pageData, pageNum < Math.ceil(total / pageSize));
const { pageNum, pageSize, total } = this.pageData;
if (pageNum < Math.ceil(total / pageSize)) {
this.pageData.pageNum = Number(this.pageData.pageNum) + 1;
this.getCourseTaskPage();
} else {
this.nothing = true;
}
},
// 获取我的任务接口, completeStatus: 完成状态 0=待完成 1=已完成, courseType: 课程类型 1=短课程 2=长课程
async getCourseTaskPage() {
try {
uni.showLoading({
mask: true
})
const { pageNum, pageSize } = this.pageData
const params = {
recommendStatus: 1, // 推荐状态 0=无推荐 1=推荐课程
pageNum,
pageSize
}
const res = await uni.$api.commonApi.getCourseTaskPage(params)
if (pageNum == 1) {
this.recommendCourseList = res.list
} else {
this.recommendCourseList = this.recommendCourseList.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
}
}
</script>
<style scoped lang="scss">
.detail-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding: toRpx(160) toRpx(64) 0;
}
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
}
.detail-content {
display: flex;
height: calc(100vh - #{toRpx(214)});
.detail-content-left {
width: toRpx(800);
height: 100%;
background: #fff;
border-radius: toRpx(32);
background: #ffffff59;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
margin-right: toRpx(32);
z-index: 999999;
.title {
font-size: toRpx(34);
color: #292D33;
font-weight: 700;
padding: toRpx(32) toRpx(48);
}
.scroll-view-box {
display: flex;
padding: 0 toRpx(32) toRpx(32);
height: calc(100% - #{toRpx(110)});
}
.scroll-view {
border-radius: toRpx(24);
background-color: #fff;
height: 100%;
.scroll-view-item {
position: relative;
display: flex;
padding: toRpx(24);
align-items: center;
&:first-child {
border-radius: toRpx(24) toRpx(24) 0 0;
}
&:last-child {
border-radius: 0 0 toRpx(24) toRpx(24);
}
&:first-child:last-child {
/* 只有一个元素时,四个角都圆角 */
border-radius: toRpx(24);
}
&.active {
background: #EBF0FF;
}
.item-img {
width: toRpx(128);
height: toRpx(160);
border-radius: toRpx(16);
}
.recommendation-img {
width: toRpx(128);
height: toRpx(144);
border-radius: toRpx(16);
}
.item-content {
display: flex;
flex-direction: column;
margin-left: toRpx(24);
width: toRpx(364);
.item-title {
font-size: toRpx(30);
color: #333333;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
margin-bottom: toRpx(16);
}
.recommendation-title {
color: #292D33;
font-size: toRpx(30);
margin-bottom: toRpx(8);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
}
.item-info {
display: flex;
align-items: center;
font-size: toRpx(24);
&:not(:last-child) {
margin-bottom: toRpx(10);
}
.item-info-label {
color: #999EA8;
margin-right: toRpx(24);
}
.item-info-value {
display: inline-flex;
align-items: center;
justify-content: center;
color: #666666;
&.orange {
color: #F59619;
}
&.green {
color: #2CCA74;
}
.dot-value {
width: toRpx(12);
height: toRpx(12);
border-radius: 50%;
background: #F59619;
margin-right: toRpx(8);
}
}
}
}
.item-btn {
margin-left: auto;
width: toRpx(148);
height: toRpx(64);
border-radius: toRpx(24);
background: #F1F7FE;
font-size: toRpx(26);
color: #3B73FF;
text-align: center;
line-height: toRpx(64);
}
.completed-bg {
width: toRpx(112);
height: toRpx(112);
position: absolute;
bottom: toRpx(56);
right: toRpx(40);
top: 50%;
transform: translateY(-50%);
}
}
}
}
.detail-content-right {
flex: 1;
background: #fff;
border-radius: toRpx(32);
background: #ffffff;
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
.web-view-box {
border-radius: toRpx(32);
overflow: hidden;
}
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0;
font-size: toRpx(24);
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="detail-box">
<view class="nav-bar">
<view class="back" @click="backPage">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">任务详情</view>
</view>
<view class="course-detail-box">
<view class="course-detail-img-box">
<image class="course-detail-img" src="../../../assets/images/common/course-default-bg.webp"
mode="scaleToFill" />
<view class="time-limit-tag" v-if="completeStatus == 0 && rowData.punishType == 1"></view>
</view>
<view class="course-detail-content">
<view class="course-title">{{ rowData.taskTitle || rowData.taskName }}</view>
<view class="course-info course-progress">
<view class="info-label">任务进度</view>
<view v-if="completeStatus == 1" class="info-progress-text green">
<view class="dot-value"></view>
已完成
</view>
<view class="info-progress" v-else>
<view class="info-progress-bar" :style="{ width: Math.floor(rowData.taskProgress) + '%' }"></view>
<view class="info-progress-text">{{ Math.floor(rowData.taskProgress) }}%</view>
</view>
</view>
<view class="course-info">
<view class="info-label">课程数</view>
<view class="info-value">
{{ (rowData.courseTotalCount || rowData.courseTotalCount === 0) ? `${rowData.courseTotalCount}节` : '-' }}|
{{ (rowData.totalDuration || rowData.totalDuration === 0) ? `${rowData.totalDuration}min` : '-' }}
</view>
</view>
<view class="course-info">
<view class="info-label">完成时间</view>
<view class="info-value">{{ completeStatus == 0 ? formatTime(rowData.taskDeadline, 'YYYY-MM-DD HH:mm') :
formatTime(rowData.finishDate, 'YYYY-MM-DD HH:mm') }}</view>
</view>
</view>
<view class="time-limit-countdown" v-if="completeStatus == 0 && rowData.punishType == 1">
<template v-if="!isTimeout">
<view class="countdown-label">仅剩</view>
<view class="countdown-num">{{ countdown.days < 10 ? '0' + countdown.days : countdown.days }}</view>
<view class="countdown-separator">天</view>
<view class="countdown-num">{{ countdown.hours < 10 ? '0' + countdown.hours : countdown.hours }}</view>
<view class="countdown-separator">:</view>
<view class="countdown-num">{{ countdown.minutes < 10 ? '0' + countdown.minutes : countdown.minutes
}}</view>
<view class="countdown-separator">:</view>
<view class="countdown-num">{{ countdown.seconds < 10 ? '0' + countdown.seconds :
countdown.seconds }}</view>
</template>
<template v-else>
<view class="countdown-label" style="color:#B87A11;">已超时</view>
</template>
</view>
</view>
<view class="course-list-box-wrapper">
<view class="course-list-box-title">课程列表</view>
<scroll-view class="course-list-box" scroll-y>
<view class="course-list-item-wrapper">
<view class="course-list-item" @click="startStudy(index, item)" v-for="(item, index) in courseList"
:key="index">
<image class="course-img" src="../../../assets/images/common/long-course-default.webp" mode="scaleToFill" />
<view class="item-content">
<view class="item-title">{{ item.courseName }}</view>
<view class="item-info">
<view class="item-info-label">当前状态</view>
<view :class="['item-info-value', item.status === 5 ? 'green' : 'orange']">
<view class="dot-value" :class="item.status === 5 ? 'green' : 'orange'"></view>
{{ item.status !== 5 ? `${statusMap[item.status]}(${item.progress === 0 ? 0 : item.progress || 0}%)` : '已完成' }}
</view>
</view>
<view class="item-info">
<view class="item-info-label">考试成绩</view>
<view class="item-info-value">
<template v-if="item.status !== 5 && item.totalScore == null">待考核</template>
<template v-else-if="item.status !== 5 && item.totalScore != null">{{ item.totalScore }}分</template>
<template v-else-if="item.status === 5 && item.totalScore == null">无需考核</template>
<template v-else-if="item.status === 5 && item.totalScore != null">{{ item.totalScore }}分</template>
</view>
</view>
<view class="item-info">
<view class="item-info-label">课程时长</view>
<view class="item-info-value">{{ (item.learnDuration || item.learnDuration === 0) ? `${item.learnDuration}min` : '-' }}</view>
</view>
<template v-if="item.status === 5">
<image class="completed-bg" src="../../../assets/images/common/completed-bg.png" mode="scaleToFill" />
</template>
<template v-else>
<view class="item-btn">
开始学习
</view>
</template>
</view>
</view>
</view>
<!-- <template>
<view class="end-text">到底了!</view>
</template> -->
</scroll-view>
</view>
</view>
</template>
<script>
const statusMap = {
1: '未学习',
2: '未完成',
3: '待考核',
4: '未通过',
5: '已完成'
}
import dayjs from 'dayjs'
export default {
data() {
return {
progress: 80,
courseList: [],
rowData: {},
completeStatus: null,
punishType: null,
countdown: {
days: 0,
hours: 0,
minutes: 0,
seconds: 0
},
isTimeout: false,
timer: null,
statusMap,
}
},
onLoad(options) {
const { row } = options
const rowData = JSON.parse(decodeURIComponent(row))
console.log(rowData, 'rowData')
this.rowData = rowData
if (!this.rowData.taskDeadline) this.rowData.taskDeadline = rowData.finishTime
this.completeStatus = options.completeStatus
this.punishType = options.punishType
if (options.from === 'service') {
this.getLongCourseDetail(rowData.detailId, rowData.id)
} else {
this.getLongCourseDetail(rowData.id)
}
if (this.completeStatus == 0) {
this.initCountdown()
}
},
watch: {
// 监听rowData变化,重新初始化倒计时
'rowData.taskDeadline'(val) {
this.initCountdown()
}
},
methods: {
// 格式化时间
formatTime(time, formatStr) {
if (!time) return '-';
return dayjs(time).format(formatStr);
},
backPage() {
uni.navigateBack();
uni.$emit('backStudyCenter')
},
async getLongCourseDetail(id, boxId) {
const params = { id }
if (boxId) {
params.boxId = boxId
}
const res = await uni.$api.commonApi.getLongCourseDetail(params)
console.log(res, 'res')
this.courseList = res.courseList
},
initCountdown() {
// 清除旧定时器
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
// 兼容rowData未加载时
if (!this.rowData || !this.rowData.taskDeadline) {
this.isTimeout = false
this.countdown = { days: 0, hours: 0, minutes: 0, seconds: 0 }
return
}
const updateCountdown = () => {
const now = dayjs()
const deadline = dayjs(this.rowData.taskDeadline)
const diff = deadline.diff(now, 'second')
if (diff <= 0) {
this.isTimeout = true
this.countdown = { days: 0, hours: 0, minutes: 0, seconds: 0 }
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
} else {
this.isTimeout = false
let seconds = diff
const days = Math.floor(seconds / (24 * 3600))
seconds = seconds % (24 * 3600)
const hours = Math.floor(seconds / 3600)
seconds = seconds % 3600
const minutes = Math.floor(seconds / 60)
seconds = seconds % 60
this.countdown = {
days,
hours,
minutes,
seconds
}
}
}
updateCountdown()
this.timer = setInterval(updateCountdown, 1000)
},
startStudy(index, item) {
uni.$api.commonApi.findBeiSenSSOToken({}).then(res => {
const beisenToken = res.data
uni.$storage.set('beisenToken', res.data)
if (beisenToken) {
uni.$track.add({ eventCode: 'app_long_course', businessId: item.id, pagePath: '/pages/common/studyDetail/longCourse' })
uni.navigateTo({
url: `/pages/common/studyDetail/detail?type=long&index=${index}&courseList=${encodeURIComponent(JSON.stringify(this.courseList))}`
})
} else {
uni.showToast({
title: '培训账号未创建',
icon: 'none'
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.detail-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding: toRpx(160) toRpx(64) 0;
}
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
}
.course-detail-box {
position: relative;
display: flex;
align-items: center;
border-radius: toRpx(32);
background: #ffffff59;
box-shadow: inset 0 0 16px 0 #ffffff;
padding: toRpx(32) toRpx(48);
.course-detail-img-box {
position: relative;
margin-right: toRpx(40);
.course-detail-img {
width: toRpx(472);
height: toRpx(279);
border-radius: toRpx(24);
}
.time-limit-tag {
position: absolute;
top: 0;
left: 0;
width: toRpx(122);
height: toRpx(48);
background-image: url('../../../assets/images/common/limit-page.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
z-index: 1;
color: #fff;
}
}
.course-detail-content {
.course-title {
font-size: toRpx(34);
color: #292D33;
margin-bottom: toRpx(28);
font-weight: 500;
}
.course-info {
position: relative;
display: flex;
align-items: center;
font-size: toRpx(28);
&:not(:last-child) {
margin-bottom: toRpx(28);
}
.info-label {
width: toRpx(112);
color: #999EA8;
margin-right: toRpx(24);
}
.info-value {
color: #666666;
}
.green {
display: flex;
align-items: center;
color: #2CCA74;
.dot-value {
width: toRpx(12);
height: toRpx(12);
border-radius: 50%;
background: #2CCA74;
margin-right: toRpx(8);
}
}
.info-progress {
width: toRpx(410);
height: toRpx(16);
background: linear-gradient(128.8deg, rgba(117, 188, 255, .35) 0%, rgba(44, 102, 247, .35) 100%);
border-radius: toRpx(8);
.info-progress-text {
color: #3B73FF;
font-size: toRpx(24);
position: absolute;
top: 50%;
right: toRpx(-72);
transform: translateY(-50%);
}
.info-progress-bar {
height: 100%;
background: linear-gradient(128.8deg, #75bcff 0%, #2c66f7 100%);
border-radius: toRpx(8);
}
}
}
}
.time-limit-countdown {
position: absolute;
right: toRpx(48);
top: toRpx(40);
line-height: toRpx(48);
display: flex;
align-items: center;
justify-content: center;
font-size: toRpx(28);
z-index: 1;
.limit-page {
width: toRpx(122);
height: toRpx(48);
margin-right: toRpx(16);
}
.countdown-num {
display: flex;
flex-basis: 0;
// justify-content: center;
color: #B87A11;
width: toRpx(48);
height: toRpx(48);
line-height: toRpx(48);
border-radius: toRpx(6);
background: #b87a1126;
margin: 0 toRpx(8);
line-height:normal;
padding: toRpx(10) toRpx(8) toRpx(6);
}
.countdown-separator {
color: #B87A11;
}
.countdown-label,
.countdown-unit {
line-height: toRpx(48);
color: #B87A11;
margin: 0 toRpx(4);
}
}
}
.course-list-box-wrapper {
position: relative;
width: 100%;
height: calc(100vh - #{toRpx(610)});
background-color: #fff;
border-radius: toRpx(40);
// padding: toRpx(32) toRpx(48);
margin-top: toRpx(32);
.course-list-box-title {
font-size: toRpx(34);
color: #292D33;
font-weight: 500;
padding: toRpx(32) toRpx(48);
}
.course-list-box {
height: calc(100% - #{toRpx(110)});
padding-bottom: toRpx(32);
}
.course-list-item-wrapper {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: toRpx(40);
padding: 0 toRpx(48) toRpx(32);
.course-list-item {
position: relative;
height: toRpx(504);
border-radius: toRpx(24);
background: #ffffff;
font-size: 0;
box-shadow: 0 toRpx(8) toRpx(24) 0 #2a61eb1a;
overflow: hidden;
.course-img {
width: 100%;
height: toRpx(180);
border-radius: toRpx(24) toRpx(24) 0 0;
}
.item-content {
padding: toRpx(24) toRpx(32);
}
.item-title {
font-size: toRpx(30);
color: #292D33;
font-weight: 500;
margin-top: toRpx(8);
margin-bottom: toRpx(28);
overflow: hidden; /* 超出部分隐藏 */
white-space: nowrap; /* 文本不换行 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
}
.item-info {
display: flex;
margin-bottom: toRpx(16);
font-size: toRpx(24);
.item-info-label {
color: #999EA8;
margin-right: toRpx(24);
}
.item-info-value {
color: #666666;
display: inline-flex;
align-items: center;
justify-content: center;
&.green {
color: #2CCA74;
}
&.orange {
color: #F59619;
}
.dot-value {
width: toRpx(12);
height: toRpx(12);
border-radius: 50%;
// background: #F59619;
margin-right: toRpx(8);
&.green {
background: #2CCA74;
}
&.orange {
background: #F59619;
}
}
}
}
.item-btn {
margin-top: toRpx(32);
width: toRpx(430.5);
height: toRpx(56);
border-radius: toRpx(24);
background: #F1F7FE;
font-size: toRpx(26);
color: #3B73FF;
text-align: center;
line-height: toRpx(56);
}
.completed-bg {
width: toRpx(144);
height: toRpx(144);
position: absolute;
bottom: toRpx(56);
right: toRpx(-26);
}
}
}
}
.end-text {
color: #999;
text-align: center;
padding: toRpx(30) 0;
font-size: toRpx(24);
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="detail-box">
<view class="nav-bar">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="20"
color="#000"
></uni-icons>
</view>
<view class="title">任务详情</view>
</view>
<view class="detail-content">
<view class="left-box">
<view class="top-box">
<view class="top-box-name">
{{ courseDetail.staffName || '-' }}
<view
class="role-tag"
v-for="(item, index) in courseDetail.positionList"
:key="index"
>{{ item }}</view>
</view>
<view class="top-box-info">
<view class="top-box-info-item">驻店时间:{{ courseDetail.residentTimeTag || '-' }}</view>
<view class="top-box-info-item">
直属上级:
<text class="superior-text">
{{ courseDetail.superior || '-' }}
</text>
</view>
</view>
</view>
<view class="bottom-box">
<view class="bottom-box-title margin-bottom">
<view>战败复盘</view>
<view class="date">{{ formatTime(courseDetail.checkDate, 'YYYY年MM月DD日') }}</view>
</view>
<RadarChart
:labelColors="labelColors"
:chartData="chartData"
/>
<view class="bottom-box-summary">
<view>总结</view>
<view
class="summary-btn"
@click="handleSummary"
>查看</view>
</view>
<view class="bottom-box-title">
<view>战败明细</view>
</view>
<view class="bottom-box-detail">
<scroll-view
scroll-y
class="bottom-box-detail-scroll"
>
<view
class="bottom-box-detail-item"
@click="handleDetail(item)"
v-for="(item, index) in courseDetail.defeatReviewDetailList"
:key="index"
>
<view class="detail-item-box">
<view class="name-box">
<view class="name-box-text">{{ item.customerName }} </view>
<view class="phone">{{
desensitizePhone(item.customerPhone) }}</view>
</view>
<view class="role-box">
<view class="role-tag-box">
<view
v-if="item.carBrand"
class="role-tag"
>{{ item.carBrand }}</view>
<view
v-if="item.carModel"
class="role-tag"
>{{ item.carModel }}</view>
</view>
<view class="role-tag-score">
<view class="role-tag-score-text">战败</view>
<view class="score-line"></view> {{ Math.floor(item.inspectionScore) }} <view class="score-text-unit">分</view>
</view>
</view>
</view>
<view class="sprite-icon icon-detail-arrow"></view>
</view>
</scroll-view>
</view>
</view>
</view>
<view class="right-box">
<view class="right-box-title">
<view class="right-box-title-left">
<view class="sprite-icon icon-short-task-title"></view>
短课程学习明细
</view>
<view
class="time-limit-countdown"
v-if="completeStatus == 0"
>
<image
class="limit-page"
src="../../../assets/images/common/limit-page2.png"
mode="scaleToFill"
/>
<template v-if="!isTimeout">
<view class="countdown-label">仅剩</view>
<view class="countdown-num">{{ countdown.days < 10 ? '0' + countdown.days : countdown.days }}</view>
<view class="countdown-separator">天</view>
<view class="countdown-num">{{ countdown.hours < 10 ? '0' + countdown.hours : countdown.hours
}}</view>
<view class="countdown-separator">:</view>
<view class="countdown-num">{{ countdown.minutes < 10 ? '0' + countdown.minutes :
countdown.minutes }}</view>
<view class="countdown-separator">:</view>
<view class="countdown-num">{{ countdown.seconds < 10 ? '0' + countdown.seconds :
countdown.seconds }}</view>
</template>
<template v-else>
<view
class="countdown-label"
style="color:#B87A11;"
>已超时</view>
</template>
</view>
</view>
<view class="table-box">
<view
class="table-content"
style="border-radius: 16px; overflow: hidden;"
>
<view class="table-header flex">
<template v-for="(i, index) in qualityTitle">
<view
:class="['title-item flex', `row-${index + 1}`]"
:key="index"
>{{ i }}</view>
</template>
</view>
<scroll-view
scroll-y
class="table-content-scroll"
>
<view
class="table-content-item"
v-for="(item, index) in courseDetail.aiReviewReport"
:key="index"
>
<view class="row-1 flex">{{ item.tagName }}</view>
<view class="row-2">
<view class="table-content-text">不足:{{ item.weakness }}</view>
<view class="table-content-suggest">
<view class="suggest-title">改善建议</view> {{ item.suggestion }}
</view>
</view>
<view class="row-3 flex">
<template v-if="item.examStatus == 2">
<view class="sprite-icon icon-task-pass"></view>
<view class="check-result-text">考核通过</view>
</template>
<template v-else>
<view
:class="['check-result-btn', item.examStatus == 0 ? 'disabled' : '']"
@click="handleExam(item)"
>{{item.examStatus == 0 ? '无需考核' : '去考核'}}</view>
</template>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
<CoursePopup
ref="coursePopupRef"
:popType="popupType"
:title="popupTitle"
@cancel="handleCancel"
>
<template #content>
<template v-if="popupType == 'summary'">
<view class="summary-content">
{{ courseDetail.summaryCopy }}
</view>
</template>
<template v-if="popupType == 'detail'">
<view class="popup-details-box">
<view class="detail-user-info">
<view class="user-basic-info">
<view class="user-name">{{courseDetail.staffName || '-'}}</view>
<view class="user-phone">{{desensitizePhone(popupDetail.customerPhone) || '-'}}</view>
</view>
<view class="role-tag-score">
<view class="role-tag-score-text">战败</view>
<view class="score-line"></view>
<view class="score-value">{{ Math.floor(popupDetail.inspectionScore) }}</view>
<view class="score-text-unit">分</view>
</view>
</view>
<view class="role-box">
<view
v-if="popupDetail.carBrand"
class="role-tag"
>{{ popupDetail.carBrand }}</view>
<view
v-if="popupDetail.carModel"
class="role-tag"
>{{ popupDetail.carModel }}</view>
</view>
<view class="detail-time-list">
<view class="detail-time-item">开始于 <view class="detail-time-value">{{ popupDetail.receptionStartTime }}</view>
</view>
<view class="detail-time-item">结束于 <view class="detail-time-value">{{ popupDetail.receptionEndTime }}</view>
</view>
<view class="detail-time-item">共计 <view class="detail-time-value">{{ popupDetail.receptionDuration }}</view>
</view>
</view>
<view class="identity-list">
<view
class="identity-item"
v-for="(i, index) in popupDetail.indicatorTagList"
:key="index"
>
<view class="identity-title">{{ i.tagGroupName }}</view>
<view :class="['identity-desc', i.tagValueName === '差' ? 'bad' : '']">{{ i.tagValueName }}</view>
</view>
</view>
</view>
</template>
</template>
</CoursePopup>
<learn-popup
ref="learn"
content="您还没有完成本次短课程学习,\n是否确定退出?"
@confirm="backPage"
/>
</view>
</template>
<script>
import dayjs from 'dayjs'
import CoursePopup from 'pages/common/studyDetail/components/CoursePopup.vue'
import RadarChart from 'pages/common/studyDetail/components/RadarChart.vue'
import LearnPopup from '@/components/LearnPopup.vue'
export default {
components: {
RadarChart,
CoursePopup,
LearnPopup
},
data () {
return {
chartData: {},
labelColors: [],
qualityTitle: Object.freeze(['课程标签', '不足/改善建议', '对练考核']),
courseDetail: {},
rowData: {},
countdown: {
days: 0,
hours: 0,
minutes: 0,
seconds: 0
},
isTimeout: false,
timer: null,
coursePopupVisible: false,
popupTitle: '',
popupType: '',
popupDetail: {},
aiAgentData: {},
completeStatus: null,
studyId: '',
options: {}
}
},
onLoad (options) {
console.log(options, 'options')
this.options = options
const { row } = options
const rowData = JSON.parse(decodeURIComponent(row))
console.log(rowData, 'rowData')
this.rowData = rowData
this.completeStatus = options.completeStatus
if (!this.rowData.taskDeadline) this.rowData.taskDeadline = rowData.finishTime
this.refreshStudyList()
if (this.completeStatus == 0) {
this.initCountdown()
}
this.getAiAgentList()
uni.$on('refreshStudyList', () => {
this.refreshStudyList()
})
},
onUnload () {
// 清除定时器
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
},
watch: {
// 监听rowData变化,重新初始化倒计时
'rowData.taskDeadline' (val) {
this.initCountdown()
}
},
computed: {
learnRef () {
return this.$refs.learn
},
},
onBackPress (options) {
if (options.from === 'backbutton') {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
this.back()
return true
}
// 其他情况允许正常返回
return false
},
methods: {
refreshStudyList () {
const { options, rowData } = this
if (options.from === 'service') {
this.studyId = rowData.detailId
this.getShortCourseDetail(rowData.detailId, rowData.id)
} else {
this.studyId = rowData.id
this.getShortCourseDetail(rowData.id)
}
},
desensitizePhone (phone) {
if (!phone || typeof phone !== 'string') return phone;
// 只处理11位手机号
if (phone.length === 11) {
return phone.substr(0, 3) + '****' + phone.substr(7, 4);
}
// 其他长度不处理
return phone;
},
formatTime (time, formatStr) {
return dayjs(time).format(formatStr);
},
backPage () {
if (!this.coursePopupVisible) { // 防止弹窗遮罩点击后返回
uni.$emit("backStudyCenter")
uni.navigateBack();
}
},
async getShortCourseDetail (id, boxId) {
uni.showLoading()
const params = { id }
if (boxId) {
params.boxId = boxId
}
const res = await uni.$api.commonApi.getShortCourseDetail(params)
uni.hideLoading()
// const res = {
// staffName: '许小奇',
// position: '驻店销售,带教导师',
// residentTimeTag: '',
// superior: '',
// defeatReviewTag: ["身份介绍", "逼单能力", "攻防能力", "案例展示", "场景塑造", "专业知识", "需求分析", "话题介入", "服务意识"],
// defeatReviewScore: [1, 2, 3, 1, 2, 2, 3, 3, 3]
// }
const _chartData = {
categories: res.defeatReviewTag,
series: [
{
data: res.defeatReviewValue
}
]
}
this.chartData = _chartData
if (_chartData.series && _chartData.series[0] && Array.isArray(_chartData.series[0].data)) {
const dataArr = _chartData.series[0].data;
let _labelColors = [];
if (dataArr.every(val => val === 0)) {
_labelColors = [];
} else {
_labelColors = dataArr.map(val => val === 1 ? '#EB4E4E' : '#666666');
}
console.log(_labelColors, '_labelColors')
this.labelColors = _labelColors;
console.log(this.labelColors, 'this.labelColors')
}
console.log(res, 'res')
res.positionList = res.position.split(',')
this.courseDetail = res
},
// 获取智能体
async getAiAgentList () {
const { phone } = uni.$storage.get("userInfo")
const res = await uni.$api.commonApi.getAiAgentList({
accountPhone: phone,
ownerShipType: 1, // 1-驻店 0-总部
agentCode: 'AI8'
})
this.aiAgentData = res[0]
},
initCountdown () {
// 清除旧定时器
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
// 兼容rowData未加载时
if (!this.rowData || !this.rowData.taskDeadline) {
this.isTimeout = false
this.countdown = { days: 0, hours: 0, minutes: 0, seconds: 0 }
return
}
const updateCountdown = () => {
const now = dayjs()
const deadline = dayjs(this.rowData.taskDeadline)
const diff = deadline.diff(now, 'second')
if (diff <= 0) {
this.isTimeout = true
this.countdown = { days: 0, hours: 0, minutes: 0, seconds: 0 }
if (this.timer) {
clearInterval(this.timer)
this.timer = null
}
} else {
this.isTimeout = false
let seconds = diff
const days = Math.floor(seconds / (24 * 3600))
seconds = seconds % (24 * 3600)
const hours = Math.floor(seconds / 3600)
seconds = seconds % 3600
const minutes = Math.floor(seconds / 60)
seconds = seconds % 60
this.countdown = {
days,
hours,
minutes,
seconds
}
}
}
updateCountdown()
this.timer = setInterval(updateCountdown, 1000)
},
async handleExam (item) {
console.log(item, '===')
if (item.examStatus == 0) {
return
}
// const { checkDate } = this.rowData
const { businessType, brandType, checkDate } = this.courseDetail
console.log(checkDate, 'checkDate')
let { agentUrl, domainName, taskStatus, agentCode } = this.aiAgentData
// if (agentCode == 'AI8') {
// const isPermision = await this.isPermissionFunction('请打开麦克风权限')
// if (!isPermision) return
// }
if (!agentUrl) {
return uni.showToast({
title: '待开放',
icon: 'none'
})
}
let url = `/pages/common/aiWebview?url=${agentUrl}&domain=${domainName}&presuppositionProblem=${item.tagName}&businessType=${businessType}&brandType=${brandType}&studyId=${this.studyId}&pageTitle=AI导师`
url += `&date=${this.formatTime(checkDate, 'YYYY-MM-DD')}`
uni.navigateTo({ url })
},
handleSummary () {
console.log(1211, '===')
this.popupTitle = '战败总结'
this.popupType = 'summary'
this.coursePopupVisible = true
this.$refs.coursePopupRef.open()
},
handleDetail (item) {
this.popupTitle = '战败详情'
this.popupType = 'detail'
this.popupDetail = item
this.coursePopupVisible = true
this.$refs.coursePopupRef.open()
},
handleCancel () {
this.coursePopupVisible = false
},
back () {
try {
const { aiReviewReport } = this.courseDetail
aiReviewReport.map(e => {
if (e.examStatus != 2) throw 1
})
this.backPage()
} catch (error) {
if (error == 1) this.learnRef.open()
else this.backPage()
}
}
}
}
</script>
<style lang="scss" scoped>
.detail-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding: toRpx(160) toRpx(64) 0;
}
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
}
.detail-content {
display: flex;
gap: toRpx(32);
height: calc(100% - #{toRpx(80)});
.left-box {
width: toRpx(656);
height: 100%;
.top-box {
width: 100%;
height: toRpx(160);
border-radius: toRpx(24);
background: linear-gradient(180deg, #f0f6ff 0%, #ffffff 100%);
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
padding: toRpx(32);
&-name {
display: flex;
align-items: center;
color: #333333;
font-size: toRpx(36);
font-weight: 500;
.role-tag {
height: toRpx(36);
border-radius: toRpx(4);
border: toRpx(2) solid #e8ecf0;
padding: toRpx(4) toRpx(16);
font-size: toRpx(24);
color: #79859e;
margin-left: toRpx(12);
font-weight: 400;
&:first-child {
margin-left: toRpx(16);
}
}
}
&-info {
display: flex;
justify-content: space-between;
margin-top: toRpx(24);
&-item {
color: #79859e;
font-size: toRpx(24);
font-weight: 400;
.superior-text {
max-width: toRpx(200);
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
vertical-align: bottom;
}
}
}
}
.bottom-box {
width: 100%;
height: calc(100% - #{toRpx(184)});
border-radius: toRpx(24);
background: linear-gradient(180deg, #f0f6ff 0%, #ffffff 100%);
box-shadow: inset 0 0 toRpx(16) 0 #ffffff;
padding: toRpx(24) toRpx(32);
margin-top: toRpx(24);
.bottom-box-title {
display: flex;
justify-content: space-between;
color: #1a1a1a;
font-size: toRpx(28);
font-weight: 400;
&.margin-bottom {
margin-bottom: toRpx(12);
}
.date {
font-size: toRpx(24);
color: #79859e;
}
}
.bottom-box-summary {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
background-color: #fff;
border-radius: toRpx(16);
padding: toRpx(18) toRpx(24);
font-size: toRpx(24);
color: #000000;
margin-top: toRpx(24);
margin-bottom: toRpx(32);
.summary-btn {
color: #3b73ff;
}
}
.bottom-box-detail {
border-radius: toRpx(24);
margin-top: toRpx(16);
height: calc(100% - #{toRpx(496)});
overflow: hidden;
.bottom-box-detail-scroll {
height: 100%;
border-radius: toRpx(24);
}
&-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: toRpx(24);
background-color: #fff;
&:first-child {
border-radius: toRpx(24) toRpx(24) 0 0;
}
&:last-child {
border-radius: 0 0 toRpx(24) toRpx(24);
}
.detail-item-box {
width: 100%;
}
.name-box {
display: flex;
align-items: center;
margin-bottom: toRpx(12);
&-text {
max-width: toRpx(312);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.phone {
font-size: toRpx(24);
color: #79859e;
margin-left: toRpx(16);
}
}
.role-box {
display: flex;
align-items: center;
justify-content: space-between;
.role-tag-box {
display: flex;
align-items: center;
}
.role-tag {
max-width: toRpx(134);
margin-right: toRpx(8);
font-size: toRpx(22);
color: #79859e;
border-radius: toRpx(4);
border: toRpx(2) solid #e8ecf0;
padding: toRpx(4) toRpx(8);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.role-tag-score {
display: flex;
align-items: center;
font-size: toRpx(28);
color: #292d33;
margin-right: toRpx(26);
.score-line {
display: block;
width: toRpx(2);
height: toRpx(14);
background-color: #d1dbe7;
margin-left: toRpx(12);
margin-right: toRpx(12);
}
.role-tag-score-text {
font-size: toRpx(28);
color: #eb4e4e;
}
.score-text-unit {
margin-left: toRpx(4);
}
}
}
}
}
}
}
.right-box {
flex: 1;
background-color: #fff;
border-radius: toRpx(32);
height: 100%;
padding: toRpx(32) toRpx(40);
&-title {
position: relative;
display: flex;
align-items: center;
&-left {
display: flex;
align-items: center;
font-size: toRpx(32);
color: #333333;
font-weight: 500;
.icon-short-task-title {
margin-right: toRpx(16);
}
}
}
.time-limit-countdown {
position: absolute;
right: 0;
top: toRpx(8);
display: flex;
align-items: center;
justify-content: center;
font-size: toRpx(28);
z-index: 1;
.limit-page {
width: toRpx(122);
height: toRpx(48);
margin-right: toRpx(16);
}
.countdown-num {
display: flex;
align-items: center;
justify-content: center;
color: #b87a11;
width: toRpx(48);
height: toRpx(48);
border-radius: toRpx(4);
background: #b87a111a;
margin: 0 toRpx(8);
}
.countdown-separator {
color: #b87a11;
}
.countdown-label,
.countdown-unit {
color: #b87a11;
margin: 0 toRpx(4);
}
}
.table-box {
width: 100%;
height: calc(100% - #{toRpx(104)});
margin-top: toRpx(32);
.table-content {
width: 100%;
height: 100%;
.table-header {
background-color: #edf3ff;
border-radius: toRpx(16) toRpx(16) 0 0;
height: toRpx(88);
color: #000;
font-size: toRpx(26);
line-height: toRpx(40);
.title-item {
height: toRpx(88);
justify-content: center;
box-sizing: border-box;
flex-shrink: 0;
color: #000;
}
}
.row-1 {
width: toRpx(192);
}
.row-2 {
width: toRpx(1042);
border-right: toRpx(4) solid #fff;
border-left: toRpx(4) solid #fff;
}
.row-3 {
width: calc(100% - #{toRpx(1042 + 192)});
}
.table-content-scroll {
height: calc(100% - #{toRpx(88)});
.table-content-item {
display: flex;
font-size: toRpx(26);
background-color: #fafcff;
box-sizing: border-box;
border-top: toRpx(4) solid #fff;
.row-1 {
text-align: center;
color: #333;
align-items: center;
}
.row-1,
.row-2,
.row-3 {
padding: toRpx(24) toRpx(40);
vertical-align: middle;
}
.row-3 {
align-items: center;
.check-result-text {
color: #2cca74;
font-size: toRpx(24);
margin-left: toRpx(6);
}
.check-result-btn {
width: toRpx(120);
height: toRpx(56);
text-align: center;
line-height: toRpx(56);
color: #fff;
font-size: toRpx(24);
border-radius: toRpx(40);
background: linear-gradient(0deg, #2c66f7 0%, #48a6ff 100%);
&.disabled {
background: #d3dae6;
width: toRpx(140);
}
}
}
}
}
.table-content-text {
color: #71747a;
line-height: toRpx(40);
}
.table-content-suggest {
line-height: toRpx(40);
.suggest-title {
display: inline-block;
color: #3b73ff;
font-size: toRpx(24);
padding: toRpx(4) toRpx(12);
border-radius: toRpx(8);
background: #eaf3fe;
margin-top: toRpx(20);
margin-right: toRpx(16);
}
}
}
}
}
}
// 战败详情
.popup-details-box {
.detail-user-info {
display: flex;
align-items: center;
justify-content: space-between;
.user-basic-info {
display: flex;
align-items: baseline;
.user-name {
font-size: toRpx(48);
color: #333;
font-weight: 500;
margin-right: toRpx(20);
}
.user-phone {
font-size: toRpx(32);
color: #79859e;
}
}
.role-tag-score {
display: flex;
align-items: center;
.role-tag-score-text {
font-size: toRpx(32);
color: #eb4e4e;
}
.score-line {
display: block;
width: toRpx(2);
height: toRpx(24);
background-color: #d1dbe7;
margin-left: toRpx(12);
margin-right: toRpx(12);
}
.score-value {
font-size: toRpx(32);
color: #292d33;
}
.score-text-unit {
font-size: toRpx(32);
color: #292d33;
margin-left: toRpx(4);
}
}
}
.role-box {
display: flex;
align-items: center;
margin-top: toRpx(16);
.role-tag {
height: toRpx(44);
line-height: toRpx(44);
margin-right: toRpx(12);
font-size: toRpx(22);
color: #79859e;
border-radius: toRpx(4);
border: toRpx(2) solid #e8ecf0;
padding: 0 toRpx(8);
}
}
.detail-time-list {
display: flex;
justify-content: space-between;
margin-top: toRpx(32);
font-size: toRpx(32);
.detail-time-item {
display: flex;
color: #999ea8;
}
.detail-time-value {
color: #666;
margin-left: toRpx(16);
}
}
.identity-list {
display: grid;
grid-template-columns: repeat(5, 1fr);
grid-template-rows: repeat(2, 1fr);
gap: toRpx(32);
margin-top: toRpx(48);
.identity-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: toRpx(170);
border-radius: toRpx(16);
background-color: #f5f7fa;
// margin-right: toRpx(32);
&:nth-child(5n) {
margin-right: 0;
}
.identity-title {
font-size: toRpx(32);
color: #383838;
}
.identity-desc {
font-size: toRpx(40);
color: #181a1f;
margin-top: toRpx(16);
&.bad {
color: #eb4e4e;
}
}
}
}
}
.summary-content {
line-height: toRpx(40);
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="detail-box">
<view class="nav-bar">
<view class="back" @click="back">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">{{ systemInfo.title }}</view>
</view>
<view class="weekly-tips">
<scroll-view scroll-y class="outstanding-tip-list">
<view class="outstanding-tip-item">
<view class="tip-header">
<view class="tip-rank">{{ systemInfo.subtitle || '' }}</view>
<view class="tip-time">{{ systemInfo.time }}</view>
</view>
<view class="tip-content">
<rich-text :nodes="systemInfo.content"></rich-text>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import systemTrack from '../../mixin/systemTrack';
export default {
name: 'SystemDetial',
data() {
return {
classCountList: [],
countFlag: false,
systemInfo: {},
type: 'view',
content: '<p><img src=\"https://qcimg01.glsx.com.cn/group1/M00/0A/6B/wKgD3mfuUHiAIvUfAAKVSmxdFVE298.jpg\" style=\"max-width:100%;\" contenteditable=\"false\"/></p>'
}
},
mixins: [systemTrack],
methods: {
// 返回
back() {
// this.showPage('MessageList')
// uni.$emit('pageBack');
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100
})
},
}
}
</script>
<style scoped lang="scss">
.detail-box {
position: relative;
width: 100vw;
height: 100vh;
background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding-top: toRpx(160);
}
.nav-bar {
position: fixed;
width: 100%;
height: toRpx(96);
left: 0;
top: toRpx(48);
z-index: 999;
pointer-events: none;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
align-items: center;
justify-content: center;
pointer-events: auto;
}
.title {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: 700;
font-size: toRpx(32);
color: #1a1a1a;
}
}
.weekly-tips {
position: relative;
margin: 0 toRpx(64) toRpx(80);
background-color: rgba(255, 255, 255, 0.35);
border: toRpx(4) solid #fff;
border-radius: toRpx(16);
height: calc(100% - #{toRpx(80)});
.outstanding-tip-list {
height: 100%;
background-color: #fff;
border-radius: toRpx(16);
}
.outstanding-tip-item {
width: 100%;
padding: toRpx(24) toRpx(32);
border-radius: toRpx(16);
background-color: #fff;
height: 100%;
.tip-header {
// display: flex;
// align-items: center;
.tip-rank {
color: #333;
font-size: toRpx(32);
font-weight: 500;
line-height: toRpx(44);
margin-right: toRpx(24);
}
.tip-time {
color: rgba(102, 102, 102, 0.6);
font-size: toRpx(28);
line-height: toRpx(44);
}
.tip-tags {
border-radius: toRpx(4);
background: rgba(255, 157, 10, 0.1);
padding: toRpx(8) toRpx(24);
color: #ff9d0a;
font-size: toRpx(24);
font-weight: 500;
margin-left: toRpx(24);
}
}
.tip-content {
padding: toRpx(17) 0;
color: #666;
font-size: toRpx(28);
line-height: toRpx(48);
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -11,10 +11,8 @@ ...@@ -11,10 +11,8 @@
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import report from "@/mixin/report.js";
export default { export default {
name: '', name: '',
mixins:[report],
data () { data () {
return { return {
url: '', url: '',
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
@openStep="openStep" @openStep="openStep"
@backHome="backHome" @backHome="backHome"
@changeTab="changeTab" @changeTab="changeTab"
:moduleList="moduleList" :moduleList="homeList"
@swiperClick="toDetail" @swiperClick="toDetail"
:loadComplete="loadComplete" :loadComplete="loadComplete"
> >
...@@ -43,6 +43,7 @@ export default { ...@@ -43,6 +43,7 @@ export default {
components: { HomeFrame, detail }, components: { HomeFrame, detail },
data () { data () {
return { return {
homeList: [],
moduleList: [], moduleList: [],
folderList: [], folderList: [],
toolList: [], toolList: [],
...@@ -83,6 +84,7 @@ export default { ...@@ -83,6 +84,7 @@ export default {
// this.get_Vehicle_Sales_Data() // this.get_Vehicle_Sales_Data()
// this.requested = true // this.requested = true
// this.$refs.home.updateApp(true) // this.$refs.home.updateApp(true)
this.getHomeSource(mockdata?.typeCode)
this.getSoure(mockdata?.typeCode) this.getSoure(mockdata?.typeCode)
setTimeout(() => { setTimeout(() => {
...@@ -152,8 +154,19 @@ export default { ...@@ -152,8 +154,19 @@ export default {
shortTitleUrl: item.materialUrl shortTitleUrl: item.materialUrl
})) }))
}, },
// 获取首页素材
async getHomeSource(typeCode) {
const res = await uni.$api.commonApi.getPadMaterialList({
typeCode,
status: 0,
showOnHomepage: 1
})
console.log(res, 'res首页')
this.homeList = Array.isArray(res?.data) ? res.data : []
},
changeType () { changeType () {
const typeItem = uni.$storage.get('typeItem') const typeItem = uni.$storage.get('typeItem')
this.getHomeSource(typeItem?.typeCode)
this.getSoure(typeItem?.typeCode) this.getSoure(typeItem?.typeCode)
}, },
async start (item) { async start (item) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!