|
|
@ -75,7 +75,7 @@ export default { |
|
|
methods: { |
|
|
methods: { |
|
|
// 获取微信头像 + 上传到服务器 |
|
|
// 获取微信头像 + 上传到服务器 |
|
|
onChooseAvatar(e) { |
|
|
onChooseAvatar(e) { |
|
|
console.log('获取微信头像', e) |
|
|
|
|
|
|
|
|
// console.log('获取微信头像', e) |
|
|
// 临时文件路径 |
|
|
// 临时文件路径 |
|
|
const tempFilePath = e.detail.avatarUrl; |
|
|
const tempFilePath = e.detail.avatarUrl; |
|
|
|
|
|
|
|
|
@ -88,24 +88,24 @@ export default { |
|
|
"Content-Type": "multipart/form-data" |
|
|
"Content-Type": "multipart/form-data" |
|
|
}, |
|
|
}, |
|
|
success: (res) => { |
|
|
success: (res) => { |
|
|
console.log("上传成功原始返回:", res); |
|
|
|
|
|
|
|
|
// console.log("上传成功原始返回:", res); |
|
|
let realAvatar = ''; |
|
|
let realAvatar = ''; |
|
|
try { |
|
|
try { |
|
|
const data = JSON.parse(res.data); |
|
|
const data = JSON.parse(res.data); |
|
|
console.log('解析成功:', data) |
|
|
|
|
|
|
|
|
// console.log('解析成功:', data) |
|
|
realAvatar = data.data || data.url || ''; |
|
|
realAvatar = data.data || data.url || ''; |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
realAvatar = res.data; |
|
|
realAvatar = res.data; |
|
|
} |
|
|
} |
|
|
if (realAvatar) { |
|
|
if (realAvatar) { |
|
|
console.log("永久头像URL:", realAvatar); |
|
|
|
|
|
|
|
|
// console.log("永久头像URL:", realAvatar); |
|
|
this.avatarUrl = config.baseUrl + '/api/fileRelevant/getImg?imgType=5&imgId=' + realAvatar |
|
|
this.avatarUrl = config.baseUrl + '/api/fileRelevant/getImg?imgType=5&imgId=' + realAvatar |
|
|
} else { |
|
|
} else { |
|
|
uni.showToast({ title: '头像上传失败', icon: 'none' }); |
|
|
uni.showToast({ title: '头像上传失败', icon: 'none' }); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
fail: (err) => { |
|
|
fail: (err) => { |
|
|
console.log("上传失败", err); |
|
|
|
|
|
|
|
|
// console.log("上传失败", err); |
|
|
uni.showToast({ title: '头像上传失败', icon: 'none' }); |
|
|
uni.showToast({ title: '头像上传失败', icon: 'none' }); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
@ -129,7 +129,7 @@ export default { |
|
|
|
|
|
|
|
|
async getScreenSetting() { |
|
|
async getScreenSetting() { |
|
|
try { |
|
|
try { |
|
|
const res = await FetchInitScreenSetting({ libcode: '1201' }); |
|
|
|
|
|
|
|
|
const res = await FetchInitScreenSetting({ libcode: config.LIB_CODE }); |
|
|
const data = res.data; |
|
|
const data = res.data; |
|
|
this.screenConfig = { |
|
|
this.screenConfig = { |
|
|
thirdUrl: data.open_lib_http?.context || '', |
|
|
thirdUrl: data.open_lib_http?.context || '', |
|
|
@ -200,11 +200,11 @@ export default { |
|
|
openid: openId, |
|
|
openid: openId, |
|
|
bindValue: this.queryvalue, |
|
|
bindValue: this.queryvalue, |
|
|
bindType: 'rdid', |
|
|
bindType: 'rdid', |
|
|
libcode: '1201', |
|
|
|
|
|
|
|
|
libcode: config.LIB_CODE, |
|
|
} |
|
|
} |
|
|
// 调用绑定接口 |
|
|
// 调用绑定接口 |
|
|
const bindRes = await FetchBindReadCard(bindParams); |
|
|
const bindRes = await FetchBindReadCard(bindParams); |
|
|
console.log('绑定结果', bindRes); |
|
|
|
|
|
|
|
|
// console.log('绑定结果', bindRes); |
|
|
|
|
|
|
|
|
if(bindRes.code === 200 ){ |
|
|
if(bindRes.code === 200 ){ |
|
|
|
|
|
|
|
|
@ -214,11 +214,11 @@ export default { |
|
|
icon: 'success' |
|
|
icon: 'success' |
|
|
}); |
|
|
}); |
|
|
const data = { |
|
|
const data = { |
|
|
libcode: '1201', |
|
|
|
|
|
|
|
|
libcode: config.LIB_CODE, |
|
|
openId: openId |
|
|
openId: openId |
|
|
} |
|
|
} |
|
|
FetchFindAllReaderBindByOpenId(data).then(res => { |
|
|
FetchFindAllReaderBindByOpenId(data).then(res => { |
|
|
console.log('获取读者证列表',res) |
|
|
|
|
|
|
|
|
// console.log('获取读者证列表',res) |
|
|
if (res.code === 200 && res.data.length > 0) { |
|
|
if (res.code === 200 && res.data.length > 0) { |
|
|
uni.setStorageSync(STORAGE_KEYS.READER_CARD_LIST, res.data); |
|
|
uni.setStorageSync(STORAGE_KEYS.READER_CARD_LIST, res.data); |
|
|
} else { |
|
|
} else { |
|
|
|