update
This commit is contained in:
@@ -191,7 +191,7 @@ const generateImage = async (options) => {
|
|||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
const mergeFetch = async (index)=> {
|
const mergeFetch = async (index)=> {
|
||||||
const statusRes = await Request(`face/merge/${mergeData.merge_id}/status`, {}, 'GET', false)
|
const statusRes = await Request(`face/merge/${mergeData.merge_id}/status`, {}, 'GET', true)
|
||||||
|
|
||||||
if (statusRes.res.status === 200) {
|
if (statusRes.res.status === 200) {
|
||||||
if (statusRes.json.status === 'success') {
|
if (statusRes.json.status === 'success') {
|
||||||
@@ -334,6 +334,7 @@ const imagePosition = (index) => {
|
|||||||
|
|
||||||
// 自定义上传方法
|
// 自定义上传方法
|
||||||
const customUpload = async (options) => {
|
const customUpload = async (options) => {
|
||||||
|
const loading = weui.loading()
|
||||||
const { file, data, onProgress, onSuccess, onError } = options
|
const { file, data, onProgress, onSuccess, onError } = options
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -350,13 +351,16 @@ const customUpload = async (options) => {
|
|||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
console.log('Success:', data);
|
loading.hide();
|
||||||
onSuccess(data);
|
console.log('Success:', data);
|
||||||
|
onSuccess(data);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Error:', error);
|
loading.hide();
|
||||||
|
console.error('Error:', error);
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
loading.hide();
|
||||||
onError(error)
|
onError(error)
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,8 +193,8 @@ const handleHaibao = async () => {
|
|||||||
|
|
||||||
const haibaoSave = new Haibao(1080, 2160)
|
const haibaoSave = new Haibao(1080, 2160)
|
||||||
const qrcode = await generateQR(`fromid=${infos.invite_code}&merge_id=${infos.merge_id}`, 200, 200)
|
const qrcode = await generateQR(`fromid=${infos.invite_code}&merge_id=${infos.merge_id}`, 200, 200)
|
||||||
haibaoSave.add(url, 62, 350)
|
|
||||||
haibaoSave.add(bg, 0, 0)
|
haibaoSave.add(bg, 0, 0)
|
||||||
|
haibaoSave.add(url, 64, 250)
|
||||||
haibaoSave.add(qrcode, 115, 1875)
|
haibaoSave.add(qrcode, 115, 1875)
|
||||||
haibaoSave.draw().then(() => {
|
haibaoSave.draw().then(() => {
|
||||||
haibaoSave.text(infos.nickname, haibaoSave.canvas.width / 2, 200, { font: 'bold 50px Arial', color: '#ffee6f' })
|
haibaoSave.text(infos.nickname, haibaoSave.canvas.width / 2, 200, { font: 'bold 50px Arial', color: '#ffee6f' })
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ const handleHaibao = async () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
const userPicture = await loadImage(globalStore.result_url)
|
const userPicture = await loadImage(globalStore.result_url)
|
||||||
haibaoCover.add(userPicture, 0, 0)
|
haibaoCover.add(userPicture, 0, 50, 951, 1698)
|
||||||
haibaoCover.add(mask, 10, 100)
|
haibaoCover.add(mask, 10, 100)
|
||||||
haibaoCover.add(haibaoCoverBorder, 0, 0)
|
haibaoCover.add(haibaoCoverBorder, 0, 0)
|
||||||
haibaoCover.draw('destination-in').then(() => {
|
haibaoCover.draw('destination-in').then(() => {
|
||||||
@@ -79,8 +79,8 @@ const handleHaibao = async () => {
|
|||||||
|
|
||||||
const haibaoSave = new Haibao(1080, 2160)
|
const haibaoSave = new Haibao(1080, 2160)
|
||||||
const qrcode = await generateQR(`fromid=${infos.invite_code}&merge_id=${infos.merge_id}`, 200, 200)
|
const qrcode = await generateQR(`fromid=${infos.invite_code}&merge_id=${infos.merge_id}`, 200, 200)
|
||||||
haibaoSave.add(url, 62, 350)
|
|
||||||
haibaoSave.add(bg, 0, 0)
|
haibaoSave.add(bg, 0, 0)
|
||||||
|
haibaoSave.add(url, 64, 250)
|
||||||
haibaoSave.add(qrcode, 115, 1875)
|
haibaoSave.add(qrcode, 115, 1875)
|
||||||
haibaoSave.draw().then(() => {
|
haibaoSave.draw().then(() => {
|
||||||
haibaoSave.text(infos.nickname, haibaoSave.canvas.width / 2, 200, { font: 'bold 50px Arial', color: '#ffee6f' })
|
haibaoSave.text(infos.nickname, haibaoSave.canvas.width / 2, 200, { font: 'bold 50px Arial', color: '#ffee6f' })
|
||||||
|
|||||||
@@ -114,17 +114,40 @@ const openQiwei = (e) => {
|
|||||||
|
|
||||||
qiweiShow.value = true
|
qiweiShow.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const openHaibao = (e) => {
|
const openHaibao = (e) => {
|
||||||
const target = e.currentTarget
|
const target = e.currentTarget
|
||||||
|
|
||||||
if (target.classList.contains("has")) {
|
if (target.classList.contains("has")) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const url = new URL('https://huodong2.lzlj.com/api/faceFamily/face/square');
|
||||||
|
url.searchParams.append('my_only', '1');
|
||||||
|
url.searchParams.append('page', '1');
|
||||||
|
url.searchParams.append('per_page', '100');
|
||||||
if (!globalStore.result_url) {
|
if (!globalStore.result_url) {
|
||||||
return weui.alert("请先参与活动合成图片并打榜!")
|
fetch(url.toString(), {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${Storage.get("userinfos").api_token}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const foundItem = data.data.find(item => item.is_public === true);
|
||||||
|
if (foundItem) {
|
||||||
|
globalStore.result_url = foundItem.result_url;
|
||||||
|
haibaoShow.value = true
|
||||||
|
handleHaibao()
|
||||||
|
} else {
|
||||||
|
return weui.alert("请先参与活动合成图片并打榜!")
|
||||||
|
}
|
||||||
|
return { success: true, data };
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error:', error);
|
||||||
|
return { success: false, error };
|
||||||
|
});
|
||||||
}
|
}
|
||||||
haibaoShow.value = true
|
|
||||||
handleHaibao()
|
|
||||||
}
|
}
|
||||||
const openPeifang = (e) => {
|
const openPeifang = (e) => {
|
||||||
const target = e.currentTarget
|
const target = e.currentTarget
|
||||||
|
|||||||
Reference in New Issue
Block a user