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