通知公告

This commit is contained in:
wanglei
2021-12-13 14:02:07 +08:00
parent 29e8bf8957
commit 36d55c999e
3 changed files with 287 additions and 305 deletions

View File

@@ -171,7 +171,7 @@ export default {
this.show = false;
this.changeState();
},
handleOpt(item) {
handleOpt(item){
this.content = {
1: "撤回",
2: "发布",
@@ -180,27 +180,20 @@ export default {
if (item.val == 0) {
this.show = false;
this.comp = "detail";
this.params = {
id: this.detail.id,
flag: true
};
this.showList = false;
return
return uni.navigateTo({
url: "/apps/notification/detail?id=" + this.detail.id
});
}
if ([1, 2, 4].includes(item.val)) {
if ([1,2,4].includes(item.val)) {
return this.modal = true;
}
if (item.val == 3) {
if(item.val==3){
this.show = false;
this.comp = "add";
this.params = {
id: this.detail.id,
flag: false
};
this.showList = false;
return uni.navigateTo({
url:"/apps/notification/add?id=" + this.detail.id + "&flag=" + false
});
}
},
color(status) {
@@ -215,22 +208,16 @@ export default {
this.detail = item;
if (this.index == 1) {
this.show = true;
} else {
this.comp = "detail";
this.params = {
id: this.detail.id,
flag: true
};
this.showList = false;
}else {
uni.navigateTo({
url: "/apps/notification/detail?id=" + this.detail.id + "&flag=" + true
})
}
},
add() {
this.comp = "add";
this.params = {
id: null,
flag: false
};
this.showList = false;
add(){
uni.navigateTo({
url: "/apps/notification/add"
})
},
change(val) {
this.index = val;

View File

@@ -100,23 +100,16 @@ export default {
},
}
},
watch: {
params: {
handler: function () {
if (this.params?.id) {
this.form.id = this.params?.id;
this.flag = this.params?.flag;
}
},
immediate: true
}
},
created() {
onLoad(opt) {
document.title = "新增公告";
if (this.params?.id) {
if(opt.id) {
this.form.id = opt.id;
this.flag = opt.flag;
this.getDetail();
}
},
methods: {
...mapActions(['selectEnterpriseContact']),
handleSelectUser() {
@@ -125,7 +118,6 @@ export default {
type: ["user"],
selectedUserIds: this.form.persons?.map(e => e.id)
}).then(res => {
console.log(res);
this.form.persons = res?.userList || []
})
},

View File

@@ -60,299 +60,302 @@
</template>
<script>
import {mapActions} from "vuex";
import {mapActions} from "vuex";
export default {
name: "detail",
props: {
params: Object
},
data() {
return {
detailObj: {},
pageShow: false
}
},
created() {
this.$loading()
this.injectJWeixin(['sendChatMessage']).then(() => {
this.getDetail()
}).catch(() => {
this.getDetail()
this.$hideLoading()
})
},
mounted() {
document.title = "公告详情";
},
methods: {
...mapActions(['previewFile', 'injectJWeixin']),
preFile(e) {
if ([".jpg", ".png", ".gif"].includes(e.postfix.toLowerCase())) {
uni.previewImage({
current: e.url,
urls: [e.url]
})
} else {
this.previewFile({...e})
export default {
name: "detail",
data() {
return {
detailObj: {},
id: null,
pageShow: false,
flag: false,
}
},
getDetail() {
this.$http.post("/app/appannouncement/detail", null, {
params: {
id: this.params?.id,
detail: this.params?.flag
}
}).then(res => {
if (res && res.data) {
this.detailObj = res.data;
this.pageShow = true
this.$hideLoading()
}
onLoad(opt) {
document.title = "公告详情";
this.id = opt.id;
this.flag = opt.flag;
},
created() {
this.$loading()
this.injectJWeixin(['sendChatMessage']).then(() => {
this.getDetail()
}).catch(() => {
this.getDetail()
this.$hideLoading()
})
},
handleClick() {
this.$parent.params = this.params.id;
this.$parent.comp = "read";
this.$parent.showList = false;
}
},
}
methods: {
...mapActions(['previewFile', 'injectJWeixin']),
preFile(e) {
if ([".jpg", ".png", ".gif"].includes(e.postfix.toLowerCase())) {
uni.previewImage({
current: e.url,
urls: [e.url]
})
} else {
this.previewFile({...e})
}
},
getDetail() {
this.$http.post("/app/appannouncement/detail", null, {
params: {
id: this.id,
detail: this.flag
}
}).then(res => {
if (res && res.data) {
this.detailObj = res.data;
this.pageShow = true
this.$hideLoading()
}
})
},
handleClick() {
uni.navigateTo({
url:"/apps/notification/read?id=" + this.id,
})
}
},
}
</script>
<style lang="scss" scoped>
.detail {
min-height: 100%;
background-color: #F5F5F5;
padding-bottom: 140px;
.detail {
min-height: 100%;
background-color: #F5F5F5;
padding-bottom: 140px;
::v-deep .content {
padding: 0;
}
.card {
background-color: #FFFFFF;
margin-bottom: 8px;
box-sizing: border-box;
padding: 16px 32px;
header {
font-size: 40px;
font-weight: 600;
color: #333333;
line-height: 64px;
letter-spacing: 1px;
::v-deep .content {
padding: 0;
}
.u-row {
& > div {
border-radius: 50%;
text-align: center;
font-size: 22px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
}
& > span {
font-size: 30px;
color: #343D65;
line-height: 48px;
}
& > span:last-child {
font-size: 30px;
/*color: #343D65;*/
/*margin-left: 16px;*/
line-height: 48px;
}
.title {
width: 490px;
height: 112px;
display: flex;
align-items: center;
font-size: 32px;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.right {
font-size: 28px;
display: flex;
align-items: center;
color: #666666;
.arrow {
width: 16px;
height: 16px;
border-top: 3px solid #CCCCCC;
border-right: 3px solid #CCCCCC;
transform: rotate(45deg);
}
}
}
.item {
position: relative;
height: 80px;
&:after {
width: 100%;
height: 1px;
background-color: rgba(216, 221, 230, 0.5);
content: "";
position: absolute;
left: 0;
bottom: 0;
}
}
& > span {
font-size: 32px;
color: #333333;
line-height: 48px;
letter-spacing: 1px;
display: inline-block;
}
.label {
height: 80px;
font-size: 32px;
color: #333333;
display: flex;
align-items: center;
margin-bottom: 16px;
& > em {
font-style: normal;
font-size: 32px;
color: #1365DD;
}
}
.file {
height: 128px;
background: #FFFFFF;
border-radius: 8px;
border: 1px solid #CCCCCC;
.card {
background-color: #FFFFFF;
margin-bottom: 8px;
box-sizing: border-box;
padding: 0 16px;
margin-bottom: 32px;
padding: 16px 32px;
& > .u-row {
height: 100%;
header {
font-size: 40px;
font-weight: 600;
color: #333333;
line-height: 64px;
letter-spacing: 1px;
}
.left {
width: 476px;
.u-row {
& > div {
border-radius: 50%;
text-align: center;
font-size: 22px;
font-weight: bold;
display: flex;
align-items: center;
word-break: break-all;
& > img {
flex-shrink: 0;
width: 96px;
height: 96px;
}
& > span {
font-size: 32px;
color: #333333;
display: inline-block;
line-height: 44px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
justify-content: center;
}
& > span {
font-size: 30px;
color: #343D65;
line-height: 48px;
}
& > span:last-child {
font-size: 30px;
/*color: #343D65;*/
/*margin-left: 16px;*/
line-height: 48px;
}
.title {
width: 490px;
height: 112px;
display: flex;
align-items: center;
font-size: 32px;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.right {
font-size: 28px;
color: #999999;
display: flex;
align-items: center;
color: #666666;
.arrow {
width: 16px;
height: 16px;
border-top: 3px solid #CCCCCC;
border-right: 3px solid #CCCCCC;
transform: rotate(45deg);
}
}
}
}
.active {
background-color: #F3F6F9;
}
.item {
position: relative;
height: 80px;
& > text {
width: 100%;
display: inline-block;
font-size: 30px;
color: #649EFD;
text-align: center;
}
.progress {
height: 12px;
background: #F2F4FC;
border-radius: 12px;
position: relative;
margin: 16px 0 64px 0;
.pro-active {
height: 12px;
background: #639EFD;
border-radius: 12px;
position: absolute;
left: 0;
top: 0;
&:after {
width: 100%;
height: 1px;
background-color: rgba(216, 221, 230, 0.5);
content: "";
position: absolute;
left: 0;
bottom: 0;
}
}
}
em {
font-style: normal;
font-size: 28px;
color: #1365DD;
}
::v-deep .u-collapse {
position: relative;
&:after {
content: "";
width: 718px;
height: 1px;
background-color: rgba(216, 221, 230, 0.5);
position: absolute;
left: 0;
bottom: 0;
}
.u-collapse-head {
padding: 40px 0;
}
.u-collapse-content {
& > span {
font-size: 32px;
color: #333333;
line-height: 48px;
letter-spacing: 1px;
display: inline-block;
}
.label {
height: 80px;
font-size: 32px;
color: #333333;
display: flex;
align-items: center;
margin-bottom: 16px;
& > em {
font-style: normal;
font-size: 32px;
color: #1365DD;
}
}
.file {
height: 128px;
background: #FFFFFF;
border-radius: 8px;
border: 1px solid #CCCCCC;
box-sizing: border-box;
padding: 0 16px;
margin-bottom: 32px;
& > .u-row {
height: 100%;
.left {
width: 476px;
display: flex;
align-items: center;
word-break: break-all;
& > img {
flex-shrink: 0;
width: 96px;
height: 96px;
}
& > span {
font-size: 32px;
color: #333333;
display: inline-block;
line-height: 44px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
& > span {
font-size: 28px;
color: #999999;
}
}
}
.active {
background-color: #F3F6F9;
}
& > text {
width: 100%;
display: inline-block;
font-size: 30px;
color: #649EFD;
text-align: center;
}
.progress {
height: 12px;
background: #F2F4FC;
border-radius: 12px;
position: relative;
margin: 16px 0 64px 0;
.pro-active {
height: 12px;
background: #639EFD;
border-radius: 12px;
position: absolute;
left: 0;
top: 0;
}
}
em {
font-style: normal;
font-size: 28px;
color: #1365DD;
}
::v-deep .u-collapse {
position: relative;
&:after {
content: "";
width: 718px;
height: 1px;
background-color: rgba(216, 221, 230, 0.5);
position: absolute;
left: 0;
bottom: 0;
}
.u-collapse-head {
padding: 40px 0;
}
.u-collapse-content {
font-size: 32px;
color: #333333;
line-height: 48px;
letter-spacing: 1px;
}
}
}
}
.footer {
height: 112px;
width: 100%;
position: fixed;
left: 0;
bottom: 0;
background: #1365DD;
display: flex;
align-items: center;
justify-content: center;
font-size: 36px;
color: #FFFFFF;
.footer {
height: 112px;
width: 100%;
position: fixed;
left: 0;
bottom: 0;
background: #1365DD;
display: flex;
align-items: center;
justify-content: center;
font-size: 36px;
color: #FFFFFF;
}
}
}
</style>