添加时间
This commit is contained in:
@@ -105,6 +105,26 @@ function formatTime(time, option) {
|
||||
)
|
||||
}
|
||||
}
|
||||
// 获取当天日期(年月日)
|
||||
function getToday() {
|
||||
const today = new Date();
|
||||
const year = today.getFullYear();
|
||||
const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需+1
|
||||
const day = String(today.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
|
||||
// 获取3个月前的日期
|
||||
function getThreeMonthsAgo() {
|
||||
const threeMonthsAgo = new Date();
|
||||
threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3); // 月份减3
|
||||
const year = threeMonthsAgo.getFullYear();
|
||||
const month = String(threeMonthsAgo.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(threeMonthsAgo.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const h5Helper = {
|
||||
isAndroid: function () {
|
||||
@@ -296,4 +316,6 @@ export default {
|
||||
loginSuccess,
|
||||
refreshPrePage,
|
||||
getDictData,
|
||||
getToday,
|
||||
getThreeMonthsAgo
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"name" : "灿能物联",
|
||||
"appid" : "__UNI__88BC25B",
|
||||
"description" : "",
|
||||
"versionName" : "1.6.7",
|
||||
"versionCode" : 167,
|
||||
"versionName" : "1.6.8",
|
||||
"versionCode" : 168,
|
||||
"transformPx" : false,
|
||||
"sassImplementationName" : "node-sass",
|
||||
/* 5+App特有相关 */
|
||||
@@ -70,13 +70,7 @@
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {
|
||||
"ad" : {},
|
||||
"maps" : {
|
||||
"amap" : {
|
||||
"name" : "",
|
||||
"appkey_ios" : "73262624599d79ee4ad8bba2ab4a0958",
|
||||
"appkey_android" : "c93dd87e087f3686a9d4463ce5ebcbe1"
|
||||
}
|
||||
},
|
||||
"maps" : {},
|
||||
"push" : {
|
||||
"unipush" : {
|
||||
"version" : "2",
|
||||
@@ -156,6 +150,9 @@
|
||||
},
|
||||
"router" : {
|
||||
"base" : ""
|
||||
},
|
||||
"unipush" : {
|
||||
"enable" : false
|
||||
}
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
|
||||
@@ -3,8 +3,14 @@
|
||||
<view class="content" slot="body">
|
||||
<view class="content-item" v-for="(item, index) in store.data" :key="index" @click="jump(item)">
|
||||
<view class="content-item-header">
|
||||
<uni-badge class="uni-badge-left-margin" :is-dot="true" :text="item.status == '1' ? 0 : 1"
|
||||
absolute="rightTop" size="small" style="margin-top: 30rpx;">
|
||||
<uni-badge
|
||||
class="uni-badge-left-margin"
|
||||
:is-dot="true"
|
||||
:text="item.status == '1' ? 0 : 1"
|
||||
absolute="rightTop"
|
||||
size="small"
|
||||
style="margin-top: 30rpx"
|
||||
>
|
||||
<view class="content-item-header-icon">
|
||||
<image mode="aspectFill" :src="staticIcon" style="height: 60rpx; width: 60rpx"></image>
|
||||
</view>
|
||||
@@ -38,8 +44,10 @@
|
||||
</view>
|
||||
</uni-card> -->
|
||||
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty>
|
||||
<uni-load-more v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
||||
:status="store.status"></uni-load-more>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
@@ -104,6 +112,8 @@ export default {
|
||||
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
|
||||
this.store.params.type = this.type
|
||||
this.store.params.deviceId = this.deviceId
|
||||
this.store.params.startTime = this.$util.getToday()
|
||||
this.store.params.endTime = this.$util.getThreeMonthsAgo()
|
||||
this.store.loadedCallback = () => {
|
||||
this.store.data.forEach((item) => {
|
||||
if (this.type === '3') {
|
||||
|
||||
@@ -3,8 +3,14 @@
|
||||
<view class="content" slot="body">
|
||||
<view class="content-item" v-for="(item, index) in store.data" :key="index" @click="jump(item)">
|
||||
<view class="content-item-header">
|
||||
<uni-badge class="uni-badge-left-margin" :is-dot="true" :text="item.status == '1' ? 0 : 1"
|
||||
absolute="rightTop" size="small" :style="type == '0' ? `margin-top: 30rpx;` : ''">
|
||||
<uni-badge
|
||||
class="uni-badge-left-margin"
|
||||
:is-dot="true"
|
||||
:text="item.status == '1' ? 0 : 1"
|
||||
absolute="rightTop"
|
||||
size="small"
|
||||
:style="type == '0' ? `margin-top: 30rpx;` : ''"
|
||||
>
|
||||
<view class="content-item-header-icon">
|
||||
<image mode="aspectFill" :src="staticIcon" style="height: 60rpx; width: 60rpx"></image>
|
||||
</view>
|
||||
@@ -14,9 +20,12 @@
|
||||
<!-- <view class="content-item-header-right-des">{{ item.engineeringName }} {{ item.projectName }}</view> -->
|
||||
<view class="content-item-header-right-des">工程名称:{{ item.engineeringName }}</view>
|
||||
<view class="content-item-header-right-des">项目名称:{{ item.projectName }}</view>
|
||||
<view class="content-item-header-right-des" v-if="type == '0' || type == '1'">监测点名称:{{
|
||||
item.lineName }}</view>
|
||||
<view class="content-item-header-right-des" v-if="type == '0'">暂态类型:{{ item.showName}}</view>
|
||||
<view class="content-item-header-right-des" v-if="type == '0' || type == '1'"
|
||||
>监测点名称:{{ item.lineName }}</view
|
||||
>
|
||||
<view class="content-item-header-right-des" v-if="type == '0'"
|
||||
>暂态类型:{{ item.showName }}</view
|
||||
>
|
||||
<!-- <view class="content-item-header-right-des">{{ item.subTitle }}</view> -->
|
||||
</view>
|
||||
<view class="ml10" v-if="type === '0' || item.status != '1'">🔍</view>
|
||||
@@ -39,14 +48,17 @@
|
||||
</view>
|
||||
</uni-card> -->
|
||||
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty>
|
||||
<uni-load-more v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
||||
:status="store.status"></uni-load-more>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import list from '@/common/js/list'
|
||||
import Calendar from './util.js'
|
||||
import { updateStatus } from '@/common/api/message'
|
||||
|
||||
export default {
|
||||
@@ -104,6 +116,8 @@ export default {
|
||||
console.log(dictData)
|
||||
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
|
||||
this.store.params.type = this.type
|
||||
this.store.params.startTime = this.$util.getToday()
|
||||
this.store.params.endTime = this.$util.getThreeMonthsAgo()
|
||||
this.store.loadedCallback = () => {
|
||||
console.log(111, this.store.data)
|
||||
|
||||
@@ -135,7 +149,6 @@ export default {
|
||||
},
|
||||
jump(item) {
|
||||
if (this.type === '0') {
|
||||
|
||||
let str = JSON.stringify(item).replace(/%/g, '百分比')
|
||||
item.status = '1'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<view class="about">
|
||||
<image src="/static/logo.png" class="logo"></image>
|
||||
<view class="name">灿能物联</view>
|
||||
<view class="version">Version 1.6.6</view>
|
||||
<view class="version">Version 1.6.7</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<!-- @click="jump('about')" -->
|
||||
<view class="mine-nav" style="border-bottom: none">
|
||||
<view class="mine-nav-label">版本信息</view>
|
||||
<view style="color: #828282; font-size: 14rpx">当前版本V1.6.6</view>
|
||||
<view style="color: #828282; font-size: 14rpx">当前版本V<1.6.7/view>
|
||||
<!-- <uni-icons type="forward" color="#aaa" size="20"></uni-icons> -->
|
||||
</view>
|
||||
<view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none">
|
||||
|
||||
Reference in New Issue
Block a user