|
@@ -13,6 +13,7 @@ import {
|
|
|
getCircles,
|
|
|
getDesignerInfo,
|
|
|
getUserInfoById,
|
|
|
+ updateDesignerInfo,
|
|
|
} from '../../../core/libs/requests'
|
|
|
import { useUserStore } from '../../../store'
|
|
|
import { storeToRefs } from 'pinia'
|
|
@@ -83,9 +84,33 @@ const handleMomentDelete = async (id) => {
|
|
|
})
|
|
|
}
|
|
|
const handle2Video = () => {
|
|
|
- // wx.openChannelsUserProfile({ finderUserName: 'sphtEhk7olIepB0' })
|
|
|
-
|
|
|
- uni.openChannelsUserProfile({ finderUserName: designerInfo.value?.videoNumber })
|
|
|
+ try {
|
|
|
+ uni.openChannelsUserProfile({ finderUserName: designerInfo.value?.videoNumber })
|
|
|
+ } catch (e) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '打开失败',
|
|
|
+ icon: 'none',
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+const handleUnbundle = async () => {
|
|
|
+ confirm({
|
|
|
+ title: '警告',
|
|
|
+ msg: '确定要解绑吗?',
|
|
|
+ beforeConfirm: async ({ resolve }) => {
|
|
|
+ await requestToast(
|
|
|
+ () =>
|
|
|
+ updateDesignerInfo({
|
|
|
+ id: designerInfo.value.id,
|
|
|
+ userId: designerInfo.value.userId,
|
|
|
+ videoNumber: '',
|
|
|
+ }),
|
|
|
+ { success: true, successTitle: '解绑成功' },
|
|
|
+ )
|
|
|
+ await setDesignerInfo()
|
|
|
+ resolve(true)
|
|
|
+ },
|
|
|
+ })
|
|
|
}
|
|
|
onLoad(async (query: { id: string }) => {
|
|
|
if (query.id) {
|
|
@@ -100,6 +125,9 @@ onLoad(async (query: { id: string }) => {
|
|
|
viewStartAt.value = new Date()
|
|
|
}
|
|
|
})
|
|
|
+onShow(async () => {
|
|
|
+ await setDesignerInfo()
|
|
|
+})
|
|
|
onUnload(async () => {
|
|
|
if (!isOwn.value) {
|
|
|
viewDuration.value = dayjs().diff(viewStartAt.value, 'seconds')
|
|
@@ -186,8 +214,18 @@ defineExpose({
|
|
|
class="bg-gradient-to-t from-[#fdf6ee] to-[#fefdfc] rounded-[10px] border border-[#fff4e6] border-solid flex items-center px-3.5 py-5 gap-3"
|
|
|
@click="handle2Video"
|
|
|
>
|
|
|
- <div class="w-[37.01px] h-[37.01px] bg-[#fa9d3b] rounded-lg">
|
|
|
- <wd-img width="100%" height="100%" :src="wechatChannels"></wd-img>
|
|
|
+ <div>
|
|
|
+ <div class="w-[37.01px] h-[37.01px] bg-[#fa9d3b] rounded-lg">
|
|
|
+ <wd-img width="100%" height="100%" :src="wechatChannels"></wd-img>
|
|
|
+ </div>
|
|
|
+ <div v-if="(designerInfo?.videoNumber ?? '') !== ''" @click.stop="handleUnbundle">
|
|
|
+ <div
|
|
|
+ class="text-[#da7e1e] text-[9px] font-normal font-['PingFang_SC'] leading-normal flex items-center"
|
|
|
+ >
|
|
|
+ 解绑
|
|
|
+ <wd-icon name="arrow-right" size="12"></wd-icon>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="flex-1">
|
|
|
<div class="text-black/90 text-sm font-normal font-['PingFang SC'] leading-normal">
|