|
@@ -3,7 +3,11 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24" class="top">
|
|
|
<div class="w_1200">
|
|
|
- <span class="date">{{ date }}{{ day }}</span>
|
|
|
+ <span class="date"
|
|
|
+ >{{ date }}星期{{
|
|
|
+ week == 1 ? '一' : week == 2 ? '二' : week == 3 ? '三' : week == 4 ? '四' : week == 5 ? '五' : week == 6 ? '六' : week == 7 ? '日' : ''
|
|
|
+ }}</span
|
|
|
+ >
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="logo">
|
|
@@ -23,43 +27,28 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import moment from 'moment';
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
components: {},
|
|
|
data: () => ({
|
|
|
todate: '',
|
|
|
- day: '',
|
|
|
+ week: '',
|
|
|
date: '',
|
|
|
}),
|
|
|
created() {
|
|
|
- let today = this.getDay();
|
|
|
- let todate = this.getDate();
|
|
|
- this.day = today;
|
|
|
- this.date = todate;
|
|
|
- this.search();
|
|
|
+ this.searchdate();
|
|
|
},
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
- search() {
|
|
|
- console.log(this.day);
|
|
|
- },
|
|
|
-
|
|
|
- getDay(date = new Date()) {
|
|
|
- var str = '星期' + '日一二三四五六'.charAt(new Date(date).getDay());
|
|
|
- return str;
|
|
|
- console.log(str);
|
|
|
- },
|
|
|
- getDate(date = new Date()) {
|
|
|
- console.log('s');
|
|
|
- let res = new Date(date)
|
|
|
- .toLocaleDateString()
|
|
|
- .replace('/', '-')
|
|
|
- .replace('/', '-');
|
|
|
- let arr = res.split('-');
|
|
|
- arr[1] = arr[1] * 1 >= 10 ? `${arr[1]}` : `0${arr[1]}`;
|
|
|
- arr[2] = arr[2] * 1 >= 10 ? `${arr[2]}` : `0${arr[2]}`;
|
|
|
- return `${arr[0]}-${arr[1]}-${arr[2]}`;
|
|
|
+ searchdate() {
|
|
|
+ let dates = moment().format('YYYY-MM-DD ');
|
|
|
+ let week = moment().format('d');
|
|
|
+ console.log(week);
|
|
|
+ this.week = week;
|
|
|
+ this.date = dates;
|
|
|
+ console.log(dates);
|
|
|
},
|
|
|
},
|
|
|
};
|