Commit 0dbacc8c authored by zhijie.xue's avatar zhijie.xue

抽奖页面图片展示居中

parent 7e2b5a6a
......@@ -356,7 +356,6 @@
},
getAwards: function() {
console.log(444);
const { id, photoUrl, name, chance } = this.awardsInfo;
if ((!id && id !== 0) || !this.mainInfo || !this.mainInfo.account) {
Notify({ message: '服务器异常,请稍后重试', safeAreaInsetTop: true });
......@@ -494,11 +493,25 @@
},
showInfo() {
this.isShowIntroduce = true;
},
onShareTimeline: function(res) {
return {
title: '又中奖了! 人品爆啊',
query: ''
};
},
onShareAppMessage: function(res) {
const openid = wx.getStorageSync('openId');
return {
title: `${(this.$wepy.userInfo && this.$wepy.userInfo.nickName) || '您的好朋友'}邀请您来抽奖啦~`,
path: `/pages/index?openid=${openid}&prizeId=${this.$wepy.awardsInfo.id}`,
// todo: 图片大小减少了50%,但仍然偏大
imageUrl: decodeURIComponent(this.$wepy.awardsInfo.photoUrl) + '?imageMogr2/auto-orient/thumbnail/500x800!/gravity/Center/crop/x500/blur/1x0/quality/75'
};
}
},
async onLoad (query) {
const {scene} = wx.getLaunchOptionsSync();
console.log(33, scene);
if (scene === 1154) {
this.showInfo();
return;
......@@ -546,7 +559,6 @@
},
async onShow() {
const {scene} = wx.getLaunchOptionsSync();
console.log(34, scene);
if (scene === 1154) {
return;
}
......@@ -561,28 +573,6 @@
wx.removeStorageSync('userJoin');
this.showActivity();
}
},
onShareTimeline: function(res) {
return {
title: '又中奖了! 人品爆啊',
query: ''
};
},
onShareAppMessage: function(res) {
const openid = wx.getStorageSync('openId');
return {
title: `${(this.userInfo && this.userInfo.nickName) || '您的好朋友'}邀请您来抽奖啦~`,
path: `/pages/index?openid=${openid}&prizeId=${this.awardsInfo.id}`,
// todo: 图片大小减少了50%,但仍然偏大
imageUrl: decodeURIComponent(this.awardsInfo.photoUrl) + '?imageMogr2/auto-orient/thumbnail/500x800!/gravity/Center/crop/x500/blur/1x0/quality/75'
};
}
}, {
lifecycle: {
page: () => {
return ['onShareTimeline'];
}
}
});
</script>
......
......@@ -211,7 +211,7 @@
<template>
<view class="raffle-wrapper">
<view class="raffle-content">
<van-image use-loading-slot src="{{photoUrl}}" class="img" width="610rpx" height="610rpx" radius="10rpx" fit="cover">
<van-image use-loading-slot src="{{photoUrl}}" class="img" width="610rpx" height="610rpx" radius="10rpx" fit="widthFix">
<van-loading slot="loading" type="spinner" size="20" vertical />
</van-image>
<view class="goodsinfo">
......@@ -436,7 +436,7 @@
this.quantity = quantity || '';
this.name = name;
this.chance = chance;
this.photoUrl = decodeURIComponent(photoUrl);
this.photoUrl = decodeURIComponent(photoUrl) + '?imageMogr2/auto-orient/thumbnail/500x/gravity/Center/crop/x600/blur/1x0/quality/75';
this.hasPhone = wx.getStorageSync('hasPhone');
innerActivity = wx.getStorageSync('innerActivity');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment