sdw2
This commit is contained in:
parent
7a79249535
commit
e01d46d64c
@ -13,42 +13,38 @@ function request(url, method = 'GET', data = {}) {
|
|||||||
header.Authorization = `${tokenString}`;
|
header.Authorization = `${tokenString}`;
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
wx.request({
|
wx.request({
|
||||||
url: baseUrl + url,
|
url: baseUrl + url,
|
||||||
method,
|
method,
|
||||||
data,
|
data,
|
||||||
dataType: 'json', // 微信官方文档中介绍会对数据进行一次JSON.parse
|
dataType: 'json', // 微信官方文档中介绍会对数据进行一次JSON.parse
|
||||||
header,
|
header,
|
||||||
success(res) {
|
success(res) {
|
||||||
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.navigateTo({
|
wx.navigateTo({
|
||||||
url: '/pages/login/login',
|
url: '/pages/login/login',
|
||||||
complete: () => {
|
|
||||||
isNavigatingToLogin = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
reject(res.data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
wx.showToast({
|
|
||||||
title: res.data.message,
|
|
||||||
icon: 'none'
|
|
||||||
});
|
});
|
||||||
reject(res.data);
|
reject(res.data);
|
||||||
} else {
|
return;
|
||||||
resolve(res.data);
|
|
||||||
}
|
}
|
||||||
|
wx.showToast({
|
||||||
|
title: res.data.message,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
reject(res.data);
|
||||||
|
} else {
|
||||||
|
resolve(res.data);
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
// 断网、服务器挂了都会fail回调,直接reject即可
|
// 断网、服务器挂了都会fail回调,直接reject即可
|
||||||
reject(err);
|
reject(err);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -73,6 +73,12 @@ Page({
|
|||||||
imageVisible: true
|
imageVisible: true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onClose(){
|
||||||
|
this.setData({
|
||||||
|
imageVisible: false
|
||||||
|
})
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -8,12 +8,7 @@ const app = getApp();
|
|||||||
|
|
||||||
Page({
|
Page({
|
||||||
onShareAppMessage: function (res) {
|
onShareAppMessage: function (res) {
|
||||||
return {
|
|
||||||
title: 'ECharts 可以在微信小程序中使用啦!',
|
|
||||||
path: '/pages/index/index',
|
|
||||||
success: function () {},
|
|
||||||
fail: function () {}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
ec: {
|
ec: {
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<image src="{{userInfo.avatar}}" />
|
<image src="{{userInfo.avatar}}" />
|
||||||
</view>
|
</view>
|
||||||
<view class="text-group_1">
|
<view class="text-group_1">
|
||||||
<text lines="1" class="text_2">{{userInfo.username}}<text lines="1" decode="true" class="text_4">{{userInfo.sex == 1 ? '男':'女'}} · {{ userInfo.age }}</text></text>
|
<text lines="1" class="text_2">{{userInfo.username ? userInfo.username : '患者信息未完善'}}<text wx:if="{{userInfo.username}}" lines="1" decode="true" class="text_4">{{userInfo.sex == 1 ? '男':'女'}} · {{ userInfo.age }}</text></text>
|
||||||
<text lines="1" class="text_3">下次随访时间:{{ userInfo.next_follow_date }}</text>
|
<text lines="1" class="text_3">下次随访时间:{{ userInfo.next_follow_date }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
@ -30,8 +30,8 @@
|
|||||||
<text lines="1" class="text_4">登录</text>
|
<text lines="1" class="text_4">登录</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-wrapper_2">
|
<view class="text-wrapper_2">
|
||||||
<text lines="1" class="text_6">登录或注册完成即代表您同意</text>
|
<!-- <text lines="1" class="text_6">登录或注册完成即代表您同意</text>
|
||||||
<text lines="1" class="text_7">《用户服务协议》</text>
|
<text lines="1" class="text_7">《用户服务协议》</text> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -19,8 +19,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="text-group_2">
|
<view class="text-group_2">
|
||||||
<view class="text-wrapper_1">
|
<view class="text-wrapper_1">
|
||||||
<text class="text_2">{{item.username}}</text>
|
<text class="text_2">{{item.username ? item.username : '患者信息未完善'}}</text>
|
||||||
<text decode="true" class="text_3">
|
<text wx:if="{{item.username}}" decode="true" class="text_3">
|
||||||
{{item.sex == 1 ? '男':'女'}} · {{item.age}}
|
{{item.sex == 1 ? '男':'女'}} · {{item.age}}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user