master
xy 1 year ago
parent 1e32945654
commit 87fd336485

@ -3,9 +3,16 @@
globalData: { globalData: {
navbarHeight: 44, navbarHeight: 44,
}, },
onLaunch: function() { onLaunch: async function() {
console.log('App Launch') console.log('App Launch')
this.globalData.navbarHeight = uni.getSystemInfoSync().safeArea.top this.globalData.navbarHeight = uni.getSystemInfoSync().safeArea.top
try {
const { user } = await this.$u.api.getUserInfo()
this.$u.vuex('vuex_user', user)
} catch (err) {
console.error(err)
}
}, },
onShow: function() { onShow: function() {
console.log('App Show') console.log('App Show')

@ -22,8 +22,9 @@ const install = (Vue, vm) => {
Vue.prototype.$u.http.interceptor.request = (config) => { Vue.prototype.$u.http.interceptor.request = (config) => {
console.log('config-http', config) console.log('config-http', config)
// 引用token // 引用token
if (vm.vuex_token) { let token = vm.vuex_token ? vm.vuex_token : uni.getStorageSync('lifeData')?.vuex_token;
config.header['Authorization'] = `Bearer ${vm.vuex_token}`; if (token) {
config.header['Authorization'] = `Bearer ${token}`;
} }
return config; return config;
} }

@ -55,9 +55,9 @@
"urlCheck" : false "urlCheck" : false
}, },
"usingComponents" : true, "usingComponents" : true,
"permission": { "permission" : {
"scope.userLocation": { "scope.userLocation" : {
"desc": "需要获取您的定位" "desc" : "需要获取您的定位"
} }
}, },
"requiredPrivateInfos" : [ "getLocation" ], "requiredPrivateInfos" : [ "getLocation" ],

@ -64,6 +64,9 @@
v-for="item in links" v-for="item in links"
:key="item.text" :key="item.text"
bg-color="transparent" bg-color="transparent"
@click="$u.throttle($u.route({
url: item.to
}))"
> >
<image class="icon" :src="item.icon" mode="aspectFit"></image> <image class="icon" :src="item.icon" mode="aspectFit"></image>
<view class="text">{{ item.text }}</view> <view class="text">{{ item.text }}</view>
@ -193,6 +196,7 @@ export default {
{ {
text: "陪诊服务", text: "陪诊服务",
icon: "/static/index/peizhenfuwu.png", icon: "/static/index/peizhenfuwu.png",
to: "/package_sub/pages/ServiceList/ServiceList"
}, },
{ {
text: "就医服务", text: "就医服务",

@ -6,8 +6,8 @@
<image class="avatar" mode="aspectFit" src="http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg"></image> <image class="avatar" mode="aspectFit" src="http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg"></image>
<view class="info"> <view class="info">
<view class="info-name">我的</view> <view class="info-name">{{ vuex_user.nickname || '微信用户' }}</view>
<view class="info-mobile">手机号18888888888</view> <view class="info-mobile">手机号{{ vuex_user.mobile || '' }}</view>
</view> </view>
</view> </view>
<tabbar /> <tabbar />

Loading…
Cancel
Save