Keep sharing images in the users subpackage

This commit is contained in:
Glore Zeng 2026-11-02 18:26:41 +08:00
parent 190db7446d
commit 77cb04964a
6 changed files with 7 additions and 7 deletions

View File

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -42,11 +42,11 @@ import {service} from '../../config'
import {sharingPath, renderSharingPoster, renderSharingCover, saveSharingPoster, storeSharingCode} from '../../utils/sharing'
wepy.page({
mixins:[https],
data:{loading:true,error:'',total:0,verified:0,remaining:7,invitees:[],page:0,hasMore:false,listLoading:false,listError:false,profile:{id:0,nickname:'',qrcode:''},poster:'',cover:'',posterError:'',generating:false,saving:false,canApply:false,checkingEligibility:false,eligibilityError:false,showApplication:false,savingContact:false,contactImage:'/images/ambassador-contact.jpg'},
data:{loading:true,error:'',total:0,verified:0,remaining:7,invitees:[],page:0,hasMore:false,listLoading:false,listError:false,profile:{id:0,nickname:'',qrcode:''},poster:'',cover:'',posterError:'',generating:false,saving:false,canApply:false,checkingEligibility:false,eligibilityError:false,showApplication:false,savingContact:false,contactImage:'/pages/users/assets/ambassador-contact.jpg'},
onLoad() { this.load() },
onShow() { if (!this.loading && !this.error) this.refreshEligibility() },
onShareAppMessage() {
return {title:'邀请你加入福恋,上福恋认真找对象',path:this.profile.id ? sharingPath(this.profile.id,false) : '/pages/tabBar/welcome',imageUrl:this.cover || '/images/fulian-logo.png'}
return {title:'邀请你加入福恋,上福恋认真找对象',path:this.profile.id ? sharingPath(this.profile.id,false) : '/pages/tabBar/welcome',imageUrl:this.cover || '/pages/users/assets/fulian-logo.png'}
},
methods:{
setOverview(data) {

View File

@ -8,7 +8,7 @@
<block v-else>
<image v-if="poster" class="sharing-poster" src="{{poster}}" mode="widthFix" @tap="preview"></image>
<view v-else class="sharing-preview">
<image class="sharing-logo" src="/images/fulian-logo.png" mode="aspectFit"></image>
<image class="sharing-logo" src="/pages/users/assets/fulian-logo.png" mode="aspectFit"></image>
<image v-if="profile.photo" class="sharing-photo" src="{{profile.photo}}" mode="aspectFill"></image>
<view class="sharing-title">{{profile.nickname}}</view><view>{{profile.details}}</view>
<view class="sharing-intro">{{profile.introduction}}</view>
@ -31,7 +31,7 @@ wepy.page({
onLoad() { this.load() },
onShareAppMessage() {
if (!this.profile.id) return {title:'上福恋认真找对象',path:'/pages/tabBar/welcome'}
return {title:`我是${this.profile.nickname},期待与你相识`,path:sharingPath(this.profile.id,true),imageUrl:this.cover || this.profile.photo || '/images/fulian-logo.png'}
return {title:`我是${this.profile.nickname},期待与你相识`,path:sharingPath(this.profile.id,true),imageUrl:this.cover || this.profile.photo || '/pages/users/assets/fulian-logo.png'}
},
methods:{
async load() {

View File

@ -43,7 +43,7 @@ function textLines(ctx, text, x, y, width, lineHeight, maxLines) {
export async function renderSharingPoster(page, profile, personal) {
if (!profile.qrcode) throw new Error('分享码暂未准备好,请稍后重试')
const sources = ['/images/fulian-logo.png', profile.qrcode]
const sources = ['/pages/users/assets/fulian-logo.png', profile.qrcode]
if (personal && profile.photo) sources.push(profile.photo)
const images = await Promise.all(sources.map(imageInfo))
const ctx = wx.createCanvasContext('fulianPoster', page.$wx)
@ -95,7 +95,7 @@ export function saveSharingPoster(filePath) {
}
export async function renderSharingCover(page, profile, personal) {
const logo=await imageInfo('/images/fulian-logo.png')
const logo=await imageInfo('/pages/users/assets/fulian-logo.png')
const photo=personal && profile.photo ? await imageInfo(profile.photo) : null
const ctx=wx.createCanvasContext('fulianPoster',page.$wx)
ctx.setFillStyle('#FFF9F5'); ctx.fillRect(0,0,750,600)

View File

@ -6,7 +6,7 @@ module.exports = {
wpyExt: '.wpy',
// eslint: true,
cliLogs: !prod,
static: ['./src/images'],
static: ['./src/images', './src/pages/users/assets'],
build: {},
resolve: {
alias: {