Authored by 李奇
Committed by 李奇

yas上报、公共参数设定

... ... @@ -128,7 +128,7 @@ class App extends Component {
}
this.props.globalData.systemInfo = systemInfo;
this.props.globalData.sid = sid;
this.props.globalData.sid = sid;
this.props.globalData.ch = options.scene;
systemInfo.screenHeight = !systemInfo.screenHeight ? systemInfo.windowHeight : systemInfo.screenHeight;
... ... @@ -152,7 +152,6 @@ class App extends Component {
Taro.setStorage({ key: 'unionid', data: '' });
Taro.setStorage({ key: 'user_union_type', data: '' });
}
console.log(result);
}).catch(error => {
console.log(error);
});
... ... @@ -243,7 +242,6 @@ class App extends Component {
});
}
}
console.log(result);
}).catch(error => {
let userInfo = Taro.getStorageSync('userInfo');
if (userInfo && userInfo.uid && userInfo.session_key) {
... ...
... ... @@ -83,8 +83,8 @@ export const decodeUnionId = (srd_session, result) => {
// 网络上传头像,union_id,昵称
login.sendWeChatUserDataWithUnionId(data.union_id, nickName, avatarUrl).catch(error => {
});
return {
union_id: union_id,
return {
union_id: union_id,
userInfo: res.userInfo
};
});
... ... @@ -185,7 +185,7 @@ const getStorageWithValueForKey = (key) => {
wx.getStorage({
key: key,
success: function(res) {
},
})
}
... ... @@ -222,7 +222,7 @@ export const getUserInfo = (e) => {
const fromPage = e.currentTarget.dataset.from;
if (e.detail.errMsg === 'getUserInfo:ok') {
loginAction((error, loginData) => {
if (error) {
if (error) {
event.emit(checkEventName(USER_GET_PHONENUMBER_ERROR, fromPage), error.message);
return;
}
... ... @@ -414,4 +414,4 @@ const getStorageUserInfo = () => {
export const getCountryArea = () => {
return login.getCountryArea();
}
\ No newline at end of file
}
... ...
... ... @@ -263,7 +263,6 @@ const _reportData = async (reportType, pt, pn, param, appObject) => {
device,
sid: sid
}
console.log(report_params);
return report_params
};
... ...
... ... @@ -2,7 +2,6 @@ import api from '../utils/api';
export default {
resource(code) {
console.log(code);
return api.get({
url: '/resources',
data: {
... ...
... ... @@ -68,7 +68,6 @@ export default class Index extends Component {
async getResource() {
const pk = await getPrivateKey();
Taro.setStorage({ key: 'verifyKey', data: pk });
console.log(contentCode.index);
return commonModel.resource(contentCode.index).then(res => {
if (res && res.code === 200) {
this.setState({
... ...
... ... @@ -80,7 +80,7 @@ export default class Login extends Component {
addPrefix(prefix, eventName) {
return `${prefix}-${eventName}`;
}
eventOnAll() {
const prefix = 'phonenumber';
event.on(this.addPrefix(prefix, USER_GET_PHONENUMBER_ERROR), (errMsg) => {
... ... @@ -131,7 +131,7 @@ export default class Login extends Component {
}
})
}
chooseCountry() {
router.go('selectCountry');
}
... ... @@ -235,7 +235,7 @@ export default class Login extends Component {
elem.dataVal = dataVal;
this.setState({graphicsCodeElement});
}
async bindBtnAction() {
let {phoneNum, verifyCode} = this.state;
... ... @@ -258,7 +258,7 @@ export default class Login extends Component {
return;
}
let result = await this.props.bindAction(this.state.phoneNum, this.state.verifyCode, this.state.countryArea, this.state.inviteCode);
if (result && result.message) {
... ... @@ -339,7 +339,6 @@ export default class Login extends Component {
render () {
let { tipText, verifyBtnText, countryArea, graphicsCodeElement, graphicsCodeSwitch, graphicsCodeUrl, hasUnionID, is_bind } = this.state;
let showBind = wx.getStorageSync('show_bind');
console.log(hasUnionID);
return (
<View className="login-page">
... ... @@ -349,7 +348,7 @@ export default class Login extends Component {
<View className="phonenum-container">
<View onClick={this.chooseCountry} className="country-area">
<Text className="phone-title" >{`+${countryArea}`}</Text>
<Image className="arrow-down-icon" src={arrowDown}></Image>
<Image className="arrow-down-icon" src={arrowDown}></Image>
</View>
<Input
className="phoneNumberContent"
... ... @@ -390,12 +389,12 @@ export default class Login extends Component {
</View>
</View>
}
<Button onClick={this.bindBtnAction} className={disabledClass ? 'bind-btn disabled' : 'bind-btn'} >完成</Button>
<Button
className="verify-btn"
openType={hasUnionID ? ( showBind ? 'getPhoneNumber' : '') :'getUserInfo'}
onGetPhoneNumber={this.getPhoneNumber}
<Button
className="verify-btn"
openType={hasUnionID ? ( showBind ? 'getPhoneNumber' : '') :'getUserInfo'}
onGetPhoneNumber={this.getPhoneNumber}
onGetUserInfo={this.getUserInfo}
onClick={this.checkUnionIdIsBind}
data-from="phonenumber">自动验证</Button>
... ...
... ... @@ -43,15 +43,11 @@ export default class yas {
uploadData(params) {
let sid = '';
let globalData = getGlobalData();
if (this.app && this.app.globalData) {
sid = globalData.sid || '';
}
// 开发环境不上报
if (this.devEnv) {
return console.log(params);
}
return Taro.request({
url: config.domains.yasHost,
data: { _mlogs: JSON.stringify(params) },
... ... @@ -117,24 +113,28 @@ export default class yas {
}
},
complete() {
self.app.globalData = self.app.globalData || {};
let ch = self.app.globalData.ch || '';
let uid = self.app.globalData.userInfo && self.app.globalData.userInfo.uid || '';
// ch = self.app.getUnion_type() || ch;
self.deviceInfo.ch = ch;
return resolve(self.uploadData({
status: statusInfo,
device: self.deviceInfo,
events: [{
param: userInfo,
ts: new Date().getTime(),
op: event,
uid: uid,
sid: self.app.globalData.sid || ''
}]
}));
let globalData = getGlobalData();
let userData = globalData.userInfo || {};
if (!Object.keys(userData).length) {
userData = Taro.getStorageSync('userInfo') || {};
}
let ch = globalData.ch || '';
let uid = userData.uid || '';
self.deviceInfo.ch = ch;
return resolve(self.uploadData({
status: statusInfo,
device: self.deviceInfo,
events: [{
param: userInfo,
ts: new Date().getTime(),
op: event,
uid: uid,
sid: globalData.sid || ''
}]
}));
}
});
});
... ...