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

This commit is contained in:
lifizer
2024-06-28 14:20:43 +08:00
parent 6f3e25ab64
commit f02a7c5514
2 changed files with 14 additions and 12 deletions
+1 -1
View File
@@ -226,5 +226,5 @@ export function setTopHotelNew(data) {
* @param id 店铺ID int
* */
export function getHotelShareBackgroundImage(id) {
return request.get("/api/hotelMain/shareBackgroundImage/" + id, {}, {login: true})
return request.get("/api/hotelMain/shareImage/" + id, {}, {login: true})
}
+13 -11
View File
@@ -473,7 +473,8 @@ export default {
],
isLoadGoodListoSuccess: false,
isLoadInfoListSuccess: false,
pageKeyId: ''
pageKeyId: '',
shareImg: ''
}
},
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
@@ -538,19 +539,20 @@ export default {
this.picColumnWidth = (e.screenWidth - uni.upx2px(92)) / 2 + 'px'
}
})
},
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
})
getHotelShareBackgroundImage(this.id).then(res => {
const { success, data } = res
if (success) {
this.shareImg = data
}
})
},
onShareAppMessage() {
return {
title: this.inn.name,
path: '/pagesInn/inn/innHome?id=' + this.inn.id,
imageUrl: this.shareImg
}
},
onShow() {
if (!this.isLoad) {
return