|
@@ -12,6 +12,7 @@
|
|
|
import { ref, computed } from 'vue'
|
|
|
import { userStore } from '@/store/user'
|
|
|
import { onLoad } from '@dcloudio/uni-app'
|
|
|
+import { getUserAvatar } from '@/utils/avatar'
|
|
|
|
|
|
const useUserStore = userStore()
|
|
|
const baseInfo = computed(() => useUserStore?.baseInfo)
|
|
@@ -76,7 +77,8 @@ const createPoster = async () => {
|
|
|
context.drawImage(bgUrl, 0, 0, 330, 600) // 路径、x、y、宽、高
|
|
|
|
|
|
// 头像
|
|
|
- const { path } = await getImageTempRatio(baseInfo.value.avatar)
|
|
|
+ const avatarUrl = getUserAvatar(baseInfo.value?.avatar, baseInfo.value?.sex)
|
|
|
+ const { path } = await getImageTempRatio(avatarUrl)
|
|
|
drawAvatar(context, path, 124, 22, 40.5) // canvas、图片路径、x、y、半径
|
|
|
|
|
|
//分享二维码
|