儿科患者端

This commit is contained in:
@zuopngfei 2025-07-04 20:50:40 +08:00
parent fc7f361661
commit c04555d8a8
4 changed files with 34 additions and 29 deletions

View File

@ -1,5 +1,5 @@
const baseUrl = 'http://1.15.53.35:9998/'; const baseUrl = 'https://ddbs.1024tool.vip/';
let isNavigatingToLogin = false;
function request(url, method = 'GET', data = {}) { function request(url, method = 'GET', data = {}) {
const header = { const header = {
'content-type': 'application/json', 'content-type': 'application/json',
@ -21,9 +21,15 @@ function request(url, method = 'GET', data = {}) {
if (res.data.code) { if (res.data.code) {
if (res.data.code == 10103) { if (res.data.code == 10103) {
wx.removeStorageSync('access_token'); wx.removeStorageSync('access_token');
wx.switchTab({ if (!isNavigatingToLogin) {
url: '/pages/my/index', isNavigatingToLogin = true;
}) wx.navigateTo({
url: '/pages/login/login',
complete: () => {
isNavigatingToLogin = false;
}
});
}
reject(res.data); reject(res.data);
} }
reject(res.data); reject(res.data);

View File

@ -152,14 +152,17 @@ Page({
onLoad(){ onLoad(){
this.getSfList()
this.getChartData()
this.getPersonalInfo()
}, },
onReady() { onReady() {
}, },
onShow(){
this.getSfList()
this.getChartData()
this.getPersonalInfo()
},
changeChart(e) { changeChart(e) {
const index = e.currentTarget.dataset.index; const index = e.currentTarget.dataset.index;
@ -220,7 +223,7 @@ Page({
let totalList = [] let totalList = []
standardHeight.forEach(item => { standardHeight.forEach(item => {
props.xAxis.forEach(item2 => { this.data.xAxis.forEach(item2 => {
if(item.age == item2) { if(item.age == item2) {
totalList.push(item.value) totalList.push(item.value)
} }
@ -289,7 +292,7 @@ Page({
let totalList = [] let totalList = []
standardWeight.forEach(item => { standardWeight.forEach(item => {
props.xAxis.forEach(item2 => { this.data.xAxis.forEach(item2 => {
if(item.age == item2) { if(item.age == item2) {
totalList.push(item.value) totalList.push(item.value)
} }

View File

@ -15,17 +15,17 @@ Page({
code: '' code: ''
}, },
onLoad() { onLoad() {
wx.login({ // wx.login({
success(res) { // success(res) {
console.log(res.code) // console.log(res.code)
if (res.code) { // if (res.code) {
//发起网络请求 // //发起网络请求
} else { // } else {
console.log('登录失败!' + res.errMsg) // console.log('登录失败!' + res.errMsg)
} // }
} // }
}) // })
}, },
async getPhoneNumber(e) { async getPhoneNumber(e) {
// console.log(e.detail.code) // 动态令牌 // console.log(e.detail.code) // 动态令牌
@ -37,9 +37,7 @@ Page({
}) })
await wx.setStorageSync('access_token', res.token); await wx.setStorageSync('access_token', res.token);
if (res.is_personal_information_complete) { if (res.is_personal_information_complete) {
wx.switchTab({ wx.navigateBack();
url: `/pages/my/index`,
});
} else { } else {
wx.navigateTo({ wx.navigateTo({
url: `/pages/my/info-edit/index`, url: `/pages/my/info-edit/index`,
@ -143,9 +141,7 @@ Page({
}); });
await wx.setStorageSync('access_token', res.token); await wx.setStorageSync('access_token', res.token);
if (res.is_personal_information_complete) { if (res.is_personal_information_complete) {
wx.switchTab({ wx.navigateBack();
url: `/pages/my/index`,
});
} else { } else {
wx.navigateTo({ wx.navigateTo({
url: `/pages/my/info-edit/index`, url: `/pages/my/info-edit/index`,

View File

@ -48,7 +48,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.getList()
}, },
@ -63,7 +63,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.getList()
}, },
/** /**