接入两个接口
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
import Container from "@/components/Container.vue";
|
||||
import Guide from "@/components/Guide.vue";
|
||||
import Avatar from "@/components/Avatar.vue";
|
||||
import { getPractiseDataAPI } from "@/apis";
|
||||
|
||||
import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
const store = useStore();
|
||||
const { user } = storeToRefs(store);
|
||||
const data = ref({});
|
||||
|
||||
const toPractiseOne = () => {
|
||||
uni.navigateTo({
|
||||
@@ -19,6 +23,11 @@ const toPractiseTwo = () => {
|
||||
url: "/pages/practise-two",
|
||||
});
|
||||
};
|
||||
|
||||
onShow(async () => {
|
||||
const result = await getPractiseDataAPI();
|
||||
data.value = result;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -40,17 +49,23 @@ const toPractiseTwo = () => {
|
||||
</view>
|
||||
<view>
|
||||
<text>已练习打卡</text>
|
||||
<text>12121</text>
|
||||
<text>{{ data.totalDay }}</text>
|
||||
<text>天</text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
<view><text>1111</text><text>组</text></view>
|
||||
<view>
|
||||
<text>{{ data.totalGroup }}</text>
|
||||
<text>组</text>
|
||||
</view>
|
||||
<text>个人练习量</text>
|
||||
</view>
|
||||
<view>
|
||||
<view><text>1111</text><text>箭</text></view>
|
||||
<view>
|
||||
<text>{{ data.totalArrow }}</text>
|
||||
<text>箭</text>
|
||||
</view>
|
||||
<text>射箭量</text>
|
||||
</view>
|
||||
<view>
|
||||
@@ -116,7 +131,7 @@ const toPractiseTwo = () => {
|
||||
.practise-data > view:first-child > view:last-child > text:nth-child(2) {
|
||||
color: #f7d247;
|
||||
margin: 0 3px;
|
||||
font-size: 18px;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
transform: translateY(3px);
|
||||
}
|
||||
@@ -139,11 +154,11 @@ const toPractiseTwo = () => {
|
||||
align-items: flex-end;
|
||||
}
|
||||
.practise-data > view:last-child > view > view > text:nth-last-child(2) {
|
||||
font-size: 18px;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
margin: 0 3px;
|
||||
transform: translateY(3px);
|
||||
transform: translateY(5px);
|
||||
}
|
||||
.practise-data > view:last-child > view > text {
|
||||
margin-top: 5px;
|
||||
|
||||
Reference in New Issue
Block a user