|
@@ -7,10 +7,23 @@
|
|
|
}
|
|
|
</route>
|
|
|
<script setup lang="ts">
|
|
|
+import { getBrokerCard } from '../../../../core/libs/requests'
|
|
|
+import { useUserStore } from '../../../../store/index'
|
|
|
+import { Canvas } from '@designer-hub/app/src/core/utils/canvas'
|
|
|
import { businessLogo, logoWhite, edit, wechatGreen } from '@/core/libs/svgs'
|
|
|
+import { phone, wechat, email, local } from '@/core/libs/pngs'
|
|
|
import { NetImages } from '@/core/libs/net-images'
|
|
|
import BottomAppBar from '@/components/bottom-app-bar.vue'
|
|
|
-
|
|
|
+const currentInstance = getCurrentInstance()
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
+const userStore = useUserStore()
|
|
|
+const { userInfo } = storeToRefs(userStore)
|
|
|
+const { data, run: setData } = useRequest(() =>
|
|
|
+ getBrokerCard({ brokerId: userInfo.value.userId!.toString() }),
|
|
|
+)
|
|
|
+const wechatShare = () =>{
|
|
|
+
|
|
|
+}
|
|
|
const submitUpload = () => {
|
|
|
console.log('submitUpload')
|
|
|
}
|
|
@@ -19,11 +32,70 @@ const toEditPage = () => {
|
|
|
url: '/pages/mine/agent/business-card/edit-card',
|
|
|
})
|
|
|
}
|
|
|
+onLoad(async () => {
|
|
|
+ await setData()
|
|
|
+ // try {
|
|
|
+ // const [bg, bLogo, logoW, icon1, icon2, icon3 ,icon4, icon5, avatar] =
|
|
|
+ // await Promise.all(
|
|
|
+ // [
|
|
|
+ // data.value.cardStyleUrl || '',
|
|
|
+ // businessLogo,
|
|
|
+ // logoWhite,
|
|
|
+ // phone,
|
|
|
+ // wechat,
|
|
|
+ // email,
|
|
|
+ // local,
|
|
|
+ // NetImages.筑巢荟,
|
|
|
+ // data.value.avatar || ''
|
|
|
+ // ].map((it) =>
|
|
|
+ // uni
|
|
|
+ // .getImageInfo({ src: it })
|
|
|
+ // .then(({ path }) => path)
|
|
|
+ // .catch(() =>
|
|
|
+ // uni
|
|
|
+ // .getImageInfo({
|
|
|
+ // src: 'https://image.zhuchaohui.com/zhucaohui/6f858f282ce597abd2dd2717264b0cdde1566c4f8d5f3baa20fb7cf4c2e11a2f.png',
|
|
|
+ // })
|
|
|
+ // .then(({ path }) => path),
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ // )
|
|
|
+ // const ctx = uni.createCanvasContext('qrcode', currentInstance)
|
|
|
+ // const { width, height } = await new Promise<any>((resolve) => {
|
|
|
+ // uni
|
|
|
+ // .createSelectorQuery()
|
|
|
+ // .in(currentInstance)
|
|
|
+ // .select('#qrcode')
|
|
|
+ // .fields({ node: true, size: true }, (res) => {
|
|
|
+ // resolve(res)
|
|
|
+ // })
|
|
|
+ // .exec()
|
|
|
+ // })
|
|
|
+ // const canvas = new Canvas(ctx, { width, height }, { width: 351 })
|
|
|
+ // canvas.FillImage(bg)
|
|
|
+ // canvas.Image(logoW, 0, 0, 13, 13)
|
|
|
+ // canvas.Image(bLogo, 10, 4, 78, 27)
|
|
|
+ // canvas.Image(icon1, 28, 69, 15, 15)
|
|
|
+ // canvas.Image(icon2, 24, 24, 56, 80)
|
|
|
+ // canvas.FillText(data.value.phone, '#ffffff', 12, 46, 80)
|
|
|
+
|
|
|
+ // canvas.CircleImage(avatar, 220, 40, 37)
|
|
|
+
|
|
|
+ // canvas.RoundRect('#F5F5F5', 26, 282, 300, 306, 20)
|
|
|
+
|
|
|
+ // ctx.draw && ctx.draw()
|
|
|
+ // } catch (e) {
|
|
|
+ // console.log(e)
|
|
|
+ // }
|
|
|
+})
|
|
|
</script>
|
|
|
<template>
|
|
|
<div class="p-[16px]">
|
|
|
<div class="h-325px relative rounded-[10px] color-[#ffffff] bg-[#f3f6ff]">
|
|
|
- <div class="h-185px p-20px relative rounded-[10px] color-[#ffffff] bg-[#2357E9]">
|
|
|
+ <div class="h-185px p-20px relative rounded-[10px] color-[#ffffff] bg-[#2357E9] overflow-hidden">
|
|
|
+ <div class="absolute w-full h-full top-0 left-0 z-0">
|
|
|
+ <wd-img :src="data.cardStyleUrl" custom-class="w-full h-full"></wd-img>
|
|
|
+ </div>
|
|
|
<wd-img
|
|
|
:src="businessLogo"
|
|
|
width="78px"
|
|
@@ -46,32 +118,32 @@ const toEditPage = () => {
|
|
|
custom-class="absolute top-[5px] left-[7px]"
|
|
|
/>
|
|
|
</div>
|
|
|
- <div class="h-65px flex justify-between items-center mb-10px">
|
|
|
+ <div class="h-65px flex justify-between items-center mb-10px relative">
|
|
|
<div class="font-size-22px fw-400">
|
|
|
- 李世东
|
|
|
- <text class="font-size-12px ml-10px">平台经纪人</text>
|
|
|
+ {{ data.name }}
|
|
|
+ <text class="font-size-12px ml-10px" v-if="data.displayInfo[1].status">{{ data.position }}</text>
|
|
|
</div>
|
|
|
- <wd-img :src="businessLogo" round width="65px" height="65px" />
|
|
|
+ <wd-img :src="data.avatar" round width="65px" height="65px" />
|
|
|
</div>
|
|
|
- <div class="flex items-center">
|
|
|
+ <div class="flex items-center relative z-10">
|
|
|
<wd-icon name="phone" size="15px" color="#ffffff" />
|
|
|
- <div class="font-size-12px ml-10px">13888888888</div>
|
|
|
+ <div class="font-size-12px ml-10px">{{ data.phone }}</div>
|
|
|
</div>
|
|
|
- <div class="flex items-center">
|
|
|
+ <div class="flex items-center relative" v-if="data.displayInfo[4].status">
|
|
|
<wd-icon name="phone" size="15px" color="#ffffff" />
|
|
|
- <div class="font-size-12px ml-10px">13888888888</div>
|
|
|
+ <div class="font-size-12px ml-10px">{{ data.weChat }}</div>
|
|
|
</div>
|
|
|
- <div class="flex items-center">
|
|
|
+ <div class="flex items-center relative" v-if="data.displayInfo[2].status">
|
|
|
<wd-icon name="phone" size="15px" color="#ffffff" />
|
|
|
- <div class="font-size-12px ml-10px">13888888888</div>
|
|
|
+ <div class="font-size-12px ml-10px">{{ data.email }}</div>
|
|
|
</div>
|
|
|
- <div class="flex items-center">
|
|
|
+ <div class="flex items-center relative" v-if="data.displayInfo[3].status">
|
|
|
<wd-icon name="phone" size="15px" color="#ffffff" />
|
|
|
- <div class="font-size-12px ml-10px">13888888888</div>
|
|
|
+ <div class="font-size-12px ml-10px">{{ data.address }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="h-75px pt-[25px] px-[12px] color-[#7F88A0] font-size-12px fw-400 lh-[19px]">
|
|
|
- 你好,我是筑巢荟平台经纪人李世东,这个是我的名片,请惠存!
|
|
|
+ <div class="h-75px pt-[25px] px-[12px] color-[#7F88A0] font-size-12px fw-400 lh-[19px]" v-if="data.displayInfo[5].status">
|
|
|
+ {{ data.personalBio }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 按钮 -->
|
|
@@ -85,6 +157,7 @@ const toEditPage = () => {
|
|
|
</div>
|
|
|
<div
|
|
|
class="inline-flex py-[10px] px-[24px] rounded-[8px] border-[1px] border-solid border-[#E2E4ED] color-[#13AC5C] lh-[24px]"
|
|
|
+ @click="wechatShare"
|
|
|
>
|
|
|
<wd-img
|
|
|
:src="wechatGreen"
|
|
@@ -109,5 +182,8 @@ const toEditPage = () => {
|
|
|
保存到本地
|
|
|
</wd-button>
|
|
|
</BottomAppBar>
|
|
|
+ <div class="w-[344px] h-[185px] fixed top-0 left-0">
|
|
|
+ <canvas class="w-full h-full" id="qrcode" canvas-id="qrcode"></canvas>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|