完善消息详情

This commit is contained in:
TOP糯米 2023-03-18 23:53:20 +08:00
parent 0a4b556d44
commit 0419c656e2
6 changed files with 46 additions and 110 deletions

View File

@ -11,6 +11,7 @@ const apis = {
}, },
carefree: { carefree: {
url: "/user/workerinfo/carefree", url: "/user/workerinfo/carefree",
showLoading: true,
auth: true, auth: true,
}, },
notify: { notify: {

View File

@ -49,24 +49,12 @@
"navigationBarTitleText": "消息" "navigationBarTitleText": "消息"
} }
}, },
{
"path": "pages/message/detail",
"style": {
"navigationBarTitleText": "详情"
}
},
{ {
"path": "pages/member/member", "path": "pages/member/member",
"style": { "style": {
"navigationBarTitleText": "我的" "navigationBarTitleText": "我的"
} }
}, },
{
"path": "pages/member/carefree",
"style": {
"navigationBarTitleText": "无忧保"
}
},
{ {
"path": "pages/member/password", "path": "pages/member/password",
"style": { "style": {

View File

@ -1,34 +0,0 @@
<template>
<app-layout title="无忧保">
<rich-text :nodes="content"></rich-text>
</app-layout>
</template>
<script>
import AppLayout from "@/components/layout/layout";
export default {
name: "member-carefree",
data() {
return {
content: "",
};
},
components: {
AppLayout,
},
onLoad() {
this.$request({
api: "system.carefree",
}).then((response) => {
this.content = response.data.content;
});
},
onShow() {},
onReady() {},
onReachBottom() {},
onPullDownRefresh() {},
methods: {},
};
</script>
<style lang="less" scoped></style>

View File

@ -68,7 +68,7 @@
<text class="title limit-line clamp-1">我要提现</text> <text class="title limit-line clamp-1">我要提现</text>
<text class="iconfont icon-jinru"></text> <text class="iconfont icon-jinru"></text>
</view> </view>
<view class="widget-item" @click="toPage('/pages/member/carefree')"> <view class="widget-item" @click="showCarefree">
<text class="title limit-line clamp-1">服务无忧保</text> <text class="title limit-line clamp-1">服务无忧保</text>
<text class="iconfont icon-jinru"></text> <text class="iconfont icon-jinru"></text>
</view> </view>
@ -101,12 +101,18 @@
</view> </view>
</view> </view>
</view> </view>
<widget-modal v-show="showCarefreeModal" title="服务无忧保" @close="showCarefreeModal = false">
<view class="modal-content-box">
<rich-text :nodes="carefreeContent"></rich-text>
</view>
</widget-modal>
</app-layout> </app-layout>
</template> </template>
<script> <script>
import AppLayout from "@/components/layout/layout"; import AppLayout from "@/components/layout/layout";
import WidgetSwitch from "@/components/widgets/switch"; import WidgetSwitch from "@/components/widgets/switch";
import WidgetModal from "@/components/widgets/modal";
import { mapGetters, mapState } from "vuex"; import { mapGetters, mapState } from "vuex";
export default { export default {
name: "member", name: "member",
@ -120,6 +126,8 @@ export default {
acceptOrderState: false, acceptOrderState: false,
typeText: "", typeText: "",
typeTextColor: "", typeTextColor: "",
showCarefreeModal: false,
carefreeContent: "",
serviceData: { serviceData: {
times: 0, times: 0,
favorableRate: "0", favorableRate: "0",
@ -132,6 +140,7 @@ export default {
components: { components: {
AppLayout, AppLayout,
WidgetSwitch, WidgetSwitch,
WidgetModal,
}, },
computed: { computed: {
...mapGetters({ ...mapGetters({
@ -167,6 +176,14 @@ export default {
} }
this.$utils.toPage(url); this.$utils.toPage(url);
}, },
showCarefree() {
this.showCarefreeModal = true;
this.$request({
api: "system.carefree",
}).then((response) => {
this.carefreeContent = response.data.content;
});
},
}, },
}; };
</script> </script>
@ -298,4 +315,8 @@ export default {
margin-right: 14rpx; margin-right: 14rpx;
} }
} }
.modal-content-box {
max-height: 400rpx;
overflow-y: scroll;
}
</style> </style>

View File

@ -1,61 +0,0 @@
<template>
<app-layout title="详情">
<div class="message-container">
<view class="head">
<text class="title limit-line clamp-1">{{ title }}</text>
<text class="date">{{ date }}</text>
</view>
<view class="body">
<rich-text :nodes="content"></rich-text>
</view>
</div>
</app-layout>
</template>
<script>
import AppLayout from "@/components/layout/layout";
export default {
name: "message-detail",
data() {
return {
title: "接单后要求多久与客户预约安装时间?",
date: "2022-11-01 18:14",
content: "哈哈哈",
};
},
components: {
AppLayout,
},
onLoad() {},
onShow() {},
onReady() {},
onReachBottom() {},
onPullDownRefresh() {},
methods: {},
};
</script>
<style lang="less" scoped>
.message-container {
width: 100%;
box-sizing: border-box;
padding: 40rpx;
.head {
width: 100%;
font-size: 30rpx;
font-weight: bold;
line-height: 30rpx;
.title {
color: #333333;
}
.date {
display: inline-block;
color: #999999;
margin-top: 24rpx;
}
}
.body {
margin-top: 40rpx;
}
}
</style>

View File

@ -19,7 +19,7 @@
> >
<swiper-item v-for="(item, index) in tabList" :key="index"> <swiper-item v-for="(item, index) in tabList" :key="index">
<view :class="['tab' + index]"> <view :class="['tab' + index]">
<view class="message-item" v-for="(v, k) in item.list" :key="k" @click="toDetail(v.id)"> <view class="message-item" v-for="(v, k) in item.list" :key="k" @click="toDetail(v)">
<text class="title limit-line clamp-1">{{ v.title }}</text> <text class="title limit-line clamp-1">{{ v.title }}</text>
<text class="date">{{ v.date }}</text> <text class="date">{{ v.date }}</text>
</view> </view>
@ -27,11 +27,17 @@
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
<widget-modal v-show="showDetail" :title="detail.title" @close="showDetail = false">
<view class="message-box">
<rich-text :nodes="detail.content"></rich-text>
</view>
</widget-modal>
</app-layout> </app-layout>
</template> </template>
<script> <script>
import AppLayout from "@/components/layout/layout"; import AppLayout from "@/components/layout/layout";
import WidgetModal from "@/components/widgets/modal";
import { mapState } from "vuex"; import { mapState } from "vuex";
export default { export default {
name: "message", name: "message",
@ -43,10 +49,16 @@ export default {
tabIndex: 0, tabIndex: 0,
tabHeight: 0, tabHeight: 0,
tabList: [], tabList: [],
showDetail: false,
detail: {
title: "",
content: "",
},
}; };
}, },
components: { components: {
AppLayout, AppLayout,
WidgetModal,
}, },
computed: { computed: {
...mapState({ ...mapState({
@ -117,6 +129,7 @@ export default {
id: item.id, id: item.id,
title: item.title, title: item.title,
date: item.times, date: item.times,
content: item.message,
}); });
}); });
currentTab.page++; currentTab.page++;
@ -131,7 +144,11 @@ export default {
/** /**
* 详情 * 详情
*/ */
toDetail(id) {}, toDetail(detail) {
this.showDetail = true;
this.detail.title = detail.title;
this.detail.content = detail.content;
},
}, },
}; };
</script> </script>
@ -193,4 +210,8 @@ export default {
} }
} }
} }
.message-box {
max-height: 400rpx;
overflow-y: scroll;
}
</style> </style>