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

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

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

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

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

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

@ -66,6 +66,13 @@ const store = new Vuex.Store({
uni.removeStorageSync("lifeData") 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