Commit 9f67351045280603425e3bc5daf8ee670b068909
1 parent
922fa221
名字修改
Showing
2 changed files
with
25 additions
and
28 deletions
pages/user/Detailed/Detailed.js
... | ... | @@ -187,12 +187,7 @@ Page({ |
187 | 187 | var unit = th.data.screenWidth / 750 * 1.35; |
188 | 188 | var scene = getApp().globalData.user_id; |
189 | 189 | var nickname = user.nickname; |
190 | - | |
191 | - if (nickname.length>3){ | |
192 | - nickname=nickname.substr(0, 3); | |
193 | - | |
194 | - nickname = nickname+"..." | |
195 | - } | |
190 | + var nickname ="说的还是计算急急急"; | |
196 | 191 | |
197 | 192 | //---二微码--- |
198 | 193 | var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + |
... | ... | @@ -207,17 +202,18 @@ Page({ |
207 | 202 | //开启画布 |
208 | 203 | const ctx = wx.createCanvasContext('myCanvas'); |
209 | 204 | //先画背景 |
210 | - ctx.drawImage("../../../images/share/mackground.png", 0, 0, 554 * unit, 930 * unit); | |
211 | - ctx.setFontSize(26 * unit); | |
205 | + ctx.drawImage("../../../images/share/mackground.png", 0, 0, 554 * unit, 899 * unit); | |
206 | + ctx.setFontSize(24 * unit); | |
212 | 207 | ctx.setFillStyle("rgb(0,0,0)"); |
213 | - ctx.fillText(nickname, 155 * unit, 75 * unit, 200 * unit); | |
214 | - | |
208 | + ctx.fillText(nickname, 152 * unit, 76 * unit); | |
209 | + var width = 24 * nickname.length * unit + 2 * unit; | |
215 | 210 | var tj_path = "../../../images/share/q_tj.png"; |
216 | - ctx.drawImage(tj_path, 255 * unit, 50 * unit, 90 * unit, 30 * unit); | |
211 | + ctx.drawImage(tj_path, 152 * unit + width, 54 * unit, 95 * unit, 30 * unit); | |
217 | 212 | ctx.setFontSize(18 * unit); |
213 | + ctx.setLineJoin('round'); //交点设置成圆角 | |
218 | 214 | ctx.setFillStyle("rgb(255,255,255)"); |
219 | - ctx.fillText("强烈推荐", 265 * unit, 72 * unit); | |
220 | - | |
215 | + // ctx.fillText("强烈推荐", 265 * unit, 72 * unit); | |
216 | + ctx.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit); | |
221 | 217 | ctx.setStrokeStyle("rgb(255,255,255)"); |
222 | 218 | ctx.setLineDash([5 * unit, 5 * unit], 5 * unit); |
223 | 219 | ctx.beginPath(); | ... | ... |
pages/user/cardinfo/cardinfo.js
... | ... | @@ -295,13 +295,6 @@ Page({ |
295 | 295 | var privilege_o = th.data.privilege_o;//勋章图片 |
296 | 296 | var img_square=th.data.img_square; |
297 | 297 | var nickname = user.nickname; |
298 | - | |
299 | - if (nickname.length > 3) { | |
300 | - nickname = nickname.substr(0, 3); | |
301 | - | |
302 | - nickname = nickname + "..." | |
303 | - } | |
304 | - | |
305 | 298 | var app = getApp(); |
306 | 299 | var unit = th.data.screenWidth / 750 * 1.35; |
307 | 300 | var scene = getApp().globalData.user_id; |
... | ... | @@ -322,17 +315,25 @@ Page({ |
322 | 315 | const ctx = wx.createCanvasContext('myCanvas'); |
323 | 316 | |
324 | 317 | |
325 | - //先画背景 | |
326 | - ctx.drawImage("../../../images/share/mackground.png", 0, 0, 554 * unit, 930 * unit); | |
327 | - ctx.setFontSize(26 * unit); | |
318 | + //先画背景 930 | |
319 | + ctx.drawImage("../../../images/share/mackground.png", 0, 0, 554 * unit, 899 * unit); | |
320 | + ctx.setFontSize(24 * unit); | |
328 | 321 | ctx.setFillStyle("rgb(0,0,0)"); |
329 | - ctx.fillText(nickname, 155 * unit, 75 * unit, 200 * unit); | |
330 | - | |
322 | + // ctx.fillText(nickname, 152 * unit, 75 * unit, 200 * unit); | |
323 | + ctx.fillText(nickname, 152 * unit, 76 * unit); | |
324 | + | |
325 | + // var width = 24 * nickname.length * unit + 2 * unit; | |
326 | + var width = 24 * nickname.length * unit + 2 * unit; | |
327 | + console.log("强烈推荐的距离:", "nickname.length", nickname.length, "unit", unit, "width", width); | |
331 | 328 | var tj_path = "../../../images/share/q_tj.png"; |
332 | - ctx.drawImage(tj_path, 255 * unit, 50 * unit, 90 * unit, 30 * unit); | |
329 | + // ctx.drawImage(tj_path, 255 * unit + width, 50 * unit, 90 * unit, 30 * unit); | |
330 | + ctx.drawImage(tj_path, 152 * unit + width, 54 * unit, 95 * unit, 30 * unit); | |
331 | + | |
333 | 332 | ctx.setFontSize(18 * unit); |
334 | - ctx.setFillStyle("rgb(255,255,255)"); | |
335 | - ctx.fillText("强烈推荐", 265 * unit, 72 * unit); | |
333 | + ctx.setLineJoin('round'); //交点设置成圆角 | |
334 | + ctx.setFillStyle("white"); | |
335 | + ctx.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit); | |
336 | + // ctx.fillText("强烈推荐", 265 * unit + width, 72 * unit); | |
336 | 337 | |
337 | 338 | ctx.setStrokeStyle("rgb(255,255,255)"); |
338 | 339 | ctx.setLineDash([5 * unit, 5 * unit], 5 * unit); | ... | ... |