Showing
6 changed files
with
60 additions
and
2 deletions
@@ -150,3 +150,12 @@ exports.inviteUserInfo = (req, res, next) => { | @@ -150,3 +150,12 @@ exports.inviteUserInfo = (req, res, next) => { | ||
150 | res.json(result); | 150 | res.json(result); |
151 | }).catch(next); | 151 | }).catch(next); |
152 | }; | 152 | }; |
153 | + | ||
154 | +// 刷新二维码 | ||
155 | +exports.reloadQrcode = (req, res, next) => { | ||
156 | + let uid = req.user.uid; | ||
157 | + | ||
158 | + req.ctx(expandModel).reloadQrcode(uid).then(result => { | ||
159 | + res.json(result); | ||
160 | + }).catch(next); | ||
161 | +}; |
@@ -194,4 +194,21 @@ module.exports = class extends global.yoho.BaseModel { | @@ -194,4 +194,21 @@ module.exports = class extends global.yoho.BaseModel { | ||
194 | return friendInviteData; | 194 | return friendInviteData; |
195 | }); | 195 | }); |
196 | } | 196 | } |
197 | + | ||
198 | + reloadQrcode(uid) { | ||
199 | + return api.get('', { | ||
200 | + method: 'app.invitecode.my', | ||
201 | + uid: uid | ||
202 | + }, { | ||
203 | + code: 200 | ||
204 | + }).then((result) => { | ||
205 | + | ||
206 | + if (result && result.code === 200 && result.data) { | ||
207 | + | ||
208 | + return result.data; | ||
209 | + } else { | ||
210 | + return {}; | ||
211 | + } | ||
212 | + }); | ||
213 | + } | ||
197 | }; | 214 | }; |
@@ -281,6 +281,7 @@ router.get('/friend-invite', expand.friendInvite); // 拓展新客 好友邀请 | @@ -281,6 +281,7 @@ router.get('/friend-invite', expand.friendInvite); // 拓展新客 好友邀请 | ||
281 | router.get('/invite-reg', expand.inviteReg); // 注册成功页 | 281 | router.get('/invite-reg', expand.inviteReg); // 注册成功页 |
282 | router.get('/set-trend-world', expand.setTrendWord); // 设置潮流口令 | 282 | router.get('/set-trend-world', expand.setTrendWord); // 设置潮流口令 |
283 | router.get('/invite-uesr-info', expand.inviteUserInfo); // 根据邀请码获取个人信息 | 283 | router.get('/invite-uesr-info', expand.inviteUserInfo); // 根据邀请码获取个人信息 |
284 | +router.get('/reload-qrcode', expand.reloadQrcode); // 根据邀请码获取个人信息 | ||
284 | 285 | ||
285 | router.get('/free-mail/index', auth, freeMail.freeMailIndex); // 免邮券主页 | 286 | router.get('/free-mail/index', auth, freeMail.freeMailIndex); // 免邮券主页 |
286 | router.get('/free-mail/list', auth, freeMail.freeMailList); // 免邮券列表页 | 287 | router.get('/free-mail/list', auth, freeMail.freeMailList); // 免邮券列表页 |
@@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
7 | </div> | 7 | </div> |
8 | <div class="title">方法一:扫描二维码</div> | 8 | <div class="title">方法一:扫描二维码</div> |
9 | <div class="code-outer"> | 9 | <div class="code-outer"> |
10 | + <div class="qrcode-avatar"{{#if headIcon}} style="background-image:url({{image2 headIcon mode=2 h=100 w=100 q=90}})"{{/if}}></div> | ||
10 | <div class="code-qr" qr-data="{{qrcodeUrl}}"></div> | 11 | <div class="code-qr" qr-data="{{qrcodeUrl}}"></div> |
11 | </div> | 12 | </div> |
12 | <div class="reload-c"> | 13 | <div class="reload-c"> |
@@ -18,7 +18,7 @@ require('common/share')(shareData); | @@ -18,7 +18,7 @@ require('common/share')(shareData); | ||
18 | require('common/set-trend-world'); | 18 | require('common/set-trend-world'); |
19 | 19 | ||
20 | // 生成二维码 | 20 | // 生成二维码 |
21 | -setTimeout(function() { | 21 | +function generateCode() { |
22 | let text = $('.code-qr').attr('qr-data'), | 22 | let text = $('.code-qr').attr('qr-data'), |
23 | width = $('.code-qr').css('width'); | 23 | width = $('.code-qr').css('width'); |
24 | 24 | ||
@@ -29,7 +29,7 @@ setTimeout(function() { | @@ -29,7 +29,7 @@ setTimeout(function() { | ||
29 | ecLevel: 'L', // 纠错级别 | 29 | ecLevel: 'L', // 纠错级别 |
30 | background: '#fff' | 30 | background: '#fff' |
31 | }); | 31 | }); |
32 | -}, 0); | 32 | +} |
33 | 33 | ||
34 | // 分享弹框 | 34 | // 分享弹框 |
35 | $('.share').click(function() { | 35 | $('.share').click(function() { |
@@ -55,6 +55,19 @@ $('.modify').click(function() { | @@ -55,6 +55,19 @@ $('.modify').click(function() { | ||
55 | $('.set-trend-world').show(); | 55 | $('.set-trend-world').show(); |
56 | }); | 56 | }); |
57 | 57 | ||
58 | +$('.reload-c').click(function() { | ||
59 | + $.ajax({ | ||
60 | + type: 'get', | ||
61 | + url: '//m.yohobuy.com/activity/reload-qrcode', | ||
62 | + }).then(function(data) { | ||
63 | + | ||
64 | + $('.code-qr').attr('qr-data', data.qrcodeUrl); | ||
65 | + $('.code-qr').find('img').remove(); | ||
66 | + | ||
67 | + generateCode(); | ||
68 | + }); | ||
69 | +}); | ||
70 | + | ||
58 | (function() { | 71 | (function() { |
59 | if (!$('.set-trend-world').hasClass('trend-world')) { | 72 | if (!$('.set-trend-world').hasClass('trend-world')) { |
60 | if (!window.cookie('promotion-trend-pop') || parseInt(window.cookie('promotion-trend-pop'), 10) !== 1) { | 73 | if (!window.cookie('promotion-trend-pop') || parseInt(window.cookie('promotion-trend-pop'), 10) !== 1) { |
@@ -65,4 +78,6 @@ $('.modify').click(function() { | @@ -65,4 +78,6 @@ $('.modify').click(function() { | ||
65 | }, 1000); | 78 | }, 1000); |
66 | } | 79 | } |
67 | } | 80 | } |
81 | + | ||
82 | + generateCode(); | ||
68 | }()); | 83 | }()); |
@@ -51,6 +51,21 @@ | @@ -51,6 +51,21 @@ | ||
51 | height: 180px; | 51 | height: 180px; |
52 | } | 52 | } |
53 | 53 | ||
54 | + .qrcode-avatar { | ||
55 | + width: 58px; | ||
56 | + height: 58px; | ||
57 | + position: absolute; | ||
58 | + top: 50%; | ||
59 | + left: 50%; | ||
60 | + margin-top: 44px; | ||
61 | + margin-left: -20px; | ||
62 | + background-position: center center; | ||
63 | + background-size: contain; | ||
64 | + border-radius: 50%; | ||
65 | + overflow: hidden; | ||
66 | + border: solid 2px #fff; | ||
67 | + } | ||
68 | + | ||
54 | .title { | 69 | .title { |
55 | color: #fff; | 70 | color: #fff; |
56 | } | 71 | } |
-
Please register or login to post a comment