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 * @param id 店铺ID int
* */ * */
export function getHotelShareBackgroundImage(id) { 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, isLoadGoodListoSuccess: false,
isLoadInfoListSuccess: false, isLoadInfoListSuccess: false,
pageKeyId: '' pageKeyId: '',
shareImg: ''
} }
}, },
// 必须在页面加 onPageScroll(e){} ,才能滑动显示背景 // 必须在页面加 onPageScroll(e){} ,才能滑动显示背景
@@ -538,19 +539,20 @@ export default {
this.picColumnWidth = (e.screenWidth - uni.upx2px(92)) / 2 + 'px' this.picColumnWidth = (e.screenWidth - uni.upx2px(92)) / 2 + 'px'
} }
}) })
}, getHotelShareBackgroundImage(this.id).then(res => {
onShareAppMessage() { const { success, data } = res
return new Promise(async (resolve, reject) => { if (success) {
const result = getHotelShareBackgroundImage(this.id) this.shareImg = data
if (result.status === 200) {
resolve({
title: this.inn.name,
path: '/pagesInn/inn/innHome?id=' + this.inn.id,
imageUrl: result.data
})
} }
}) })
}, },
onShareAppMessage() {
return {
title: this.inn.name,
path: '/pagesInn/inn/innHome?id=' + this.inn.id,
imageUrl: this.shareImg
}
},
onShow() { onShow() {
if (!this.isLoad) { if (!this.isLoad) {
return return