Skip to content

Commit 8383f41

Browse files
committed
Revert(SPA): 回滚2.2版本的消息系统
1 parent b390b44 commit 8383f41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3126
-1891
lines changed

packages/slimkit-plus-socialite/src/API/Controllers/WechatController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function getOauthUrl(Request $request)
4343
if ($url === '') {
4444
return response()->json(['message' => '微信配置错误'], 422);
4545
}
46-
$url = urlencode($url);
46+
4747
$originUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$config['appid'].'&redirect_uri='.$url.'&response_type=code&scope=snsapi_userinfo&state=true#wechat_redirect';
4848

4949
return response()->json(['url' => $originUrl], 200);

resources/spa/src/api/feeds.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@ export function getFeeds (params) {
2727
return api.get('/feeds', { params, validateStatus: s => s === 200 })
2828
}
2929

30-
/**
31-
* 获取动态详情
32-
*
33-
* @author mutoe <[email protected]>
34-
* @export
35-
* @param {string} feedId
36-
* @returns
37-
*/
38-
export function getFeed (feedId) {
39-
return api.get(`/feeds/${feedId}`)
40-
}
41-
4230
/**
4331
* 申请动态置顶
4432
* @author mutoe <[email protected]>

resources/spa/src/api/group.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,3 @@ export function getPostCommentAudits ({ after = 0, post = 0 }) {
6262
const params = { after, limit, post }
6363
return api.get('/plus-group/pinned/comments', { params })
6464
}
65-
66-
/**
67-
* 获取圈子审核列表
68-
* @author mutoe <[email protected]>
69-
* @export
70-
* @param {Object} payload
71-
* @param {number} [payload.after=0]
72-
* @returns
73-
*/
74-
export function getGroupAudits ({ after }) {
75-
const params = { after, limit }
76-
return api.get('/plus-group/user-group-audit-members', { params })
77-
}
78-
79-
/**
80-
* 批量获取帖子简单数据
81-
*
82-
* @author mutoe <[email protected]>
83-
* @export
84-
* @param {string} ids
85-
* @returns
86-
*/
87-
export function getSimplePosts (ids) {
88-
return api.get('/group/simple-posts', { params: { id: ids } })
89-
}

resources/spa/src/api/message.js

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,24 @@
11
import api from './api'
2+
import { limit } from './index'
23

