feat:修改bug
This commit is contained in:
1 parent
a9d66d4f4a
commit
afd84e06e7
12 files changed
+575
-665
No files matched your search
@@ -28,186 +28,189 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'chatItem',
|
||||
data() {
|
||||
return {};
|
||||
export default {
|
||||
name: 'chatItem',
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
props: {
|
||||
userId: {
|
||||
type: Number,
|
||||
},
|
||||
props: {
|
||||
chat: {
|
||||
type: Object,
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
},
|
||||
active: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
chat: {
|
||||
type: Object,
|
||||
},
|
||||
methods: {
|
||||
showChatBox() {
|
||||
// 初始化期间进入会话会导致消息不刷新
|
||||
if (!this.configStore.appInit || this.chatStore.loading) {
|
||||
uni.showToast({
|
||||
title: '正在初始化页面,请稍后...',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/message/chat-box?chatIdx=' + this.index,
|
||||
index: {
|
||||
type: Number,
|
||||
},
|
||||
active: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
showChatBox() {
|
||||
// 初始化期间进入会话会导致消息不刷新
|
||||
if (!this.configStore.appInit || this.chatStore.loading) {
|
||||
uni.showToast({
|
||||
title: '正在初始化页面,请稍后...',
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
return;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/message/chat-box?chatIdx=${this.index}&memberId=${this.userId}`,
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
isShowSendName() {
|
||||
if (!this.chat.sendNickName) {
|
||||
return false;
|
||||
}
|
||||
let size = this.chat.messages.length;
|
||||
if (size == 0) {
|
||||
return false;
|
||||
}
|
||||
// 只有群聊的普通消息需要显示名称
|
||||
let lastMsg = this.chat.messages[size - 1];
|
||||
return this.$msgType.isNormal(lastMsg.type);
|
||||
},
|
||||
atText() {
|
||||
if (this.chat.atMe) {
|
||||
return '[有人@我]';
|
||||
} else if (this.chat.atAll) {
|
||||
return '[@全体成员]';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
isTextMessage() {
|
||||
if (this.chat.messages.length == 0) {
|
||||
return false;
|
||||
}
|
||||
let idx = this.chat.messages.length - 1;
|
||||
let messageType = this.chat.messages[idx].type;
|
||||
return messageType == this.$enums.MESSAGE_TYPE.TEXT;
|
||||
},
|
||||
isGiftMessage() {
|
||||
if (this.chat.messages.length == 0) {
|
||||
return false;
|
||||
}
|
||||
let idx = this.chat.messages.length - 1;
|
||||
let messageType = this.chat.messages[idx].type;
|
||||
return messageType == this.$enums.MESSAGE_TYPE.GIFT;
|
||||
},
|
||||
nodesText() {
|
||||
let text = this.$str.html2Escape(this.chat.lastContent);
|
||||
return this.$emo.transform(text, 'emoji-small');
|
||||
},
|
||||
online() {
|
||||
if (this.chat.type == 'PRIVATE') {
|
||||
let friend = this.friendStore.findFriend(this.chat.targetId);
|
||||
return friend && friend.online;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isShowSendName() {
|
||||
if (!this.chat.sendNickName) {
|
||||
return false;
|
||||
},
|
||||
}
|
||||
let size = this.chat.messages.length;
|
||||
if (size == 0) {
|
||||
return false;
|
||||
}
|
||||
// 只有群聊的普通消息需要显示名称
|
||||
let lastMsg = this.chat.messages[size - 1];
|
||||
return this.$msgType.isNormal(lastMsg.type);
|
||||
},
|
||||
};
|
||||
atText() {
|
||||
if (this.chat.atMe) {
|
||||
return '[有人@我]';
|
||||
} else if (this.chat.atAll) {
|
||||
return '[@全体成员]';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
isTextMessage() {
|
||||
if (this.chat.messages.length == 0) {
|
||||
return false;
|
||||
}
|
||||
let idx = this.chat.messages.length - 1;
|
||||
let messageType = this.chat.messages[idx].type;
|
||||
return messageType == this.$enums.MESSAGE_TYPE.TEXT;
|
||||
},
|
||||
isGiftMessage() {
|
||||
if (this.chat.messages.length == 0) {
|
||||
return false;
|
||||
}
|
||||
let idx = this.chat.messages.length - 1;
|
||||
let messageType = this.chat.messages[idx].type;
|
||||
return messageType == this.$enums.MESSAGE_TYPE.GIFT;
|
||||
},
|
||||
nodesText() {
|
||||
let text = this.$str.html2Escape(this.chat.lastContent);
|
||||
return this.$emo.transform(text, 'emoji-small');
|
||||
},
|
||||
online() {
|
||||
if (this.chat.type == 'PRIVATE') {
|
||||
let friend = this.friendStore.findFriend(this.chat.targetId);
|
||||
return friend && friend.online;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.chat-item {
|
||||
height: 96rpx;
|
||||
display: flex;
|
||||
margin-bottom: 2rpx;
|
||||
.chat-item {
|
||||
height: 96rpx;
|
||||
display: flex;
|
||||
margin-bottom: 2rpx;
|
||||
position: relative;
|
||||
padding: 18rpx 20rpx;
|
||||
align-items: center;
|
||||
background-color: $im-bg;
|
||||
white-space: nowrap;
|
||||
border-top: 1px solid $im-border;
|
||||
|
||||
&:hover {
|
||||
background-color: $im-bg-active;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: $im-bg-active;
|
||||
}
|
||||
|
||||
.mask {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.left {
|
||||
position: relative;
|
||||
padding: 18rpx 20rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: $im-bg;
|
||||
white-space: nowrap;
|
||||
border-top: 1px solid $im-border;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: $im-bg-active;
|
||||
}
|
||||
.chat-right {
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding-left: 20rpx;
|
||||
text-align: left;
|
||||
overflow: hidden;
|
||||
|
||||
&.active {
|
||||
background-color: $im-bg-active;
|
||||
}
|
||||
|
||||
.mask {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.left {
|
||||
position: relative;
|
||||
.chat-name {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
.chat-right {
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding-left: 20rpx;
|
||||
text-align: left;
|
||||
overflow: hidden;
|
||||
|
||||
.chat-name {
|
||||
.chat-name-text {
|
||||
flex: 1;
|
||||
font-size: $im-font-size-large;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
|
||||
.chat-name-text {
|
||||
flex: 1;
|
||||
font-size: $im-font-size-large;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chat-time {
|
||||
font-size: $im-font-size-smaller-extra;
|
||||
color: $im-text-color-lighter;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chat-content {
|
||||
display: flex;
|
||||
font-size: $im-font-size-smaller;
|
||||
.chat-time {
|
||||
font-size: $im-font-size-smaller-extra;
|
||||
color: $im-text-color-lighter;
|
||||
padding: 8rpx 30rpx 0 0;
|
||||
align-items: center;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.chat-at-text {
|
||||
color: $im-color-danger;
|
||||
}
|
||||
.chat-content {
|
||||
display: flex;
|
||||
font-size: $im-font-size-smaller;
|
||||
color: $im-text-color-lighter;
|
||||
padding: 8rpx 30rpx 0 0;
|
||||
align-items: center;
|
||||
|
||||
.chat-send-name {
|
||||
font-size: $im-font-size-smaller;
|
||||
}
|
||||
.chat-at-text {
|
||||
color: $im-color-danger;
|
||||
}
|
||||
|
||||
.chat-content-text {
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.chat-send-name {
|
||||
font-size: $im-font-size-smaller;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: $im-font-size;
|
||||
}
|
||||
.chat-content-text {
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: $im-font-size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,25 +1,11 @@
|
||||
<template>
|
||||
<view class="long-press-menu none-pointer-events">
|
||||
<view
|
||||
@longpress.prevent.stop="onLongPress($event)"
|
||||
@touchmove="onTouchMove"
|
||||
@touchend="onTouchEnd"
|
||||
>
|
||||
<view @longpress.prevent.stop="onLongPress($event)" @touchmove="onTouchMove" @touchend="onTouchEnd">
|
||||
<slot></slot>
|
||||
</view>
|
||||
<view
|
||||
v-if="isShowMenu"
|
||||
class="menu-mask"
|
||||
@touchstart="onClose()"
|
||||
@contextmenu.prevent=""
|
||||
></view>
|
||||
<view v-if="isShowMenu" class="menu-mask" @touchstart="onClose()" @contextmenu.prevent=""></view>
|
||||
<view v-if="isShowMenu" class="menu" :style="menuStyle">
|
||||
<view
|
||||
class="menu-item"
|
||||
v-for="item in items"
|
||||
:key="item.key"
|
||||
@click.prevent="onSelectMenu(item)"
|
||||
>
|
||||
<view class="menu-item" v-for="item in items" :key="item.key" @click.prevent="onSelectMenu(item)">
|
||||
<text :style="itemStyle(item)"> {{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -27,119 +13,119 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'long-press-menu',
|
||||
data() {
|
||||
return {
|
||||
isShowMenu: false,
|
||||
isTouchMove: false,
|
||||
style: '',
|
||||
};
|
||||
export default {
|
||||
name: 'long-press-menu',
|
||||
data() {
|
||||
return {
|
||||
isShowMenu: false,
|
||||
isTouchMove: false,
|
||||
style: '',
|
||||
};
|
||||
},
|
||||
props: {
|
||||
items: {
|
||||
type: Array,
|
||||
},
|
||||
props: {
|
||||
items: {
|
||||
type: Array,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onLongPress(e) {
|
||||
if (this.isTouchMove) {
|
||||
// 屏幕移动时不弹出
|
||||
return;
|
||||
}
|
||||
uni.getSystemInfo({
|
||||
success: (res) => {
|
||||
let touches = e.touches[0];
|
||||
let style = '';
|
||||
/* 因 非H5端不兼容 style 属性绑定 Object ,所以拼接字符 */
|
||||
if (touches.clientY > res.windowHeight / 2) {
|
||||
style = `bottom:${res.windowHeight - touches.clientY + 20}px;`;
|
||||
} else {
|
||||
style = `top:${touches.clientY + 20}px;`;
|
||||
}
|
||||
if (touches.clientX > res.windowWidth / 2) {
|
||||
style += `right:${res.windowWidth - touches.clientX}px;`;
|
||||
} else {
|
||||
style += `left:${touches.clientX}px;`;
|
||||
}
|
||||
this.menuStyle = style;
|
||||
//
|
||||
this.$nextTick(() => {
|
||||
this.isShowMenu = true;
|
||||
});
|
||||
this.menuTouch = touches;
|
||||
},
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
onLongPress(e) {
|
||||
if (this.isTouchMove) {
|
||||
// 屏幕移动时不弹出
|
||||
return;
|
||||
}
|
||||
uni.getSystemInfo({
|
||||
success: (res) => {
|
||||
let touches = e.touches[0];
|
||||
let style = '';
|
||||
/* 因 非H5端不兼容 style 属性绑定 Object ,所以拼接字符 */
|
||||
if (touches.clientY > res.windowHeight / 2) {
|
||||
style = `bottom:${res.windowHeight - touches.clientY + 20}px;`;
|
||||
} else {
|
||||
style = `top:${touches.clientY + 20}px;`;
|
||||
}
|
||||
if (touches.clientX > res.windowWidth / 2) {
|
||||
style += `right:${res.windowWidth - touches.clientX}px;`;
|
||||
} else {
|
||||
style += `left:${touches.clientX}px;`;
|
||||
}
|
||||
this.menuStyle = style;
|
||||
//
|
||||
this.$nextTick(() => {
|
||||
this.isShowMenu = true;
|
||||
});
|
||||
this.menuTouch = touches;
|
||||
},
|
||||
});
|
||||
},
|
||||
onTouchMove(e) {
|
||||
this.isTouchMove = true;
|
||||
let touches = e.touches[0];
|
||||
// 屏幕拖动大于50px时,取消菜单
|
||||
if (
|
||||
Math.abs(touches.clientX || 0 - this.menuTouch.clientX || 0) > 50 ||
|
||||
Math.abs(touches.clientY || 0 - this.menuTouch.clientY || 0) > 50
|
||||
) {
|
||||
this.onClose();
|
||||
}
|
||||
},
|
||||
onTouchEnd() {
|
||||
this.isTouchMove = false;
|
||||
},
|
||||
onSelectMenu(item) {
|
||||
this.$emit('select', item);
|
||||
this.isShowMenu = false;
|
||||
},
|
||||
onClose() {
|
||||
this.isShowMenu = false;
|
||||
},
|
||||
itemStyle(item) {
|
||||
if (item.color) {
|
||||
return `color:${item.color};`;
|
||||
}
|
||||
return `color:#fff;`;
|
||||
},
|
||||
onTouchMove(e) {
|
||||
this.isTouchMove = true;
|
||||
let touches = e.touches[0];
|
||||
// 屏幕拖动大于50px时,取消菜单
|
||||
if (
|
||||
Math.abs(touches.clientX || 0 - this.menuTouch.clientX || 0) > 50 ||
|
||||
Math.abs(touches.clientY || 0 - this.menuTouch.clientY || 0) > 50
|
||||
) {
|
||||
this.onClose();
|
||||
}
|
||||
},
|
||||
};
|
||||
onTouchEnd() {
|
||||
this.isTouchMove = false;
|
||||
},
|
||||
onSelectMenu(item) {
|
||||
this.$emit('select', item);
|
||||
this.isShowMenu = false;
|
||||
},
|
||||
onClose() {
|
||||
this.isShowMenu = false;
|
||||
},
|
||||
itemStyle(item) {
|
||||
if (item.color) {
|
||||
return `color:${item.color};`;
|
||||
}
|
||||
return `color:#fff;`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.long-press-menu {
|
||||
.menu-mask {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 999;
|
||||
}
|
||||
.long-press-menu {
|
||||
.menu-mask {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.menu {
|
||||
position: fixed;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
background-color: $im-bg-active-lighter;
|
||||
z-index: 1000;
|
||||
box-shadow: $im-box-shadow-dark;
|
||||
.menu {
|
||||
position: fixed;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
background-color: $im-bg-active-lighter;
|
||||
z-index: 1000;
|
||||
box-shadow: $im-box-shadow-dark;
|
||||
|
||||
.menu-item {
|
||||
height: 28px;
|
||||
min-width: 120rpx;
|
||||
line-height: 28px;
|
||||
font-size: $im-font-size-small;
|
||||
display: flex;
|
||||
padding: 6px 20px;
|
||||
justify-content: flex-start;
|
||||
.menu-item {
|
||||
height: 28px;
|
||||
min-width: 120rpx;
|
||||
line-height: 28px;
|
||||
font-size: $im-font-size-small;
|
||||
display: flex;
|
||||
padding: 6px 20px;
|
||||
justify-content: flex-start;
|
||||
|
||||
&:hover {
|
||||
background: $im-bg-active-light;
|
||||
}
|
||||
&:hover {
|
||||
background: $im-bg-active-light;
|
||||
}
|
||||
|
||||
.menu-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.menu-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -50,7 +50,7 @@
|
||||
<image class="size-44rpx" src="@/static/weixin-black.png" mode="aspectFill" />
|
||||
</view>
|
||||
<text class="text-color-theme text-xs">{{ user.member.wechatNum || '*************'
|
||||
}}</text>
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="flex-col justify-center items-center m-t-15rpx text-color-theme text-xs">
|
||||
<view>解锁微信只能展示24小时</view>
|
||||
@@ -101,6 +101,8 @@ const userWechatInfo = reactive({
|
||||
wechatQrCode: '',
|
||||
});
|
||||
|
||||
const emit = defineEmits(['updateUser'])
|
||||
|
||||
onMounted(() => {
|
||||
lookWechatCount()
|
||||
})
|
||||
@@ -137,7 +139,8 @@ const doSubmitUnlockWechat = async () => {
|
||||
if (code === 0) {
|
||||
uni.showToast({ title: '解锁成功', icon: 'none' });
|
||||
Object.assign(userWechatInfo, data);
|
||||
// getDetail()
|
||||
lookWechatCount()
|
||||
emit('updateUser')
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("|执行解锁微信|,意外的错误:error", error);
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
<template>
|
||||
<wd-action-sheet v-model="actionShow" :actions="actions" @select="actionSelect" cancel-text="取消" :z-index="5000" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
|
||||
import RecentApi from '@/sheep/api/member/recent';
|
||||
|
||||
const props = defineProps({
|
||||
user: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
hides: {
|
||||
/**
|
||||
* user - 查看资料
|
||||
* report - 举报
|
||||
* shield - 拉黑
|
||||
*/
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
})
|
||||
|
||||
const actions = computed(() => {
|
||||
const { hides } = props;
|
||||
let actions = [{ name: '查看资料', key: "user" }, { name: '拉黑', key: "shield" }, { name: '举报', key: "report" }];
|
||||
if (hides.includes('user')) {
|
||||
actions = actions.filter(item => item.key !== 'user');
|
||||
}
|
||||
if (hides.includes('report')) {
|
||||
actions = actions.filter(item => item.key !== 'report');
|
||||
}
|
||||
if (hides.includes('shield')) {
|
||||
actions = actions.filter(item => item.key !== 'shield');
|
||||
}
|
||||
return actions;
|
||||
})
|
||||
|
||||
const actionShow = ref(false);
|
||||
|
||||
const openActionSheet = () => {
|
||||
actionShow.value = true;
|
||||
}
|
||||
|
||||
const closeActionSheet = () => {
|
||||
actionShow.value = false;
|
||||
}
|
||||
|
||||
// 拉黑 举报
|
||||
async function actionSelect({ item, index }) {
|
||||
console.log(item, "item");
|
||||
|
||||
const key = item.key
|
||||
switch (key) {
|
||||
case "user":
|
||||
uni.navigateTo({ url: '/pages/home/detail?memberId=' + props.user.member.memberId });
|
||||
break;
|
||||
case "shield":
|
||||
const { code } = await RecentApi.recentOperate({
|
||||
memberId: props.user.member.memberId,
|
||||
action: 'MEMBER_SHIELD',
|
||||
});
|
||||
if (code === 0) {
|
||||
uni.showToast({ title: '拉黑成功', icon: 'none' });
|
||||
}
|
||||
break;
|
||||
case "report":
|
||||
uni.navigateTo({ url: '/pages/home/report?memberId=' + props.user.member.memberId });
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open: openActionSheet,
|
||||
close: closeActionSheet
|
||||
})
|
||||
</script>
|
||||
+14
-178
@@ -16,7 +16,7 @@
|
||||
{{ userDetail.member.memberCity ? userDetail.member.memberCity + ' · ' : '' }}
|
||||
{{ userDetail.distance ? userDetail.distance.toFixed(2) + 'km' : '' }}
|
||||
</view>
|
||||
<uni-icons type="more-filled" size="28" color="#D29E52" @click="actionShow = true" />
|
||||
<uni-icons type="more-filled" size="28" color="#D29E52" @click="userMoreRef.open" />
|
||||
</view>
|
||||
</template>
|
||||
</wd-navbar>
|
||||
@@ -29,10 +29,12 @@
|
||||
<image class="text-center size-150rpx rounded-full bg-#333 mb-20rpx" :src="userDetail.member.memberAvatar"
|
||||
mode="aspectFill" />
|
||||
<view class="text-base mb-20rpx">{{ userDetail.member?.memberNickname }}</view>
|
||||
<view v-for="(item, index) in userDetail.memberTagList" :key="index"
|
||||
class="mb-20rpx inline-flex px-2 py-1 text-xs c-black rounded-1 bg-color-theme-dark">
|
||||
<wd-icon name="discount-filled" size="16px" color="#000"></wd-icon>
|
||||
<text>{{ item.tagTitle }}</text>
|
||||
<view v-for="(item, index) in userDetail.memberTagList" :key="index">
|
||||
<view v-if="['1'].includes(item.tagBizType)"
|
||||
class="mb-20rpx inline-flex px-2 py-1 text-xs c-black rounded-1 bg-color-theme-dark">
|
||||
<wd-icon name="discount-filled" size="16px" color="#000"></wd-icon>
|
||||
<text>{{ item.tagTitle }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="flex flex-wrap justify-center mb-20rpx">
|
||||
@@ -62,29 +64,7 @@
|
||||
</view>
|
||||
<view class="m-4">
|
||||
<view class="my-2 text-size-base">查看微信</view>
|
||||
<view class="bg-color-theme rounded-1 flex justify-between items-center p-2">
|
||||
<view class="flex-col">
|
||||
<view class="flex items-center">
|
||||
<image class="size-44rpx mr-2" src="@/static/weixin-black.png" mode="aspectFill" />
|
||||
<text class="text-black">{{ userDetail.member.wechatNum || '*************' }}</text>
|
||||
</view>
|
||||
<view v-if="!userDetail?.userOperationStatus?.isLookWechat" class="text-xs c-black tracking-0.2">
|
||||
<text>成为</text>
|
||||
<text class="text-base font-bold font-italic"> VIP </text>
|
||||
<text>免费解锁</text>
|
||||
</view>
|
||||
<view v-else>
|
||||
<text class="text-black text-xs">已解锁对方微信</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!userDetail?.userOperationStatus?.isLookWechat" class="rounded-1 px-4 py-1 bg-#333 active:bg-#222"
|
||||
@click="doWeChatBtn">
|
||||
解锁
|
||||
</view>
|
||||
<view v-else class="rounded-1 px-4 py-1 bg-#333 active:bg-#222" @click="doWeChatBtn">
|
||||
查看
|
||||
</view>
|
||||
</view>
|
||||
<UserLookWechat :user="userDetail" @update-user="getDetail" />
|
||||
</view>
|
||||
<view class="m-4">
|
||||
<view class="my-2 text-size-base">相册</view>
|
||||
@@ -139,53 +119,7 @@
|
||||
<text>喜欢</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<wd-action-sheet v-model="actionShow" :actions="[{ name: '拉黑' }, { name: '举报' }]" @select="actionSelect"
|
||||
cancel-text="取消" :z-index="100" />
|
||||
<wd-message-box selector="operateMessage" />
|
||||
|
||||
<wd-popup custom-class="custom-wechat-popup" :z-index="999" v-model="visibleWechat">
|
||||
<view class="min-w-70vw w-full overflow-hidden p-y-50rpx">
|
||||
<view v-if="!userDetail?.userOperationStatus?.isLookWechat" class="flex-col justify-center items-center">
|
||||
<image class="size-150rpx bg-#333 rounded-full mr-1" :src="userDetail.member?.memberAvatar"
|
||||
mode="aspectFill" />
|
||||
<view class="inline-flex items-center justify-center bg-color-theme-dark m-t-30rpx p-x-10 p-y-1 rounded-full">
|
||||
<image class="size-44rpx mr-2" src="@/static/weixin-black.png" mode="aspectFill" />
|
||||
<text class="text-black text-xs">{{ userDetail.member.wechatNum || '*************' }}</text>
|
||||
</view>
|
||||
<view class="flex justify-center items-center m-t-30rpx text-color-theme">
|
||||
<text class="iconfont icon-weixin" />
|
||||
</view>
|
||||
<text class="text-color-theme text-xs m-t-30rpx">今日vip特权已使用{{ lookWechatDetail.todayCount }}/{{
|
||||
lookWechatDetail.todayCountTotal }}次</text>
|
||||
<view class="m-t-30rpx p-x-10 p-y-1.5 bg-color-theme-dark text-xs rounded-full" @tap="doSubmitUnlockWechat">
|
||||
<text class="text-black text-xs">使用VIP特权免费解锁</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-col justify-center items-center" v-else>
|
||||
<view class="inline-flex items-center justify-center">
|
||||
<view class="size-50rpx bg-color-theme-dark flex justify-center items-center mr-1 rounded-full">
|
||||
<image class="size-44rpx" src="@/static/weixin-black.png" mode="aspectFill" />
|
||||
</view>
|
||||
<text class="text-color-theme text-xs">{{ userDetail.member.wechatNum || '*************' }}</text>
|
||||
</view>
|
||||
<view class="flex-col justify-center items-center m-t-15rpx text-color-theme text-xs">
|
||||
<view>解锁微信只能展示24小时</view>
|
||||
<view>添加备注"荷塘月色App"会快速通过哟</view>
|
||||
</view>
|
||||
<text class="text-color-theme text-xs m-t-30rpx">今日vip特权已使用{{ lookWechatDetail.todayCount }}/{{
|
||||
lookWechatDetail.todayCountTotal }}次</text>
|
||||
<view class="m-t-30rpx p-x-10 p-y-1.5 bg-color-theme-dark text-xs rounded-full" @tap="copyWechatNum">
|
||||
复制微信号
|
||||
</view>
|
||||
<view class="m-t-30rpx text-xs" @tap="wechatJb">
|
||||
<text>搜索不到微信?点击【</text>
|
||||
<text class="underline underline-1 underline-solid">立即举报</text>
|
||||
<text>】退还次数</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</wd-popup>
|
||||
<UserMore ref="userMoreRef" :user="userDetail" :hides="['user']" />
|
||||
</wd-config-provider>
|
||||
</template>
|
||||
|
||||
@@ -195,6 +129,8 @@ import { ref, computed, getCurrentInstance, reactive, onMounted } from 'vue';
|
||||
import MomentCard from '@/sheep/components/moment-card/moment-card.vue';
|
||||
import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
|
||||
import useScroll from '@/sheep/hooks/use-scroll';
|
||||
import UserLookWechat from "@/pages/components/user-look-wechat.vue"
|
||||
import UserMore from "@/pages/components/user-more.vue"
|
||||
import RecentApi from '@/sheep/api/member/recent';
|
||||
import { onHide, onUnload, onLoad } from '@dcloudio/uni-app';
|
||||
import { getGender } from '@/sheep/util/index';
|
||||
@@ -206,17 +142,16 @@ import request from '@/common/request';
|
||||
import { formatDate } from '@/sheep/helper/utils';
|
||||
import { useMessage } from '@/uni_modules/wot-design-uni';
|
||||
|
||||
const operateMessage = useMessage('operateMessage');
|
||||
|
||||
const userCity = computed(() => sheep.$store('user').userCity);
|
||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||
|
||||
const userMoreRef = ref(null)
|
||||
|
||||
const scrollTop = ref(0);
|
||||
// 用户详情
|
||||
const userDetail = ref<any>({});
|
||||
// 解锁微信次数
|
||||
const lookWechatDetail = ref<any>({});
|
||||
const actionShow = ref(false);
|
||||
const visibleWechat = ref(false)
|
||||
// 朋友圈列表参数
|
||||
const params = reactive({
|
||||
@@ -239,11 +174,7 @@ const viewRecord = reactive({
|
||||
viewStartTime: new Date().getTime(),
|
||||
viewEndTime: '',
|
||||
});
|
||||
// 用户微信信息
|
||||
const userWechatInfo = reactive({
|
||||
wechatNum: '',
|
||||
wechatQrCode: '',
|
||||
});
|
||||
|
||||
|
||||
const photoListUrls = computed(
|
||||
() =>
|
||||
@@ -258,24 +189,14 @@ onLoad(async (options: any) => {
|
||||
params.memberId = memberId;
|
||||
viewRecord.bizId = memberId;
|
||||
await getDetail();
|
||||
await lookWechatCount()
|
||||
});
|
||||
|
||||
// 获取用户详情
|
||||
const getDetail = async () => {
|
||||
const { data = null } = await RecentApi.getRecentDetail({ id: params.memberId });
|
||||
userDetail.value = data ?? {};
|
||||
if (data.member && data.member.wechatNum) {
|
||||
userWechatInfo.wechatNum = data.member.wechatNum;
|
||||
}
|
||||
};
|
||||
|
||||
// 查询解锁微信次数
|
||||
const lookWechatCount = async () => {
|
||||
const { data = null } = await RecentApi.lookWechatCount();
|
||||
lookWechatDetail.value = data ?? {};
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
refreshList();
|
||||
});
|
||||
@@ -314,58 +235,6 @@ function onScroll(e: any) {
|
||||
scrollTop.value = e.detail.scrollTop;
|
||||
}
|
||||
|
||||
// 解锁微信
|
||||
const doWeChatBtn = async () => {
|
||||
if (!params.memberId) return uni.showToast({ title: '用户id不存在', icon: 'none' });
|
||||
const vip = userInfo.value?.memberVip.vip;
|
||||
// 如果不是vip
|
||||
if (!vip) {
|
||||
operateMessage
|
||||
.confirm({
|
||||
title: '获取VIP特权',
|
||||
msg: '请先开通VIP会员',
|
||||
confirmButtonText: '获取会员',
|
||||
zIndex: 9999,
|
||||
})
|
||||
.then(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/profile/apply-vip',
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
return;
|
||||
}
|
||||
visibleWechat.value = true
|
||||
};
|
||||
|
||||
// 执行解锁微信
|
||||
const doSubmitUnlockWechat = async () => {
|
||||
try {
|
||||
const { code, data } = await RecentApi.unlockWeChat({ memberId: params.memberId });
|
||||
if (code === 0) {
|
||||
uni.showToast({ title: '解锁成功', icon: 'none' });
|
||||
Object.assign(userWechatInfo, data);
|
||||
getDetail()
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("|执行解锁微信|,意外的错误:error", error);
|
||||
}
|
||||
}
|
||||
|
||||
// 复制微信号
|
||||
const copyWechatNum = () => {
|
||||
console.log("userWechatInfo:", userWechatInfo);
|
||||
|
||||
uni.setClipboardData({
|
||||
data: userWechatInfo.wechatNum,
|
||||
showToast: false,
|
||||
success: () => {
|
||||
uni.showToast({ title: '微信号已复制', icon: 'success' });
|
||||
visibleWechat.value = false
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// 相册预览
|
||||
const previewPhoto = (current: number) => {
|
||||
uni.previewImage({
|
||||
@@ -375,22 +244,6 @@ const previewPhoto = (current: number) => {
|
||||
});
|
||||
};
|
||||
|
||||
// 找不到微信举报
|
||||
const wechatJb = async () => {
|
||||
try {
|
||||
const { code, data, msg } = await RecentApi.createWecahtErrorAuth({
|
||||
memberId: params.memberId
|
||||
})
|
||||
if (code != 0) {
|
||||
uni.showToast({ title: msg ?? '举报失败', icon: "none" });
|
||||
return
|
||||
}
|
||||
uni.showToast({ title: '举报成功', icon: "success" });
|
||||
} catch (error) {
|
||||
console.log("|找不到微信举报|,意外的错误:error", error);
|
||||
}
|
||||
}
|
||||
|
||||
// 私聊
|
||||
const goChat = async () => {
|
||||
if (!userDetail.value.memberId) return uni.showToast({ title: '用户不存在' });
|
||||
@@ -440,23 +293,6 @@ const goChat = async () => {
|
||||
});
|
||||
};
|
||||
|
||||
// 拉黑 举报
|
||||
async function actionSelect({ item, index }) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
const { code } = await RecentApi.recentOperate({
|
||||
memberId: userDetail.value.member.memberId,
|
||||
action: 'MEMBER_SHIELD',
|
||||
});
|
||||
if (code === 0) {
|
||||
uni.showToast({ title: '拉黑成功', icon: 'none' });
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
uni.navigateTo({ url: '/pages/home/report?memberId=' + userDetail.value.member.memberId });
|
||||
}
|
||||
}
|
||||
|
||||
// 喜欢
|
||||
const handleLike = async () => {
|
||||
const { code } = await RecentApi.recentOperate({
|
||||
|
||||
@@ -1,25 +1,35 @@
|
||||
<template>
|
||||
<view class="chat-box" id="chatBox">
|
||||
<wd-config-provider theme="dark">
|
||||
<wd-navbar :title="title" fixed safeAreaInsetTop :bordered="false">
|
||||
<wd-navbar fixed safeAreaInsetTop :bordered="false">
|
||||
<template #left>
|
||||
<navigator open-type="navigateBack" hover-class="navigator-hover">
|
||||
<uni-icons type="back" size="30" color="#D29E52"></uni-icons>
|
||||
</navigator>
|
||||
<view class="flex items-center" :style="navUserInfoStyle">
|
||||
<image class="size-70rpx bg-#333 rounded-full mr-1" :src="avatar" mode="aspectFill" />
|
||||
<text class="truncate text-sm">{{ title }}</text>
|
||||
</view>
|
||||
</template>
|
||||
<template #right>
|
||||
<uni-icons type="more-filled" color="#D29E52" size="24" @click="onShowMore" />
|
||||
<view v-if="!isSystemUser">
|
||||
<!-- <uni-icons type="more-filled" color="#D29E52" size="24" @click="onShowMore" /> -->
|
||||
<uni-icons type="more-filled" size="28" color="#D29E52" @click="doUserMoreAction" />
|
||||
</view>
|
||||
</template>
|
||||
</wd-navbar>
|
||||
</wd-config-provider>
|
||||
|
||||
|
||||
<view class="chat-main-box" :style="{ height: chatMainHeight + 'px' }">
|
||||
<wd-config-provider theme="dark">
|
||||
<userMore :user="recentUserInfo" ref="userMoreRef" />
|
||||
</wd-config-provider>
|
||||
<WarningCar />
|
||||
<view class="chat-message" @click="switchChatTabBox('none')">
|
||||
<scroll-view class="scroll-box" scroll-y="true" upper-threshold="200" @scrolltoupper="onScrollToTop"
|
||||
@scroll="onScroll" :scroll-into-view="'chat-item-' + scrollMsgIdx" :scroll-top="scrollTop">
|
||||
<UserInfoCar :user="recentUserInfo" />
|
||||
<UserInfoCar v-if="!isSystemUser" :user="recentUserInfo" @update-user="getDetail" />
|
||||
<view v-if="chat" class="chat-wrap">
|
||||
<view v-for="(msgInfo, idx) in chat.messages" :key="idx">
|
||||
<chat-message-item :ref="'message' + msgInfo.id" v-if="idx >= showMinIdx" :headImage="headImage(msgInfo)"
|
||||
@@ -174,11 +184,13 @@ import sheep from '@/sheep';
|
||||
|
||||
import WarningCar from "./components/warning-car.vue"
|
||||
import UserInfoCar from "./components/user-info-car.vue"
|
||||
import userMore from '../components/user-more.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
WarningCar,
|
||||
UserInfoCar
|
||||
UserInfoCar,
|
||||
userMore,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -211,6 +223,7 @@ export default {
|
||||
scrollViewHeight: 0, // 滚动条总长度
|
||||
maxTmpId: 0, // 最后生成的临时id
|
||||
|
||||
userMoreRef: null, // 右上角操作
|
||||
userId: null,
|
||||
recentUserInfo: null,
|
||||
giftShow: false, // 礼物弹窗显示
|
||||
@@ -218,6 +231,9 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
doUserMoreAction() {
|
||||
this.$refs.userMoreRef.open();
|
||||
},
|
||||
onRecorderInput() {
|
||||
this.showRecord = true;
|
||||
this.switchChatTabBox('none');
|
||||
@@ -1101,8 +1117,10 @@ export default {
|
||||
},
|
||||
// 获取用户详情
|
||||
async getDetail() {
|
||||
const { data = null } = await RecentApi.getRecentDetail({ id: this.userId });
|
||||
this.recentUserInfo = data ?? {};
|
||||
if (!this.isSystemUser) {
|
||||
const { data = null } = await RecentApi.getRecentDetail({ id: this.userId });
|
||||
this.recentUserInfo = data ?? {};
|
||||
}
|
||||
},
|
||||
// 赠送礼物
|
||||
giveGift(item) {
|
||||
@@ -1160,6 +1178,20 @@ export default {
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
// 是否为`消息通知`用户
|
||||
isMessageUser() {
|
||||
if (!this.userId) return false
|
||||
return this.userId == -100
|
||||
},
|
||||
// 是否为`客服`用户
|
||||
isServiceUser() {
|
||||
if (!this.userId) return false
|
||||
return this.userId == -200
|
||||
},
|
||||
// 是否为`系统`用户
|
||||
isSystemUser() {
|
||||
return this.isMessageUser || this.isServiceUser
|
||||
},
|
||||
mine() {
|
||||
return this.userStore.userInfo;
|
||||
},
|
||||
@@ -1167,9 +1199,7 @@ export default {
|
||||
return this.friendStore.findFriend(this.userInfo.id);
|
||||
},
|
||||
title() {
|
||||
if (!this.chat) {
|
||||
return '';
|
||||
}
|
||||
if (!this.chat) return '';
|
||||
let title = this.chat.showName;
|
||||
if (this.isGroup) {
|
||||
let size = this.groupMembers.filter((m) => !m.quit).length;
|
||||
@@ -1177,6 +1207,10 @@ export default {
|
||||
}
|
||||
return title;
|
||||
},
|
||||
avatar() {
|
||||
if (!this.chat) return '';
|
||||
return this.chat.headImage;
|
||||
},
|
||||
messageAction() {
|
||||
return `/message/${this.chat.type.toLowerCase()}/send`;
|
||||
},
|
||||
|
||||
@@ -19,10 +19,14 @@
|
||||
</view>
|
||||
<view class="flex items-center">
|
||||
<text class="iconfont icon-anquan color-#D29E52 w-40rpx"></text>
|
||||
<view class="flex justify-center items-center bg-blue color-black rounded-full p-x-1 m-l-5rpx">
|
||||
<view v-if="truePersonAuth"
|
||||
class="flex justify-center items-center bg-blue color-black rounded-full p-x-1 m-l-5rpx">
|
||||
<text class="iconfont icon-a-ziyuan592 font-size-20rpx"></text>
|
||||
<text class="font-size-16rpx m-l-5rpx">已认证</text>
|
||||
</view>
|
||||
<view v-else class="flex justify-center items-center bg-red color-black rounded-full p-x-1 m-l-5rpx">
|
||||
<text class="font-size-16rpx m-l-5rpx">未认证</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="photoListUrls.length" class="flex items-start m-t-5rpx">
|
||||
<text class="iconfont icon-tupian color-#D29E52 w-40rpx"></text>
|
||||
@@ -37,7 +41,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-t-20rpx">
|
||||
<UserLookWechat :user="user" />
|
||||
<UserLookWechat :user="user" @update-user="updateUser" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -47,6 +51,8 @@ import { computed } from 'vue';
|
||||
|
||||
import UserLookWechat from '@/pages/components/user-look-wechat.vue'
|
||||
|
||||
const emit = defineEmits(['updateUser'])
|
||||
|
||||
const props = defineProps({
|
||||
user: {
|
||||
type: Object,
|
||||
@@ -54,6 +60,10 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const truePersonAuth = computed(() => {
|
||||
return props.user?.memberTagList?.some((i) => i.tagBizType === '1') ?? false
|
||||
})
|
||||
|
||||
const photoListUrls = computed(
|
||||
() =>
|
||||
props.user?.memberPhotoList
|
||||
@@ -70,6 +80,10 @@ const previewPhoto = (current: number) => {
|
||||
});
|
||||
};
|
||||
|
||||
const updateUser = () => {
|
||||
emit('updateUser')
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -1,48 +1,26 @@
|
||||
<template>
|
||||
<scroll-list
|
||||
class="h-full"
|
||||
:loadMoreStatus="loadMoreStatus"
|
||||
@refresh="refreshList"
|
||||
@loadMore="listLoadMore"
|
||||
:scroll-top="scrollTop"
|
||||
>
|
||||
<scroll-list class="h-full" :loadMoreStatus="loadMoreStatus" @refresh="refreshList" @loadMore="listLoadMore"
|
||||
:scroll-top="scrollTop">
|
||||
<view v-if="isRefreshing" class="py-2 px-4" v-for="index in 4" :key="index">
|
||||
<view class="flex">
|
||||
<wd-skeleton :row-col="[{ size: '100px', type: 'rect' }]" animation="gradient" />
|
||||
<wd-skeleton
|
||||
:custom-style="{ width: '100%', marginLeft: '12px' }"
|
||||
:row-col="[{ width: '100%' }, { width: '100%' }]"
|
||||
animation="gradient"
|
||||
/>
|
||||
<wd-skeleton :custom-style="{ width: '100%', marginLeft: '12px' }"
|
||||
:row-col="[{ width: '100%' }, { width: '100%' }]" animation="gradient" />
|
||||
</view>
|
||||
<view class="flex -mt-50px">
|
||||
<wd-skeleton :row-col="[{ size: '100px', type: 'rect' }]" animation="gradient" />
|
||||
<wd-skeleton
|
||||
:custom-style="{ width: '100%', marginLeft: '12px' }"
|
||||
:row-col="[{ width: '100%' }, { width: '50%' }]"
|
||||
animation="gradient"
|
||||
/>
|
||||
<wd-skeleton :custom-style="{ width: '100%', marginLeft: '12px' }"
|
||||
:row-col="[{ width: '100%' }, { width: '50%' }]" animation="gradient" />
|
||||
</view>
|
||||
</view>
|
||||
<user-card
|
||||
v-else-if="listData.length"
|
||||
v-for="user in listData"
|
||||
:key="user.id"
|
||||
:data="user"
|
||||
:backdropFilter="backdropFilter"
|
||||
@click="detail(user)"
|
||||
/>
|
||||
<user-card v-else-if="listData.length" v-for="user in listData" :key="user.id" :data="user"
|
||||
:backdropFilter="backdropFilter" @click="detail(user)" />
|
||||
<wd-status-tip v-else image="content" tip="暂无内容" />
|
||||
</scroll-list>
|
||||
|
||||
<wd-config-provider theme="dark">
|
||||
<wd-message-box />
|
||||
<wd-popup
|
||||
v-model="authShow"
|
||||
custom-style="border-radius:32rpx;"
|
||||
closable
|
||||
:safe-area-inset-bottom="true"
|
||||
>
|
||||
<wd-popup v-model="authShow" custom-style="border-radius:32rpx;" closable :safe-area-inset-bottom="true">
|
||||
<view class="w-80vw py-3 text-center">
|
||||
<view class="text-lg text-color-theme">魅力女生认证</view>
|
||||
<image class="size-400rpx" src="@/static/auth-message-box-bg.png" mode="aspectFill" />
|
||||
@@ -70,127 +48,127 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
||||
// @ts-ignore
|
||||
import sheep from '@/sheep';
|
||||
import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
|
||||
import UserCard from '@/sheep/components/user-card/user-card.vue';
|
||||
import useScroll from '@/sheep/hooks/use-scroll';
|
||||
import RecentApi from '@/sheep/api/member/recent';
|
||||
import { useMessage } from '@/uni_modules/wot-design-uni';
|
||||
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
||||
// @ts-ignore
|
||||
import sheep from '@/sheep';
|
||||
import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
|
||||
import UserCard from '@/sheep/components/user-card/user-card.vue';
|
||||
import useScroll from '@/sheep/hooks/use-scroll';
|
||||
import RecentApi from '@/sheep/api/member/recent';
|
||||
import { useMessage } from '@/uni_modules/wot-design-uni';
|
||||
|
||||
const message = useMessage();
|
||||
const message = useMessage();
|
||||
|
||||
const props = defineProps<{
|
||||
scene: string;
|
||||
}>();
|
||||
const props = defineProps<{
|
||||
scene: string;
|
||||
}>();
|
||||
|
||||
const userCity = computed(() => sheep.$store('user').userCity);
|
||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||
const backdropFilter = computed(() => {
|
||||
const vip = userInfo.value?.memberVip.vip;
|
||||
return (props.scene === 'SQUARE_NEW_PERSON' || props.scene === 'SQUARE_FEMALE') && !vip;
|
||||
const userCity = computed(() => sheep.$store('user').userCity);
|
||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||
const backdropFilter = computed(() => {
|
||||
const vip = userInfo.value?.memberVip.vip;
|
||||
return (props.scene === 'SQUARE_NEW_PERSON' || props.scene === 'SQUARE_FEMALE') && !vip;
|
||||
});
|
||||
|
||||
const scrollTop = ref(1);
|
||||
const authShow = ref(false);
|
||||
const params = reactive({
|
||||
scene: props.scene,
|
||||
province: '',
|
||||
city: userCity.value.t,
|
||||
memberId: '',
|
||||
});
|
||||
const { isRefreshing, listData, loadMoreStatus, refreshList, listLoadMore } = useScroll(
|
||||
RecentApi.quickPage,
|
||||
params,
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
refreshList();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => userCity.value,
|
||||
async (city) => {
|
||||
params.city = city.t;
|
||||
await refreshList();
|
||||
scrollTop.value = 0;
|
||||
},
|
||||
);
|
||||
|
||||
const goAuth = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/profile/verify-status',
|
||||
});
|
||||
};
|
||||
|
||||
const scrollTop = ref(1);
|
||||
const authShow = ref(false);
|
||||
const params = reactive({
|
||||
scene: props.scene,
|
||||
province: '',
|
||||
city: userCity.value.t,
|
||||
memberId: '',
|
||||
});
|
||||
const { isRefreshing, listData, loadMoreStatus, refreshList, listLoadMore } = useScroll(
|
||||
RecentApi.quickPage,
|
||||
params,
|
||||
);
|
||||
// 判断查看用户详情时有无权限
|
||||
const judgeGetByUserRole = async (user: any) => {
|
||||
const { code } = await RecentApi.judgeGetByUserRole({ id: user.memberId });
|
||||
if (code === 2001000007) {
|
||||
authShow.value = true;
|
||||
return;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
refreshList();
|
||||
});
|
||||
if (code === 2001000008) {
|
||||
message
|
||||
.confirm({
|
||||
title: '获取VIP特权',
|
||||
msg: '请先开通VIP会员',
|
||||
confirmButtonText: '获取会员',
|
||||
zIndex: 9999,
|
||||
})
|
||||
.then(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/profile/apply-vip',
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => userCity.value,
|
||||
async (city) => {
|
||||
params.city = city.t;
|
||||
await refreshList();
|
||||
scrollTop.value = 0;
|
||||
uni.navigateTo({
|
||||
url: `/pages/home/detail?memberId=${user.memberId}`,
|
||||
success: function (res) {
|
||||
res.eventChannel.emit('viewRecordType', 'USER');
|
||||
},
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
const goAuth = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/profile/verify-status',
|
||||
});
|
||||
};
|
||||
|
||||
// 判断查看用户详情时有无权限
|
||||
const judgeGetByUserRole = async (user: any) => {
|
||||
const { code } = await RecentApi.judgeGetByUserRole({ id: user.memberId });
|
||||
if (code === 2001000007) {
|
||||
authShow.value = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (code === 2001000008) {
|
||||
message
|
||||
.confirm({
|
||||
title: '获取VIP特权',
|
||||
msg: '请先开通VIP会员',
|
||||
confirmButtonText: '获取会员',
|
||||
zIndex: 9999,
|
||||
})
|
||||
.then(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/profile/apply-vip',
|
||||
});
|
||||
const detail = async (user: any) => {
|
||||
// 如果男生 查看‘新人’分类-SQUARE_NEW_PERSON 且 未开通会员
|
||||
if (props.scene === 'SQUARE_NEW_PERSON' && backdropFilter.value) {
|
||||
message
|
||||
.confirm({
|
||||
title: '获取VIP特权',
|
||||
msg: '请先开通VIP会员',
|
||||
confirmButtonText: '获取会员',
|
||||
zIndex: 9999,
|
||||
})
|
||||
.then(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/profile/apply-vip',
|
||||
});
|
||||
return;
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/home/detail?memberId=${user.memberId}`,
|
||||
success: function (res) {
|
||||
res.eventChannel.emit('viewRecordType', 'USER');
|
||||
},
|
||||
});
|
||||
};
|
||||
// 如果女生 查看‘vip男士’分类-SQUARE_VIP_MALE 或 ‘女生’分类-SQUARE_FEMALE
|
||||
if (props.scene === 'SQUARE_VIP_MALE' || props.scene === 'SQUARE_FEMALE') {
|
||||
await judgeGetByUserRole(user);
|
||||
return;
|
||||
}
|
||||
|
||||
const detail = async (user: any) => {
|
||||
// 如果男生 查看‘新人’分类-SQUARE_NEW_PERSON 且 未开通会员
|
||||
if (props.scene === 'SQUARE_NEW_PERSON' && backdropFilter.value) {
|
||||
message
|
||||
.confirm({
|
||||
title: '获取VIP特权',
|
||||
msg: '请先开通VIP会员',
|
||||
confirmButtonText: '获取会员',
|
||||
zIndex: 9999,
|
||||
})
|
||||
.then(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/profile/apply-vip',
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果女生 查看‘vip男士’分类-SQUARE_VIP_MALE 或 ‘女生’分类-SQUARE_FEMALE
|
||||
if (props.scene === 'SQUARE_VIP_MALE' || props.scene === 'SQUARE_FEMALE') {
|
||||
await judgeGetByUserRole(user);
|
||||
return;
|
||||
}
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/home/detail?memberId=${user.memberId}`,
|
||||
success: function (res) {
|
||||
res.eventChannel.emit('viewRecordType', 'USER');
|
||||
},
|
||||
});
|
||||
};
|
||||
uni.navigateTo({
|
||||
url: `/pages/home/detail?memberId=${user.memberId}`,
|
||||
success: function (res) {
|
||||
res.eventChannel.emit('viewRecordType', 'USER');
|
||||
},
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.icon-bg-clip {
|
||||
clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
|
||||
}
|
||||
.icon-bg-clip {
|
||||
clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
|
||||
}
|
||||
</style>
|
||||
@@ -36,9 +36,9 @@
|
||||
|
||||
<scroll-view class="scroll-bar" v-else scroll-with-animation="true" scroll-y="true">
|
||||
<view v-for="(chat, index) in chatStore.chats" :key="index">
|
||||
<long-press-menu v-if="isShowChat(chat)" :items="menu.items" @select="onSelectMenu($event, index)">
|
||||
<chat-item :chat="chat" :index="index" :active="menu.chatIdx == index"></chat-item>
|
||||
</long-press-menu>
|
||||
<!-- <long-press-menu v-if="isShowChat(chat)" :items="menu.items" @select="onSelectMenu($event, index)"> -->
|
||||
<chat-item :user-id="chat.targetId" :chat="chat" :index="index" :active="menu.chatIdx == index"></chat-item>
|
||||
<!-- </long-press-menu> -->
|
||||
</view>
|
||||
</scroll-view>
|
||||
</wd-config-provider>
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
<view class="flex items-center">
|
||||
<text class="text-base truncate">{{ member?.memberNickname }}</text>
|
||||
<view class="flex my-1 ml-15rpx">
|
||||
<view v-for="(item, index) in data.memberTagList" :key="index"
|
||||
class="mr-2 flex items-center px-1 text-18rpx text-black rounded-4rpx bg-color-theme-dark">
|
||||
<wd-icon name="discount-filled" size="10px" color="#000" />
|
||||
<text class="whitespace-nowrap">{{ item.tagTitle }}</text>
|
||||
<view v-for="(item, index) in data.memberTagList" :key="index">
|
||||
<view v-if="['1'].includes(item.tagBizType)"
|
||||
class="mr-2 flex items-center px-1 text-18rpx text-black rounded-4rpx bg-color-theme-dark">
|
||||
<wd-icon name="discount-filled" size="10px" color="#000" />
|
||||
<text class="whitespace-nowrap">{{ item.tagTitle }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -3,14 +3,9 @@
|
||||
<view class="flex px-4 py-2">
|
||||
<view class="w-200rpx h-300rpx rounded-2 bg-#777 mr-3 relative">
|
||||
<image class="size-full rounded-2" :src="member.memberAvatar" mode="aspectFill" />
|
||||
<view
|
||||
class="absolute z-10 rounded-2 inset-0 size-full bg-#00000000"
|
||||
:style="filterStyle"
|
||||
></view>
|
||||
<view
|
||||
v-if="data.memberPhotoTotal?.total"
|
||||
class="absolute left-0 bottom-0 bg-#22222277 rounded-rt-2 rounded-lb-2 flex-row-center px-1 line-height-28rpx"
|
||||
>
|
||||
<view class="absolute z-10 rounded-2 inset-0 size-full bg-#00000000" :style="filterStyle"></view>
|
||||
<view v-if="data.memberPhotoTotal?.total"
|
||||
class="absolute left-0 bottom-0 bg-#22222277 rounded-rt-2 rounded-lb-2 flex-row-center px-1 line-height-28rpx">
|
||||
<uni-icons type="image" color="#fff" size="12" />
|
||||
<text class="text-16rpx ml-0.5">{{ data.memberPhotoTotal.total }}</text>
|
||||
</view>
|
||||
@@ -18,11 +13,6 @@
|
||||
<view class="flex-1 overflow-hidden">
|
||||
<view class="flex justify-between items-center mt-2">
|
||||
<text class="text-sm truncate">
|
||||
<!-- {{
|
||||
backdropFilter
|
||||
? '*'.repeat(member.memberNickname === null ? 3 : member.memberNickname.length)
|
||||
: member.memberNickname
|
||||
}} -->
|
||||
{{ member.memberNickname }}
|
||||
</text>
|
||||
<text class="py-4rpx px-2 rounded-full text-22rpx bg-color-theme-dark whitespace-nowrap">
|
||||
@@ -33,45 +23,30 @@
|
||||
}}
|
||||
</text>
|
||||
</view>
|
||||
<view
|
||||
v-for="(item, index) in data.memberTagList"
|
||||
:key="index"
|
||||
class="mt-2 inline-flex px-1 py-6rpx text-18rpx c-black rounded-4rpx bg-color-theme-dark mr-2"
|
||||
>
|
||||
<wd-icon name="discount-filled" size="10px" color="#000" />
|
||||
<text>{{ item.tagTitle }}</text>
|
||||
<view v-for="(item, index) in data.memberTagList" :key="index">
|
||||
<view v-if="['1'].includes(item.tagBizType)"
|
||||
class="mt-2 inline-flex px-1 py-6rpx text-18rpx c-black rounded-4rpx bg-color-theme-dark mr-2">
|
||||
<wd-icon name="discount-filled" size="10px" color="#000" />
|
||||
<text>{{ item.tagTitle }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-2 flex flex-wrap gap-3">
|
||||
<text
|
||||
v-if="member.memberSex || member.memberAge"
|
||||
class="bg-#333 text-color-theme-dark text-22rpx px-1 py-4rpx rounded-1"
|
||||
>
|
||||
<text v-if="member.memberSex || member.memberAge"
|
||||
class="bg-#333 text-color-theme-dark text-22rpx px-1 py-4rpx rounded-1">
|
||||
<text v-if="member.memberSex">{{ getGender(member.memberSex) }}</text>
|
||||
<text v-if="member.memberSex && member.memberAge">·</text>
|
||||
<text v-if="member.memberAge">{{ member.memberAge }}岁</text>
|
||||
</text>
|
||||
<text
|
||||
v-if="member.memberHeight"
|
||||
class="bg-#333 text-color-theme-dark text-22rpx px-1 py-4rpx rounded-1"
|
||||
>
|
||||
<text v-if="member.memberHeight" class="bg-#333 text-color-theme-dark text-22rpx px-1 py-4rpx rounded-1">
|
||||
{{ member.memberHeight }}cm
|
||||
</text>
|
||||
<text
|
||||
v-if="member.memberWeight"
|
||||
class="bg-#333 text-color-theme-dark text-22rpx px-1 py-4rpx rounded-1"
|
||||
>
|
||||
<text v-if="member.memberWeight" class="bg-#333 text-color-theme-dark text-22rpx px-1 py-4rpx rounded-1">
|
||||
{{ member.memberWeight }}kg
|
||||
</text>
|
||||
<text
|
||||
v-if="member.memberOcc"
|
||||
class="bg-#333 text-color-theme-dark text-22rpx px-1 py-4rpx rounded-1"
|
||||
>
|
||||
<text v-if="member.memberOcc" class="bg-#333 text-color-theme-dark text-22rpx px-1 py-4rpx rounded-1">
|
||||
{{ member.memberOcc }}
|
||||
</text>
|
||||
<text
|
||||
v-if="data.distance"
|
||||
class="bg-#333 text-color-theme-dark text-22rpx px-1 py-4rpx rounded-1"
|
||||
>
|
||||
<text v-if="data.distance" class="bg-#333 text-color-theme-dark text-22rpx px-1 py-4rpx rounded-1">
|
||||
{{ data.distance.toFixed(2) }}km
|
||||
</text>
|
||||
</view>
|
||||
@@ -82,20 +57,20 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
// @ts-ignore
|
||||
import { getGender } from '@/sheep/util/index';
|
||||
// @ts-ignore
|
||||
import { formatDate } from '@/sheep/util/index';
|
||||
import { computed } from 'vue';
|
||||
// @ts-ignore
|
||||
import { getGender } from '@/sheep/util/index';
|
||||
// @ts-ignore
|
||||
import { formatDate } from '@/sheep/util/index';
|
||||
|
||||
const props = withDefaults(defineProps<{ data: any; backdropFilter?: boolean }>(), {
|
||||
backdropFilter: false,
|
||||
});
|
||||
const emit = defineEmits(['click']);
|
||||
const props = withDefaults(defineProps<{ data: any; backdropFilter?: boolean }>(), {
|
||||
backdropFilter: false,
|
||||
});
|
||||
const emit = defineEmits(['click']);
|
||||
|
||||
const member = computed(() => props.data.member || {});
|
||||
const member = computed(() => props.data.member || {});
|
||||
|
||||
const filterStyle = computed(() => {
|
||||
return props.backdropFilter ? { backdropFilter: 'blur(10px)' } : {};
|
||||
});
|
||||
const filterStyle = computed(() => {
|
||||
return props.backdropFilter ? { backdropFilter: 'blur(10px)' } : {};
|
||||
});
|
||||
</script>
|
||||
@@ -3,6 +3,7 @@
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"strict": true,
|
||||
"noImplicitAny": false,
|
||||
"jsx": "preserve",
|
||||
"moduleResolution": "bundler",
|
||||
"esModuleInterop": true,
|
||||
|
||||
Reference in new issue
Block a user