diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..f7ee3d5 --- /dev/null +++ b/api/index.js @@ -0,0 +1,19 @@ +// 首页 +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const NOTICE_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory.do' +const PYXX_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory' + + +// 通知公告列表 +export function getNoticeList(data) { + return fetch.get(NOTICE_LIST, data).then(res => res); +} + +// 辟谣信息列表 +export function getPyxxList(data) { + return fetch.get(PYXX_LIST, data).then(res => res); +} + + diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..f7ee3d5 --- /dev/null +++ b/api/index.js @@ -0,0 +1,19 @@ +// 首页 +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const NOTICE_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory.do' +const PYXX_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory' + + +// 通知公告列表 +export function getNoticeList(data) { + return fetch.get(NOTICE_LIST, data).then(res => res); +} + +// 辟谣信息列表 +export function getPyxxList(data) { + return fetch.get(PYXX_LIST, data).then(res => res); +} + + diff --git a/common/utils.js b/common/utils.js index 76faf0d..556f693 100644 --- a/common/utils.js +++ b/common/utils.js @@ -211,6 +211,24 @@ var str = String(year) + String(month) + String(date) + ''; return str; } +//时间戳格式化 2021-12-22 13:12:12 形式 +export function stamp2Time(value) { + let time = new Date(value); + let year = time.getFullYear()+'/'; + let month = (time.getMonth()+1); + let date = time.getDate(); + let hour = time.getHours(); + let minute = time.getMinutes(); + let second = time.getSeconds(); + month = month < 10 ? '0'+ month +'-' : month +'-'; + date = date < 10 ? '0'+ date : date; + hour = hour < 10 ? '0'+ hour + ":" : hour + ":"; + minute = minute < 10 ? '0'+ minute : minute + ":"; + second = second < 10 ? '0'+ second : second; + let str = String(year)+String(month)+String(date)+ ' ' + String(hour) + String(minute) + String(second); + return str; +} + //深拷贝 export function deepCopy(data) { diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..f7ee3d5 --- /dev/null +++ b/api/index.js @@ -0,0 +1,19 @@ +// 首页 +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const NOTICE_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory.do' +const PYXX_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory' + + +// 通知公告列表 +export function getNoticeList(data) { + return fetch.get(NOTICE_LIST, data).then(res => res); +} + +// 辟谣信息列表 +export function getPyxxList(data) { + return fetch.get(PYXX_LIST, data).then(res => res); +} + + diff --git a/common/utils.js b/common/utils.js index 76faf0d..556f693 100644 --- a/common/utils.js +++ b/common/utils.js @@ -211,6 +211,24 @@ var str = String(year) + String(month) + String(date) + ''; return str; } +//时间戳格式化 2021-12-22 13:12:12 形式 +export function stamp2Time(value) { + let time = new Date(value); + let year = time.getFullYear()+'/'; + let month = (time.getMonth()+1); + let date = time.getDate(); + let hour = time.getHours(); + let minute = time.getMinutes(); + let second = time.getSeconds(); + month = month < 10 ? '0'+ month +'-' : month +'-'; + date = date < 10 ? '0'+ date : date; + hour = hour < 10 ? '0'+ hour + ":" : hour + ":"; + minute = minute < 10 ? '0'+ minute : minute + ":"; + second = second < 10 ? '0'+ second : second; + let str = String(year)+String(month)+String(date)+ ' ' + String(hour) + String(minute) + String(second); + return str; +} + //深拷贝 export function deepCopy(data) { diff --git a/components/eventList.vue b/components/eventList.vue index 032e69e..5cd31f3 100644 --- a/components/eventList.vue +++ b/components/eventList.vue @@ -28,9 +28,19 @@ default: () => [] } }, - computed: { - showList() { - return this.list.filter((item, index) => index < 2) + // computed: { + // showList() { + // console.log('6666', this.list) + // return this.list.filter((item, index) => index < 2) + // } + // }, + watch: { + list: { + handler: (val, olVal) => { + console.log('我变化了', val, olVal) + }, + deep: true, + immediate: true } }, data() { diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..f7ee3d5 --- /dev/null +++ b/api/index.js @@ -0,0 +1,19 @@ +// 首页 +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const NOTICE_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory.do' +const PYXX_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory' + + +// 通知公告列表 +export function getNoticeList(data) { + return fetch.get(NOTICE_LIST, data).then(res => res); +} + +// 辟谣信息列表 +export function getPyxxList(data) { + return fetch.get(PYXX_LIST, data).then(res => res); +} + + diff --git a/common/utils.js b/common/utils.js index 76faf0d..556f693 100644 --- a/common/utils.js +++ b/common/utils.js @@ -211,6 +211,24 @@ var str = String(year) + String(month) + String(date) + ''; return str; } +//时间戳格式化 2021-12-22 13:12:12 形式 +export function stamp2Time(value) { + let time = new Date(value); + let year = time.getFullYear()+'/'; + let month = (time.getMonth()+1); + let date = time.getDate(); + let hour = time.getHours(); + let minute = time.getMinutes(); + let second = time.getSeconds(); + month = month < 10 ? '0'+ month +'-' : month +'-'; + date = date < 10 ? '0'+ date : date; + hour = hour < 10 ? '0'+ hour + ":" : hour + ":"; + minute = minute < 10 ? '0'+ minute : minute + ":"; + second = second < 10 ? '0'+ second : second; + let str = String(year)+String(month)+String(date)+ ' ' + String(hour) + String(minute) + String(second); + return str; +} + //深拷贝 export function deepCopy(data) { diff --git a/components/eventList.vue b/components/eventList.vue index 032e69e..5cd31f3 100644 --- a/components/eventList.vue +++ b/components/eventList.vue @@ -28,9 +28,19 @@ default: () => [] } }, - computed: { - showList() { - return this.list.filter((item, index) => index < 2) + // computed: { + // showList() { + // console.log('6666', this.list) + // return this.list.filter((item, index) => index < 2) + // } + // }, + watch: { + list: { + handler: (val, olVal) => { + console.log('我变化了', val, olVal) + }, + deep: true, + immediate: true } }, data() { diff --git a/packageC/components/noticeList.vue b/packageC/components/noticeList.vue new file mode 100644 index 0000000..5f8781b --- /dev/null +++ b/packageC/components/noticeList.vue @@ -0,0 +1,91 @@ + + + + + \ No newline at end of file diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..f7ee3d5 --- /dev/null +++ b/api/index.js @@ -0,0 +1,19 @@ +// 首页 +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const NOTICE_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory.do' +const PYXX_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory' + + +// 通知公告列表 +export function getNoticeList(data) { + return fetch.get(NOTICE_LIST, data).then(res => res); +} + +// 辟谣信息列表 +export function getPyxxList(data) { + return fetch.get(PYXX_LIST, data).then(res => res); +} + + diff --git a/common/utils.js b/common/utils.js index 76faf0d..556f693 100644 --- a/common/utils.js +++ b/common/utils.js @@ -211,6 +211,24 @@ var str = String(year) + String(month) + String(date) + ''; return str; } +//时间戳格式化 2021-12-22 13:12:12 形式 +export function stamp2Time(value) { + let time = new Date(value); + let year = time.getFullYear()+'/'; + let month = (time.getMonth()+1); + let date = time.getDate(); + let hour = time.getHours(); + let minute = time.getMinutes(); + let second = time.getSeconds(); + month = month < 10 ? '0'+ month +'-' : month +'-'; + date = date < 10 ? '0'+ date : date; + hour = hour < 10 ? '0'+ hour + ":" : hour + ":"; + minute = minute < 10 ? '0'+ minute : minute + ":"; + second = second < 10 ? '0'+ second : second; + let str = String(year)+String(month)+String(date)+ ' ' + String(hour) + String(minute) + String(second); + return str; +} + //深拷贝 export function deepCopy(data) { diff --git a/components/eventList.vue b/components/eventList.vue index 032e69e..5cd31f3 100644 --- a/components/eventList.vue +++ b/components/eventList.vue @@ -28,9 +28,19 @@ default: () => [] } }, - computed: { - showList() { - return this.list.filter((item, index) => index < 2) + // computed: { + // showList() { + // console.log('6666', this.list) + // return this.list.filter((item, index) => index < 2) + // } + // }, + watch: { + list: { + handler: (val, olVal) => { + console.log('我变化了', val, olVal) + }, + deep: true, + immediate: true } }, data() { diff --git a/packageC/components/noticeList.vue b/packageC/components/noticeList.vue new file mode 100644 index 0000000..5f8781b --- /dev/null +++ b/packageC/components/noticeList.vue @@ -0,0 +1,91 @@ + + + + + \ No newline at end of file diff --git a/packageC/notice/notice.vue b/packageC/notice/notice.vue new file mode 100644 index 0000000..ec1c858 --- /dev/null +++ b/packageC/notice/notice.vue @@ -0,0 +1,181 @@ + + + + + + + diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..f7ee3d5 --- /dev/null +++ b/api/index.js @@ -0,0 +1,19 @@ +// 首页 +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const NOTICE_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory.do' +const PYXX_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory' + + +// 通知公告列表 +export function getNoticeList(data) { + return fetch.get(NOTICE_LIST, data).then(res => res); +} + +// 辟谣信息列表 +export function getPyxxList(data) { + return fetch.get(PYXX_LIST, data).then(res => res); +} + + diff --git a/common/utils.js b/common/utils.js index 76faf0d..556f693 100644 --- a/common/utils.js +++ b/common/utils.js @@ -211,6 +211,24 @@ var str = String(year) + String(month) + String(date) + ''; return str; } +//时间戳格式化 2021-12-22 13:12:12 形式 +export function stamp2Time(value) { + let time = new Date(value); + let year = time.getFullYear()+'/'; + let month = (time.getMonth()+1); + let date = time.getDate(); + let hour = time.getHours(); + let minute = time.getMinutes(); + let second = time.getSeconds(); + month = month < 10 ? '0'+ month +'-' : month +'-'; + date = date < 10 ? '0'+ date : date; + hour = hour < 10 ? '0'+ hour + ":" : hour + ":"; + minute = minute < 10 ? '0'+ minute : minute + ":"; + second = second < 10 ? '0'+ second : second; + let str = String(year)+String(month)+String(date)+ ' ' + String(hour) + String(minute) + String(second); + return str; +} + //深拷贝 export function deepCopy(data) { diff --git a/components/eventList.vue b/components/eventList.vue index 032e69e..5cd31f3 100644 --- a/components/eventList.vue +++ b/components/eventList.vue @@ -28,9 +28,19 @@ default: () => [] } }, - computed: { - showList() { - return this.list.filter((item, index) => index < 2) + // computed: { + // showList() { + // console.log('6666', this.list) + // return this.list.filter((item, index) => index < 2) + // } + // }, + watch: { + list: { + handler: (val, olVal) => { + console.log('我变化了', val, olVal) + }, + deep: true, + immediate: true } }, data() { diff --git a/packageC/components/noticeList.vue b/packageC/components/noticeList.vue new file mode 100644 index 0000000..5f8781b --- /dev/null +++ b/packageC/components/noticeList.vue @@ -0,0 +1,91 @@ + + + + + \ No newline at end of file diff --git a/packageC/notice/notice.vue b/packageC/notice/notice.vue new file mode 100644 index 0000000..ec1c858 --- /dev/null +++ b/packageC/notice/notice.vue @@ -0,0 +1,181 @@ + + + + + + + diff --git a/pages.json b/pages.json index f9d7fca..486c1be 100644 --- a/pages.json +++ b/pages.json @@ -265,8 +265,18 @@ "navigationBarBackgroundColor": "#eef2fe" // "navigationBarTextStyle": "white" } - } - ] - } + }, + { + "path" : "notice/notice", + "style" : + { + "navigationBarTitleText": "通知公告", + "enablePullDownRefresh": false, + "navigationBarBackgroundColor": "#4390f7", + "navigationBarTextStyle": "white" + } + } + ] + } ] } diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..f7ee3d5 --- /dev/null +++ b/api/index.js @@ -0,0 +1,19 @@ +// 首页 +import fetch from '@/common/fetch.js'; +import BASE_URL from './base.js'; + +const NOTICE_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory.do' +const PYXX_LIST = BASE_URL + '/pymhserver/news/listNewsByCategory' + + +// 通知公告列表 +export function getNoticeList(data) { + return fetch.get(NOTICE_LIST, data).then(res => res); +} + +// 辟谣信息列表 +export function getPyxxList(data) { + return fetch.get(PYXX_LIST, data).then(res => res); +} + + diff --git a/common/utils.js b/common/utils.js index 76faf0d..556f693 100644 --- a/common/utils.js +++ b/common/utils.js @@ -211,6 +211,24 @@ var str = String(year) + String(month) + String(date) + ''; return str; } +//时间戳格式化 2021-12-22 13:12:12 形式 +export function stamp2Time(value) { + let time = new Date(value); + let year = time.getFullYear()+'/'; + let month = (time.getMonth()+1); + let date = time.getDate(); + let hour = time.getHours(); + let minute = time.getMinutes(); + let second = time.getSeconds(); + month = month < 10 ? '0'+ month +'-' : month +'-'; + date = date < 10 ? '0'+ date : date; + hour = hour < 10 ? '0'+ hour + ":" : hour + ":"; + minute = minute < 10 ? '0'+ minute : minute + ":"; + second = second < 10 ? '0'+ second : second; + let str = String(year)+String(month)+String(date)+ ' ' + String(hour) + String(minute) + String(second); + return str; +} + //深拷贝 export function deepCopy(data) { diff --git a/components/eventList.vue b/components/eventList.vue index 032e69e..5cd31f3 100644 --- a/components/eventList.vue +++ b/components/eventList.vue @@ -28,9 +28,19 @@ default: () => [] } }, - computed: { - showList() { - return this.list.filter((item, index) => index < 2) + // computed: { + // showList() { + // console.log('6666', this.list) + // return this.list.filter((item, index) => index < 2) + // } + // }, + watch: { + list: { + handler: (val, olVal) => { + console.log('我变化了', val, olVal) + }, + deep: true, + immediate: true } }, data() { diff --git a/packageC/components/noticeList.vue b/packageC/components/noticeList.vue new file mode 100644 index 0000000..5f8781b --- /dev/null +++ b/packageC/components/noticeList.vue @@ -0,0 +1,91 @@ + + + + + \ No newline at end of file diff --git a/packageC/notice/notice.vue b/packageC/notice/notice.vue new file mode 100644 index 0000000..ec1c858 --- /dev/null +++ b/packageC/notice/notice.vue @@ -0,0 +1,181 @@ + + + + + + + diff --git a/pages.json b/pages.json index f9d7fca..486c1be 100644 --- a/pages.json +++ b/pages.json @@ -265,8 +265,18 @@ "navigationBarBackgroundColor": "#eef2fe" // "navigationBarTextStyle": "white" } - } - ] - } + }, + { + "path" : "notice/notice", + "style" : + { + "navigationBarTitleText": "通知公告", + "enablePullDownRefresh": false, + "navigationBarBackgroundColor": "#4390f7", + "navigationBarTextStyle": "white" + } + } + ] + } ] } diff --git a/pages/index/index.vue b/pages/index/index.vue index 57dc3dc..e40537e 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -44,19 +44,61 @@ - - + --> + + 通知公告 + + 更多 + + + + + + {{e.title}} + + + + + + 辟谣信息 + + 更多 + + + + + + {{e.title}} + + + + + + 案例警醒 + + 更多 + + + + + + {{e.title}} + +