Showing
6 changed files
with
33 additions
and
15 deletions
@@ -474,6 +474,7 @@ export const bindAction = (phoneNumb, verifyCode, areaCode, inviteCode, callback | @@ -474,6 +474,7 @@ export const bindAction = (phoneNumb, verifyCode, areaCode, inviteCode, callback | ||
474 | if (ret && ret.code === 200 && ret.data && ret.data.uid > 0) { | 474 | if (ret && ret.code === 200 && ret.data && ret.data.uid > 0) { |
475 | if (ret.data.nFlag === 'Y') { | 475 | if (ret.data.nFlag === 'Y') { |
476 | event.emit('report-new-user-created'); | 476 | event.emit('report-new-user-created'); |
477 | + event.emit('store-new-user-created'); | ||
477 | } | 478 | } |
478 | let userInfo = { | 479 | let userInfo = { |
479 | ssouid: ret.data.ssouid, | 480 | ssouid: ret.data.ssouid, |
@@ -517,6 +518,7 @@ export const bindAction = (phoneNumb, verifyCode, areaCode, inviteCode, callback | @@ -517,6 +518,7 @@ export const bindAction = (phoneNumb, verifyCode, areaCode, inviteCode, callback | ||
517 | if (ret.code === 200 && (ret.data.uid !== null) && ret.data.uid > 0 && ret.data.uid !== undefined) {//验证正确 | 518 | if (ret.code === 200 && (ret.data.uid !== null) && ret.data.uid > 0 && ret.data.uid !== undefined) {//验证正确 |
518 | if (ret.data.nFlag === 'Y') { | 519 | if (ret.data.nFlag === 'Y') { |
519 | event.emit('report-new-user-created'); | 520 | event.emit('report-new-user-created'); |
521 | + event.emit('store-new-user-created'); | ||
520 | } | 522 | } |
521 | userInfo = { | 523 | userInfo = { |
522 | ssouid: ret.data.ssouid, | 524 | ssouid: ret.data.ssouid, |
@@ -19,21 +19,18 @@ Component({ | @@ -19,21 +19,18 @@ Component({ | ||
19 | }, | 19 | }, |
20 | 20 | ||
21 | created() { | 21 | created() { |
22 | - let that = this; | ||
23 | event.one('user-login-success', () => { | 22 | event.one('user-login-success', () => { |
24 | this.triggerEvent('loginSuccess', true); | 23 | this.triggerEvent('loginSuccess', true); |
25 | - // 返回上一页 | ||
26 | - this.goReferer(); // 如果不需要绑定手机则返回前一页 | ||
27 | }); | 24 | }); |
28 | event.one('change-login-status', params => { | 25 | event.one('change-login-status', params => { |
29 | - that.setData({ | 26 | + this.setData({ |
30 | loginText: params.text || '微信登录', | 27 | loginText: params.text || '微信登录', |
31 | loginTips: params.tips || '', | 28 | loginTips: params.tips || '', |
32 | loginButtonType: params.openType || '' | 29 | loginButtonType: params.openType || '' |
33 | }); | 30 | }); |
34 | }); | 31 | }); |
35 | - event.one('user-login-callback', this.loginCallback); | ||
36 | event.one('user-get-phonenumber-error', this.getPhonenumberError); | 32 | event.one('user-get-phonenumber-error', this.getPhonenumberError); |
33 | + event.one('store-new-user-created', this.newUser.bind(this)); | ||
37 | }, | 34 | }, |
38 | 35 | ||
39 | attached() { | 36 | attached() { |
@@ -44,19 +41,19 @@ Component({ | @@ -44,19 +41,19 @@ Component({ | ||
44 | }); | 41 | }); |
45 | }, | 42 | }, |
46 | 43 | ||
44 | + detached() { | ||
45 | + event.remove('user-login-success'); | ||
46 | + event.remove('change-login-status'); | ||
47 | + event.remove('user-get-phonenumber-error'); | ||
48 | + event.remove('store-new-user-created'); | ||
49 | + }, | ||
50 | + | ||
47 | /** | 51 | /** |
48 | * 组件的方法列表 | 52 | * 组件的方法列表 |
49 | */ | 53 | */ |
50 | methods: { | 54 | methods: { |
51 | - loginCallback(res) { | ||
52 | - | ||
53 | - }, | ||
54 | - | ||
55 | - goReferer() { | ||
56 | - console.log('执行返回'); | ||
57 | - wx.navigateBack({ | ||
58 | - delta: 1 | ||
59 | - }); | 55 | + newUser() { |
56 | + this.triggerEvent('reportStoreId'); | ||
60 | }, | 57 | }, |
61 | 58 | ||
62 | getPhonenumberError(error) { | 59 | getPhonenumberError(error) { |
@@ -362,6 +362,7 @@ export const getPhoneNumber = (e) => { | @@ -362,6 +362,7 @@ export const getPhoneNumber = (e) => { | ||
362 | }).then(result => { | 362 | }).then(result => { |
363 | if(result.nFlag === 'Y') { | 363 | if(result.nFlag === 'Y') { |
364 | event.emit('report-new-user-created'); | 364 | event.emit('report-new-user-created'); |
365 | + event.emit('store-new-user-created'); | ||
365 | } | 366 | } |
366 | if (result.is_register !== undefined && result.is_register === 0) { | 367 | if (result.is_register !== undefined && result.is_register === 0) { |
367 | const newUserInfo = { | 368 | const newUserInfo = { |
@@ -59,5 +59,15 @@ export default { | @@ -59,5 +59,15 @@ export default { | ||
59 | store_id | 59 | store_id |
60 | } | 60 | } |
61 | }) | 61 | }) |
62 | + }, | ||
63 | + storeIdLoginReport(storeId, fromPage) { | ||
64 | + return api.get({ | ||
65 | + api: 'yohoApi', | ||
66 | + data: { | ||
67 | + method: 'app.passport.recordRegisterSource', | ||
68 | + storeId: storeId, | ||
69 | + fromPage: fromPage, | ||
70 | + } | ||
71 | + }) | ||
62 | } | 72 | } |
63 | } | 73 | } |
@@ -385,6 +385,11 @@ export default class ProductDetail extends Component { | @@ -385,6 +385,11 @@ export default class ProductDetail extends Component { | ||
385 | } | 385 | } |
386 | } | 386 | } |
387 | 387 | ||
388 | + reportStoreId(storeId) { | ||
389 | + console.log(storeId); | ||
390 | + productDetailModel.storeIdLoginReport(storeId, 'OfflineStore').then(ret => {}); | ||
391 | + } | ||
392 | + | ||
388 | onShareAppMessage(res) { | 393 | onShareAppMessage(res) { |
389 | console.log(res); | 394 | console.log(res); |
390 | 395 | ||
@@ -642,7 +647,7 @@ export default class ProductDetail extends Component { | @@ -642,7 +647,7 @@ export default class ProductDetail extends Component { | ||
642 | </View>) | 647 | </View>) |
643 | } | 648 | } |
644 | { | 649 | { |
645 | - !isLogin && storeId !== -1 && (<login-bg catchtouchmove='true' onLoginSuccess={this.loginSuccess}></login-bg>) | 650 | + !isLogin && storeId !== -1 && (<login-bg catchtouchmove='true' onReportStoreId={this.reportStoreId.bind(this, storeId)} onLoginSuccess={this.loginSuccess}></login-bg>) |
646 | } | 651 | } |
647 | </View> | 652 | </View> |
648 | ) | 653 | ) |
@@ -351,6 +351,7 @@ function checkVerifyCode(phoneNumb, verifyCode, areaCode, inviteCode, callbackFu | @@ -351,6 +351,7 @@ function checkVerifyCode(phoneNumb, verifyCode, areaCode, inviteCode, callbackFu | ||
351 | if (data.code === 200 && (data.data.uid !== null) && data.data.uid > 0 && data.data.uid !== undefined) {//验证正确 | 351 | if (data.code === 200 && (data.data.uid !== null) && data.data.uid > 0 && data.data.uid !== undefined) {//验证正确 |
352 | if(data.data.nFlag === 'Y') { | 352 | if(data.data.nFlag === 'Y') { |
353 | event.emit('report-new-user-created'); | 353 | event.emit('report-new-user-created'); |
354 | + event.emit('store-new-user-created'); | ||
354 | } | 355 | } |
355 | let userInfo = {} | 356 | let userInfo = {} |
356 | userInfo.ssouid = data.data.ssouid; | 357 | userInfo.ssouid = data.data.ssouid; |
@@ -458,6 +459,7 @@ function autoSignin(mobile, verifyCode, areaCode, inviteCode, callbackFunc) { | @@ -458,6 +459,7 @@ function autoSignin(mobile, verifyCode, areaCode, inviteCode, callbackFunc) { | ||
458 | 459 | ||
459 | if(data.data.nFlag === 'Y') { | 460 | if(data.data.nFlag === 'Y') { |
460 | event.emit('report-new-user-created'); | 461 | event.emit('report-new-user-created'); |
462 | + event.emit('store-new-user-created'); | ||
461 | } | 463 | } |
462 | 464 | ||
463 | let userInfo = {} | 465 | let userInfo = {} |
@@ -565,6 +567,7 @@ function BindMiniAppByAuto(mobile, countryCode, inviteCode, callbackFunc){ | @@ -565,6 +567,7 @@ function BindMiniAppByAuto(mobile, countryCode, inviteCode, callbackFunc){ | ||
565 | 567 | ||
566 | if(data.data && data.data.nFlag === 'Y') { | 568 | if(data.data && data.data.nFlag === 'Y') { |
567 | event.emit('report-new-user-created'); | 569 | event.emit('report-new-user-created'); |
570 | + event.emit('store-new-user-created'); | ||
568 | } | 571 | } |
569 | 572 | ||
570 | if (data.data.is_register !== undefined && data.data.is_register !== null && data.data.is_register === 0) { | 573 | if (data.data.is_register !== undefined && data.data.is_register !== null && data.data.is_register === 0) { |
-
Please register or login to post a comment