master
271556543@qq.com 3 years ago
parent f88cdec345
commit 07b713c0ab

@ -63,15 +63,14 @@
</view>
<view class="data-content">
<view v-for="(item,index) in dataList" :key="index" class="data-item"
:style="index%2==0?'padding-left:20rpx;':'padding-right:104rpx;'">
<view v-for="(value,key,index) in dataList" :key="index" class="data-item"
:style="(key === 'todayServe' || key === 'todayHour') ? 'padding-left:20rpx;' : 'padding-right:104rpx;'">
<view class="data-title">
{{item.title}}
{{value.title}}
</view>
<view class="data-value">
<view class="number">{{item.value}}</view>
<view class="unit" v-if="item.type === 0"></view>
<view class="unit" v-else></view>
<view class="number">{{value.value}}</view>
<view class="unit">{{value.unit}}</view>
</view>
</view>
</view>
@ -85,7 +84,7 @@
</view>
</view>
<view class="statistics-value">
<view class="number">1</view>
<view class="number">{{status.ing}}</view>
<view class="unit"></view>
</view>
</view>
@ -97,7 +96,7 @@
</view>
</view>
<view class="statistics-value">
<view class="number">36</view>
<view class="number">{{status.wait}}</view>
<view class="unit"></view>
</view>
</view>
@ -109,7 +108,7 @@
</view>
</view>
<view class="statistics-value">
<view class="number">366</view>
<view class="number">{{status.end}}</view>
<view class="unit"></view>
</view>
</view>
@ -146,7 +145,7 @@
</view>
<view v-else class="no-data">
<u-empty></u-empty>
<u-empty mode="list" text="暂无提醒"></u-empty>
</view>
</scroll-view>
</view>
@ -163,23 +162,33 @@
fontSize: "28rpx",
fontWeight: "500"
},
dataList: [{
title: "今日服务数量",
value: 6,
type: 0
}, {
title: "本月服务数量",
value: 36,
type: 0
}, {
title: "今日服务工时",
value: 6,
type: 1
}, {
title: "本月服务工时",
value: 136,
type: 1
}],
dataList: {
todayServe: {
title: "今日服务数量",
value: 0,
unit: "位"
},
monthServe: {
title: "本月服务数量",
value: 0,
unit: "位"
},
todayHour: {
title: "今日服务工时",
value: 0,
unit: "小时"
},
monthHour: {
title: "本月服务工时",
value: 0,
unit: "小时"
},
},
status: {
wait: 0,
ing: 0,
end: 0,
},
infoList: []
}
},
@ -197,7 +206,14 @@
async getStatistic() {
let res = await this.$u.api.statistic()
console.log(res);
this.dataList.monthHour.value = res.month_hour_total
this.dataList.monthServe.value = res.month_serve_total
this.dataList.todayHour.value = res.today_hour_total
this.dataList.todayServe.value = res.today_serve_total
this.status.wait = res.wait
this.status.ing = res.ing
this.status.end = res.end
},
async getRemind() {
let res = await this.$u.api.noticeList()

@ -90,7 +90,7 @@
</view>
<view v-else>
<u-empty></u-empty>
<u-empty mode="list" text="暂无护理"></u-empty>
</view>
</view>
</view>
@ -285,6 +285,10 @@
align-items: center;
}
/deep/.u-load-more-wrap {
padding: 10px 0;
}
.search {
width: 710rpx;
height: 70rpx;

@ -81,19 +81,17 @@
this.getInfo();
})
},
getInfo() {
this.$u.api.me().then(res => {
this.$u.vuex("vuex_user", res);
uni.showToast({
icon: "none",
title: `欢迎回来,${res.name}`,
});
async getInfo() {
await this.$store.dispatch('me')
uni.showToast({
icon: "none",
title: `欢迎回来,${this.vuex_user.name}`,
});
setTimeout(() => {
uni.switchTab({
url: "/pages/home/home"
});
})
}, 1500)
},
},
computed: {},

@ -12,8 +12,8 @@
<view class="text">头像</view>
<view style="display: flex">
<view class="avatar">
<u-image :src="vuex_user.avatar || '/static/logo.png'" height="104" width="104"
shape="circle"></u-image>
<u-avatar :src="vuex_user.avatar || '/static/logo.png'" :size="104" mode="circle">
</u-avatar>
</view>
<view class="arrow" @click="chooseAvatar">
<u-icon name="arrow-right" size="24"></u-icon>

@ -71,7 +71,7 @@
</view>
<view v-else class="nursing-list-nodata">
<u-empty mode="data">
<u-empty mode="list" text="暂无护理">
</u-empty>
</view>
</view>

@ -66,6 +66,13 @@ const store = new Vuex.Store({
uni.removeStorageSync("lifeData")
}
},
actions: {
async me(context, payload) {
let res = await Vue.prototype.$u.api.me()
Vue.prototype.$u.vuex('vuex_user', res)
}
}
})

Loading…
Cancel
Save