fix: 修复通知列表bug

This commit is contained in:
范鹏 2024-10-07 10:35:37 +08:00
parent 4a2614ff83
commit c340a52c35
4 changed files with 14 additions and 6 deletions

View File

@ -3,7 +3,7 @@
"appid" : "__UNI__933D519", "appid" : "__UNI__933D519",
"description" : "", "description" : "",
"versionName" : "1.1.0", "versionName" : "1.1.0",
"versionCode" : "23", "versionCode" : "24",
"transformPx" : false, "transformPx" : false,
/* */ /* */
"mp-weixin" : { "mp-weixin" : {

View File

@ -5,7 +5,7 @@
<scroll-view v-if="deviceInfo" scroll-y="true" :style="{ height: deviceInfo.windowHeight + 'px' }" <scroll-view v-if="deviceInfo" scroll-y="true" :style="{ height: deviceInfo.windowHeight + 'px' }"
lower-threshold="100" @refresherrefresh="refresherList" :refresher-enabled="true" @scrolltolower="nextPage" lower-threshold="100" @refresherrefresh="refresherList" :refresher-enabled="true" @scrolltolower="nextPage"
:refresher-triggered="refresherTriggered"> :refresher-triggered="refresherTriggered">
<view class="search"> <view class="search" v-if="!(lockList.length === 0 && lockSearch.searchStr === '' && !focus)">
<up-search :searchIconSize="48" :inputStyle="{ fontSize: '32rpx' }" @focus="getFocus" @blur="getBlur" <up-search :searchIconSize="48" :inputStyle="{ fontSize: '32rpx' }" @focus="getFocus" @blur="getBlur"
:height="80" placeholder="搜索" :clearabled="false" @change="changeSearch" :height="80" placeholder="搜索" :clearabled="false" @change="changeSearch"
v-model="lockSearch.searchStr" bgColor="#ffffff" :showAction="false" maxlength="20"></up-search> v-model="lockSearch.searchStr" bgColor="#ffffff" :showAction="false" maxlength="20"></up-search>
@ -14,7 +14,7 @@
<view v-if="lockList.length === 0 && lockSearch.searchStr === '' && !focus"> <view v-if="lockList.length === 0 && lockSearch.searchStr === '' && !focus">
<image src="/static/images/icon_add_round.png" mode="aspectFill" class="button-add-big" <image src="/static/images/icon_add_round.png" mode="aspectFill" class="button-add-big"
@click="toSearchDevice"></image> @click="toSearchDevice"></image>
<view class="text">加锁时手机必须在锁旁边</view> <view class="text">加锁时手机必须在锁旁边</view>
</view> </view>
<view v-else> <view v-else>
<view class="group" v-for="(group, grounIndex) in lockList" :key="group.groupId"> <view class="group" v-for="(group, grounIndex) in lockList" :key="group.groupId">

View File

@ -2,7 +2,7 @@
<view> <view>
<scroll-view v-if="deviceInfo" scroll-y="true" :style="{ height: deviceInfo.windowHeight + 'px' }" <scroll-view v-if="deviceInfo" scroll-y="true" :style="{ height: deviceInfo.windowHeight + 'px' }"
lower-threshold="100" @refresherrefresh="refresherList" :refresher-enabled="true" @scrolltolower="nextPage" lower-threshold="100" @refresherrefresh="refresherList" :refresher-enabled="true" @scrolltolower="nextPage"
:refresher-triggered="refresherTriggered"> :refresher-triggered="refresherTriggered" @scroll="scroll">
<view class="list" v-if="requestFinished"> <view class="list" v-if="requestFinished">
<view v-if="notificationList.length === 0"> <view v-if="notificationList.length === 0">
<image class="empty-list" src="/static/images/background_empty_list.png" mode="aspectFill"></image> <image class="empty-list" src="/static/images/background_empty_list.png" mode="aspectFill"></image>
@ -11,7 +11,8 @@
<up-swipe-action v-else> <up-swipe-action v-else>
<up-swipe-action-item class="item" ref="swipeItem" :options="options" <up-swipe-action-item class="item" ref="swipeItem" :options="options"
v-for="(notification,index) in notificationList" :key="notification.id" v-for="(notification,index) in notificationList" :key="notification.id"
:threshold="50" @click="deleteNotification(notification, index)"> :threshold="50" @click="deleteNotification(notification, index)" :index="index"
:name="index">
<view class="notification" @click="toDetail(index,notification)"> <view class="notification" @click="toDetail(index,notification)">
<view v-if="notification.readAt === 0"> <view v-if="notification.readAt === 0">
<image class="icon" src="/static/images/icon_notification_unread.png" mode="aspectFill"></image> <image class="icon" src="/static/images/icon_notification_unread.png" mode="aspectFill"></image>
@ -78,6 +79,13 @@ export default {
timeFormat, timeFormat,
...mapActions(useNotificationStore, ['getNotificationList', 'updateNotificationSearch', 'updateNotificationItem','deleteNotificationItem']), ...mapActions(useNotificationStore, ['getNotificationList', 'updateNotificationSearch', 'updateNotificationItem','deleteNotificationItem']),
...mapActions(useBasicStore, ['routeJump', 'getDeviceInfo', 'getNetworkType']), ...mapActions(useBasicStore, ['routeJump', 'getDeviceInfo', 'getNetworkType']),
scroll(e) {
this.$refs.swipeItem.forEach(item => {
if(item.show) {
item.closeHandler()
}
})
},
async deleteNotification (notification, index) { async deleteNotification (notification, index) {
const netWork = await this.getNetworkType() const netWork = await this.getNetworkType()
if (!netWork) { if (!netWork) {

View File

@ -2,7 +2,7 @@
<view> <view>
<view class="view"> <view class="view">
<view class="view-button"> <view class="view-button">
<view style="width: 350rpx">名称</view> <view style="width: 150rpx">名称</view>
<view class="view-button" style="padding: 20rpx 0"> <view class="view-button" style="padding: 20rpx 0">
<view class="info" style="line-height: 40rpx;word-break: break-all;">{{currentLockInfo.lockAlias}}</view> <view class="info" style="line-height: 40rpx;word-break: break-all;">{{currentLockInfo.lockAlias}}</view>
</view> </view>