Commit bfcc3779 by 胡悦

提交服务中心代码

1 parent 91549652
......@@ -369,5 +369,13 @@ module.exports = {
projectName: 'pad',
...data
})
},
// 服务中心-消息汇总
getMessageSummary(data) {
return http.post({
method: 'dj.pad.api.page.script.sop.message.summary.list',
projectName: 'pad',
...data
})
}
}
......@@ -152,7 +152,7 @@
.icon-notice-study { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
background-position: calc(100vmin * (1173 / 768) * -0.59846547314578) calc(100vmin * (1173 / 768) * -0.4825234441602728);}
.icon-notice-success { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.3124467178175618) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.3375959079283887) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-notice-system { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
background-position: calc(100vmin * (1173 / 768) * 0) calc(100vmin * (1173 / 768) * -0.5366581415174766);}
.icon-notice-violate { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
......@@ -220,7 +220,7 @@
.icon-record { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
background-position: calc(100vmin * (1173 / 768) * -0.4373401534526854) calc(100vmin * (1173 / 768) * -0.4317988064791134);}
.icon-right-arrow { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.33248081841432225) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.3576300085251492) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-role-1 { width: calc(100vmin * (1173 / 768) * 0.028985507246376812); height: calc(100vmin * (1173 / 768) * 0.028985507246376812);
background-position: calc(100vmin * (1173 / 768) * -0.5707587382779199) calc(100vmin * (1173 / 768) * -0.5366581415174766);}
.icon-role-2 { width: calc(100vmin * (1173 / 768) * 0.028985507246376812); height: calc(100vmin * (1173 / 768) * 0.028985507246376812);
......@@ -228,7 +228,7 @@
.icon-rule { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * 0);}
.icon-scan { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.3525149190110827) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.3776641091219096) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-scene-0 { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
background-position: calc(100vmin * (1173 / 768) * -0.14194373401534527) calc(100vmin * (1173 / 768) * -0.5366581415174766);}
.icon-scene-1 { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
......@@ -236,7 +236,7 @@
.icon-scene-active { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
background-position: calc(100vmin * (1173 / 768) * -0.4880647911338448) calc(100vmin * (1173 / 768) * -0.4317988064791134);}
.icon-scene-change { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.37254901960784315) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.3976982097186701) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-scene { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
background-position: calc(100vmin * (1173 / 768) * -0.16240409207161124) calc(100vmin * (1173 / 768) * -0.4825234441602728);}
.icon-search { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
......@@ -249,14 +249,16 @@
background-position: calc(100vmin * (1173 / 768) * 0) calc(100vmin * (1173 / 768) * -0.4317988064791134);}
.icon-short-second-nav { width: calc(100vmin * (1173 / 768) * 0.1977834612105712); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
background-position: calc(100vmin * (1173 / 768) * -0.15302642796248933) calc(100vmin * (1173 / 768) * -0.13256606990622335);}
.icon-short-task-title { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
background-position: calc(100vmin * (1173 / 768) * -0.5861040068201193) calc(100vmin * (1173 / 768) * -0.5839727195225917);}
.icon-start-text { width: calc(100vmin * (1173 / 768) * 0.0733162830349531); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.4761295822676897) calc(100vmin * (1173 / 768) * -0.2659846547314578);}
.icon-stick-top-blue { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.39258312020460356) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.4177323103154305) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-stick-top { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.41261722080136404) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.437766410912191) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-store-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.43265132139812446) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.4578005115089514) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-store { width: calc(100vmin * (1173 / 768) * 0.04092071611253197); height: calc(100vmin * (1173 / 768) * 0.04092071611253197);
background-position: calc(100vmin * (1173 / 768) * -0.23657289002557544) calc(100vmin * (1173 / 768) * -0.5366581415174766);}
.icon-study-active { width: calc(100vmin * (1173 / 768) * 0.0443307757885763); height: calc(100vmin * (1173 / 768) * 0.0443307757885763);
......@@ -270,19 +272,21 @@
.icon-suggestions-arrow { width: calc(100vmin * (1173 / 768) * 0.015345268542199489); height: calc(100vmin * (1173 / 768) * 0.015345268542199489);
background-position: calc(100vmin * (1173 / 768) * -0.11381074168797954) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-suggestions-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.45268542199488493) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.4778346121057119) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-tag-checked { width: calc(100vmin * (1173 / 768) * 0.02557544757033248); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.42838874680306904) calc(100vmin * (1173 / 768) * -0.3269394714407502);}
.icon-task-pass { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.011935208866155157);
background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.03665814151747655);}
.icon-tdcj-icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.4855072463768116) calc(100vmin * (1173 / 768) * -0.4079283887468031);}
.icon-time-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.47271952259164535) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.4978687127024723) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-time { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.5089514066496164) calc(100vmin * (1173 / 768) * -0.4079283887468031);}
.icon-tips-b { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.4927536231884058) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.5179028132992327) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-tips-g { width: calc(100vmin * (1173 / 768) * 0.020460358056265986); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
background-position: calc(100vmin * (1173 / 768) * -0.5861040068201193) calc(100vmin * (1173 / 768) * -0.5839727195225917);}
background-position: calc(100vmin * (1173 / 768) * -0.6129582267689685) calc(100vmin * (1173 / 768) * -0.5839727195225917);}
.icon-tips { width: calc(100vmin * (1173 / 768) * 0.03410059676044331); height: calc(100vmin * (1173 / 768) * 0.03410059676044331);
background-position: calc(100vmin * (1173 / 768) * -0.5302642796248934) calc(100vmin * (1173 / 768) * -0.5366581415174766);}
.icon-tool-file { width: calc(100vmin * (1173 / 768) * 0.02557544757033248); height: calc(100vmin * (1173 / 768) * 0.02557544757033248);
......@@ -292,18 +296,18 @@
.icon-tool-pay { width: calc(100vmin * (1173 / 768) * 0.02557544757033248); height: calc(100vmin * (1173 / 768) * 0.02557544757033248);
background-position: calc(100vmin * (1173 / 768) * -0.3333333333333333) calc(100vmin * (1173 / 768) * -0.5839727195225917);}
.icon-total { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.5127877237851662) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.5379369138959932) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-two-arrow { width: calc(100vmin * (1173 / 768) * 0.011935208866155157); height: calc(100vmin * (1173 / 768) * 0.010230179028132993);
background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.054987212276214836);}
.icon-visible { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.5323955669224212) calc(100vmin * (1173 / 768) * -0.4079283887468031);}
.icon-warning-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.5328218243819267) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.5579710144927537) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-work-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.5528559249786871) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.578005115089514) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-ybtc_icon { width: calc(100vmin * (1173 / 768) * 0.017050298380221655); height: calc(100vmin * (1173 / 768) * 0.017050298380221655);
background-position: calc(100vmin * (1173 / 768) * -0.02514919011082694) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-yw-icon { width: calc(100vmin * (1173 / 768) * 0.015345268542199489); height: calc(100vmin * (1173 / 768) * 0.015345268542199489);
background-position: calc(100vmin * (1173 / 768) * -0.13554987212276215) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
.icon-zj-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.5728900255754475) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
background-position: calc(100vmin * (1173 / 768) * -0.5980392156862745) calc(100vmin * (1173 / 768) * -0.6176470588235294);}
\ No newline at end of file

