Commit 698e5bad by 胡悦

refactor: 移除无用组件和页面文件

清理项目中不再使用的组件和页面,包括:
1. 删除多个vue组件文件(NoticePopup, SwiperComponent等)
2. 删除serviceDetail、studyDetail等相关页面
3. 删除messageList、earlyWarnDetail等页面
4. 移除相关的枚举定义和样式文件

这些文件已不再被项目使用,清理以减少代码冗余
1 parent dde65788
<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
......@@ -82,30 +82,6 @@
}
},
{
"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"
......
<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
<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
<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
<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
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
<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
<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
<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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!