添加时间

This commit is contained in:
guanj
2025-08-19 09:50:23 +08:00
parent 127adcd524
commit 67ea86015a
6 changed files with 818 additions and 776 deletions

View File

@@ -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 = { const h5Helper = {
isAndroid: function () { isAndroid: function () {
@@ -296,4 +316,6 @@ export default {
loginSuccess, loginSuccess,
refreshPrePage, refreshPrePage,
getDictData, getDictData,
getToday,
getThreeMonthsAgo
} }

View File

@@ -2,8 +2,8 @@
"name" : "灿能物联", "name" : "灿能物联",
"appid" : "__UNI__88BC25B", "appid" : "__UNI__88BC25B",
"description" : "", "description" : "",
"versionName" : "1.6.7", "versionName" : "1.6.8",
"versionCode" : 167, "versionCode" : 168,
"transformPx" : false, "transformPx" : false,
"sassImplementationName" : "node-sass", "sassImplementationName" : "node-sass",
/* 5+App */ /* 5+App */
@@ -70,13 +70,7 @@
/* SDK */ /* SDK */
"sdkConfigs" : { "sdkConfigs" : {
"ad" : {}, "ad" : {},
"maps" : { "maps" : {},
"amap" : {
"name" : "",
"appkey_ios" : "73262624599d79ee4ad8bba2ab4a0958",
"appkey_android" : "c93dd87e087f3686a9d4463ce5ebcbe1"
}
},
"push" : { "push" : {
"unipush" : { "unipush" : {
"version" : "2", "version" : "2",
@@ -156,6 +150,9 @@
}, },
"router" : { "router" : {
"base" : "" "base" : ""
},
"unipush" : {
"enable" : false
} }
}, },
"mp-toutiao" : { "mp-toutiao" : {

View File

@@ -3,8 +3,14 @@
<view class="content" slot="body"> <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" v-for="(item, index) in store.data" :key="index" @click="jump(item)">
<view class="content-item-header"> <view class="content-item-header">
<uni-badge class="uni-badge-left-margin" :is-dot="true" :text="item.status == '1' ? 0 : 1" <uni-badge
absolute="rightTop" size="small" style="margin-top: 30rpx;"> 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"> <view class="content-item-header-icon">
<image mode="aspectFill" :src="staticIcon" style="height: 60rpx; width: 60rpx"></image> <image mode="aspectFill" :src="staticIcon" style="height: 60rpx; width: 60rpx"></image>
</view> </view>
@@ -38,8 +44,10 @@
</view> </view>
</uni-card> --> </uni-card> -->
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty> <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)" <uni-load-more
:status="store.status"></uni-load-more> v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
:status="store.status"
></uni-load-more>
</view> </view>
</Cn-page> </Cn-page>
</template> </template>
@@ -104,6 +112,8 @@ export default {
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage') this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
this.store.params.type = this.type this.store.params.type = this.type
this.store.params.deviceId = this.deviceId 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.loadedCallback = () => {
this.store.data.forEach((item) => { this.store.data.forEach((item) => {
if (this.type === '3') { if (this.type === '3') {

View File

@@ -3,8 +3,14 @@
<view class="content" slot="body"> <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" v-for="(item, index) in store.data" :key="index" @click="jump(item)">
<view class="content-item-header"> <view class="content-item-header">
<uni-badge class="uni-badge-left-margin" :is-dot="true" :text="item.status == '1' ? 0 : 1" <uni-badge
absolute="rightTop" size="small" :style="type == '0' ? `margin-top: 30rpx;` : ''"> 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"> <view class="content-item-header-icon">
<image mode="aspectFill" :src="staticIcon" style="height: 60rpx; width: 60rpx"></image> <image mode="aspectFill" :src="staticIcon" style="height: 60rpx; width: 60rpx"></image>
</view> </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 }} {{ item.projectName }}</view> -->
<view class="content-item-header-right-des">工程名称{{ item.engineeringName }}</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">项目名称{{ item.projectName }}</view>
<view class="content-item-header-right-des" v-if="type == '0' || type == '1'">监测点名称{{ <view class="content-item-header-right-des" v-if="type == '0' || type == '1'"
item.lineName }}</view> >监测点名称{{ 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'"
>暂态类型{{ item.showName }}</view
>
<!-- <view class="content-item-header-right-des">{{ item.subTitle }}</view> --> <!-- <view class="content-item-header-right-des">{{ item.subTitle }}</view> -->
</view> </view>
<view class="ml10" v-if="type === '0' || item.status != '1'">🔍</view> <view class="ml10" v-if="type === '0' || item.status != '1'">🔍</view>
@@ -39,14 +48,17 @@
</view> </view>
</uni-card> --> </uni-card> -->
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty> <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)" <uni-load-more
:status="store.status"></uni-load-more> v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
:status="store.status"
></uni-load-more>
</view> </view>
</Cn-page> </Cn-page>
</template> </template>
<script> <script>
import list from '@/common/js/list' import list from '@/common/js/list'
import Calendar from './util.js'
import { updateStatus } from '@/common/api/message' import { updateStatus } from '@/common/api/message'
export default { export default {
@@ -104,6 +116,8 @@ export default {
console.log(dictData) console.log(dictData)
this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage') this.store = this.DataSource('/cs-harmonic-boot/eventUser/queryEventpage')
this.store.params.type = this.type this.store.params.type = this.type
this.store.params.startTime = this.$util.getToday()
this.store.params.endTime = this.$util.getThreeMonthsAgo()
this.store.loadedCallback = () => { this.store.loadedCallback = () => {
console.log(111, this.store.data) console.log(111, this.store.data)
@@ -135,7 +149,6 @@ export default {
}, },
jump(item) { jump(item) {
if (this.type === '0') { if (this.type === '0') {
let str = JSON.stringify(item).replace(/%/g, '百分比') let str = JSON.stringify(item).replace(/%/g, '百分比')
item.status = '1' item.status = '1'

View File

@@ -4,7 +4,7 @@
<view class="about"> <view class="about">
<image src="/static/logo.png" class="logo"></image> <image src="/static/logo.png" class="logo"></image>
<view class="name">灿能物联</view> <view class="name">灿能物联</view>
<view class="version">Version 1.6.6</view> <view class="version">Version 1.6.7</view>
</view> </view>
</view> </view>
</Cn-page> </Cn-page>

View File

@@ -48,7 +48,7 @@
<!-- @click="jump('about')" --> <!-- @click="jump('about')" -->
<view class="mine-nav" style="border-bottom: none"> <view class="mine-nav" style="border-bottom: none">
<view class="mine-nav-label">版本信息</view> <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> --> <!-- <uni-icons type="forward" color="#aaa" size="20"></uni-icons> -->
</view> </view>
<view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none"> <view class="mine-nav" @click="jump('layout')" style="margin-top: 20rpx; border-bottom: none">