From 6f3e25ab64c8e9c182e3e7ea1fda01bfbe783b9c Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Wed, 26 Jun 2024 18:10:42 +0800 Subject: [PATCH] =?UTF-8?q?Feat(=E5=BA=97=E9=93=BA):=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/inn.js | 10 +++++++++- pagesInn/inn/innHome.vue | 15 ++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/api/inn.js b/api/inn.js index 83a09ad..8d5f985 100644 --- a/api/inn.js +++ b/api/inn.js @@ -219,4 +219,12 @@ export function setTopHotelNew(data) { return request.post("/api/hotelNews/setIsTop", data, { login: true }); -} \ No newline at end of file +} + +/** + * 店铺转发分享背景图片 + * @param id 店铺ID int + * */ +export function getHotelShareBackgroundImage(id) { + return request.get("/api/hotelMain/shareBackgroundImage/" + id, {}, {login: true}) +} diff --git a/pagesInn/inn/innHome.vue b/pagesInn/inn/innHome.vue index fd2cdb3..66740f5 100644 --- a/pagesInn/inn/innHome.vue +++ b/pagesInn/inn/innHome.vue @@ -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