Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mini-program-wepy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
mini-program-wepy
Commits
0dbacc8c
Commit
0dbacc8c
authored
Jul 17, 2020
by
zhijie.xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抽奖页面图片展示居中
parent
7e2b5a6a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
27 deletions
+17
-27
index.wpy
src/pages/index.wpy
+15
-25
raffle.wpy
src/pages/raffle.wpy
+2
-2
No files found.
src/pages/index.wpy
View file @
0dbacc8c
...
...
@@ -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>
...
...
src/pages/raffle.wpy
View file @
0dbacc8c
...
...
@@ -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');
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment