fixed:发布动态;相册回显

This commit is contained in:
ctw committed 2025-12-11 16:06:02 +08:00
1 parent ae5e3e900f
commit a225bae035
11 files changed
+94 -82

No files matched your search

+4 -4
View File
@@ -122,9 +122,9 @@
"iosStyle" : "common",
"useOriginalMsgbox" : true,
"android" : {
"hdpi" : "unpackage/res/icons/20x20.png",
"xhdpi" : "unpackage/res/icons/20x20.png",
"xxhdpi" : "unpackage/res/icons/20x20.png"
"hdpi" : "unpackage/res/icons/1024x1024.png",
"xhdpi" : "unpackage/res/icons/1024x1024.png",
"xxhdpi" : "unpackage/res/icons/1024x1024.png"
}
},
"icons" : {
@@ -195,7 +195,7 @@
"versionCode" : 100
},
"mp-weixin" : {
"appid" : "wx2b4e4d3feff8267f",
"appid" : "wx66186af0759f47c9",
"setting" : {
"urlCheck" : false,
"minified" : true,
+16 -7
View File
@@ -58,16 +58,25 @@
<view class="flex flex-wrap justify-center mb-20rpx">
<text class="px-2 py-1 rounded-1 mr-2 bg-#222 text-color-theme-dark">
{{ getGender(userDetail.member?.memberSex) }}·{{ userDetail.member?.memberAge }}岁
{{ getGender(userDetail.member.memberSex) }}·{{ userDetail.member?.memberAge }}岁
</text>
<text class="px-2 py-1 rounded-1 mr-2 bg-#222 text-color-theme-dark">
{{ userDetail.member?.memberHeight || '' }}cm
<text
v-if="userDetail.member.memberHeight"
class="px-2 py-1 rounded-1 mr-2 bg-#222 text-color-theme-dark"
>
{{ userDetail.member.memberHeight }}cm
</text>
<text class="px-2 py-1 rounded-1 mr-2 bg-#222 text-color-theme-dark">
{{ userDetail.member?.memberWeight || '' }}kg
<text
v-if="userDetail.member.memberWeight"
class="px-2 py-1 rounded-1 mr-2 bg-#222 text-color-theme-dark"
>
{{ userDetail.member.memberWeight }}kg
</text>
<text class="px-2 py-1 rounded-1 mr-2 bg-#222 text-color-theme-dark">
{{ userDetail.member?.memberOcc || '' }}
<text
v-if="userDetail.member.memberOcc"
class="px-2 py-1 rounded-1 mr-2 bg-#222 text-color-theme-dark"
>
{{ userDetail.member.memberOcc }}
</text>
</view>
<view class="px-8">
+63 -51
View File
@@ -5,14 +5,12 @@
<uni-icons type="back" size="30" color="#D29E52" @click="back"></uni-icons>
</template>
<template #right>
<navigator hover-class="navigator-hover">
<view
class="bg-color-theme px-3 py-1 rounded-full c-black h-1/2 line-height-normal"
@click="publishMoments"
>
发布
</view>
</navigator>
<view
class="bg-color-theme px-3 py-1 rounded-full c-black h-1/2 line-height-normal"
@click="publishMoments"
>
发布
</view>
</template>
</wd-navbar>
@@ -21,15 +19,16 @@
<wd-tabs v-model="activeTab">
<wd-tab title="发图文">
<view class="px-4 py-8">
<wd-upload
v-model:file-list="params.coverPic"
:action="baseUrl + apiPath + '/infra/file/upload'"
:header="header"
image-mode="aspectFill"
accept="image"
multiple
:limit="6"
:max-size="500000"
<s-uploader
v-model:url="params.coverPic"
fileMediatype="image"
limit="6"
mode="grid"
:imageStyles="{
width: '230rpx',
height: '230rpx',
border: { width: '4rpx', color: '#D29E52', radius: '40rpx' },
}"
/>
</view>
</wd-tab>
@@ -49,7 +48,7 @@
</wd-tab>
</wd-tabs>
<wd-col-picker
<!-- <wd-col-picker
label="选择地址"
title="选择地址"
align-right
@@ -57,8 +56,9 @@
:columns="area"
:column-change="columnChange"
@confirm="areaPickerConfirm"
/>
/> -->
</scroll-view>
<wd-toast />
</wd-config-provider>
</template>
@@ -71,25 +71,24 @@
import { baseUrl, apiPath, tenantId } from '@/sheep/config';
// @ts-ignore
import { getAccessToken } from '@/sheep/request';
import { onLoad } from '@dcloudio/uni-app';
import { useToast } from '@/uni_modules/wot-design-uni';
const toast = useToast();
const { colPickerData, findChildrenByCode } = useColPickerData();
const activeTab = ref<0 | 1>(0);
const addressValue = ref<string[]>([]);
// const addressValue = ref<string[]>([]);
const params = reactive({
coverPic: [],
coverVideo: [],
description: '',
issueLong: '0',
issueLat: '0',
issueLong: '',
issueLat: '',
issueProvince: '',
issueCity: '',
issueDistrict: '',
});
const coverPic = computed(() => {
return params.coverPic.map((item: any) => JSON.parse(item.response).data);
});
const coverPic = computed(() => params.coverPic?.join(',') || []);
const coverVideo = computed(() => {
return params.coverVideo.map((item: any) => JSON.parse(item.response).data);
});
@@ -131,43 +130,56 @@
params.issueDistrict = selectedItems[2].label;
};
// 获取经纬度位置信息
const getLocation = () => {
uni.getLocation({
success: (res) => {
params.issueLat = String(res.latitude);
params.issueLong = String(res.longitude);
},
fail: (err) => {
uni.showToast({ title: '位置信息获取失败,请打开系统定位', icon: 'none' });
},
});
};
const header = {
Accept: '*/*',
'tenant-id': tenantId,
Authorization: 'Bearer ' + getAccessToken(),
};
onLoad(() => {
getLocation();
});
// 发布朋友圈
const publishMoments = async () => {
if (!params.description || !params.issueProvince)
return uni.showToast({ title: '请填写内容', icon: 'error' });
if (!params.description) return uni.showToast({ title: '请填写内容', icon: 'error' });
if (!params.coverPic || !params.coverPic.length)
return uni.showToast({ title: '请上传图片', icon: 'error' });
getLocation();
await RecentApi.createMoment({
...params,
coverPic: coverPic.value.join(','),
coverVideo: coverVideo.value.join(','),
// 获取经纬度位置信息
uni.getLocation({
success: async (res) => {
params.issueLat = String(res.latitude);
params.issueLong = String(res.longitude);
const { code, msg } = await RecentApi.createMoment({
...params,
coverPic: coverPic.value,
coverVideo: coverVideo.value.join(','),
});
if (code !== 0)
return toast.error({
msg,
duration: 5000,
direction: 'vertical',
position: 'middle',
});
toast.success({
msg: '发布成功',
duration: 5000,
direction: 'vertical',
position: 'middle',
});
setTimeout(() => {
back();
}, 800);
},
fail: (err) => {
toast.error({
msg: '发布失败,位置信息获取失败,请打开手机系统定位',
duration: 5000,
direction: 'vertical',
position: 'middle',
});
},
});
back();
};
// 返回
+1
View File
@@ -302,6 +302,7 @@
.then(async () => {
const { code } = await RecentApi.deleteUserAlbum(file.id);
if (code === 0) {
await getUserAlbum();
resolve(true);
}
});
+1
View File
@@ -83,6 +83,7 @@
const { code } = await RecentApi.deleteUserAlbum(file.id);
if (code === 0) {
resolve(true);
await getUserAlbum();
return toast.success('移除成功');
}
toast.error('移除失败');
+2 -2
View File
@@ -1,9 +1,9 @@
import { onMounted, ref } from 'vue';
import RecentApi from '@/sheep/api/member/recent';
export default function useAblum() {
const ablumList = ref<any>([]); // 用户相册
const ablumList = ref<any>([]); // 用户相册列表
export default function useAblum() {
// 获取用户相册
const getUserAlbum = async () => {
const { data = null } = await RecentApi.getUserAlbum({
@@ -22,8 +22,6 @@
</template>
<script setup lang="ts">
import { computed } from 'vue';
export interface AlbumData {
resourceType: 'IMAGE' | 'VIDEO';
address: string;
@@ -34,8 +32,6 @@
ablumList: AlbumData[];
}>();
const ablumList = computed(() => props.ablumList);
const previewPhoto = (current: number) => {
if (!props.ablumList.length) return;
const urls = props.ablumList.map((item) => item.address);
+2 -2
View File
@@ -29,9 +29,9 @@
<navigator url="/pages/wechat-tabbar/index" open-type="navigate" hover-class="navigator-hover">
<image
class="size-120rpx fixed right-0 bottom-260"
class="w-140rpx h-130rpx fixed right-0 bottom-260"
src="@/static/invitation-activity.png"
mode="aspectFit"
mode="aspectFill"
/>
</navigator>
+1 -8
View File
@@ -188,7 +188,7 @@
</template>
<script setup lang="ts">
import { computed, reactive, ref, watch } from 'vue';
import { computed, reactive, ref } from 'vue';
import UserAblum from './components/user-ablum.vue';
import useAblum from '../profile/use-ablum';
// @ts-ignore
@@ -200,13 +200,6 @@
const { ablumList } = useAblum();
watch(
() => ablumList.value,
(val) => {
console.log('val', val);
},
);
// 统计信息
const recentTotal = ref({
memberRecentId: null,
+3 -3
View File
@@ -52,9 +52,9 @@ const RecentApi = {
data,
custom: {
showLoading: true,
showSuccess: true,
loadingMsg: '提交中',
successMsg: '提交成功',
loadingMsg: '发布中',
showSuccess: false,
showError: false,
},
});
},
+1 -1
View File
@@ -160,6 +160,6 @@ export const getGender = (genderType) => {
case 2:
return '女';
default:
return '其他性别';
return '';
}
};