34
// 获取系统通知
4-
export function getNotificationStatistics () {
5-
return api.get(`/user/notification-statistics`)
6-
}
7-
8-
// 获取未读审核通知数量
9-
export function getUnreadCounts () {
10-
return api.get('/user/counts')
11-
}
12-
13-
/**
14-
* 获取通知列表
15-
* @author mutoe <[email protected]>
16-
* @export
17-
* @param {Object} params
18-
* @param {string} params.type
19-
* @param {number} [params.page=1]
20-
* @returns
21-
*/
22-
export function getNotification (params) {
23-
return api.get('/user/notifications', { params })
5+
export function getNotifications (offset = 0) {
6+
return api.get(`/user/notifications`, {
7+
params: {
8+
offset,
9+
limit,
10+
},
11+
})
2412
}
2513

2614
/**
27-
* 标记通知已读
28-
* @author mutoe <[email protected]>
29-
* @export
30-
* @param {string} type
31-
* @returns
15+
* 清除未读提示
16+
* @Author Wayne
17+
* @DateTime 2018-05-05
18+
19+
* @param {String} type [清除的消息类型]
20+
* @return {[type]} [description]
3221
*/
33-
export function resetNotificationCount (type) {
34-
return api.patch('/user/notifications', {}, { params: { type } })
22+
export function resetUserCount (type = '') {
23+
api.patch('/user/counts', { type })
3524
}

resources/spa/src/components.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** common components */
22
import btnSwitch from './components/common/btnSwitch' /* btnSwitch 按钮 */
3-
import BadgeIcon from './components/common/BadgeIcon' /* Badge 徽标 */
3+
import badge from './components/common/badge' /* Badge 徽标 */
44
import CommonHeader from './components/common/CommonHeader.vue' /* 通用头部 */
55
import fullSpin from './components/FullSpin' /* 全屏加载动画 */
66
import loadMore from './components/loadMore'
@@ -18,7 +18,7 @@ import FormItems from '@/components/form/formItem.js'
1818
export default [
1919
Avatar,
2020
btnSwitch,
21-
BadgeIcon,
21+
badge,
2222
loadMore,
2323
fullSpin,
2424
HeadTop,

resources/spa/src/components/DiySelect.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55
@click="onClick"
66
>
77
<div class="diy-select--label">{{ curSelectValue }}</div>
8-
<div v-show="open" class="diy-select--options">
8+
<div
9+
v-show="open"
10+
class="diy-select--options"
11+
>
912
<div
1013
v-for="option in options"
1114
:key="option.label"
1215
class="diy-select--option"
1316
@click="setCurVal(option)"
1417
>
1518
<template v-if="option.hasMsg">
16-
<BadgeIcon :dot="option.hasMsg">{{ option.label }}</BadgeIcon>
19+
<VBadge :dot="option.hasMsg">{{ option.label }}</VBadge>
1720
</template>
1821
<span v-else>{{ option.label }}</span>
1922
</div>

resources/spa/src/components/FootGuide.vue

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,25 @@
3131
<section
3232
:class="{active: isCurPath('/message')}"
3333
class="guide-item"
34-
@click="to({name: 'MessageHome'})"
34+
@click="to('/message/info')"
3535
>
36-
<BadgeIcon :dot="notification">
36+
<VBadge :dot="hasMsg">
3737
<svg class="m-style-svg m-svg-def">
3838
<use xlink:href="#icon-foot-message" />
3939
</svg>
40-
</BadgeIcon>
40+
</VBadge>
4141
<span>消息</span>
4242
</section>
4343
<section
4444
:class="{active: isCurPath('profile')}"
4545
class="guide-item"
4646
@click="to('/profile')"
4747
>
48-
<BadgeIcon :dot="profile">
48+
<VBadge :dot="profile">
4949
<svg class="m-style-svg m-svg-def">
5050
<use xlink:href="#icon-foot-profile" />
5151
</svg>
52-
</BadgeIcon>
52+
</VBadge>
5353
<span>我</span>
5454
</section>
5555
</footer>
@@ -62,23 +62,37 @@ export default {
6262
name: 'FootGuide',
6363
data () {
6464
return {
65-
// has_fans: false,
65+
has_fans: false,
6666
}
6767
},
6868
computed: {
69-
...mapState('message', {
70-
profile: state => state.user.following + state.user.mutual > 0,
71-
}),
72-
...mapGetters('message', {
73-
notification: 'unreadMessage',
69+
...mapState({
70+
has_msg: state =>
71+
state.MESSAGE.NEW_UNREAD_COUNT.commented +
72+
state.MESSAGE.NEW_UNREAD_COUNT['feed-comment-pinned'] +
73+
state.MESSAGE.NEW_UNREAD_COUNT['group-join-pinned'] +
74+
state.MESSAGE.NEW_UNREAD_COUNT.liked +
75+
state.MESSAGE.NEW_UNREAD_COUNT['news-comment-pinned'] +
76+
state.MESSAGE.NEW_UNREAD_COUNT['post-comment-pinned'] +
77+
state.MESSAGE.NEW_UNREAD_COUNT['post-pinned'] +
78+
state.MESSAGE.NEW_UNREAD_COUNT.system >
79+
0,
80+
profile: state =>
81+
state.MESSAGE.NEW_UNREAD_COUNT.following +
82+
state.MESSAGE.NEW_UNREAD_COUNT.mutual >
83+
0,
7484
}),
85+
...mapGetters(['hasUnreadChat']),
86+
hasMsg () {
87+
return this.has_msg || this.hasUnreadChat > 0
88+
},
7589
},
7690
mounted () {
7791
this.$el.parentNode.style.paddingBottom = '1rem'
7892
},
7993
methods: {
8094
to (path) {
81-
this.$router.push(path)
95+
this.$router.push({ path })
8296
},
8397
isCurPath (path) {
8498
return this.$route.fullPath.indexOf(path) > -1

resources/spa/src/components/ImagePoster.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ const defaultPoster = {
9696
}
9797
9898
export default {
99-
name: 'ImagePoster',
10099
props: {
101100
/**
102101
* @type {Poster}

resources/spa/src/components/common/BadgeIcon.vue renamed to resources/spa/src/components/common/badge.vue

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
:class="classes"
66
>
77
<slot />
8-
<sup :class="dotClasses" />
8+
<sup
9+
v-show="badge"
10+
:class="dotClasses"
11+
/>
912
</span>
10-
1113
<span
1214
v-else
1315
ref="badge"
@@ -28,10 +30,10 @@
2830
const prefixCls = 'v-badge'
2931
3032
export default {
31-
name: 'BadgeIcon',
33+
name: 'VBadge',
3234
props: {
3335
count: { type: [Number, String], default: 0 },
34-
dot: { type: [Boolean, Number], default: false },
36+
dot: { type: Boolean, default: false },
3537
overflowCount: { type: [Number, String], default: 99 },
3638
className: { type: String, default: '' },
3739
},
@@ -88,19 +90,21 @@ export default {
8890
8991
&-count {
9092
position: absolute;
91-
display: flex;
92-
justify-content: center;
93-
align-items: center;
93+
transform: translateX(50%);
94+
top: -10px;
9495
right: 0;
95-
height: 32px;
96-
width: 32px;
97-
border-radius: 32px;
96+
height: 20px;
97+
min-width: 20px;
98+
border-radius: 10px;
9899
background: @error;
99100
border: 1px solid transparent; /*no*/
100101
color: #fff;
101-
font-size: 20px;
102+
line-height: 20px;
103+
text-align: center;
104+
padding: 0 6px;
105+
font-size: 16px;
102106
white-space: nowrap;
103-
// transform-origin: -10% center;
107+
transform-origin: -10% center;
104108
z-index: 10;
105109
box-shadow: 0 0 0 1px @error; /*no*/
106110
@@ -111,16 +115,17 @@ export default {
111115
112116
&-alone {
113117
top: auto;
118+
display: block;
114119
position: relative;
115-
transform: scale(0.9);
120+
transform: translateX(0);
116121
}
117122
}
118123
119124
&-dot {
120125
position: absolute;
121126
transform: translateX(-50%);
122127
transform-origin: 0 center;
123-
top: 2px; /* no */
128+
top: -3px; /* no */
124129
right: -6px; /* no */
125130
height: 6px; /* no */
126131
width: 6px; /* no */

resources/spa/src/components/reference/ReferenceFeed.vue

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)