2.44 MB | W: | H:

2.44 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -318,14 +318,14 @@ export default {
}
},
// 消息中心未读总数
async getMessageCount () {
const { sceneType } = uni.$storage.get("userInfo")
const res = await uni.$api.commonApi.getMessageCount({
status: 0, // 待查看,未读
businessType: sceneType
})
this.messageTotal = res
},
// async getMessageCount () {
// const { sceneType } = uni.$storage.get("userInfo")
// const res = await uni.$api.commonApi.getMessageCount({
// status: 0, // 待查看,未读
// businessType: sceneType
// })
// this.messageTotal = res
// },
// 学习中心消息弹窗,优先级高于有修改话术弹窗
async getMessagePop () {
// 获取今天日期字符串
......@@ -375,8 +375,9 @@ export default {
})
},
getMessageInfo () {
console.log(111111, 'getMessageInfo')
// this.getMessage()
this.getMessageCount()
// this.getMessageCount()
this.getMessagePop()
},
jumpPersonCenter () {
......
......@@ -140,9 +140,6 @@ export default {
console.log(error)
this.back()
}
// if (type == 'read') this.$emit("backHome")
// else if (type == 'view') this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex})
// this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex})
},
back() {
uni.navigateTo({
......@@ -175,22 +172,14 @@ export default {
const res = await uni.$api.commonApi.updateMessageStatus({
idList
})
// this.backPage()
// if (res) {
// this.backPage()
// } else {
// console.log('接口返回结果为空,可能存在问题')
// }
} catch (error) {
// this.backPage()
console.error('更新消息状态时出现错误:', error)
} finally {
this.isProcessing = false; // 处理完成,将标志位设为 false
this.backPage()
}
}
},
}
}
}
</script>
......
<template>
<view>
<ServiceList :topListProp="topList" @handleClick="handleClick" />
<ServiceList :messageList="messageList" :topListProp="topList" @handleClick="handleClick" />
</view>
</template>
<script>
import ServiceList from '../../../../pages/common/serviceDetail/components/ServiceList.vue';
import { getMessageSummary } from '../../../../api/module/common'
export default {
name: 'MessageIndex',
components: {
......@@ -12,7 +13,8 @@ export default {
},
data() {
return {
topList: []
topList: [],
messageList: []
}
},
created() {
......@@ -20,7 +22,18 @@ export default {
this.topList = topList
})
},
mounted() {
console.log('消息')
this.getMessageSummary()
},
methods: {
// 获取服务中心列表
async getMessageSummary() {
const userInfo = uni.$storage.get('userInfo')
const res = await getMessageSummary({businessType: userInfo.sceneType})
console.log(res, '===')
this.messageList = res
},
handleClick(item) {
const { moduleType } = item
uni.navigateTo({
......
......@@ -56,7 +56,7 @@
<view class="content-right box-class">
<view class="common-title">服务中心</view>
<view class="content-box">
<MessageIndex />
<MessageIndex class="message-box" ref="messageRef" />
</view>
</view>
</view>
......@@ -239,6 +239,7 @@ export default {
},
methods: {
async changeTab ({ item, jumpUrl, index }) {
if (index == 0) this.$refs.messageRef.getMessageSummary()
this.previewOff = index != 0
this.$emit('changeTab', index)
this.showBeisen = false
......@@ -535,6 +536,9 @@ export default {
position: relative;
width: 100%;
height: calc(100% - #{toRpx(120)});
.message-box {
height: 100%;
}
.developing {
height: 100%;
flex-direction: column;
......
......@@ -24,7 +24,7 @@
`${countdown}s` :
'' }}</view>
</template>
<template v-if="pageType == 'service'">
<template v-if="pageType == 'service' && messageInfo.status == 1">
<view class="btn blue more-script" @click="handleMoreScript">更多话术</view>
</template>
</view>
......@@ -61,6 +61,7 @@ export default {
// 获取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) {
......@@ -102,7 +103,11 @@ export default {
startTime: this.enterTime,
endTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
})
this.back(ids)
if (ids) {
this.back(ids)
} else {
this.handleMoreScript()
}
// if (type == 'read') this.$emit("backHome")
// else if (type == 'view') this.back('MessageList', {firstIndex: 1})
// this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex})
......@@ -129,22 +134,16 @@ export default {
scriptId = [this.messageInfo.scriptId]
try {
this.isProcessing = true;
// this.back(idList)
// 接口调用
const res = await uni.$api.commonApi.updateMessageStatus({
idList
})
// if (res) {
// this.backPage(scriptId, idList)
// } else {
// console.log('接口返回结果为空,可能存在问题')
// }
} catch (error) {
// this.backPage(scriptId, idList)
console.error('更新消息状态时出现错误:', error)
} finally {
this.isProcessing = false; // 处理完成,将标志位设为 false
this.backPage(scriptId, idList)
this.backPage(scriptId)
}
}
},
......
......@@ -54,7 +54,8 @@ export default {
pageSize: PAGE_SIZE,
tagList: [],
tagIndex: '',
scrollTop: 0
scrollTop: 0,
type: ''
}
},
computed: {
......@@ -75,6 +76,7 @@ export default {
},
onLoad(options) {
console.log(options)
if (options.type) this.type = options.type
// this.init()
},
methods: {
......@@ -92,9 +94,13 @@ export default {
});
},
back() {
let pageNum = 2
if (this.type == 'read') {
pageNum = 1
}
uni.$emit('pageBack')
uni.navigateBack({
delta: 2,
delta: pageNum,
animationType: 'pop-out',
animationDuration: 100
})
......
<template>
<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) }}</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)">
<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 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) }}</view>
<view class="sprite-icon icon-stick-top"></view>
</view>
<view class="message-item-time">{{ formatTime(i.createdTime) }}</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) }}</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>
</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';
......@@ -59,6 +63,10 @@ export default {
topListProp: {
type: Array,
default: () => []
},
messageList: {
type: Array,
default: () => []
}
},
data() {
......@@ -107,6 +115,12 @@ export default {
}
},
watch: {
messageList: {
handler(newVal) {
this.msgList = newVal
},
immediate: true
},
topListProp: {
handler(newVal) {
this.topList = newVal
......@@ -118,7 +132,7 @@ export default {
getTopList() {
if (!this.topList) return [];
// 按topList中的倒序排列
return this.topList.slice().reverse().map(type =>
return this.topList.slice().reverse().map(type =>
this.msgList.find(item => item.moduleType === type)
).filter(Boolean);
},
......@@ -132,10 +146,10 @@ export default {
// 根据date进行分组
const groupedByDate = {};
filteredList.forEach(item => {
if (!groupedByDate[item.strdate]) {
groupedByDate[item.strdate] = [];
if (!groupedByDate[item.strDate]) {
groupedByDate[item.strDate] = [];
}
groupedByDate[item.strdate].push(item);
groupedByDate[item.strDate].push(item);
});
// 转换为数组格式,并按date降序排列
......@@ -152,7 +166,7 @@ export default {
},
methods: {
getTopInfo() {
const {phone, shopMerchantId, sceneType} = uni.$storage.get('userInfo')
const { phone, shopMerchantId, sceneType } = uni.$storage.get('userInfo')
const _topInfo = uni.$storage.get('noticeTopInfo') || {}
const key = `${phone}-${shopMerchantId}-${sceneType}`
this.topList = _topInfo[key] || []
......@@ -170,6 +184,9 @@ export default {
}
</script>
<style scoped lang="scss">
.service-list {
height: 100%;
}
.message-index-box {
margin: 0 toRpx(32);
height: 100%;
......@@ -193,6 +210,7 @@ export default {
background: #ffffff;
border-radius: toRpx(24);
padding: toRpx(24);
&.active {
background: #4673ff1a;
}
......@@ -237,16 +255,19 @@ export default {
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);
}
......@@ -254,16 +275,19 @@ export default {
}
}
}
.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);
......
<template>
<view class="detail-box">
<view class="nav-bar">
<view class="back" @click="backPage(null)">
<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" :topListProp="topList" @handleClick="handleClick" />
<ServiceList :moduleType="moduleType" :messageList="messageList" :topListProp="topList" @handleClick="handleClick" />
</view>
<view class="detail-right">
<view class="common-title">
......@@ -41,9 +41,9 @@
</view>
</view>
<uni-transition :show="noticeTips" mode="slide-top">
<view class="notice-tips blue" >
<view class="sprite-icon icon-notice-success"></view>
<view>{{ topList.includes(Number(moduleType)) ? '置顶' : '取消置顶' }}成功</view>
<view class="notice-tips" >
<!-- <view class="sprite-icon icon-notice-success"></view> -->
<view>{{ topList.includes(Number(moduleType)) ? '置顶成功' : '取消置顶' }}</view>
</view>
</uni-transition>
</view>
......@@ -55,6 +55,7 @@ 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: {
......@@ -76,7 +77,8 @@ export default {
scrollTop: 0,
isLoading: false,
userInfo: {},
noticeTips: false
noticeTips: false,
messageList: []
}
},
computed: {
......@@ -119,9 +121,17 @@ export default {
// this.handleClick({moduleType: this.moduleType})
},
methods: {
// 获取服务中心列表
async getMessageSummary(sceneType) {
// const userInfo = uni.$storage.get('userInfo')
const res = await getMessageSummary({businessType: sceneType})
console.log(res, '===')
this.messageList = res
},
// 获取缓存中置顶的列表
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] || []
......@@ -129,6 +139,7 @@ export default {
backPage() {
uni.navigateBack({
success: (res) => {
this.getMessageSummary(this.userInfo.sceneType)
uni.$emit('messageBackHome', this.topList)
}
});
......@@ -504,22 +515,18 @@ export default {
}
.notice-tips {
position: fixed;
top: toRpx(160);
top: toRpx(150);
width: toRpx(400);
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
justify-content: center;
color: #4673ff;
color: #FFFFFF;
font-size: toRpx(28);
padding: toRpx(16) toRpx(24);
border-radius: toRpx(8);
z-index: 1;
&.blue {
background: #4673ff1a;
}
.icon-notice-success {
margin-right: toRpx(16);
}
background-color: #000000cc;
}
</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!