Commit d230a858 by 胡悦

修复消息中心bug

1 parent 7babedf0
...@@ -132,8 +132,9 @@ export default { ...@@ -132,8 +132,9 @@ export default {
this.messageTotal = res this.messageTotal = res
}, },
openPop() { openPop() {
// this.$refs.kfRef.open() uni.navigateTo({
this.showPage('MessageList') url: `/pages/common/messageList`
})
}, },
getMessageInfo() { getMessageInfo() {
this.getMessage() this.getMessage()
......
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
</template> </template>
<script> <script>
let timer = null let timer = null
let countTimer = 1
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { create } from 'lodash'
export default { export default {
name: 'MessageDetail', name: 'MessageDetail',
data() { data() {
...@@ -75,9 +75,7 @@ export default { ...@@ -75,9 +75,7 @@ export default {
tagIndex: '', tagIndex: '',
enterTime: '', enterTime: '',
isProcessing: false, isProcessing: false,
MOCKDATA: { MOCKDATA: {}
timer: 3
}
} }
}, },
props: { props: {
...@@ -94,7 +92,8 @@ export default { ...@@ -94,7 +92,8 @@ export default {
created() { created() {
// 获取mock配置的时间 // 获取mock配置的时间
this.MOCKDATA = uni.$storage.get('mock_data') this.MOCKDATA = uni.$storage.get('mock_data')
this.countdown = this.MOCKDATA.timer * 60 - 1 const _countTime = this.MOCKDATA.timer || countTimer
this.countdown = _countTime * 60 - 1
}, },
mounted() { mounted() {
// 开始倒计时 // 开始倒计时
...@@ -123,12 +122,8 @@ export default { ...@@ -123,12 +122,8 @@ export default {
clearInterval(timer); clearInterval(timer);
} }
}, },
inject: ['showPage'], // inject: ['showPage'],
methods: { methods: {
// 返回
back(name, obj = null) {
this.showPage(name, obj)
},
async backPage() { async backPage() {
const {type} = this const {type} = this
let idList let idList
...@@ -140,8 +135,12 @@ export default { ...@@ -140,8 +135,12 @@ export default {
startTime: this.enterTime, startTime: this.enterTime,
endTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss") endTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
}) })
if (type == 'read') this.$emit("backHome") uni.navigateTo({
else if (type == 'view') this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex}) url: `/pages/common/messageList?type=read`
})
this.$emit("backHome")
// 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}) // this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex})
}, },
// 开始倒计时 // 开始倒计时
......
export const CONTRNT_TYPE = {
1: '图文',
2: '视频',
3: 'PDF'
}
...@@ -78,11 +78,9 @@ import Promotion from './components/Income/Promotion.vue' ...@@ -78,11 +78,9 @@ import Promotion from './components/Income/Promotion.vue'
import History from './components/Income/History.vue' import History from './components/Income/History.vue'
import merge from '@/mixin/record/merge.js' import merge from '@/mixin/record/merge.js'
import MessageDetail from './components/Message/MessageDetail.vue' import MessageDetail from './components/Message/MessageDetail.vue'
import MessageList from './components/Message/MessageList.vue'
import SystemDetial from './components/Message/SystemDetial.vue'
export default { export default {
mixins: [recorder, uploader, timeout, versionCheck, merge], mixins: [recorder, uploader, timeout, versionCheck, merge],
components: { RecordList, CustomerFile, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History, LevelMedal, MessageDetail, MessageList, SystemDetial }, components: { RecordList, CustomerFile, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History, LevelMedal, MessageDetail },
props: { props: {
id: [String, Number], id: [String, Number],
finishDoneText: String, finishDoneText: String,
......
let timer = null
import dayjs from 'dayjs'
export default {
data () {
return {
systemInfo: {}
}
},
onLoad (options) {
const { row } = options
const _row = JSON.parse(row)
this.systemInfo = _row
this.systemInfo.time = dayjs(new Date(_row.actualSendTime)).format("YYYY-MM-DD HH:mm:ss")
this.addTrack(_row)
},
methods: {
// 进入埋点事件
addTrack(row) {
try {
const {phone} = uni.$storage.get("userInfo")
const entryData = {
taskId: row.id,
phoneNumber: phone
}
uni.$api.commonApi.addSystemInfo(entryData).then(res => {
if (res) {
this.leaveTrack(res)
timer = setInterval(() => {
this.leaveTrack(res)
}, 3000)
}
})
} catch (error) {
console.error('进入埋点发生错误', error);
}
},
// 离开埋点事件
async leaveTrack(id) {
await uni.$api.commonApi.leaveSystemInfo({id})
}
},
onUnload () {
if (timer) {
clearInterval(timer);
}
}
}
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
"disableSwipeBack": true "disableSwipeBack": true
} }
}, },
{ {
"path": "pages/equity/detail/detail", "path": "pages/equity/detail/detail",
"style": { "style": {
...@@ -80,6 +79,13 @@ ...@@ -80,6 +79,13 @@
} }
}, },
{ {
"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,
...@@ -111,6 +117,24 @@ ...@@ -111,6 +117,24 @@
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},
{
"path": "pages/common/messageDetail",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/messageList",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/systemDetail",
"style": {
"navigationStyle": "custom"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
<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"
:style="{ width: width + 'px' }"
/>
</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: 100%;
width: auto;
}
}
}
}
</style>
<template>
<view class="detail-box">
<view class="nav-bar">
<view v-if="messageInfo.status == 1" class="back" @click="backPage(null)">
<uni-icons type="left" :size="20" color="#000"></uni-icons>
</view>
<view class="title">优秀话术-{{ messageInfo.className }}</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 class="tip-tags">{{ messageInfo.className }}</view>
</view>
<view class="tip-content">
{{ messageInfo.polishContent }}
</view>
</view>
<view class="detail-footer" v-if="messageInfo.status == 0">
<view class="tips">以上内容请认真阅读,至少读完{{ MOCKDATA.timer }}分钟,如未按照要求阅读完内容,今日无法使用pad接待</view>
<view :class="['btn', !countFlag ? '' : 'blue']" @click="handleCompleted">已完成阅读 {{ !countFlag ?
`${countdown}s` :
'' }}</view>
</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: {
timer: 3
}
}
},
computed: {
onlyOneLength() {
return this.recordDetailList.length == 1
},
},
created() {
// 获取mock配置的时间
this.MOCKDATA = uni.$storage.get('mock_data')
const _countTime = this.MOCKDATA.timer || countTimer
this.countdown = _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)
},
beforeDestroy() {
if (timer) {
clearInterval(timer);
}
},
// inject: ['showPage'],
methods: {
// 返回
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(ids) {
let idList = ids
if (!idList) {
idList = [this.messageInfo.id];
}
// 埋点
const result = await uni.$api.commonApi.extractExcellent({
scriptIdList: idList,
startTime: this.enterTime,
endTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
})
this.back(idList)
// 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)
if (this.countFlag) {
try {
this.isProcessing = true;
let idList
idList = [this.messageInfo.id];
// this.back(idList)
// 接口调用
const res = await uni.$api.commonApi.updateMessageStatus({
idList
})
if (res) {
this.backPage(idList)
} else {
console.log('接口返回结果为空,可能存在问题')
}
} catch (error) {
console.error('更新消息状态时出现错误:', error)
} finally {
this.isProcessing = false; // 处理完成,将标志位设为 false
}
}
},
}
}
</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);
}
}
.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;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</template> </template>
<template v-else> <template v-else>
<view class="nothing flex"> <view class="nothing flex">
<image class="icon" src="../../../../assets/images/home/nothing.webp" /> <image class="icon" src="../../assets/images/home/nothing.webp" />
暂无数据 暂无数据
</view> </view>
</template> </template>
...@@ -68,7 +68,11 @@ ...@@ -68,7 +68,11 @@
<script> <script>
const PAGE_SIZE = 10 const PAGE_SIZE = 10
const PAGE_NUM = 1 const PAGE_NUM = 1
import { CONTRNT_TYPE } from './constant' const CONTRNT_TYPE = {
1: '图文',
2: '视频',
3: 'PDF'
}
import dayjs from 'dayjs' import dayjs from 'dayjs'
export default { export default {
data() { data() {
...@@ -112,26 +116,33 @@ export default { ...@@ -112,26 +116,33 @@ export default {
} }
} }
}, },
props: { // props: {
transfer: { // transfer: {
type: Object, // type: Object,
default: () => { } // default: () => { }
} // }
}, // },
inject: ['showPage'], // inject: ['showPage'],
mounted() { 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() this.init()
}, },
onLoad(options) {
console.log(options)
if (options && options.type == 'read') {
this.changeType(1)
}
},
methods: { methods: {
init() { init() {
if (this.transfer) { this.getSystemPage()
// 从话术详情返回,需记录上一次选择
const { firstIndex, tagIndex } = this.transfer
this.changeType(firstIndex, tagIndex)
} else {
// 第一次进入消息中心
this.getSystemPage()
}
}, },
// tab切换 // tab切换
changeType(index, tagIndex) { changeType(index, tagIndex) {
...@@ -154,13 +165,21 @@ export default { ...@@ -154,13 +165,21 @@ export default {
console.log(row) console.log(row)
const { id, contentType } = row const { id, contentType } = row
const { tagIndex } = this const { tagIndex } = this
if (this.firstIndex == 1) this.showPage('MessageDetail', { row, type: 'view', tagIndex }) if (this.firstIndex == 1) {
else if (this.firstIndex == 0) { // this.showPage('MessageDetail', { row, type: 'view', tagIndex })
this.getDetailById(id) uni.navigateTo({
url: `/pages/common/messageDetail?row=${encodeURIComponent(JSON.stringify(row))}&type=view`
})
} else if (this.firstIndex == 0) {
this.getDetailById(id, row.readFlag)
} }
}, },
back() { back() {
this.$emit("backHome"); uni.navigateBack({
delta: 1,
animationType: 'pop-out',
animationDuration: 100
})
}, },
// 选择标签 // 选择标签
selectTag(item) { selectTag(item) {
...@@ -213,9 +232,9 @@ export default { ...@@ -213,9 +232,9 @@ export default {
this.total = res.total this.total = res.total
this.nothing = res.length ? true : false this.nothing = res.length ? true : false
} catch (error) { } catch (error) {
console.log(111, error)
uni.showToast({ uni.showToast({
title: 'error', title: error,
icon: "none",
}); });
} }
}, },
...@@ -240,28 +259,37 @@ export default { ...@@ -240,28 +259,37 @@ export default {
this.total = res.total this.total = res.total
this.nothing = res.length ? true : false this.nothing = res.length ? true : false
} catch (error) { } catch (error) {
console.log(error) uni.showToast({
title: error,
icon: "none",
});
} }
}, },
async getDetailById(id) { async getDetailById(id, readFlag) {
const res = await uni.$api.commonApi.getTaskById({ id }) const res = await uni.$api.commonApi.getTaskById({ id })
console.log(res) // 不刷新列表的更新消息状态
if (!readFlag) this.getList.find(item => item.id == id).readFlag = true
const _row = encodeURIComponent(JSON.stringify(res))
if (res.contentType == 1) { if (res.contentType == 1) {
this.showPage('SystemDetial', { row: res }) // this.showPage('SystemDetial', { row: res })
uni.navigateTo({
url: `/pages/common/systemDetail?row=${_row}`
})
} else if (res.contentType == 2) { } else if (res.contentType == 2) {
console.log(JSON.parse(res.content)) console.log(JSON.parse(res.content))
const _content = res.content ? JSON.parse(res.content) : [] const _content = res.content ? JSON.parse(res.content) : []
const url = _content[0] const url = _content[0]
const { content, title, id } = res const { content, title, id } = res
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/msgwebview?url=${url}&title=${title}&id=${id}` // 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) { } else if (res.contentType == 3) {
const _content = res.content ? JSON.parse(res.content) : [] const _content = res.content ? JSON.parse(res.content) : []
const url = _content[0].image const url = _content[0].image
const { content, title, id } = res const { content, title, id } = res
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/msgwebview?fileUrl=${url}&title=${title}&id=${id}` url: `/pages/common/msgwebview?fileUrl=${url}&title=${title}&id=${id}&row=${_row}`
}) })
} }
}, },
...@@ -311,13 +339,17 @@ export default { ...@@ -311,13 +339,17 @@ export default {
} }
.message-box { .message-box {
position: relative;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
margin: 0 auto; background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding-top: toRpx(160);
.message-body { .message-body {
position: relative; position: relative;
margin: toRpx(156) toRpx(64) toRpx(80); margin: 0 toRpx(64) toRpx(80);
background-color: rgba(255, 255, 255, 0.35); background-color: rgba(255, 255, 255, 0.35);
border: toRpx(4) solid #fff; border: toRpx(4) solid #fff;
border-radius: toRpx(48); border-radius: toRpx(48);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
let timer = null import systemTrack from '../../mixin/systemTrack';
export default { export default {
name: '', name: '',
data () { data () {
...@@ -20,6 +20,7 @@ export default { ...@@ -20,6 +20,7 @@ export default {
viewerUrl: '/hybrid/html/web/viewer.html', viewerUrl: '/hybrid/html/web/viewer.html',
} }
}, },
mixins: [systemTrack],
onLoad (options) { onLoad (options) {
console.log(options,'options') console.log(options,'options')
if(options.fileUrl) this.url = `${this.viewerUrl}?file=${options.fileUrl}` if(options.fileUrl) this.url = `${this.viewerUrl}?file=${options.fileUrl}`
...@@ -27,41 +28,10 @@ export default { ...@@ -27,41 +28,10 @@ export default {
if (options.title) uni.setNavigationBarTitle({ if (options.title) uni.setNavigationBarTitle({
title: options.title title: options.title
}) })
this.addTrack(options)
}, },
mounted () { mounted () {
}, },
beforeDestroy() {
if (timer) {
clearInterval(timer);
}
},
methods: { methods: {
// 进入埋点事件
addTrack(row) {
console.log(row)
try {
const {phone} = uni.$storage.get("userInfo")
const entryData = {
taskId: row.id,
phoneNumber: phone
}
uni.$api.commonApi.addSystemInfo(entryData).then(res => {
if (res) {
this.leaveTrack(res)
timer = setInterval(() => {
this.leaveTrack(res)
}, 3000)
}
})
} catch (error) {
console.error('进入埋点发生错误', error);
}
},
// 离开埋点事件
async leaveTrack(id) {
await uni.$api.commonApi.leaveSystemInfo({id})
}
} }
} }
</script> </script>
......
...@@ -22,8 +22,7 @@ ...@@ -22,8 +22,7 @@
</view> </view>
</template> </template>
<script> <script>
let timer = null import systemTrack from '../../mixin/systemTrack';
import dayjs from 'dayjs'
export default { export default {
name: 'SystemDetial', name: 'SystemDetial',
data() { data() {
...@@ -35,54 +34,17 @@ export default { ...@@ -35,54 +34,17 @@ export default {
content: '<p><img src=\"https://qcimg01.glsx.com.cn/group1/M00/0A/6B/wKgD3mfuUHiAIvUfAAKVSmxdFVE298.jpg\" style=\"max-width:100%;\" contenteditable=\"false\"/></p>' content: '<p><img src=\"https://qcimg01.glsx.com.cn/group1/M00/0A/6B/wKgD3mfuUHiAIvUfAAKVSmxdFVE298.jpg\" style=\"max-width:100%;\" contenteditable=\"false\"/></p>'
} }
}, },
props: { mixins: [systemTrack],
transfer: {
type: Object,
default: () => { }
}
},
mounted() {
console.log(this.transfer)
const { row } = this.transfer || {}
this.systemInfo = row
this.systemInfo.time = dayjs(new Date(row.actualSendTime)).format("YYYY-MM-DD HH:mm:ss")
this.addTrack(row)
},
beforeDestroy() {
if (timer) {
clearInterval(timer);
}
},
inject: ['showPage'],
methods: { methods: {
// 返回 // 返回
back() { back() {
this.showPage('MessageList') // this.showPage('MessageList')
}, uni.navigateBack({
// 进入埋点事件 delta: 1,
addTrack(row) { animationType: 'pop-out',
try { animationDuration: 100
const {phone} = uni.$storage.get("userInfo") })
const entryData = {
taskId: row.id,
phoneNumber: phone
}
uni.$api.commonApi.addSystemInfo(entryData).then(res => {
if (res) {
this.leaveTrack(res)
timer = setInterval(() => {
this.leaveTrack(res)
}, 3000)
}
})
} catch (error) {
console.error('进入埋点发生错误', error);
}
}, },
// 离开埋点事件
async leaveTrack(id) {
await uni.$api.commonApi.leaveSystemInfo({id})
}
} }
} }
</script> </script>
...@@ -92,7 +54,10 @@ export default { ...@@ -92,7 +54,10 @@ export default {
position: relative; position: relative;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
margin: 0 auto; background-image: url('@/assets/images/common/page-bg.webp');
background-size: 100%;
box-sizing: border-box;
padding-top: toRpx(160);
} }
.nav-bar { .nav-bar {
...@@ -126,11 +91,11 @@ export default { ...@@ -126,11 +91,11 @@ export default {
.weekly-tips { .weekly-tips {
position: relative; position: relative;
margin: toRpx(156) toRpx(64) toRpx(80); margin: 0 toRpx(64) toRpx(80);
background-color: rgba(255, 255, 255, 0.35); background-color: rgba(255, 255, 255, 0.35);
border: toRpx(4) solid #fff; border: toRpx(4) solid #fff;
border-radius: toRpx(16); border-radius: toRpx(16);
height: calc(100% - #{toRpx(236)}); height: calc(100% - #{toRpx(80)});
.outstanding-tip-list { .outstanding-tip-list {
height: 100%; height: 100%;
...@@ -145,8 +110,8 @@ export default { ...@@ -145,8 +110,8 @@ export default {
background-color: #fff; background-color: #fff;
height: 100%; height: 100%;
.tip-header { .tip-header {
display: flex; // display: flex;
align-items: center; // align-items: center;
.tip-rank { .tip-rank {
color: #333; color: #333;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!