diff --git a/src/images/ambassador-contact.jpg b/src/pages/users/assets/ambassador-contact.jpg similarity index 100% rename from src/images/ambassador-contact.jpg rename to src/pages/users/assets/ambassador-contact.jpg diff --git a/src/images/fulian-logo.png b/src/pages/users/assets/fulian-logo.png similarity index 100% rename from src/images/fulian-logo.png rename to src/pages/users/assets/fulian-logo.png diff --git a/src/pages/users/myShare.wpy b/src/pages/users/myShare.wpy index a27c9e0..7624599 100644 --- a/src/pages/users/myShare.wpy +++ b/src/pages/users/myShare.wpy @@ -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) { diff --git a/src/pages/users/shareCard.wpy b/src/pages/users/shareCard.wpy index 56151b9..a3177b8 100644 --- a/src/pages/users/shareCard.wpy +++ b/src/pages/users/shareCard.wpy @@ -8,7 +8,7 @@ - + {{profile.details}} @@ -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() { diff --git a/src/utils/sharing.js b/src/utils/sharing.js index 2ac2c3f..a0d5845 100644 --- a/src/utils/sharing.js +++ b/src/utils/sharing.js @@ -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) diff --git a/wepy.config.js b/wepy.config.js index 42437a7..82701ac 100644 --- a/wepy.config.js +++ b/wepy.config.js @@ -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: {