Authored by lea guo

Merge branch 'develop' of git.yoho.cn:fe/xianyu-ufo-app-web into develop

... ... @@ -154,8 +154,8 @@ export default {
refreshProductList(index) {
let str = get(get(this.navList, `[${index}].url`, '').split('?'), '[1]', '');
this.params = Object.assign({}, queryString.parse(str), this.listBaseParams);
this.fetchList(this.params);
this.searchParams = Object.assign({}, queryString.parse(str), this.listBaseParams);
this.fetchList(this.searchParams);
},
async onPullingUp() {
... ... @@ -178,7 +178,7 @@ export default {
return;
}
if (typeof params === 'object' && Object.keys(params)) {
searchParams = Object.assign({...searchParams}, params);
searchParams ={...params};
this.searchParams = searchParams;
}
... ... @@ -214,8 +214,10 @@ export default {
},
onPullingDown() {
this.params.isReset = true;
this.fetchList(this.params);
let params = this.searchParams;
params.isReset = true;
this.fetchList(params);
},
},
components: {
... ...
... ... @@ -43,7 +43,7 @@ class passportModel extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
signinByOpenID({ nickname, openId, sourceType, businessLine}) {
signinByOpenID({ nickname, openId, sourceType, sourceTypeSecond, businessLine}) {
let param = {
nickname: nickname || '',
openId: openId,
... ... @@ -55,6 +55,10 @@ class passportModel extends global.yoho.BaseModel {
param.business_line = businessLine;
}
if (sourceTypeSecond) {
param.source_type_second = sourceTypeSecond;
}
return this.get({ data: param });
}
syncUserSession({uid, sessionKey, req, res}) {
... ... @@ -119,25 +123,33 @@ class passportModel extends global.yoho.BaseModel {
log.info(`[sync profile error] uid: ${uid} | err: ${JSON.stringify(e)}`);
});
}
sendTaobaoBindCode(mobile) {
return this.post({
data: {
method: 'app.bind.sendCodeByTB',
source_type: 'taobao',
mobile
}
});
sendTaobaoBindCode(mobile, sourceTypeSecond) {
let data = {
method: 'app.bind.sendCodeByTB',
source_type: 'taobao',
mobile
};
if (sourceTypeSecond) {
data.source_type_second = sourceTypeSecond;
}
return this.post({ data });
}
bindTaobaoAccountByCode({ mobile, code, openId }) {
return this.post({
data: {
method: 'app.bind.bindTBByCode',
source_type: 'taobao',
mobile,
code,
open_id: openId
}
});
bindTaobaoAccountByCode({ mobile, code, openId, sourceTypeSecond }) {
let data = {
method: 'app.bind.bindTBByCode',
source_type: 'taobao',
mobile,
code,
open_id: openId
};
if (sourceTypeSecond) {
data.source_type_second = sourceTypeSecond;
}
return this.post({ data });
}
};
... ... @@ -161,7 +173,8 @@ const login = {
return model.signinByOpenID({
openId: user.open_uid,
sourceType: 'taobao'
sourceType: 'taobao',
sourceTypeSecond: req.yoho.isAliApp ? 'xianyu' : ''
}).then(result => {
let redirectUrl = loginPage;
... ... @@ -218,7 +231,7 @@ const bind = {
let info = bind.getBindThirdInfo(bindCode);
if (info.type === 'taobao') {
req.ctx(passportModel).sendTaobaoBindCode(mobile).then(res.json).catch(next);
req.ctx(passportModel).sendTaobaoBindCode(mobile, req.yoho.isAliApp ? 'xianyu' : '').then(res.json).catch(next);
} else {
res.json({
code: 200,
... ... @@ -236,7 +249,8 @@ const bind = {
model.bindTaobaoAccountByCode({
mobile,
code,
openId: info.openId
openId: info.openId,
sourceTypeSecond: req.yoho.isAliApp ? 'xianyu' : ''
}).then(result => {
if (_.get(result, 'data.is_bind') === 'Y') {
model.syncUserSession({
... ...