Authored by QC-L

添加上报接口

... ... @@ -474,6 +474,7 @@ export const bindAction = (phoneNumb, verifyCode, areaCode, inviteCode, callback
if (ret && ret.code === 200 && ret.data && ret.data.uid > 0) {
if (ret.data.nFlag === 'Y') {
event.emit('report-new-user-created');
event.emit('store-new-user-created');
}
let userInfo = {
ssouid: ret.data.ssouid,
... ... @@ -517,6 +518,7 @@ export const bindAction = (phoneNumb, verifyCode, areaCode, inviteCode, callback
if (ret.code === 200 && (ret.data.uid !== null) && ret.data.uid > 0 && ret.data.uid !== undefined) {//验证正确
if (ret.data.nFlag === 'Y') {
event.emit('report-new-user-created');
event.emit('store-new-user-created');
}
userInfo = {
ssouid: ret.data.ssouid,
... ...
... ... @@ -19,21 +19,18 @@ Component({
},
created() {
let that = this;
event.one('user-login-success', () => {
this.triggerEvent('loginSuccess', true);
// 返回上一页
this.goReferer(); // 如果不需要绑定手机则返回前一页
});
event.one('change-login-status', params => {
that.setData({
this.setData({
loginText: params.text || '微信登录',
loginTips: params.tips || '',
loginButtonType: params.openType || ''
});
});
event.one('user-login-callback', this.loginCallback);
event.one('user-get-phonenumber-error', this.getPhonenumberError);
event.one('store-new-user-created', this.newUser.bind(this));
},
attached() {
... ... @@ -44,19 +41,19 @@ Component({
});
},
detached() {
event.remove('user-login-success');
event.remove('change-login-status');
event.remove('user-get-phonenumber-error');
event.remove('store-new-user-created');
},
/**
* 组件的方法列表
*/
methods: {
loginCallback(res) {
},
goReferer() {
console.log('执行返回');
wx.navigateBack({
delta: 1
});
newUser() {
this.triggerEvent('reportStoreId');
},
getPhonenumberError(error) {
... ...
... ... @@ -362,6 +362,7 @@ export const getPhoneNumber = (e) => {
}).then(result => {
if(result.nFlag === 'Y') {
event.emit('report-new-user-created');
event.emit('store-new-user-created');
}
if (result.is_register !== undefined && result.is_register === 0) {
const newUserInfo = {
... ...
... ... @@ -59,5 +59,15 @@ export default {
store_id
}
})
},
storeIdLoginReport(storeId, fromPage) {
return api.get({
api: 'yohoApi',
data: {
method: 'app.passport.recordRegisterSource',
storeId: storeId,
fromPage: fromPage,
}
})
}
}
\ No newline at end of file
... ...
... ... @@ -385,6 +385,11 @@ export default class ProductDetail extends Component {
}
}
reportStoreId(storeId) {
console.log(storeId);
productDetailModel.storeIdLoginReport(storeId, 'OfflineStore').then(ret => {});
}
onShareAppMessage(res) {
console.log(res);
... ... @@ -642,7 +647,7 @@ export default class ProductDetail extends Component {
</View>)
}
{
!isLogin && storeId !== -1 && (<login-bg catchtouchmove='true' onLoginSuccess={this.loginSuccess}></login-bg>)
!isLogin && storeId !== -1 && (<login-bg catchtouchmove='true' onReportStoreId={this.reportStoreId.bind(this, storeId)} onLoginSuccess={this.loginSuccess}></login-bg>)
}
</View>
)
... ...
... ... @@ -351,6 +351,7 @@ function checkVerifyCode(phoneNumb, verifyCode, areaCode, inviteCode, callbackFu
if (data.code === 200 && (data.data.uid !== null) && data.data.uid > 0 && data.data.uid !== undefined) {//验证正确
if(data.data.nFlag === 'Y') {
event.emit('report-new-user-created');
event.emit('store-new-user-created');
}
let userInfo = {}
userInfo.ssouid = data.data.ssouid;
... ... @@ -458,6 +459,7 @@ function autoSignin(mobile, verifyCode, areaCode, inviteCode, callbackFunc) {
if(data.data.nFlag === 'Y') {
event.emit('report-new-user-created');
event.emit('store-new-user-created');
}
let userInfo = {}
... ... @@ -565,6 +567,7 @@ function BindMiniAppByAuto(mobile, countryCode, inviteCode, callbackFunc){
if(data.data && data.data.nFlag === 'Y') {
event.emit('report-new-user-created');
event.emit('store-new-user-created');
}
if (data.data.is_register !== undefined && data.data.is_register !== null && data.data.is_register === 0) {
... ...