Files
dvcp_v2_wxcp_app/src/saas/AppCountryAlbum/components/watermark/Watermark4.vue

193 lines
3.7 KiB
Vue
Raw Normal View History

2022-05-16 18:04:46 +08:00
<template>
2022-05-18 18:06:39 +08:00
<div class="Watermark6" @click="linkTo('./WatermarkConfig')">
<div class="title">
2022-05-19 17:29:44 +08:00
<h2>{{ title }}</h2>
2022-05-16 18:04:46 +08:00
</div>
2022-05-18 18:06:39 +08:00
<div class="info">
<div class="info-item">
<label>时间</label>
2022-05-19 17:29:44 +08:00
<span>{{ date }} {{ weekCn}} {{ time }}</span>
2022-05-18 18:06:39 +08:00
</div>
<div class="info-item">
<label>地点</label>
2022-05-19 17:29:44 +08:00
<span>{{ address }}</span>
2022-05-17 14:58:10 +08:00
</div>
2022-05-16 18:04:46 +08:00
</div>
</div>
</template>
<script>
2022-05-19 17:29:44 +08:00
import { mapActions } from 'vuex'
2022-05-17 14:58:10 +08:00
export default {
2022-05-19 17:29:44 +08:00
props: ['config'],
2022-05-17 14:58:10 +08:00
data () {
return {
date: '',
2022-05-19 17:29:44 +08:00
timer: null,
week: '',
title: '定格在这一刻',
address: '武汉市·绿地蓝海A座',
}
},
computed: {
weekCn() {
if (this.week === 1) {
return '星期一'
}
if (this.week === 2) {
return '星期二'
}
if (this.week === 3) {
return '星期三'
}
if (this.week === 4) {
return '星期四'
}
if (this.week === 5) {
return '星期五'
}
if (this.week === 6) {
return '星期六'
}
return '星期天'
2022-05-17 14:58:10 +08:00
}
},
2022-05-19 17:29:44 +08:00
watch: {
configList: {
handler: function (v) {
if (v.length) {
}
},
deep: true
},
},
2022-05-17 14:58:10 +08:00
created () {
2022-05-24 11:14:29 +08:00
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
if (v.fieldType === '7') {
v.defaultValue = this.$dayjs().format('YYYY-MM-DD')
this.week = new Date().getDay()
}
if (v.fieldType === '6') {
v.defaultValue = this.$dayjs().format('HH:mm')
}
return v
})
2022-05-19 17:29:44 +08:00
this.date = this.$dayjs(new Date).format('YYYY-MM-DD')
this.time = this.$dayjs().format('HH:mm')
this.week = new Date().getDay()
2022-05-16 18:04:46 +08:00
2022-05-17 14:58:10 +08:00
this.timer = setInterval(() => {
2022-05-19 17:29:44 +08:00
this.time = this.$dayjs().format('HH:mm')
2022-05-17 14:58:10 +08:00
}, 1000)
2022-05-19 17:29:44 +08:00
uni.$on('change', e => {
this.configList = e
})
2022-05-17 14:58:10 +08:00
},
destroyed () {
clearInterval(this.timer)
},
methods: {
...mapActions(['injectJWeixin']),
linkTo (url) {
2022-05-19 17:29:44 +08:00
uni.setStorageSync('waterConfig', this.configList)
2022-05-17 14:58:10 +08:00
uni.navigateTo({
url
})
}
}
}
2022-05-16 18:04:46 +08:00
</script>
<style lang="scss" scoped>
2022-05-18 18:06:39 +08:00
.Watermark6 {
2022-05-19 17:29:44 +08:00
width: 450px;
2022-05-18 18:06:39 +08:00
box-sizing: border-box;
h2 {
font-weight: normal;
}
2022-05-17 14:58:10 +08:00
2022-05-16 18:04:46 +08:00
* {
box-sizing: border-box;
}
2022-05-18 18:06:39 +08:00
.info {
padding: 24px;
background: rgba(255, 255, 255, 0.7);
2022-05-17 14:58:10 +08:00
2022-05-18 18:06:39 +08:00
.info-item {
display: flex;
line-height: 1.3;
margin-bottom: 8px;
2022-05-16 18:04:46 +08:00
2022-05-18 18:06:39 +08:00
&:last-child {
margin-bottom: 0;
}
label {
color: #333;
font-size: 28px;
}
span {
flex: 1;
text-align: justify;
color: #000000;
font-size: 28px;
}
2022-05-16 18:04:46 +08:00
}
2022-05-17 14:58:10 +08:00
}
2022-05-16 18:04:46 +08:00
2022-05-18 18:06:39 +08:00
.title {
position: relative;
height: 60px;
line-height: 60px;
text-align: center;
color: #fff;
background: rgba(23, 91, 255, 0.7);
2022-05-17 14:58:10 +08:00
2022-05-18 18:06:39 +08:00
h2 {
font-size: 32px;
2022-05-16 18:04:46 +08:00
}
2022-05-18 18:06:39 +08:00
&::after {
position: absolute;
left: 16px;
top: 50%;
z-index: 1;
width: 12px;
height: 12px;
border-radius: 50%;
background: #FFCA32;
content: ' ';
transform: translateY(-50%);
2022-05-17 14:58:10 +08:00
}
2022-05-18 18:06:39 +08:00
&::before {
position: absolute;
right: 16px;
top: 50%;
z-index: 1;
width: 12px;
height: 12px;
border-radius: 50%;
background: #FFCA32;
content: ' ';
transform: translateY(-50%);
2022-05-16 18:04:46 +08:00
}
}
}
</style>