77cbd926 by simon

默认提交

1 parent 0be20de2
...@@ -2,7 +2,7 @@ let ENV_CONFIG = require('./env/index'); ...@@ -2,7 +2,7 @@ let ENV_CONFIG = require('./env/index');
2 2
3 const APPID = '' 3 const APPID = ''
4 /** ====每次发布版本记得修改此环境配置==== */ 4 /** ====每次发布版本记得修改此环境配置==== */
5 const ENV = 'Prod'; // Dev Prod 5 const ENV = 'Dev'; // Dev Prod
6 const NET_CONFIG = ENV_CONFIG[ENV]; 6 const NET_CONFIG = ENV_CONFIG[ENV];
7 const MOCKAPI = ENV_CONFIG.mockApi; 7 const MOCKAPI = ENV_CONFIG.mockApi;
8 8
......
...@@ -60,13 +60,24 @@ Page({ ...@@ -60,13 +60,24 @@ Page({
60 60
61 // 获取海报数据 61 // 获取海报数据
62 getPosterConfig() { 62 getPosterConfig() {
63 let qrCodeWid = 340; 63 let qrCodeWid = 300;
64 let avatarWid = 56; 64 let avatarSpace = 5;
65 let avatarWidBlock = 300 * 0.3;
66 let avatarWid = avatarWidBlock - (avatarSpace * 2);
67 let qrTop = 360;
65 // 合成图片需要的数据 68 // 合成图片需要的数据
66 let { 69 let {
67 userInfo 70 userInfo
68 } = this.data; 71 } = this.data;
69 let blocks = [] 72 let blocks = [{
73 x: (690 - avatarWidBlock) * .5,
74 y: qrTop + (qrCodeWid * .5) - (avatarWidBlock * .5),
75 width: avatarWidBlock,
76 height: avatarWidBlock,
77 backgroundColor: "#ffffff",
78 borderRadius: 10,
79 zIndex: 21,
80 }]
70 let images = [ 81 let images = [
71 // 背景图 82 // 背景图
72 { 83 {
...@@ -79,7 +90,7 @@ Page({ ...@@ -79,7 +90,7 @@ Page({
79 // 二维码 90 // 二维码
80 { 91 {
81 x: (690 - qrCodeWid) * .5, 92 x: (690 - qrCodeWid) * .5,
82 y: 340, 93 y: qrTop,
83 width: qrCodeWid, 94 width: qrCodeWid,
84 height: qrCodeWid, 95 height: qrCodeWid,
85 zIndex: 11, 96 zIndex: 11,
...@@ -88,28 +99,29 @@ Page({ ...@@ -88,28 +99,29 @@ Page({
88 // 头像 99 // 头像
89 { 100 {
90 x: (690 - avatarWid) * .5, 101 x: (690 - avatarWid) * .5,
91 y: 480, 102 y: qrTop + (qrCodeWid * .5),
103 y: qrTop + ((qrCodeWid - avatarWidBlock) * .5) + avatarSpace,
92 width: avatarWid, 104 width: avatarWid,
93 height: avatarWid, 105 height: avatarWid,
94 borderRadius: 12, 106 borderRadius: 12,
95 zIndex: 11, 107 zIndex: 22,
96 url: userInfo.avatar, 108 url: userInfo.avatar,
97 } 109 }
98 ]; 110 ];
99 let lines = []; 111 let lines = [];
100 let texts = [{ 112 let texts = [{
101 x: 690 / 2, 113 x: 690 / 2,
102 y: 686, 114 y: 700,
103 width: 690, 115 width: 688,
104 fontSize: 24, 116 fontSize: 26,
105 color: "#333333", 117 color: "#000000",
106 textAlign: "center", 118 textAlign: "center",
107 zIndex: 11, 119 zIndex: 11,
108 text: userInfo.nickname, 120 text: userInfo.nickname,
109 }, 121 },
110 { 122 {
111 x: 690 / 2, 123 x: 690 / 2,
112 y: 720, 124 y: 732,
113 width: 690, 125 width: 690,
114 fontSize: 18, 126 fontSize: 18,
115 color: "#666666", 127 color: "#666666",
......