|
|
@@ -5,9 +5,12 @@
|
|
|
<span v-else>{{ index + 1 }}</span>
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
- <van-image round width="28" height="28" :src="info.avatar" />
|
|
|
+ <van-image round width="42" height="42" :src="info.avatar" />
|
|
|
<div class="name van-ellipsis">{{ info.nickname }}</div>
|
|
|
</div>
|
|
|
+ <van-button :class="{ follow: info.follow }" @click="follow" type="primary" round size="mini" plain>
|
|
|
+ {{ info.follow ? '已关注' : '关注' }}
|
|
|
+ </van-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -33,6 +36,29 @@ export default {
|
|
|
require('@assets/info_icon_no3-2.png')
|
|
|
]
|
|
|
};
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ follow() {
|
|
|
+ this.checkLogin().then(() => {
|
|
|
+ if (!this.info.follow) {
|
|
|
+ this.$http.get(`/user/${this.info.id}/follow`).then(res => {
|
|
|
+ this.$emit('update:info', {
|
|
|
+ ...this.info,
|
|
|
+ follow: true
|
|
|
+ });
|
|
|
+ this.$toast.success('关注成功');
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$http.get(`/user/${this.info.id}/unfollow`).then(() => {
|
|
|
+ this.$emit('update:info', {
|
|
|
+ ...this.info,
|
|
|
+ follow: false
|
|
|
+ });
|
|
|
+ this.$toast.success('取消关注');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
@@ -40,25 +66,25 @@ export default {
|
|
|
<style lang="less" scoped>
|
|
|
.rank {
|
|
|
.flex();
|
|
|
- padding: 8px 16px;
|
|
|
+ padding: 12px 12px;
|
|
|
overflow: hidden;
|
|
|
- background: var(--rankBg);
|
|
|
+ position: relative;
|
|
|
|
|
|
.rank-icon {
|
|
|
- width: 42px;
|
|
|
- height: 42px;
|
|
|
+ width: 38px;
|
|
|
+ height: 38px;
|
|
|
flex-shrink: 0;
|
|
|
.flex();
|
|
|
justify-content: center;
|
|
|
img {
|
|
|
- width: 42px;
|
|
|
- height: 42px;
|
|
|
+ width: 38px;
|
|
|
+ height: 38px;
|
|
|
}
|
|
|
span {
|
|
|
font-size: 20px;
|
|
|
font-family: AlibabaPuHuiTi-Bold, AlibabaPuHuiTi;
|
|
|
font-weight: bold;
|
|
|
- color: #939599;
|
|
|
+ color: var(--text0);
|
|
|
line-height: 20px;
|
|
|
}
|
|
|
}
|
|
|
@@ -67,7 +93,7 @@ export default {
|
|
|
.flex();
|
|
|
overflow: hidden;
|
|
|
flex-grow: 1;
|
|
|
- margin-left: 30px;
|
|
|
+ margin-left: 14px;
|
|
|
.van-image {
|
|
|
flex-shrink: 0;
|
|
|
}
|
|
|
@@ -77,45 +103,30 @@ export default {
|
|
|
line-height: 24px;
|
|
|
margin-left: 10px;
|
|
|
color: var(--text0);
|
|
|
+ font-weight: bold;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- &.rank0 {
|
|
|
- background: var(--rankBg0);
|
|
|
- // border: 1px solid #ffdca2;
|
|
|
- .content {
|
|
|
- .name {
|
|
|
- color: var(--rankText0);
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
- .van-image {
|
|
|
- border: 1px solid var(--rankBorder0);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ .van-button {
|
|
|
+ border: 1px solid var(--prim);
|
|
|
+ --van-button-primary-background-color: var(--prim);
|
|
|
+ --van-button-mini-font-size: 12px;
|
|
|
+ min-width: 60px;
|
|
|
|
|
|
- &.rank1 {
|
|
|
- background: var(--rankBg1);
|
|
|
- .content {
|
|
|
- .name {
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
- .van-image {
|
|
|
- border: 1px solid var(--rankBorder1);
|
|
|
- }
|
|
|
+ &.follow {
|
|
|
+ border-color: var(--btnBorderInfo);
|
|
|
+ --van-button-primary-background-color: var(--btnInfo);
|
|
|
}
|
|
|
}
|
|
|
- &.rank2 {
|
|
|
- background: var(--rankBg2);
|
|
|
- .content {
|
|
|
- .name {
|
|
|
- color: var(--rankText2);
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
- .van-image {
|
|
|
- border: 1px solid var(--rankBorder2);
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ content: '';
|
|
|
+ position: absolute;
|
|
|
+ left: 16px;
|
|
|
+ right: 16px;
|
|
|
+ bottom: 0;
|
|
|
+ height: 1px;
|
|
|
+ background-color: var(--border);
|
|
|
}
|
|
|
}
|
|
|
</style>
|