fix:分享图根据靶纸尺寸动态切换
This commit is contained in:
@@ -263,19 +263,18 @@ const shareTitle = computed(() => {
|
||||
});
|
||||
|
||||
/**
|
||||
* 根据对战类型动态返回分享封面图路径
|
||||
* battleType === 2(多人乱斗)→ melee_share.jpg
|
||||
* 其余(好友约战 / 组队对战)→ contest_share.jpg
|
||||
* 根据对战类型和靶纸尺寸动态返回分享封面图路径,共 4 张图:
|
||||
* contest_share_20.jpg — 约战/对抗赛 + 20cm 靶
|
||||
* contest_share_40.jpg — 约战/对抗赛 + 40cm 靶
|
||||
* melee_share_20.jpg — 多人乱斗 + 20cm 靶
|
||||
* melee_share_40.jpg — 多人乱斗 + 40cm 靶
|
||||
*
|
||||
* 网络图片:
|
||||
* https://static.shelingxingqiu.com/shootmini/static/share/melee_share.jpg
|
||||
* https://static.shelingxingqiu.com/shootmini/static/share/contest_share.jpg
|
||||
* 当 targetSize 未知时默认取 20cm 图。
|
||||
*/
|
||||
const shareImage = computed(() => {
|
||||
if (room.value.battleType === 2) {
|
||||
return 'https://static.shelingxingqiu.com/shootmini/static/share/melee_share.jpg';
|
||||
}
|
||||
return 'https://static.shelingxingqiu.com/shootmini/static/share/contest_share.jpg';
|
||||
const type = room.value.battleType === 2 ? 'melee' : 'contest';
|
||||
const size = targetSize.value === 40 ? '40' : '20';
|
||||
return `https://static.shelingxingqiu.com/shootmini/static/share/${type}_share_${size}.jpg`;
|
||||
});
|
||||
|
||||
onShareAppMessage(() => {
|
||||
|
||||
Reference in New Issue
Block a user