Commit be89a6c615f19fa4a7eab0a3467e74626019f17e
Merge branch 'ft-dev' into 'main'
fix:修改通知分页前端判断状态 See merge request huang/thingskit-app!48
Showing
4 changed files
with
42 additions
and
24 deletions
@@ -138,21 +138,20 @@ export default { | @@ -138,21 +138,20 @@ export default { | ||
138 | } | 138 | } |
139 | }); | 139 | }); |
140 | }, | 140 | }, |
141 | - showToastWip(){ | ||
142 | - uni.$u.toast('拼命开发中 ...') | 141 | + showToastWip() { |
142 | + uni.$u.toast('拼命开发中 ...'); | ||
143 | }, | 143 | }, |
144 | openCamera() { | 144 | openCamera() { |
145 | - // uni.navigateTo({ | ||
146 | - // url: 'camera/camera' | ||
147 | - // }); | ||
148 | - this.showToastWip() | 145 | + uni.navigateTo({ |
146 | + url: 'camera/camera' | ||
147 | + }); | ||
148 | + // this.showToastWip() | ||
149 | }, | 149 | }, |
150 | openOrgStatus() { | 150 | openOrgStatus() { |
151 | // uni.navigateTo({ | 151 | // uni.navigateTo({ |
152 | // url: 'configuration/configuration' | 152 | // url: 'configuration/configuration' |
153 | // }); | 153 | // }); |
154 | - this.showToastWip() | ||
155 | - | 154 | + this.showToastWip(); |
156 | }, | 155 | }, |
157 | //告警状态查询 | 156 | //告警状态查询 |
158 | navigatorAlarmStatus(e) { | 157 | navigatorAlarmStatus(e) { |
@@ -249,7 +249,8 @@ export default { | @@ -249,7 +249,8 @@ export default { | ||
249 | let userInfo = { | 249 | let userInfo = { |
250 | ...resObj, | 250 | ...resObj, |
251 | token: true, //token用于判断是否登录 | 251 | token: true, //token用于判断是否登录 |
252 | - isThirdLogin: false | 252 | + isThirdLogin: false, |
253 | + isThirdLoginAndNoDind: true | ||
253 | }; | 254 | }; |
254 | if (userInfo.token) { | 255 | if (userInfo.token) { |
255 | this.setUserInfo(userInfo); | 256 | this.setUserInfo(userInfo); |
@@ -311,7 +312,8 @@ export default { | @@ -311,7 +312,8 @@ export default { | ||
311 | let userInfo = { | 312 | let userInfo = { |
312 | ...resObj, | 313 | ...resObj, |
313 | token: true, //token用于判断是否登录 | 314 | token: true, //token用于判断是否登录 |
314 | - isThirdLogin: false | 315 | + isThirdLogin: false, |
316 | + isThirdLoginAndNoDind: true | ||
315 | }; | 317 | }; |
316 | if (userInfo.token) { | 318 | if (userInfo.token) { |
317 | this.setUserInfo(userInfo); | 319 | this.setUserInfo(userInfo); |
@@ -46,13 +46,16 @@ | @@ -46,13 +46,16 @@ | ||
46 | </u--form> | 46 | </u--form> |
47 | </view> | 47 | </view> |
48 | <view class="basic-bottom u-flex"> | 48 | <view class="basic-bottom u-flex"> |
49 | - <view class="item" v-if="info.data.isThirdLoginAndNoDind"> | 49 | + <view class="item" v-if="info.data.isThirdLoginAndNoDind && isJudgeBindBtn"> |
50 | <button class="submit" size="default" @click="clearAccountFunc" :style="{ background: InfoColor }"><text class="un-bind-text">解绑</text></button> | 50 | <button class="submit" size="default" @click="clearAccountFunc" :style="{ background: InfoColor }"><text class="un-bind-text">解绑</text></button> |
51 | </view> | 51 | </view> |
52 | <view | 52 | <view |
53 | class="item" | 53 | class="item" |
54 | style="margin-right: 60rpx;" | 54 | style="margin-right: 60rpx;" |
55 | - :style="[{ position: info.data.isThirdLoginAndNoDind ? '' : 'relative' }, { right: info.data.isThirdLoginAndNoDind ? '' : '-190rpx' }]" | 55 | + :style="[ |
56 | + { position: info.data.isThirdLoginAndNoDind && isJudgeBindBtn ? '' : 'relative' }, | ||
57 | + { right: info.data.isThirdLoginAndNoDind && isJudgeBindBtn ? '' : '-190rpx' } | ||
58 | + ]" | ||
56 | > | 59 | > |
57 | <button class="submit" size="default" @click="onSubmitFunc" :style="{ background: PrimaryColor }"><text class="un-bind-text">确认</text></button> | 60 | <button class="submit" size="default" @click="onSubmitFunc" :style="{ background: PrimaryColor }"><text class="un-bind-text">确认</text></button> |
58 | </view> | 61 | </view> |
@@ -100,7 +103,8 @@ export default { | @@ -100,7 +103,8 @@ export default { | ||
100 | id: '', | 103 | id: '', |
101 | info: {}, | 104 | info: {}, |
102 | openIds: '', | 105 | openIds: '', |
103 | - isUpdatePersonOrLoginInfo: false | 106 | + isUpdatePersonOrLoginInfo: false, |
107 | + isJudgeBindBtn: true | ||
104 | }; | 108 | }; |
105 | }, | 109 | }, |
106 | onLoad(e) { | 110 | onLoad(e) { |
@@ -141,6 +145,7 @@ export default { | @@ -141,6 +145,7 @@ export default { | ||
141 | title: '解绑成功' | 145 | title: '解绑成功' |
142 | }); | 146 | }); |
143 | this.showBind = false; | 147 | this.showBind = false; |
148 | + this.isJudgeBindBtn = false; | ||
144 | } else { | 149 | } else { |
145 | uni.showToast({ | 150 | uni.showToast({ |
146 | title: '解绑失败' | 151 | title: '解绑失败' |
@@ -10,9 +10,15 @@ | @@ -10,9 +10,15 @@ | ||
10 | </view> | 10 | </view> |
11 | <view style="height: 76rpx;"></view> | 11 | <view style="height: 76rpx;"></view> |
12 | <view class="notify-main"> | 12 | <view class="notify-main"> |
13 | + <!-- 无数据图片 --> | ||
14 | + <view v-if="list.length == 0" style="position: relative;top: 100rpx;flex-direction: column;" class="u-flex"> | ||
15 | + <view><image style="width: 280rpx;height: 250rpx;" src="../../static/empty.png"></image></view> | ||
16 | + <view style="text-align: center;"><text style="font-size: 12px;color: gray;">~ 空空如也 ~</text></view> | ||
17 | + </view> | ||
18 | + <!-- 无数据图片 --> | ||
13 | <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback"> | 19 | <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback"> |
14 | <view class="u-flex main"> | 20 | <view class="u-flex main"> |
15 | - <view @click="clickNotifyDetail(item.sysNotice)" class="u-flex main-item" v-for="(item, index) in list" :key="index"> | 21 | + <view @click="clickNotifyDetail(item, index)" class="u-flex main-item" v-for="(item, index) in list" :key="index"> |
16 | <view class="u-flex item"> | 22 | <view class="u-flex item"> |
17 | <view class="item-avatar"><u-avatar class="avatar" shape="circle" size="40" :src="item.sysNotice.avatar"></u-avatar></view> | 23 | <view class="item-avatar"><u-avatar class="avatar" shape="circle" size="40" :src="item.sysNotice.avatar"></u-avatar></view> |
18 | <view class="u-flex item-content"> | 24 | <view class="u-flex item-content"> |
@@ -72,7 +78,8 @@ export default { | @@ -72,7 +78,8 @@ export default { | ||
72 | }, | 78 | }, |
73 | list: [], | 79 | list: [], |
74 | pre: false, | 80 | pre: false, |
75 | - isJudgeNextPage: '' | 81 | + isJudgeNextPage: '', |
82 | + distance: 0 | ||
76 | }; | 83 | }; |
77 | }, | 84 | }, |
78 | onLoad(e) { | 85 | onLoad(e) { |
@@ -84,14 +91,20 @@ export default { | @@ -84,14 +91,20 @@ export default { | ||
84 | onShow() { | 91 | onShow() { |
85 | this.pre = uni.getStorageSync('storagePre'); | 92 | this.pre = uni.getStorageSync('storagePre'); |
86 | if (this.pre) { | 93 | if (this.pre) { |
87 | - this.page.num = 1; | ||
88 | - this.loadData(this.page.num); | 94 | + // this.page.num = 1; |
95 | + // this.loadData(this.page.num); | ||
89 | } | 96 | } |
90 | }, | 97 | }, |
91 | onHide() { | 98 | onHide() { |
92 | uni.removeStorageSync('storagePre'); | 99 | uni.removeStorageSync('storagePre'); |
93 | }, | 100 | }, |
94 | methods: { | 101 | methods: { |
102 | + // topBack(num) { | ||
103 | + // uni.pageScrollTo({ | ||
104 | + // scrollTop: 0, // 滚动到页面的目标位置 这个是滚动到顶部, 0 | ||
105 | + // duration: 10 // 滚动动画的时长 | ||
106 | + // }); | ||
107 | + // }, | ||
95 | formatType(e) { | 108 | formatType(e) { |
96 | return e?.type == 'OTHER' ? '其他' : e?.type == 'MEETING' ? '会议' : '公告'; | 109 | return e?.type == 'OTHER' ? '其他' : e?.type == 'MEETING' ? '会议' : '公告'; |
97 | }, | 110 | }, |
@@ -145,19 +158,18 @@ export default { | @@ -145,19 +158,18 @@ export default { | ||
145 | } | 158 | } |
146 | }) | 159 | }) |
147 | .catch(e => { | 160 | .catch(e => { |
148 | - uni.$u.toast(e.data?.message); | 161 | + // uni.$u.toast(e.data?.message); |
149 | this.mescroll.endErr(); | 162 | this.mescroll.endErr(); |
150 | }); | 163 | }); |
151 | }, | 164 | }, |
152 | - clickNotifyDetail(e) { | 165 | + clickNotifyDetail(e, i) { |
166 | + this.list[i].readStatus = 1; | ||
153 | uni.$u.http | 167 | uni.$u.http |
154 | - .get(`/yt/noticeUser/${e.id}`) | 168 | + .get(`/yt/noticeUser/${e.sysNotice.id}`) |
155 | .then(res => {}) | 169 | .then(res => {}) |
156 | - .catch(e => { | ||
157 | - uni.$u.toast(e.data?.message); | ||
158 | - }); | 170 | + .catch(e => {}); |
159 | uni.navigateTo({ | 171 | uni.navigateTo({ |
160 | - url: './notifyDetail?data=' + encodeURIComponent(JSON.stringify(e)) | 172 | + url: './notifyDetail?data=' + encodeURIComponent(JSON.stringify(e.sysNotice)) |
161 | }); | 173 | }); |
162 | } | 174 | } |
163 | } | 175 | } |