Feat(店铺):分享功能对接

This commit is contained in:
lifizer
2024-06-26 18:10:42 +08:00
parent 28ffaee0ce
commit 6f3e25ab64
2 changed files with 23 additions and 2 deletions
+8
View File
@@ -220,3 +220,11 @@ export function setTopHotelNew(data) {
login: true
});
}
/**
* 店铺转发分享背景图片
* @param id 店铺ID int
* */
export function getHotelShareBackgroundImage(id) {
return request.get("/api/hotelMain/shareBackgroundImage/" + id, {}, {login: true})
}
+14 -1
View File
@@ -421,7 +421,8 @@ import {
getHotelGoodList,
postHotelNewsDel,
setTopHotelNew,
getHotelNewsZan
getHotelNewsZan,
getHotelShareBackgroundImage
} from "@/api/inn.js"
import {formatDateTime} from "@/utils"
import {getUrlParam} from "@/utils/common.js"
@@ -538,6 +539,18 @@ export default {
}
})
},
onShareAppMessage() {
return new Promise(async (resolve, reject) => {
const result = getHotelShareBackgroundImage(this.id)
if (result.status === 200) {
resolve({
title: this.inn.name,
path: '/pagesInn/inn/innHome?id=' + this.inn.id,
imageUrl: result.data
})
}
})
},
onShow() {
if (!this.isLoad) {
return