生成海报提交和详情修改右上角操作栏

This commit is contained in:
DESKTOP-RQ919RC\Pc 2025-04-15 19:00:55 +08:00
parent 3f8653b337
commit 626155a820
12 changed files with 613 additions and 304 deletions

View File

@ -181,7 +181,7 @@ Page({
// if (that.data.data.isquarantine) title = this.data.listTab.quarantineLists + '-' + that.data.data.title
const data = this.data.data
let title = "";
if (data.sharetitle) title = '香港租房 | ' + data.sharetitle
else title = '香港租房 | ' + data.title
@ -211,7 +211,6 @@ Page({
},
get_content: function () {
console.log("get_content");
let that = this;
var sendData = Object.assign({}, this.data.options, {
session: wx.getStorageSync('session'),
@ -221,7 +220,6 @@ Page({
// q: that.data.q
})
console.log("sendData", sendData);
let url = `${app.globalData.baseURL}/tenement/v2/api/apartment/details`
// url = app.globalData.config.studentapartment.details
miucms.wxget(url, sendData).then(data => {
@ -326,7 +324,6 @@ Page({
},
drawPoster() {
const user = app.globalData.user
const data = this.data.data
const roomList = this.data.roomList || []
let title = `${ roomList.length > 1 ? '多房型' : '' }`
@ -334,8 +331,7 @@ Page({
const price = Math.min(...roomList.map(item => item.price));
title += ` HK$${ price }`
const bj = data.attachment?.[0] || data.videos?.[0]?.thumbnail || data.attachment?.[0]
return
const bj = data.image
miucms.generatePoster({
bj,
title,
@ -344,7 +340,6 @@ Page({
this.setData({
shareImage: res
})
console.log("shareImage", this.data.shareImage);
})
},
@ -641,7 +636,6 @@ Page({
})
let attachment = [...targetData['videos'], ...targetData['images']]
console.log("attachment", attachment);
// wx.previewMedia({
// sources: attachment,
// current

View File

@ -801,6 +801,7 @@ map .clickmap {
.tab-box .tab-item {
height: 48rpx;
line-height: 48rpx;
padding: 0 16rpx;
color: #447eb3;
background: linear-gradient(-55.8297720355872deg, rgba(224, 240, 255, 1) 0%, rgba(98, 177, 255, 1) 297%);
@ -1264,4 +1265,14 @@ map .clickmap {
.bottom-bar .bottom-bar-share::after {
border: none;
height: 0;
}
.shareImage {
width: 280px;
height: 224px;
}
.aspectFill {
width: 280px;
height: 219px;
}

View File

@ -1,10 +1,10 @@
<import src="../common/common.wxml" />
<import src="../../wxParse/wxParse.wxml" />
<view class="container newContainer" wx:if="{{ !isloding }}">
<header-nav bgcolor="{{ operationsTop ? '#fff' : 'transparent' }}">公寓详情</header-nav>
<header-nav bgcolor="{{ operationsTop ? '#fff' : 'transparent' }}" operationsTop="{{ operationsTop }}" newHeadOperate="{{ true }}" showTab='apartment'></header-nav>
<view class="bj"></view>
<view class="content">
<!-- <image wx:if="{{ shareImage }}" class="shareImage" src="{{ shareImage }}" mode="widthFix"></image> -->
<image class="arc" src="/img/arc-shadow.png"></image>
<view class="media-module">
<head-swiper attachment="{{ attachment }}" bindplay="playVideo" bindclose="closeVideo" pages="apartmentDetail"></head-swiper>
@ -172,11 +172,11 @@
<!-- <report uniqid="{{ data.uniqid }}" bindtoReport="toReport" types="apartment"></report> -->
<cover-view class="around-school-alert" data-show="0" hidden="{{ showSchool }}">
<cover-view class="around-school-alert" data-show="0" hidden="{{ !showSchool }}">
<cover-view class="inner">
<cover-view class="title">
<cover-view class="text">房源距离学校</cover-view>
<!-- <cover-image src="/img/.png" class="close" bindtap="showSchoolAlert" data-show="0"></cover-image> -->
<cover-image src="/img/right-close.png" class="close" bindtap="showSchoolAlert" data-show="0"></cover-image>
</cover-view>
<cover-view class="list">
<cover-view class="item" wx:for="{{ data.pointData }}" wx:key="index">

View File

@ -2007,6 +2007,7 @@ map .clickmap {
}
.tab-box .tab-item {
height: 48rpx;
line-height: 48rpx;
padding: 0 16rpx;
color: #447eb3;
background: linear-gradient(-55.82977204deg, #e0f0ff 0%, #62b1ff 297%);
@ -2404,3 +2405,11 @@ map .clickmap {
border: none;
height: 0;
}
.shareImage {
width: 280px;
height: 224px;
}
.aspectFill {
width: 280px;
height: 219px;
}

View File

@ -112,6 +112,7 @@ Page({
specialSchoolDistance: null, // 特殊的 用户带有school参数 则需要特殊显示 学校距离
isShowVideo: true, // 是否显示 视频
showTab: "",
},
to_share() {
wx.navigateTo({
@ -236,8 +237,7 @@ Page({
// let title = `中国香港 > ${ info.locationList[0].head } > ${ info.locationList[0].end }`
// if (info.address) title += ' > ' + info.address
let title = that.data.info.subject
let title = '香港租房 | ' + that.data.info.subject
let imageUrl = ""
if (info['intermediary'] == 6) title = "香港租房 | 共5000+实时香港房源,甄选优质学生公寓"
else imageUrl = that.data.info.share_img
@ -314,7 +314,12 @@ Page({
updatetime = updatetime.replaceAll("-", "/") // 替换格式 部分 iOS 系统不支持
data.info['updatetimeText'] = miucms.getTimeAgo(updatetime)
let showTab = "person"
if (data.info.intermediary == 1) showTab = "agent"
if (data.info.intermediary == 6) showTab = "need"
that.setData({
showTab,
contactValue,
irentCouponBig: app.globalData.irentCouponBig || true,
info: data.info,
@ -362,8 +367,11 @@ Page({
this.handleDetailData()
if (data.info.intermediary != 6) this.drawPoster()
if (data.info.intermediary != 6) {
// setInterval(() => {
this.drawPoster()
// }, 1000);
}
// 判断是否需要获取附近房源
if (data.info.latitude && data.info.verified == 0 && data.info.intermediary != 6 && data.isintermediary != 1) this.getNearbListings()
else this.nearbListingsState = true // 阻止上拉底部加载的
@ -383,43 +391,28 @@ Page({
},
drawPoster() {
console.log("444");
let obj = {}
const info = this.data.info
console.log("intermediary", info.intermediary);
const image = info.picturegroup || []
const isintermediary = this.data.isintermediary || 0 // 是否是认证中介
console.log("isintermediary", isintermediary);
let title = `${ info.gptype }·${ info.type }·HK$${ info.rent }`
obj['bj'] = image?.[0]?.thumbnail || ''
obj['bj'] = info.image || image?.[0]?.thumbnail || ''
obj['title'] = title
// console.log("image", image);
if (isintermediary == 1) { // 认证中介
obj['type'] = 2
} else if (info.intermediary == 1) { // 普通中介
obj['type'] = 3
} else if (info.intermediary == 3 && info.verified == 0) { // 普通个人房源
obj['type'] = 4
} else if (info.intermediary == 3 && info.verified == 1) { // 认证个人房源
obj['type'] = 5
} else if (info.intermediary == 4) { // 招室友
obj['type'] = 6
} else if (info.intermediary == 5) { // 其他
obj['type'] = 7
}
if (isintermediary == 1) obj['type'] = 2 // 认证中介
else if (info.intermediary == 1) obj['type'] = 3 // 普通中介
else if (info.intermediary == 3 && info.verified == 0) obj['type'] = 4 // 普通个人房源
else if (info.intermediary == 3 && info.verified == 1) obj['type'] = 5 // 认证个人房源
else if (info.intermediary == 4) obj['type'] = 6 // 招室友
else if (info.intermediary == 5) obj['type'] = 7 // 其他
console.log("obj", obj);
let res = null
if (obj['bj']) res = miucms.generatePoster(obj)
else {
console.log(5555);
obj['position'] = `香港 > ${ info.locationList[0].head } > ${ info.locationList[0].end }`
obj['typeText'] = `${ info.gptype } · ${ info.type }`
obj['price'] = info.rent
res = miucms.generatePosterNoImage(obj)
}
console.log("res", res);
res.then(res => {
this.setData({
shareImage: res
@ -442,11 +435,8 @@ Page({
// 专门梳理v4出现的 语音包 及 不同房源值的处理
handleDetailData() {
let langs = this.data.langs || {}
if (Object.keys(langs).length == 0) {
setTimeout(() => {
this.handleDetailData()
}, 300)
} else {
if (Object.keys(langs).length == 0) setTimeout(() => this.handleDetailData(), 300)
else {
let info = this.data.info
// 判断是否是求房源的区间 面积 和 价格

View File

@ -21,7 +21,9 @@
<go-login bindislogin="islogin"></go-login>
</block>
<header-nav inner-text="Some text" bgcolor="{{ operationsTop ? '#fff' : 'transparent' }}">房源详情</header-nav>
<!-- <header-nav inner-text="Some text" bgcolor="{{ operationsTop ? '#fff' : 'transparent' }}">房源详情</header-nav> -->
<header-nav inner-text="Some text" bgcolor="{{ operationsTop ? '#fff' : 'transparent' }}" newHeadOperate="{{ true }}" showTab='{{ showTab }}'></header-nav>
<view class="bj">
<image class="bj-left" mode="widthFix" src="/img/show-head-left.svg"></image>
<image class="bj-right" mode="widthFix" src="/img/show-head-right.svg"></image>

View File

@ -22,6 +22,11 @@ Component({
headerSrc: String, // 首页的右上角图标
backSrc: String, // 特殊的返回图标
borderBottom: Boolean,
showTab: String, // 需要显示的 列表按钮
newHeadOperate: Boolean, // 是否是 新的 二级页面 顶部 返回按钮
operationsTop: Boolean, // 是否 滚动了 不需要顶部颜色
},
/**
@ -36,6 +41,12 @@ Component({
},
isTabPage: false,
openDate: {}, // 开屏广告数据
showTabObj: {
person: "房源列表",
agent: "房源列表",
apartment: "公寓列表",
need: "求房源列表",
},
},
lifetimes: {
attached: function () {
@ -122,6 +133,25 @@ Component({
// 跳转发布系统消息页面
goIsMessage() {
this.triggerEvent("goIsMessage")
}
},
// 头部 跳转 中转
skipTransfer(e) {
const key = e.currentTarget.dataset.key
const pages = getCurrentPages();
if (key == 'back' && pages.length > 1) {
wx.navigateBack()
return
}
let url = ''
if (key == 'index' || key == 'back') url = '/pages/index/index'
if (key == 'person') url = '/pages/personList/personList'
if (key == 'agent') url = '/pages/agentList/agentList'
if (key == 'apartment') url = '/pages/brandApartmentList/brandApartmentList'
if (key == 'need') url = '/pages/needHousing/needHousing'
wx.navigateTo({
url,
})
},
}
})

File diff suppressed because one or more lines are too long

View File

@ -1,54 +1,69 @@
<!--template/headerNav/index.wxml-->
<view>
<view wx:if="{{ !isNoNeedHolder }}" class="NavBar-holder" style="height:{{screen_data.totalTopHeight}}px"></view>
<view class="NavBar" style="height:{{screen_data.totalTopHeight}}px;background: {{ bgcolor }};position:{{ position }};border-bottom: {{ borderBottom ? '1rpx solid #ebebeb' : '' }};">
<view class="NavBar-statusBar" style="height:{{screen_data.statusBarHeight}}px"></view>
<view class="NavBar-titlebar" style="height:{{screen_data.titleBarHeight}}px">
<view class="NavBar-content">
<view class='NavBar-left NavBar-left-more' style="width:{{screen_data.titleWidth}}px" wx:if="{{ isIndexPage=='isIndexPage' }}">
<navigator url='../search/search' class='Btn search-btn' hover-class='hover' style='top:{{ screen_data.statusBarHeight }}px'>
<image class='searchbtn' src="../../img/searchbtn-3.png" />
</navigator>
<navigator url='../user/user' hover-class='hover' class='Btn'>
<image class="NavBar-HomeIcon user" hover-class='hover' src="../../img/userblack.png"></image>
</navigator>
</view>
<view class="NavBar-left NavBar-left-more" style="width:{{screen_data.titleWidth}}px;width:{{!notShowIndex && haveSearch ? 108 :88}}px;flex: {{ topImage ? 1 : 'none' }};">
<block wx:if="{{ topImage }}">
<image class="top-image" mode="widthFix" src="/img/{{ headerSrc }}"></image>
</block>
<block wx:if="{{ !isIndexPage }}">
<view bindtap="navigategoBack" class='Btn'>
<image class="NavBar-BackIcon" src="{{ backSrc || '/img/Back.svg'}}"></image>
</view>
<view bindtap="backHome" wx:if="{{ !notShowIndex }}" class='Btn'>
<image class="NavBar-HomeIcon backToHome" mode="widthFix" src="/img/area-icon.png"></image>
</view>
<navigator url='../search/search' class='Btn search-btn' hover-class='hover' wx:if="{{ haveSearch }}">
<image class='searchbtn' mode="widthFix" src="../../img/searchicon.png" />
</navigator>
</block>
<view wx:if="{{ !isNoNeedHolder }}" class="NavBar-holder" style="height:{{screen_data.totalTopHeight}}px"></view>
<view class="NavBar" style="height:{{screen_data.totalTopHeight}}px;background: {{ bgcolor }};position:{{ position }};border-bottom: {{ borderBottom ? '1rpx solid #ebebeb' : '' }};">
<view class="NavBar-statusBar" style="height:{{screen_data.statusBarHeight}}px"></view>
<view class="NavBar-titlebar" style="height:{{screen_data.titleBarHeight}}px">
<view class="NavBar-content">
<view class='NavBar-left NavBar-left-more' style="width:{{screen_data.titleWidth}}px" wx:if="{{ isIndexPage=='isIndexPage' }}">
<navigator url='../search/search' class='Btn search-btn' hover-class='hover' style='top:{{ screen_data.statusBarHeight }}px'>
<image class='searchbtn' src="../../img/searchbtn-3.png" />
</navigator>
<navigator url='../user/user' hover-class='hover' class='Btn'>
<image class="NavBar-HomeIcon user" hover-class='hover' src="../../img/userblack.png"></image>
</navigator>
</view>
<view class="NavBar-left NavBar-left-more" style="width:{{!notShowIndex && haveSearch ? 108 :88}}px;flex: {{ topImage || newHeadOperate ? 1 : 'none' }};">
<block wx:if="{{ topImage }}">
<image class="top-image" mode="widthFix" src="/img/{{ headerSrc }}"></image>
</block>
<block wx:if="{{ newHeadOperate }}">
<view class="left-operate-box">
<view class="left-operate-item" bind:tap="skipTransfer" data-key="back">
<image class="left-operate-icon" src="https://app.gter.net/image/miniApp/HKRenting/arrow-return.svg" mode="widthFix"></image>
返回
</view>
<view class="left-operate-item" bind:tap="skipTransfer" data-key="index">
<image class="left-operate-icon" src="https://app.gter.net/image/miniApp/HKRenting/home-page.png" mode="widthFix"></image>
首页
</view>
<view wx:if="{{ showTab }}" class="left-operate-item" bind:tap="skipTransfer" data-key="{{ showTab }}">
<image class="left-operate-icon" src="https://app.gter.net/image/miniApp/HKRenting/offer-top.png" mode="widthFix"></image>
{{ showTabObj[showTab]}}
</view>
</view>
</block>
<block wx:elif="{{ !isIndexPage }}">
<view bindtap="navigategoBack" class='Btn'>
<image class="NavBar-BackIcon" src="{{ backSrc || '/img/Back.svg'}}"></image>
</view>
<view bindtap="backHome" wx:if="{{ !notShowIndex }}" class='Btn'>
<image class="NavBar-HomeIcon backToHome" mode="widthFix" src="/img/area-icon.png"></image>
</view>
<navigator url='../search/search' class='Btn search-btn' hover-class='hover' wx:if="{{ haveSearch }}">
<image class='searchbtn' mode="widthFix" src="../../img/searchicon.png" />
</navigator>
</block>
<block wx:if="{{ isMessageCount }}">
<view class="message" bindtap="goMessageCenter">
<view class="message-count"></view>
<view class="red-dot" wx:if="{{ unreadMessages > 0 }}">{{ unreadMessages }}</view>
</view>
</block>
<block wx:if="{{ isMessageCount }}">
<view class="message" bindtap="goMessageCenter">
<view class="message-count"></view>
<view class="red-dot" wx:if="{{ unreadMessages > 0 }}">{{ unreadMessages }}</view>
</view>
</block>
<block wx:if="{{ isMessage }}">
<view class="isMessage" bindtap="goIsMessage">
<image src="/img/u1395.svg" mode="widthFix"></image>
<block wx:if="{{ isMessage }}">
<view class="isMessage" bindtap="goIsMessage">
<image src="/img/u1395.svg" mode="widthFix"></image>
</view>
</block>
</view>
<view wx:if="{{ !newHeadOperate }}" class="NavBar-content-title" style="padding-left:{{!notShowIndex && haveSearch ? 0 :11}}px">
<slot></slot>
</view>
</view>
</block>
<view class="capsule-holder"></view>
</view>
<view class="NavBar-content-title" style="padding-left:{{!notShowIndex && haveSearch ? 0 :11}}px">
<slot></slot>
</view>
</view>
<view class="capsule-holder"></view>
</view>
</view>
<open-ad openDate="{{ openDate }}"></open-ad>
<open-ad openDate="{{ openDate }}"></open-ad>
</view>

File diff suppressed because one or more lines are too long

View File

@ -16,9 +16,7 @@ Component({
},
options: {
type: Object,
observer(res) {
console.log("res,options", res);
}
observer(res) {}
},
istype: Number,
},

View File

@ -5,8 +5,8 @@ function initial(self) {
const fs = wx.getFileSystemManager();
console.log("getCurrentDate", getCurrentDate());
fs.mkdir({
// dirPath: `${wx.env.USER_DATA_PATH}/${getCurrentDate()}`,
dirPath: `${wx.env.USER_DATA_PATH}/2025-04-13`,
dirPath: `${wx.env.USER_DATA_PATH}/${getCurrentDate()}`,
// dirPath: `${wx.env.USER_DATA_PATH}/2025-04-13`,
success(res) {
console.log("res", res);
},
@ -706,7 +706,6 @@ function backOrIndex() {
// 生成海报 type 1: 公寓 2认证中介 3: 普通中介 4个人房东 5认证个人房源 6招室友 7其他
function generatePoster(target) {
return
return new Promise(async (resolve, reject) => {
const user = getApp().globalData.user || {};
// 修改画布创建方式
@ -715,6 +714,7 @@ function generatePoster(target) {
width: 280 * 2, // 增加分辨率
height: 224 * 2, // 增加分辨率
});
// target.bj = "https://oss.x-php.com/Zvt57TuJSUvkyhw-xG7Y2l-c-p4scXnqqsgFptxhT66QUmybYLYnAVBJQe2HpJNYt7VMACPX-Rzv5EQpu30SjsUfxT00NDI5";
const ctx = canvas.getContext("2d");
ctx.scale(2, 2); // 缩放绘图上下文
const tempFilePath = await downloadPic(target.bj);
@ -770,7 +770,7 @@ function generatePoster(target) {
// 源图片裁剪:取中间宽度区域
srcWidth = bgImg.height * containerRatio;
srcX = (bgImg.width - srcWidth) / 2;
srcX = (bgImg.width - drawHeight) / 2;
} else {
// 图片更高时,按容器宽度缩放
drawWidth = 280;
@ -779,13 +779,17 @@ function generatePoster(target) {
// 源图片裁剪:取中间高度区域
srcHeight = bgImg.width / containerRatio;
srcY = (bgImg.height - srcHeight) / 2;
srcY = (bgImg.height - drawWidth) / 2;
}
console.log("srcWidth", srcWidth, "srcHeight", srcHeight, "bgImg.width", bgImg.width, "drawWidth", drawWidth, "drawHeight", drawHeight, "srcX", srcX, "srcY", srcY);
// 修改后的drawImage调用
ctx.drawImage(
bgImg,
srcX,
// srcX,
// 源图像裁剪区域
imageRatio > containerRatio ? (bgImg.width - srcWidth) / 2 : srcX, // 修正水平居中计算
srcY,
srcWidth, // 改为计算后的裁剪宽度
srcHeight, // 改为计算后的裁剪高度
@ -897,7 +901,7 @@ function generatePoster(target) {
ctx.closePath();
ctx.fill();
console.log("用户名好了");
console.log("用户名好了", user.avatar);
// 绘制头像
let avatarImg = canvas.createImage();
await new Promise((resolve) => {
@ -935,28 +939,30 @@ function generatePoster(target) {
ctx.arcTo(0, 224, 0, 190, 15);
ctx.closePath();
ctx.fill();
console.log("绘制位置图标");
console.log("绘制位置图标11");
// 绘制位置图标
let positionIcon = canvas.createImage();
await new Promise((resolve) => {
positionIcon.onload = resolve;
positionIcon.src = `https://app.gter.net/image/miniApp/HKRenting/position-icon.svg?${Date.now()}`;
positionIcon.src = `https://app.gter.net/image/miniApp/HKRenting/position-icon.png?${Date.now()}`;
});
ctx.drawImage(positionIcon, 9, 200, 10, 14);
console.log("绘制位置图标完成");
// 绘制位置文本
ctx.fillStyle = "#fff";
ctx.font = "15px microsoft yahei";
ctx.fillText(`香港 | ${target.title}`, 25, 212);
console.log("开始绘制箭头图标");
// 绘制箭头图标
let arrowIcon = canvas.createImage();
await new Promise((resolve) => {
arrowIcon.onload = resolve;
arrowIcon.src = `https://app.gter.net/image/miniApp/HKRenting/arrow-round-yellow.svg?${Date.now()}`;
arrowIcon.src = `https://app.gter.net/image/miniApp/HKRenting/arrow-round-yellow.png?${Date.now()}`;
});
ctx.drawImage(arrowIcon, 255, 200, 16, 16);
console.log("绘制箭头图标");
console.log("绘制箭头图标完成");
// 修改最后保存图片的尺寸
const imgData = canvas.toDataURL({
@ -967,27 +973,69 @@ function generatePoster(target) {
});
const filePath = `${wx.env.USER_DATA_PATH}/${getCurrentDate()}/poster_share_${Date.now()}.png`;
console.log("filePath", filePath);
const fs = wx.getFileSystemManager();
console.log("开始保存");
let writeFileSum = 0; // 写入次数
const writeFile = () => {
writeFileSum++;
console.log("writeFileSum:", writeFileSum);
if (writeFileSum > 10) return;
fs.writeFile({
filePath,
data: imgData.replace(/^data:image\/\w+;base64,/, ""),
encoding: "base64",
success: (res) => {
console.log("生成成功", res);
fs.close();
resolve(filePath);
},
fail: (err) => {
console.log("err", err);
// 此处可能存在内存满了的情况
if (err?.errMsg?.indexOf("file storage limit is exceeded") != -1) {
fs.readdir({
dirPath: `${wx.env.USER_DATA_PATH}/${getCurrentDate()}`,
success: (res) => {
// 过滤并排序文件
const files = res.files
.filter((f) => f.startsWith("poster_share_") && f.endsWith(".png"))
.map((f) => ({
name: f,
timestamp: parseInt(f.match(/poster_share_(\d+)\.png/)[1]), // 提取时间戳
}))
.sort((a, b) => a.timestamp - b.timestamp); // 按时间戳升序排列
fs.writeFile({
filePath,
data: imgData.replace(/^data:image\/\w+;base64,/, ""),
encoding: "base64",
success: (res) => {
console.log("生成成功",res);
resolve(filePath);
},
fail: (err) => {
// 此处可能存在内存满了的情况
// 需要根据具体需求处理
console.log(err);
},
});
// 计算需要删除的数量取前50%
const deleteCount = Math.ceil(files.length / 2);
const toDelete = files.slice(0, deleteCount);
// 批量删除旧文件
toDelete.forEach((file) => {
fs.unlink({
filePath: `${wx.env.USER_DATA_PATH}/${getCurrentDate()}/${file.name}`,
success: () => console.log("已清理文件:", file.name),
fail: (e) => console.log("文件清理失败:", file.name, e),
});
});
// 重试写入
setTimeout(() => writeFile(), 1000);
},
});
}
if (err?.errMsg?.indexOf("fail no such file or directory") != -1) {
fs.mkdir({
dirPath: `${wx.env.USER_DATA_PATH}/${getCurrentDate()}`,
complete: (res) => writeFile(),
});
}
},
});
};
writeFile();
cleanupOldDateFolders();
fs.close();
});
}
@ -1098,7 +1146,6 @@ function generatePosterNoImage(target) {
});
const filePath = `${wx.env.USER_DATA_PATH}/${getCurrentDate()}/poster_share_${Date.now()}.png`;
console.log("filePath", filePath);
wx.getFileSystemManager().writeFile({
filePath,
data: imgData.split(",")[1],
@ -1114,7 +1161,7 @@ function generatePosterNoImage(target) {
// 下载图片
function downloadPic(src) {
return new Promise(async (resolve, reject) => {
console.log(src);
console.log("开始下载海报");
wx.getImageInfo({
src,
success(res) {
@ -1131,7 +1178,6 @@ function downloadPic(src) {
function cleanupOldDateFolders() {
const fs = wx.getFileSystemManager();
const currentDate = getCurrentDate();
fs.readdir({
dirPath: wx.env.USER_DATA_PATH,
success(res) {