feat:修改已知内容

This commit is contained in:
ctw committed 2025-12-11 11:49:57 +08:00
1 parent 23eda9c505
commit ab97edab5c
15 files changed
+240 -151

No files matched your search

+1 -1
View File
@@ -93,7 +93,7 @@
promises.push(this.friendStore.loadFriend());
promises.push(this.groupStore.loadGroup());
promises.push(this.chatStore.loadChat());
promises.push(this.configStore.loadConfig());
// promises.push(this.configStore.loadConfig());
return Promise.all(promises);
});
},
+33 -33
View File
@@ -1,36 +1,36 @@
import { defineStore } from 'pinia';
import http from '../common/request'
import http from '../common/request';
export default defineStore('configStore', {
state: () => {
return {
appInit: false,
webrtc: {}
}
},
actions: {
setConfig(config) {
this.webrtc = config.webrtc;
},
setAppInit(appInit) {
this.appInit = appInit;
},
clear() {
this.webrtc = {};
},
loadConfig() {
return new Promise((resolve, reject) => {
http({
url: '/system/config',
method: 'GET'
}).then((config) => {
console.log("系统配置", config)
this.setConfig(config);
resolve();
}).catch((res) => {
reject(res);
});
})
}
}
})
state: () => {
return {
appInit: false,
webrtc: {},
};
},
actions: {
setConfig(config) {
this.webrtc = config.webrtc;
},
setAppInit(appInit) {
this.appInit = appInit;
},
clear() {
this.webrtc = {};
},
loadConfig() {
// return new Promise((resolve, reject) => {
// http({
// url: '/system/config',
// method: 'GET'
// }).then((config) => {
// console.log("系统配置", config)
// this.setConfig(config);
// resolve();
// }).catch((res) => {
// reject(res);
// });
// })
},
},
});
+14
View File
@@ -133,6 +133,20 @@
"navigationBarTitleText": "我的",
"navigationStyle": "custom"
}
},
{
"path": "pages/wechat-tabbar/index",
"style": {
"navigationBarTitleText": "邀请福利",
"navigationStyle": "custom"
}
},
{
"path": "pages/wechat-tabbar/me",
"style": {
"navigationBarTitleText": "我的",
"navigationStyle": "custom"
}
}
// #endif
],
+2 -2
View File
@@ -18,8 +18,8 @@
v-if="userDetail?.member?.memberId"
class="py-1 px-2 text-xs bg-color-theme-dark rounded-full mr-3"
>
{{ userDetail.member?.memberCity ? userDetail.member?.memberCity + ' · ' : '' }}
{{ userDetail.distance?.toFixed(2) }}km
{{ 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" />
</view>
+7 -2
View File
@@ -8,11 +8,16 @@
</template>
</wd-navbar>
<view class="mt-40 mx-10">
<view class="flex-col-center mt-20">
<image class="mx-auto size-80px" src="@/static/logo.png" mode="aspectFill" />
<view class="text-base mt-2">荷塘月色</view>
</view>
<view class="mt-4 mx-10">
<wd-cell-group>
<wd-cell title="用户协议" value="" is-link ellipsis @click="alert(2, '用户协议')" />
<wd-cell title="隐私政策" value="" is-link ellipsis @click="alert(3, '隐私政策')" />
<wd-cell title="版本" :value="version" is-link ellipsis />
<wd-cell title="版本" :value="'V' + version" is-link ellipsis />
</wd-cell-group>
</view>
+94 -53
View File
@@ -17,6 +17,7 @@
</template>
</wd-navbar>
<!-- 女 认证 -->
<view v-if="userInfoStore.sex == 2" class="pt-20" style="height: calc(100vh - 44rpx - 200rpx)">
<wd-steps :active="stepActive" align-center>
<wd-step v-for="index in 4" :key="index" />
@@ -57,7 +58,7 @@
<capsule-cell title="职业" :value="userinfo.occ" />
</wd-picker>
<textarea
class="h-280rpx w-78% mx-auto my-4 rounded-10rpx bg-color-light p-10rpx text-32rpx text-color-theme"
class="h-200rpx w-78% mx-auto my-4 rounded-10rpx bg-color-light p-24rpx text-32rpx text-color-theme"
v-model="userinfo.description"
:maxlength="100"
placeholder="个人简介(100字以内)"
@@ -66,7 +67,7 @@
</view>
<view v-if="stepActive === 1">
<view class="text-xl my-2 mx-8 c-#FCFBFE">请上传3-5张最美的照片</view>
<view class="text-xl my-2 mx-8 c-#FCFBFE">请上传3-9张最美的照片</view>
<view class="text-sm my-2 mx-8 c-#949494">请上传本人真实照片,更容易受到男士青睐</view>
<view class="h-60rpx"></view>
<view class="mx-8">
@@ -77,8 +78,10 @@
image-mode="aspectFill"
accept="image"
multiple
:limit="5"
:limit="9"
:max-size="3000000"
@success="uploadSuccess"
:before-remove="beforeRemove"
/>
</view>
</view>
@@ -91,7 +94,7 @@
<view class="h-60rpx"></view>
<input
class="h-100rpx mx-8 my-4 rounded-50rpx bg-color-light px-40rpx text-32rpx text-color-theme"
v-model="wxInfo.wechatNum"
v-model="wxInfo.wechatNumber"
type="text"
placeholder="请输入您的微信号"
placeholder-style="color: rgba(255, 255, 255, 0.6)"
@@ -99,7 +102,7 @@
/>
<view class="flex-row-center my-6">
<s-uploader
v-model:url="wxInfo.wechatQrCode"
v-model:url="wxInfo.wechatQrcode"
fileMediatype="image"
limit="1"
mode="grid"
@@ -182,13 +185,14 @@
<view
v-if="stepActive === 3"
class="mx-auto mt-6 w-200rpx rounded-full p-3 text-center bg-color-theme-dark active:bg-color-theme"
@click="girlFaceVerify"
@click="createFaceVerify"
>
开始认证
</view>
</view>
<view v-if="userInfoStore.sex == 1" class="py-6" style="height: calc(100vh - 44rpx - 200rpx)">
<!-- 男 认证 -->
<view v-if="userInfoStore.sex == 1" class="py-10" style="height: calc(100vh - 44px - 50px)">
<view class="text-xl my-2 mx-8 c-#FCFBFE">基本资料</view>
<view class="text-sm my-2 mx-8 c-#949494">上传本人头像,女生更放心与你见面~</view>
<view class="h-60rpx"></view>
@@ -209,7 +213,7 @@
<view
class="mx-auto w-200rpx rounded-full p-3 text-center bg-color-theme-dark active:bg-color-theme"
@click="boyFaceVerify"
@click="createFaceVerify"
>
开始认证
</view>
@@ -218,13 +222,15 @@
为保护您的隐私,您的信息只有认证过的女生可以看到,请放心认证
</view>
</view>
<wd-message-box />
</wd-config-provider>
</template>
<script setup lang="ts">
import RecentApi from '@/sheep/api/member/recent';
import SUploader from '@/sheep/components/s-uploader/s-uploader.vue';
import { computed, reactive, ref } from 'vue';
import { computed, reactive, ref, watch } from 'vue';
// @ts-ignore
import sheep from '@/sheep/index';
// @ts-ignore
@@ -237,9 +243,14 @@
import { onLoad } from '@dcloudio/uni-app';
// @ts-ignore
import UserApi from '@/sheep/api/member/user';
import useAblum from './use-ablum';
import { useMessage } from '@/uni_modules/wot-design-uni';
const userInfoStore = computed(() => sheep.$store('user').userInfo);
const messageBox = useMessage();
const { ablumList, getUserAlbum } = useAblum();
const stepActive = ref(0);
const imageFileList = ref([]);
// 用户信息
@@ -255,16 +266,47 @@
});
// 微信信息
const wxInfo = reactive({
wechatNum: '',
wechatQrCode: '',
wechatNumber: '',
wechatQrcode: '',
});
watch(
() => ablumList.value,
(val) => {
imageFileList.value = val.map((item: any) => ({ url: item.address, id: item.id }));
},
{ immediate: true },
);
const header = {
Accept: '*/*',
'tenant-id': tenantId,
Authorization: 'Bearer ' + getAccessToken(),
};
const uploadSuccess = async ({ file }: any) => {
await RecentApi.saveUserAlbum({
address: JSON.parse(file.response).data,
resourceType: 'IMAGE',
});
await getUserAlbum();
};
// 相册移除确认
const beforeRemove = ({ file, fileList, resolve }: any) => {
messageBox
.confirm({
msg: '是否移除',
title: '提示',
})
.then(async () => {
const { code } = await RecentApi.deleteUserAlbum(file.id);
if (code === 0) {
resolve(true);
}
});
};
onLoad(async () => {
const { data } = await UserApi.getUserInfo();
Object.assign(userinfo, {
@@ -285,8 +327,8 @@
if (validate()) stepActive.value++;
};
// 人脸认证 女
const girlFaceVerify = async () => {
// 创建人脸认证
const createFaceVerify = async () => {
// #ifndef APP-PLUS
uni.showToast({ title: '当前设备不支持', icon: 'error' });
// #endif
@@ -297,44 +339,40 @@
const aliyunVerify = uni.requireNativePlugin('AP-FaceDetectModule');
const metaInfo = JSON.stringify(aliyunVerify.getMetaInfo());
// 创建女生人脸认证
const { code, data } = await RecentApi.createGirlFaceVerify({
memberHeight: userinfo.height,
memberWeight: userinfo.weight,
memberWechatNumber: wxInfo.wechatNum,
memberOcc: userinfo.occ,
memberDesc: userinfo.description,
authPic: userinfo.avatar,
metaInfoJson: metaInfo,
});
console.log('创建人脸认证接口responseData:', code, data);
if (code !== 0)
return uni.showToast({ title: '请上传包含人脸的头像', icon: 'none', duration: 6000 });
verify(data.bizId, data.id);
// #endif
};
let fvData = null;
// 人脸认证 男
const boyFaceVerify = async () => {
// #ifndef APP-PLUS
uni.showToast({ title: '当前设备不支持', icon: 'error' });
// #endif
if (userInfoStore.value.sex == 2) {
// 创建女生人脸认证
const { code, data } = await RecentApi.createGirlFaceVerify({
memberHeight: userinfo.height,
memberWeight: userinfo.weight,
memberWechatNumber: wxInfo.wechatNumber,
memberOcc: userinfo.occ,
memberDesc: userinfo.description,
authPic: userinfo.avatar,
metaInfoJson: metaInfo,
});
console.log('女 创建人脸认证接口responseData:', code, data);
// #ifdef APP-PLUS
if (!userinfo.avatar) return uni.showToast({ title: '请先上传人脸照片', icon: 'error' });
if (code !== 0)
return uni.showToast({ title: '请上传包含人脸的头像', icon: 'none', duration: 6000 });
fvData = data;
}
const aliyunVerify = uni.requireNativePlugin('AP-FaceDetectModule');
const metaInfo = JSON.stringify(aliyunVerify.getMetaInfo());
if (userInfoStore.value.sex == 1) {
// 创建男生人脸认证
const { code, data } = await RecentApi.createBoyFaceVerify({
authPic: userinfo.avatar,
metaInfoJson: metaInfo,
});
console.log('男 创建人脸认证接口responseData:', code, data);
// 创建男生人脸认证
const { code, data } = await RecentApi.createBoyFaceVerify({
authPic: userinfo.avatar,
metaInfoJson: metaInfo,
});
console.log('创建人脸认证接口responseData:', code, data);
if (code !== 0)
return uni.showToast({ title: '请上传包含人脸的头像', icon: 'none', duration: 6000 });
verify(data.bizId, data.id);
if (code !== 0)
return uni.showToast({ title: '请上传包含人脸的头像', icon: 'none', duration: 6000 });
fvData = data;
}
verify(fvData.bizId, fvData.id);
// #endif
};
@@ -344,9 +382,10 @@
*/
const verify = (certifyId: string, authId: string) => {
if (!certifyId) return uni.showToast({ title: 'certifyId不存在', icon: 'none' });
const p = uni.getSystemInfoSync().platform;
if (p === 'ios') {
}
if (!authId) return uni.showToast({ title: 'authId不存在', icon: 'none' });
// const p = uni.getSystemInfoSync().platform;
// if (p === 'ios') {
// }
console.log('certifyId', certifyId);
const aliyunVerify = uni.requireNativePlugin('AP-FaceDetectModule');
@@ -369,7 +408,9 @@
break;
case 1000:
UserApi.updateUser(userinfo).then(() => {
sheep.$store('user').getInfo();
const { code, data } = RecentApi.createWecahtAuth(wxInfo); // 创建微信认证
console.log('创建微信认证response:', code, data);
sheep.$store('user').getInfo(); // 认证完成再次获取用户信息
uni.showToast({ title: '您已认证成功', icon: 'none' });
setTimeout(() => {
uni.navigateBack();
@@ -407,14 +448,14 @@
return false;
}
case 1:
if (imageFileList.value.length > 2 && imageFileList.value.length < 6) {
if (imageFileList.value.length > 2 && imageFileList.value.length < 10) {
return true;
} else {
uni.showToast({ title: '请上传照片', icon: 'none' });
return false;
}
case 2:
if (wxInfo.wechatNum && wxInfo.wechatQrCode) {
if (wxInfo.wechatNumber && wxInfo.wechatQrcode) {
return true;
} else {
uni.showToast({ title: '请完善微信信息', icon: 'none' });
+2 -2
View File
@@ -43,7 +43,7 @@
@click="getWallet"
/>
<view>余额(宝石)</view>
<view class="font-bold text-xl">{{ fen2yuan(userWallet.balance) }}</view>
<view class="font-bold text-xl">{{ fen2yuanSimple(userWallet.balance) }}</view>
</view>
<!-- 支付方式切换 -->
@@ -99,7 +99,7 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
// @ts-ignore
import { fen2yuan, fen2yuanSimple } from '@/sheep/hooks/useGoods';
import { fen2yuanSimple } from '@/sheep/hooks/useGoods';
import RecentApi from '@/sheep/api/member/recent';
import { useMessage } from '@/uni_modules/wot-design-uni';
import { onLoad } from '@dcloudio/uni-app';
+4 -4
View File
@@ -86,10 +86,10 @@
loading.value = true;
const { code, data } = await RecentApi.getSetting();
if (code !== 0) return;
params.isPush = data.isPush;
params.homeHide = data.homeHide;
params.privacySecure = data.privacySecure;
params.shortNote = data.shortNote;
params.isPush = data.isPush || false;
params.homeHide = data.homeHide || false;
params.privacySecure = data.privacySecure || false;
params.shortNote = data.shortNote || false;
loading.value = false;
});
+3 -3
View File
@@ -10,7 +10,7 @@
<view class="mx-5 my-3 flex justify-between text-color-theme">
<text>图片</text>
<text>{{ imageFileList?.length || 0 }}/20</text>
<text>{{ imageFileList?.length || 0 }}/9</text>
</view>
<view class="px-4">
<wd-upload
@@ -20,7 +20,7 @@
image-mode="aspectFill"
accept="image"
multiple
:limit="20"
:limit="9"
:max-size="3000000"
@success="uploadSuccess"
:before-remove="beforeRemove"
@@ -59,7 +59,7 @@
watch(
() => ablumList.value,
(val) => {
imageFileList.value = val.map((item) => ({ url: item.address, id: item.id }));
imageFileList.value = val.map((item: any) => ({ url: item.address, id: item.id }));
},
{ immediate: true },
);
+2 -3
View File
@@ -1,15 +1,14 @@
import { onMounted, ref } from 'vue';
import { AlbumData } from './components/user-ablum.vue';
import RecentApi from '@/sheep/api/member/recent';
export default function useAblum() {
const ablumList = ref<AlbumData[]>([]); // 用户相册
const ablumList = ref<any>([]); // 用户相册
// 获取用户相册
const getUserAlbum = async () => {
const { data = null } = await RecentApi.getUserAlbum({
pageNo: 1,
pageSize: 20,
pageSize: 9,
resourceType: 'IMAGE',
});
ablumList.value = data.list ?? [];
+52 -45
View File
@@ -10,18 +10,34 @@
<wd-tabs v-model="activeTab">
<wd-tab title="我看过的">
<scroll-list style="height: calc(100dvh - 44px - 42px)" :loadMoreStatus="loadMoreStatus_seenIt"
@refresh="refreshList_seenIt" @loadMore="listLoadMore_seenIt">
<view-record-item v-if="listData_seenIt.length" v-for="user in listData_seenIt" :record="user"
@click="detail(user)" />
<scroll-list
style="height: calc(100dvh - 44px - 50px - 42px)"
:loadMoreStatus="loadMoreStatus_seenIt"
@refresh="refreshList_seenIt"
@loadMore="listLoadMore_seenIt"
>
<view-record-item
v-if="listData_seenIt.length"
v-for="user in listData_seenIt"
:record="user"
@click="detail(user)"
/>
</scroll-list>
</wd-tab>
<wd-tab title="看过我的">
<scroll-list style="height: calc(100dvh - 44px - 42px)" :loadMoreStatus="loadMoreStatus_seenMe"
@refresh="refreshList_seenMe" @loadMore="listLoadMore_seenMe">
<view-record-item v-if="listData_seenMe.length" v-for="user in listData_seenMe" :record="user"
@click="detail(user)" />
<scroll-list
style="height: calc(100dvh - 44px - 50px - 42px)"
:loadMoreStatus="loadMoreStatus_seenMe"
@refresh="refreshList_seenMe"
@loadMore="listLoadMore_seenMe"
>
<view-record-item
v-if="listData_seenMe.length"
v-for="user in listData_seenMe"
:record="user"
@click="detail(user)"
/>
</scroll-list>
</wd-tab>
</wd-tabs>
@@ -29,44 +45,35 @@
</template>
<script setup lang="ts">
import ViewRecordItem from './components/view-record-item.vue';
import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
import useScroll from '@/sheep/hooks/use-scroll';
import RecentApi from '@/sheep/api/member/recent';
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import ViewRecordItem from './components/view-record-item.vue';
import ScrollList from '@/sheep/components/scroll-list/scroll-list.vue';
import useScroll from '@/sheep/hooks/use-scroll';
import RecentApi from '@/sheep/api/member/recent';
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
const activeTab = ref();
const {
listData: listData_seenIt,
loadMoreStatus: loadMoreStatus_seenIt,
refreshList: refreshList_seenIt,
listLoadMore: listLoadMore_seenIt,
} = useScroll(RecentApi.getSeenIt);
const {
listData: listData_seenMe,
loadMoreStatus: loadMoreStatus_seenMe,
refreshList: refreshList_seenMe,
listLoadMore: listLoadMore_seenMe,
} = useScroll(RecentApi.getSeenMe);
const activeTab = ref();
const {
listData: listData_seenIt,
loadMoreStatus: loadMoreStatus_seenIt,
refreshList: refreshList_seenIt,
listLoadMore: listLoadMore_seenIt,
} = useScroll(RecentApi.getSeenIt);
const {
listData: listData_seenMe,
loadMoreStatus: loadMoreStatus_seenMe,
refreshList: refreshList_seenMe,
listLoadMore: listLoadMore_seenMe,
} = useScroll(RecentApi.getSeenMe);
onLoad(async () => {
refreshList_seenIt();
refreshList_seenMe();
});
const detail = (user: any) => {
uni.navigateTo({
url: `/pages/home/detail?memberId=${user.memberId}`,
onLoad(async () => {
refreshList_seenIt();
refreshList_seenMe();
});
};
const detail = (user: any) => {
uni.navigateTo({
url: `/pages/home/detail?memberId=${user.memberId}`,
});
};
</script>
<style>
/* #ifdef APP-PLUS */
page {
overflow: hidden;
}
/* #endif */
</style>
@@ -22,6 +22,8 @@
</template>
<script setup lang="ts">
import { computed } from 'vue';
export interface AlbumData {
resourceType: 'IMAGE' | 'VIDEO';
address: string;
@@ -32,6 +34,8 @@
ablumList: AlbumData[];
}>();
const ablumList = computed(() => props.ablumList);
const previewPhoto = (current: number) => {
if (!props.ablumList.length) return;
const urls = props.ablumList.map((item) => item.address);
+10 -3
View File
@@ -66,7 +66,7 @@
>
<view class="flex-col-center">
<text class="text-color-theme font-600 text-lg">
{{ fen2yuan(userWallet.balance) }}
{{ fen2yuanSimple(userWallet.balance) }}
</text>
<text class="text-color-theme text-sm">钱包</text>
</view>
@@ -188,7 +188,7 @@
</template>
<script setup lang="ts">
import { computed, reactive, ref } from 'vue';
import { computed, reactive, ref, watch } from 'vue';
import UserAblum from './components/user-ablum.vue';
import useAblum from '../profile/use-ablum';
// @ts-ignore
@@ -196,10 +196,17 @@
import RecentApi from '@/sheep/api/member/recent';
import { onShow } from '@dcloudio/uni-app';
// @ts-ignore
import { fen2yuan } from '@/sheep/hooks/useGoods';
import { fen2yuanSimple } from '@/sheep/hooks/useGoods';
const { ablumList } = useAblum();
watch(
() => ablumList.value,
(val) => {
console.log('val', val);
},
);
// 统计信息
const recentTotal = ref({
memberRecentId: null,
+12
View File
@@ -493,6 +493,18 @@ const RecentApi = {
},
});
},
// 创建微信认证
createWecahtAuth: (data: { wechatNumber: string; wechatQrcode: string }) => {
return request({
url: '/member/com-auth/create-wecaht-auth',
method: 'POST',
data,
custom: {
showLoading: true,
loadingMsg: '保存中',
},
});
},
};
export default RecentApi;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 13 KiB