tanxue 3 months ago
parent
commit
6abcf75c9f
2 changed files with 53 additions and 0 deletions
  1. 24 0
      components/scroll-list-card-credit/scroll-list-card-credit.vue
  2. 29 0
      pages/my/credit.vue

+ 24 - 0
components/scroll-list-card-credit/scroll-list-card-credit.vue

@@ -0,0 +1,24 @@
+<template>
+	<view class="credit-card-box">
+		 <view class="card-left">
+		     <text class="credit-span">{{item.credit}}</text>
+		     <text>分</text>
+		 </view>
+		 <view class="card-right">
+		     <view class="right-name">{{item.targetName}}</p>
+		     <view class="right-time">{{item.createTime}}</span>
+		 </view>
+	</view>
+</template>
+
+<script setup>
+	import {toRefs,ref,computed} from "vue";
+
+	const props = defineProps({
+		data: {
+			type: Object,
+		},
+	});
+	const {data} = toRefs(props);
+	
+</script>

+ 29 - 0
pages/my/credit.vue

@@ -0,0 +1,29 @@
+<template>
+	<!-- <view class="sum-score-box">总学分:{{totalCredits}}分</view>
+	<custom-scroll-list :hasSearcBar="false" :refreshFn="getCreditList" :hasTab="false">
+		<template #default="{list}">
+			<scroll-list-card-mes  v-for="(item,index) in list" :key="item.noticeId"
+				:data="item"></scroll-list-card-mes>
+		</template>
+	</custom-scroll-list> -->
+</template>
+
+<script setup>
+	import {getCreditList,getCreditTotal} from '@/api/my.js'
+	import {onLoad,onReady,} from "@dcloudio/uni-app"
+	import {reactive,ref} from "vue";
+	let totalCredits = ref('');
+	onLoad(() => {
+		getCreditInit()
+	})
+	
+	function getCreditInit() {
+		getTotalData();
+	}
+	
+	function getTotalData(){
+		getCreditTotal({}).then(res => {
+			totalCredits.value= res.data;
+		})
+	}
+</script>